Documentation ¶
Overview ¶
Package pipe provides the core functionality for transferring messages between a charge station and a CSMS using OCPP/J. A Pipe is a bidirectional connection where OCPP Call and CallResult (or CallError) messages are brokered. A Pipe is agnostic to the actual communication channels. It is up to the caller to ensure that the charge station and CSMS Rx and Tx channels are hooked up to an appropriate source or sink.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GatewayMessage ¶
type GatewayMessage struct { Context context.Context `json:"-"` MessageType ocpp.MessageType `json:"type"` Action string `json:"action"` MessageId string `json:"id"` RequestPayload json.RawMessage `json:"request,omitempty"` ResponsePayload json.RawMessage `json:"response,omitempty"` ErrorCode ocpp.ErrorCode `json:"error_code,omitempty"` ErrorDescription string `json:"error_description,omitempty"` State json.RawMessage `json:"state,omitempty"` }
type Opt ¶
type Opt func(*Pipe)
func WithCSMSCallQueueLen ¶
WithCSMSCallQueueLen is a pipe option that sets the maximum number of CSMS Call messages to queue when looking for a CallResult to send to the charge station
func WithCSMSCallResponseBufferLen ¶
WithCSMSCallResponseBufferLen is a pipe option that sets the maximum number of CSMS Call messages to buffer waiting for CallResult responses from the charge station
func WithCSMSMessageQueueLen ¶
WithCSMSMessageQueueLen is a pipe option that sets the maximum number of CSMS messages to queue
func WithMessageIdBufferLen ¶
WithMessageIdBufferLen is a pipe option that sets the number of previously used message ids to store
func WithResponseTimeout ¶
WithResponseTimeout is a pipe option that sets the response timeout
type Pipe ¶
type Pipe struct { // ChargeStationRx is an incoming channel from the Charge Station ChargeStationRx chan *GatewayMessage // ChargeStationTx is on outgoing channel to the Charge Station ChargeStationTx chan *GatewayMessage // CSMSRx is an incoming channel from the CSMS CSMSRx chan *GatewayMessage // CSMSTx is an outgoing channel to the CSMS CSMSTx chan *GatewayMessage // contains filtered or unexported fields }
Pipe provides a bidirectional RPC pipe between a ChargeStation and the CSMS