Reference
Contents
Index
OCPPClient.OCPPClientOCPPClient.ChargePointOCPPClient._emitOCPPClient._from_payloadOCPPClient._handle_server_callOCPPClient._message_loopOCPPClient._send_typedOCPPClient._to_payloadOCPPClient._transaction_eventOCPPClient.authorizeOCPPClient.boot_notificationOCPPClient.connect!OCPPClient.disconnect!OCPPClient.heartbeatOCPPClient.meter_valuesOCPPClient.on!OCPPClient.send_callOCPPClient.start_transactionOCPPClient.status_notificationOCPPClient.stop_transactionOCPPClient.subscribe!OCPPClient.transaction_event
OCPPClient.OCPPClient — Module
OCPPClientOCPP WebSocket client for connecting to a Central System (CSMS). Supports OCPP 1.6 and 2.0.1 with typed request/response handling.
OCPPClient.ChargePoint — Method
ChargePoint(id, url; spec=OCPPData.V16.Spec(), reconnect=true,
reconnect_interval=5.0)Create a ChargePoint. Does not connect yet — call connect! to start.
OCPPClient._emit — Method
Emit a ClientEvent to all registered listeners.
OCPPClient._from_payload — Method
Convert a Dict payload back to a typed struct.
OCPPClient._handle_server_call — Method
_handle_server_call(cp::ChargePoint, call::OCPPData.Call)Dispatch an incoming server Call to the registered handler and return a CallResult or CallError.
OCPPClient._message_loop — Method
Read messages from the WebSocket and dispatch them.
OCPPClient._send_typed — Method
Send a typed request and return the typed response. Throws OCPPCallError if the server returns a CallError.
OCPPClient._to_payload — Method
Convert a typed struct to a Dict{String,Any} payload with camelCase keys.
OCPPClient._transaction_event — Method
transaction_event(cp; event_type, seq_no, timestamp, transaction_info,
trigger_reason, kwargs...)Send a TransactionEvent (V201 only). Throws OCPPVersionError for V16. Required kwargs:
event_type::OCPPData.V201.TransactionEvent— Started, Updated, or Endedseq_no::Int— sequence number (monotonically increasing per transaction)transaction_info::OCPPData.V201.Transaction— transaction detailstrigger_reason::OCPPData.V201.TriggerReason— reason for this event
OCPPClient.authorize — Method
authorize(cp; kwargs...)Send an Authorize request.
V16 kwargs: id_tag::String
V201 kwargs: id_token::OCPPData.V201.IdToken
OCPPClient.boot_notification — Method
boot_notification(cp; kwargs...)Send a BootNotification. Dispatches to V16 or V201 based on cp.spec.
V16 kwargs: charge_point_vendor::String, charge_point_model::String
V201 kwargs: reason::OCPPData.V201.BootReason, charging_station::OCPPData.V201.ChargingStation
OCPPClient.connect! — Method
connect!(cp::ChargePoint)Connect to the CSMS WebSocket server. Blocks while connected; use with @async or Threads.@spawn. Automatically reconnects on disconnect if cp.reconnect is true.
OCPPClient.disconnect! — Method
disconnect!(cp::ChargePoint)Disconnect from the CSMS. Disables auto-reconnect before closing.
OCPPClient.heartbeat — Method
heartbeat(cp; timeout=30.0)Send a Heartbeat. Returns a version-appropriate HeartbeatResponse.
OCPPClient.meter_values — Method
meter_values(cp; kwargs...)Send MeterValues.
V16 kwargs: connector_id::Int, meter_value::Vector{OCPPData.V16.MeterValue}
V201 kwargs: evse_id::Int, meter_value::Vector{OCPPData.V201.MeterValue}
OCPPClient.on! — Method
on!(cp::ChargePoint, action::String, handler::Function)Register a handler for a server-initiated action (e.g., Reset). Signature: handler(cp::ChargePoint, request) → response_payload
OCPPClient.send_call — Method
send_call(cp::ChargePoint, action::String, payload::Dict{String,Any};
timeout::Float64=30.0)Send an OCPP Call to the CSMS and block until a response is received or the timeout expires. Returns the OCPPData.OCPPMessage (CallResult or CallError).
OCPPClient.start_transaction — Method
start_transaction(cp; connector_id, id_tag, meter_start, timestamp, kwargs...)Send a StartTransaction (V16 only). Throws OCPPVersionError for V201 — use transaction_event instead.
OCPPClient.status_notification — Method
status_notification(cp; kwargs...)Send a StatusNotification.
V16 kwargs: connector_id::Int, status::OCPPData.V16.ChargePointStatus, error_code::OCPPData.V16.ChargePointErrorCode
V201 kwargs: connector_id::Int, connector_status::OCPPData.V201.ConnectorStatus, evse_id::Int, timestamp::String (optional, defaults to now)
OCPPClient.stop_transaction — Method
stop_transaction(cp; transaction_id, meter_stop, timestamp, kwargs...)Send a StopTransaction (V16 only). Throws OCPPVersionError for V201 — use transaction_event instead.
OCPPClient.subscribe! — Method
subscribe!(cp::ChargePoint, callback::Function)Subscribe to ClientEvents. Signature: callback(event::ClientEvent).
OCPPClient.transaction_event — Method
transaction_event(cp; event_type, seq_no, transaction_info, trigger_reason,
timestamp, kwargs...)Send a TransactionEvent (V201 only). Throws OCPPVersionError for V16 — use start_transaction/stop_transaction instead.