OcppModel.V20.Behaviours.ChargeSystem behaviour (ocpp_model v0.1.4) View Source

Behaviour of a ChargeSystem, allowing the module assuming the behaviour to be able to respond to messages send to it

Link to this section Summary

Functions

Main entrypoint, based on the action parameter, this function will call one of the callback functions with the payload

Link to this section Functions

Link to this function

handle(caller, action, payload)

View Source

Specs

handle(atom(), String.t(), map()) :: {:ok, map()} | {:error, atom(), String.t()}

Main entrypoint, based on the action parameter, this function will call one of the callback functions with the payload

Link to this section Callbacks

Specs

authorize(
  req :: %OcppModel.V20.Messages.AuthorizeRequest{
    certificate: term(),
    idToken: term(),
    iso15118CertificateHashData: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.AuthorizeResponse{
     certificateStatus: term(),
     idTokenInfo: term()
   }}
  | {:error, :authorize, String.t()}

Specs

boot_notification(
  req :: %OcppModel.V20.Messages.BootNotificationRequest{
    chargingStation: term(),
    reason: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.BootNotificationResponse{
     currentTime: term(),
     interval: term(),
     status: term(),
     statusInfo: term()
   }}
  | {:error, :boot_notification, String.t()}

Specs

data_transfer(
  req :: %OcppModel.V20.Messages.DataTransferRequest{
    data: term(),
    messageId: term(),
    vendorId: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.DataTransferResponse{
     data: term(),
     status: term(),
     statusInfo: term()
   }}
  | {:error, :data_transfer, String.t()}

Specs

heartbeat(req :: %OcppModel.V20.Messages.HeartbeatRequest{}) ::
  {:ok, %OcppModel.V20.Messages.HeartbeatResponse{currentTime: term()}}
  | {:error, :heartbeat, String.t()}

Specs

meter_values(
  req :: %OcppModel.V20.Messages.MeterValuesRequest{
    evseId: term(),
    meterValue: term()
  }
) ::
  {:ok, %OcppModel.V20.Messages.MeterValuesResponse{}}
  | {:error, :meter_values, String.t()}
Link to this callback

status_notification(req)

View Source

Specs

status_notification(
  req :: %OcppModel.V20.Messages.StatusNotificationRequest{
    connectorId: term(),
    connectorStatus: term(),
    evseId: term(),
    timestamp: term()
  }
) ::
  {:ok, %OcppModel.V20.Messages.StatusNotificationResponse{}}
  | {:error, :status_notification, String.t()}

Specs

transaction_event(
  req :: %OcppModel.V20.Messages.TransactionEventRequest{
    eventType: term(),
    evse: term(),
    idToken: term(),
    meterValue: term(),
    seqNo: term(),
    timestamp: term(),
    transactionInfo: term(),
    triggerReason: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.TransactionEventResponse{
     chargingPriority: term(),
     idTokenInfo: term(),
     totalCost: term(),
     updatedPersonalMessage: term()
   }}
  | {:error, :transaction_event, String.t()}