Skip to main content

Module rpc

Module rpc 

Source
Expand description

OCPP-J RPC framing (OCPP-J 1.6 §4, OCPP 2.0.1/2.1 Part 4 §4).

CALL            [2, "<MessageId>", "<Action>", {<Payload>}]
CALLRESULT      [3, "<MessageId>", {<Payload>}]
CALLERROR       [4, "<MessageId>", "<errorCode>", "<errorDescription>", {<errorDetails>}]
CALLRESULTERROR [5, "<MessageId>", "<errorCode>", "<errorDescription>", {<errorDetails>}]   (2.1)
SEND            [6, "<MessageId>", "<Action>", {<Payload>}]                                 (2.1)

Enums§

Frame
FrameError
A frame that could not be parsed.
MessageTypeId

Constants§

MAX_ERROR_DESCRIPTION_LEN
Maximum CALLERROR description length (2.0.1 Part 4 §4.2.3).
MAX_MESSAGE_ID_LEN
Maximum message id length, to allow for UUIDs/GUIDs.
UNKNOWN_MESSAGE_ID
Message id to use in a CALLERROR when the id of the offending message cannot be read.

Functions§

encode_call
Serializes [2, id, action, payload].
encode_error
Serializes a CALLERROR ([4, …]) or, with result_error, a CALLRESULTERROR ([5, …]).
encode_result
Serializes [3, id, payload].
encode_send
Serializes [6, id, action, payload] (2.1 SEND).
error_from_frame
Converts a received CALLERROR into an RpcError.