pub enum SessionState {
Pending,
Charging,
SuspendedByVehicle,
SuspendedByOperator,
Ended,
}Expand description
Where a session is in its life.
Variants§
Pending
Authorised, but no energy has moved. A reservation, or a cable not yet plugged in.
Charging
Energy is moving.
SuspendedByVehicle
Plugged in and authorised, and the vehicle has stopped asking for power — the battery is full, or the car paused its own charge.
This is the occupancy [AFIR Art. 5(4)] lets a fast charger price per
minute, and the only state that is.
SuspendedByOperator
Plugged in and authorised, and the operator has stopped offering
power while the vehicle is still asking for it — a charging profile
holding the point at zero, a [EnWG §14a] dimming, a grid limit, a
fault.
Kept apart from Self::SuspendedByVehicle because the two are priced
differently and one boolean cannot say which. OCPP has said which since
2.0.1 — SuspendedEV against SuspendedEVSE — and
[OCPI 2.3.0 §mod_cdrs_chargingperiod_class] corrected its own
definition of PARKING_TIME to the vehicle’s demand precisely so that a
driver is not billed a loitering fee for the operator’s own curtailment.
Collapsing them here is what puts that fee on the invoice.
Ended
Over. Nothing further may be added.
Implementations§
Source§impl SessionState
impl SessionState
Sourcepub const fn can_transition_to(self, next: Self) -> bool
pub const fn can_transition_to(self, next: Self) -> bool
Whether a transition to next is one the protocol allows.
Written as one arm per rule rather than as the shortest expression that computes the same booleans. The table is the specification of a session’s life, and a reader checking it against OCPP needs to find each rule where it lives.