#[non_exhaustive]pub enum ReadingContext {
TransactionBegin,
TransactionEnd,
SampleClock,
SamplePeriodic,
InterruptionBegin,
InterruptionEnd,
Trigger,
Other,
}Expand description
Why a reading was taken.
The OCPP ReadingContext values, kept because the distinction decides how
much a reading is worth for settlement. Sample.Clock is a measurement of a
quarter-hour boundary; Sample.Periodic is a measurement of whenever the
station felt like it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TransactionBegin
Transaction.Begin — the opening register value.
TransactionEnd
Transaction.End — the closing register value.
SampleClock
Sample.Clock — aligned to the clock, at AlignedDataInterval.
SamplePeriodic
Sample.Periodic — at SampledDataTxUpdatedInterval, from an arbitrary
phase.
InterruptionBegin
Interruption.Begin — charging stopped.
InterruptionEnd
Interruption.End — charging resumed.
Trigger
Trigger — the backend asked for it.
Other
Other.
Implementations§
Source§impl ReadingContext
impl ReadingContext
Sourcepub const fn is_clock_aligned(self) -> bool
pub const fn is_clock_aligned(self) -> bool
Whether this reading lands on a clock boundary by construction.
Only Sample.Clock does. A periodic sample that happens to fall on
:15:00 is a coincidence, and settling a quarter hour on a coincidence
is how two suppliers end up disagreeing by the same kilowatt-hour in
opposite directions.
Sourcepub const fn is_transaction_boundary(self) -> bool
pub const fn is_transaction_boundary(self) -> bool
Whether this reading bounds the transaction.
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The OCPP spelling, identical in 1.6, 2.0.1 and 2.1.
Beside the variants rather than in the OCPP crate, because these are the OCPP names — the variant documentation gives them one line up — and a spelling kept somewhere else is a spelling that drifts from the enum it spells.