Reference

Contents

Index

OCPPClient.OCPPClientModule
OCPPClient

OCPP WebSocket client for connecting to a Central System (CSMS). Supports OCPP 1.6 and 2.0.1 with typed request/response handling.

source
OCPPClient.ChargePointMethod
ChargePoint(id, url; spec=OCPPData.V16.Spec(), reconnect=true,
            reconnect_interval=5.0)

Create a ChargePoint. Does not connect yet — call connect! to start.

source
OCPPClient._handle_server_callMethod
_handle_server_call(cp::ChargePoint, call::OCPPData.Call)

Dispatch an incoming server Call to the registered handler and return a CallResult or CallError.

source
OCPPClient._send_typedMethod

Send a typed request and return the typed response. Throws OCPPCallError if the server returns a CallError.

source
OCPPClient._transaction_eventMethod
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 Ended
  • seq_no::Int — sequence number (monotonically increasing per transaction)
  • transaction_info::OCPPData.V201.Transaction — transaction details
  • trigger_reason::OCPPData.V201.TriggerReason — reason for this event
source
OCPPClient.authorizeMethod
authorize(cp; kwargs...)

Send an Authorize request.

V16 kwargs: id_tag::String

V201 kwargs: id_token::OCPPData.V201.IdToken

source
OCPPClient.boot_notificationMethod
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

source
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.

source
OCPPClient.heartbeatMethod
heartbeat(cp; timeout=30.0)

Send a Heartbeat. Returns a version-appropriate HeartbeatResponse.

source
OCPPClient.meter_valuesMethod
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}

source
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

source
OCPPClient.send_callMethod
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).

source
OCPPClient.start_transactionMethod
start_transaction(cp; connector_id, id_tag, meter_start, timestamp, kwargs...)

Send a StartTransaction (V16 only). Throws OCPPVersionError for V201 — use transaction_event instead.

source
OCPPClient.status_notificationMethod
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)

source
OCPPClient.stop_transactionMethod
stop_transaction(cp; transaction_id, meter_stop, timestamp, kwargs...)

Send a StopTransaction (V16 only). Throws OCPPVersionError for V201 — use transaction_event instead.

source
OCPPClient.subscribe!Method
subscribe!(cp::ChargePoint, callback::Function)

Subscribe to ClientEvents. Signature: callback(event::ClientEvent).

source
OCPPClient.transaction_eventMethod
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.

source