OcppModel.V20.Behaviours.Charger behaviour (ocpp_model v0.2.3) View Source

Behaviour of a Charger, 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

Link to this section Functions

Link to this function

handle(impl, 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

Link to this section Callbacks

Specs

cancel_reservation(
  req :: %OcppModel.V20.Messages.CancelReservationRequest{reservationId: term()}
) ::
  {:ok,
   %OcppModel.V20.Messages.CancelReservationResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :cancel_reservation, String.t()}

Specs

certificate_signed(
  req :: %OcppModel.V20.Messages.CertificateSignedRequest{
    certificateChain: term(),
    certificateType: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.CertificateSignedResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :certificate_signed, String.t()}
Link to this callback

change_availability(req)

View Source

Specs

change_availability(
  req :: %OcppModel.V20.Messages.ChangeAvailabilityRequest{
    evse: term(),
    operationalStatus: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.ChangeAvailabilityResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :change_availability, String.t()}

Specs

clear_cache(req :: %OcppModel.V20.Messages.ClearCacheRequest{}) ::
  {:ok,
   %OcppModel.V20.Messages.ClearCacheResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :clear_cache, String.t()}
Link to this callback

clear_charging_profile(req)

View Source

Specs

clear_charging_profile(
  req :: %OcppModel.V20.Messages.ClearChargingProfileRequest{
    chargingProfileCriteria: term(),
    chargingProfileId: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.ClearChargingProfileResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :clear_charging_profile, String.t()}
Link to this callback

clear_display_message(req)

View Source

Specs

clear_display_message(
  req :: %OcppModel.V20.Messages.ClearDisplayMessageRequest{id: term()}
) ::
  {:ok,
   %OcppModel.V20.Messages.ClearDisplayMessageResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :clear_display_message, String.t()}
Link to this callback

clear_variable_monitoring(req)

View Source

Specs

clear_variable_monitoring(
  req :: %OcppModel.V20.Messages.ClearVariableMonitoringRequest{id: term()}
) ::
  {:ok,
   %OcppModel.V20.Messages.ClearVariableMonitoringResponse{
     clearMonitoringResult: term()
   }}
  | {:error, :clear_variable_monitoring, String.t()}

Specs

cost_updated(
  req :: %OcppModel.V20.Messages.CostUpdatedRequest{
    totalCost: term(),
    transactionId: term()
  }
) ::
  {:ok, %OcppModel.V20.Messages.CostUpdatedResponse{}}
  | {:error, :cost_updated, String.t()}
Link to this callback

customer_information(req)

View Source

Specs

customer_information(
  req :: %OcppModel.V20.Messages.CustomerInformationRequest{
    clear: term(),
    customerCertificate: term(),
    customerIdentifier: term(),
    idToken: term(),
    report: term(),
    requestId: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.CustomerInformationResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :customer_information, 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

delete_certificate(
  req :: %OcppModel.V20.Messages.DeleteCertificateRequest{
    certificateHashData: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.DeleteCertificateResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :delete_certificate, String.t()}

Specs

get_base_report(
  req :: %OcppModel.V20.Messages.GetBaseReportRequest{
    reportBase: term(),
    requestId: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.GetBaseReportResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :get_base_report, String.t()}
Link to this callback

get_charging_profiles(req)

View Source

Specs

get_charging_profiles(
  req :: %OcppModel.V20.Messages.GetChargingProfilesRequest{
    chargingProfile: term(),
    evseId: term(),
    requestId: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.GetChargingProfilesResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :get_charging_profiles, String.t()}
Link to this callback

get_composite_schedule(req)

View Source

Specs

get_composite_schedule(
  req :: %OcppModel.V20.Messages.GetCompositeScheduleRequest{
    chargingRateUnit: term(),
    duration: term(),
    evseId: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.GetCompositeScheduleResponse{
     schedule: term(),
     status: term(),
     statusInfo: term()
   }}
  | {:error, :get_composite_schedule, String.t()}
Link to this callback

get_display_messages(req)

View Source

Specs

get_display_messages(
  req :: %OcppModel.V20.Messages.GetDisplayMessagesRequest{
    id: term(),
    priority: term(),
    requestId: term(),
    state: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.GetDisplayMessagesResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :get_display_messages, String.t()}
Link to this callback

get_installed_certificate_ids(req)

View Source

Specs

get_installed_certificate_ids(
  req :: %OcppModel.V20.Messages.GetInstalledCertificateIdsRequest{
    certificateType: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.GetInstalledCertificateIdsResponse{
     certificateHashDataChain: term(),
     status: term(),
     statusInfo: term()
   }}
Link to this callback

get_local_list_version(req)

View Source

Specs

get_local_list_version(
  req :: %OcppModel.V20.Messages.GetLocalListVersionRequest{}
) ::
  {:ok,
   %OcppModel.V20.Messages.GetLocalListVersionResponse{versionNumber: term()}}
  | {:error, :get_local_list_version, String.t()}

Specs

get_log(
  req :: %OcppModel.V20.Messages.GetLogRequest{
    log: term(),
    logType: term(),
    requestId: term(),
    retries: term(),
    retryInterval: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.GetLogResponse{
     filename: term(),
     status: term(),
     statusInfo: term()
   }}
  | {:error, :get_log, String.t()}
Link to this callback

get_monitoring_report(req)

View Source

Specs

get_monitoring_report(
  req :: %OcppModel.V20.Messages.GetMonitoringReportRequest{
    componentVariable: term(),
    monitorCriteria: term(),
    requestId: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.GetMonitoringReportResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :get_monitoring_report, String.t()}

Specs

get_report(
  req :: %OcppModel.V20.Messages.GetReportRequest{
    componentCriteria: term(),
    componentVariable: term(),
    requestId: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.GetReportResponse{status: term(), statusInfo: term()}}
  | {:error, :get_report, String.t()}
Link to this callback

get_transaction_status(req)

View Source

Specs

get_transaction_status(
  req :: %OcppModel.V20.Messages.GetTransactionStatusRequest{
    transactionId: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.GetTransactionStatusResponse{
     messagesInQueue: term(),
     ongoingIndicator: term()
   }}
  | {:error, :get_transaction_status, String.t()}

Specs

get_variables(
  req :: %OcppModel.V20.Messages.GetVariablesRequest{getVariableData: term()}
) ::
  {:ok, %OcppModel.V20.Messages.GetVariablesResponse{getVariableResult: term()}}
  | {:error, :get_variables, String.t()}
Link to this callback

install_certificate(req)

View Source

Specs

install_certificate(
  req :: %OcppModel.V20.Messages.InstallCertificateRequest{
    certificate: term(),
    certificateType: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.InstallCertificateResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :install_certificate, String.t()}

Specs

reset(req :: %OcppModel.V20.Messages.ResetRequest{evseId: term(), type: term()}) ::
  {:ok,
   %OcppModel.V20.Messages.ResetResponse{status: term(), statusInfo: term()}}
  | {:error, :reset, String.t()}

Specs

send_local_list(
  req :: %OcppModel.V20.Messages.SendLocalListRequest{
    localAuthorizationList: term(),
    updateType: term(),
    versionNumber: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.SendLocalListResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :send_local_list, String.t()}
Link to this callback

set_charging_profile(req)

View Source

Specs

set_charging_profile(
  req :: %OcppModel.V20.Messages.SetChargingProfileRequest{
    chargingProfile: term(),
    evseId: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.SetChargingProfileResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :set_charging_profile, String.t()}

Specs

trigger_message(
  req :: %OcppModel.V20.Messages.TriggerMessageRequest{
    evse: term(),
    requestedMessage: term()
  }
) ::
  {:ok,
   %OcppModel.V20.Messages.TriggerMessageResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :trigger_message, String.t()}

Specs

unlock_connector(
  req :: %OcppModel.V20.Messages.UnlockConnectorRequest{evseId: term()}
) ::
  {:ok,
   %OcppModel.V20.Messages.UnlockConnectorResponse{
     status: term(),
     statusInfo: term()
   }}
  | {:error, :unlock_connector, String.t()}