ocpp/rpc
Transport-agnostic OCPP RPC concepts shared by the JSON (OCPP-J) transport now and a future SOAP transport.
The logical interaction is a CALL (request) answered by either a CALLRESULT (response) or a CALLERROR. The concrete wire framing lives in the transport modules; this module holds the parts that are independent of the wire format, such as the RPC error codes.
Types
RPC framework error codes. This is the OCPP 2.x set; the 1.6 transport maps its (differently spelled) codes onto these where they correspond.
pub type ErrorCode {
FormatViolation
GenericError
InternalError
MessageTypeNotSupported
NotImplemented
NotSupported
OccurrenceConstraintViolation
PropertyConstraintViolation
ProtocolError
RpcFrameworkError
SecurityError
TypeConstraintViolation
}
Constructors
-
FormatViolation -
GenericError -
InternalError -
MessageTypeNotSupportedDeprecated by the 2026-04 errata (2.0.1 Edition 4 / 2.1 Edition 2, erratum [1161]): a message with an unsupported message type number is now silently ignored, so this is “no longer a valid error code” to send — the 2.0.1 part 4 §4.4 extension-fallback that answered such messages with this code was removed by erratum [1163]. Kept for wire compatibility with peers that still emit it.
-
NotImplemented -
NotSupported -
OccurrenceConstraintViolation -
PropertyConstraintViolation -
ProtocolError -
RpcFrameworkError -
SecurityError -
TypeConstraintViolation
Values
pub fn error_code_from_string(
value: String,
) -> Result(ErrorCode, Nil)
pub fn error_code_to_string(code: ErrorCode) -> String