ocpp/v2_0_1/datatype/transaction

OCPP 2.0.1 Transaction data type (schema TransactionType).

to_json/decoder map to/from its OCPP-J JSON object; new (when present) builds a value from the required fields only.

Types

FieldTypeReqDescription
charging_stateChargingState
custom_dataCustomData
remote_start_idIntThe ID given to remote start request (RequestStartTransactionRequest. This enables to CSMS to match the started transaction to the given start request.
stopped_reasonReason
time_spent_chargingIntContains the total time that energy flowed from EVSE to EV during the transaction (in seconds). Note that timeSpentCharging is smaller or equal to the duration of the transaction.
transaction_idStringThis contains the Id of the transaction. (max 36 chars)

Schema: TransactionType · Transaction · urn:x-oca:ocpp:uid:2:233318

pub type Transaction {
  Transaction(
    charging_state: option.Option(charging_state.ChargingState),
    custom_data: option.Option(custom_data.CustomData),
    remote_start_id: option.Option(Int),
    stopped_reason: option.Option(reason.Reason),
    time_spent_charging: option.Option(Int),
    transaction_id: String,
  )
}

Constructors

Values

pub fn decoder() -> decode.Decoder(Transaction)

Decode a Transaction from its OCPP-J JSON object, enforcing schema constraints.

pub fn new(transaction_id transaction_id: String) -> Transaction

Construct a Transaction from its required fields, with every optional field set to None.

pub fn to_json(value: Transaction) -> json.Json

Encode a Transaction to its OCPP-J JSON object.

Search Document