core

package
v0.16.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Contains the Basic Charge Point functionality comparable with OCPP 1.5.

Index

Constants

View Source
const (
	ResetTypeHard       ResetType   = "Hard"
	ResetTypeSoft       ResetType   = "Soft"
	ResetStatusAccepted ResetStatus = "Accepted"
	ResetStatusRejected ResetStatus = "Rejected"
)
View Source
const (
	ConnectorLockFailure           ChargePointErrorCode = "ConnectorLockFailure"
	EVCommunicationError           ChargePointErrorCode = "EVCommunicationError"
	GroundFailure                  ChargePointErrorCode = "GroundFailure"
	HighTemperature                ChargePointErrorCode = "HighTemperature"
	InternalError                  ChargePointErrorCode = "InternalError"
	LocalListConflict              ChargePointErrorCode = "LocalListConflict"
	NoError                        ChargePointErrorCode = "NoError"
	OtherError                     ChargePointErrorCode = "OtherError"
	OverCurrentFailure             ChargePointErrorCode = "OverCurrentFailure"
	OverVoltage                    ChargePointErrorCode = "OverVoltage"
	PowerMeterFailure              ChargePointErrorCode = "PowerMeterFailure"
	PowerSwitchFailure             ChargePointErrorCode = "PowerSwitchFailure"
	ReaderFailure                  ChargePointErrorCode = "ReaderFailure"
	ResetFailure                   ChargePointErrorCode = "ResetFailure"
	UnderVoltage                   ChargePointErrorCode = "UnderVoltage"
	WeakSignal                     ChargePointErrorCode = "WeakSignal"
	ChargePointStatusAvailable     ChargePointStatus    = "Available"
	ChargePointStatusPreparing     ChargePointStatus    = "Preparing"
	ChargePointStatusCharging      ChargePointStatus    = "Charging"
	ChargePointStatusSuspendedEVSE ChargePointStatus    = "SuspendedEVSE"
	ChargePointStatusSuspendedEV   ChargePointStatus    = "SuspendedEV"
	ChargePointStatusFinishing     ChargePointStatus    = "Finishing"
	ChargePointStatusReserved      ChargePointStatus    = "Reserved"
	ChargePointStatusUnavailable   ChargePointStatus    = "Unavailable"
	ChargePointStatusFaulted       ChargePointStatus    = "Faulted"
)
View Source
const AuthorizeFeatureName = "Authorize"
View Source
const BootNotificationFeatureName = "BootNotification"
View Source
const ChangeAvailabilityFeatureName = "ChangeAvailability"
View Source
const ChangeConfigurationFeatureName = "ChangeConfiguration"
View Source
const ClearCacheFeatureName = "ClearCache"
View Source
const DataTransferFeatureName = "DataTransfer"
View Source
const GetConfigurationFeatureName = "GetConfiguration"
View Source
const HeartbeatFeatureName = "Heartbeat"
View Source
const MeterValuesFeatureName = "MeterValues"
View Source
const RemoteStartTransactionFeatureName = "RemoteStartTransaction"
View Source
const RemoteStopTransactionFeatureName = "RemoteStopTransaction"
View Source
const ResetFeatureName = "Reset"
View Source
const StartTransactionFeatureName = "StartTransaction"
View Source
const StatusNotificationFeatureName = "StatusNotification"
View Source
const StopTransactionFeatureName = "StopTransaction"
View Source
const UnlockConnectorFeatureName = "UnlockConnector"

Variables

Provides support for Basic Charge Point functionality comparable with OCPP 1.5.

View Source
var ProfileName = "core"

THe profile name

Functions

This section is empty.

Types

type AuthorizeConfirmation

type AuthorizeConfirmation struct {
	IdTagInfo *types.IdTagInfo `json:"idTagInfo" validate:"required"`
}

This field definition of the Authorize confirmation payload, sent by the Charge Point to the Central System in response to an AuthorizeRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewAuthorizationConfirmation

func NewAuthorizationConfirmation(idTagInfo *types.IdTagInfo) *AuthorizeConfirmation

Creates a new AuthorizeConfirmation. There are no optional fields for this message.

func (AuthorizeConfirmation) GetFeatureName

func (c AuthorizeConfirmation) GetFeatureName() string

type AuthorizeFeature

type AuthorizeFeature struct{}

Before the owner of an electric vehicle can start or stop charging, the Charge Point has to authorize the operation. Upon receipt of an AuthorizeRequest, the Central System SHALL respond with an AuthorizeConfirmation. This response payload SHALL indicate whether or not the idTag is accepted by the Central System. If the Central System accepts the idTag then the response payload MAY include a parentIdTag and MUST include an authorization status value indicating acceptance or a reason for rejection. A Charge Point MAY authorize identifier locally without involving the Central System, as described in Local Authorization List. The Charge Point SHALL only supply energy after authorization.

func (AuthorizeFeature) GetFeatureName

func (f AuthorizeFeature) GetFeatureName() string

func (AuthorizeFeature) GetRequestType

func (f AuthorizeFeature) GetRequestType() reflect.Type

func (AuthorizeFeature) GetResponseType

func (f AuthorizeFeature) GetResponseType() reflect.Type

type AuthorizeRequest

type AuthorizeRequest struct {
	IdTag string `json:"idTag" validate:"required,max=20"`
}

The field definition of the Authorize request payload sent by the Charge Point to the Central System.

func NewAuthorizationRequest

func NewAuthorizationRequest(idTag string) *AuthorizeRequest

Creates a new AuthorizeRequest, containing all required fields. There are no optional fields for this message.

func (AuthorizeRequest) GetFeatureName

func (r AuthorizeRequest) GetFeatureName() string

type AvailabilityStatus

type AvailabilityStatus string

Status returned in response to ChangeAvailabilityRequest

const (
	AvailabilityStatusAccepted  AvailabilityStatus = "Accepted"
	AvailabilityStatusRejected  AvailabilityStatus = "Rejected"
	AvailabilityStatusScheduled AvailabilityStatus = "Scheduled"
)

type AvailabilityType

type AvailabilityType string

Requested availability change in ChangeAvailabilityRequest.

const (
	AvailabilityTypeOperative   AvailabilityType = "Operative"
	AvailabilityTypeInoperative AvailabilityType = "Inoperative"
)

type BootNotificationConfirmation

type BootNotificationConfirmation struct {
	CurrentTime *types.DateTime    `json:"currentTime" validate:"required"`
	Interval    int                `json:"interval" validate:"gte=0"`
	Status      RegistrationStatus `json:"status" validate:"required,registrationStatus"`
}

This field definition of the BootNotification confirmation payload, sent by the Central System to the Charge Point in response to a BootNotificationRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewBootNotificationConfirmation

func NewBootNotificationConfirmation(currentTime *types.DateTime, interval int, status RegistrationStatus) *BootNotificationConfirmation

Creates a new BootNotificationConfirmation. There are no optional fields for this message.

func (BootNotificationConfirmation) GetFeatureName

func (c BootNotificationConfirmation) GetFeatureName() string

type BootNotificationFeature

type BootNotificationFeature struct{}

After each (re)boot, a Charge Point SHALL send a request to the Central System with information about its configuration (e.g. version, vendor, etc.). The Central System SHALL respond to indicate whether it will accept the Charge Point. Between the physical power-on/reboot and the successful completion of a BootNotification, where Central System returns Accepted or Pending, the Charge Point SHALL NOT send any other request to the Central System. When the Central System responds with a BootNotification.conf with a status Accepted, the Charge Point will adjust the heartbeat interval in accordance with the interval from the response PDU and it is RECOMMENDED to synchronize its internal clock with the supplied Central System’s current time. If that interval value is zero, the Charge Point chooses a waiting interval on its own, in a way that avoids flooding the Central System with requests. If the Central System returns the Pending status, the communication channel SHOULD NOT be closed by either the Charge Point or the Central System. The Central System MAY send request messages to retrieve information from the Charge Point or change its configuration.

func (BootNotificationFeature) GetFeatureName

func (f BootNotificationFeature) GetFeatureName() string

func (BootNotificationFeature) GetRequestType

func (f BootNotificationFeature) GetRequestType() reflect.Type

func (BootNotificationFeature) GetResponseType

func (f BootNotificationFeature) GetResponseType() reflect.Type

type BootNotificationRequest

type BootNotificationRequest struct {
	ChargeBoxSerialNumber   string `json:"chargeBoxSerialNumber,omitempty" validate:"max=25"`
	ChargePointModel        string `json:"chargePointModel" validate:"required,max=20"`
	ChargePointSerialNumber string `json:"chargePointSerialNumber,omitempty" validate:"max=25"`
	ChargePointVendor       string `json:"chargePointVendor" validate:"required,max=20"`
	FirmwareVersion         string `json:"firmwareVersion,omitempty" validate:"max=50"`
	Iccid                   string `json:"iccid,omitempty" validate:"max=20"`
	Imsi                    string `json:"imsi,omitempty" validate:"max=20"`
	MeterSerialNumber       string `json:"meterSerialNumber,omitempty" validate:"max=25"`
	MeterType               string `json:"meterType,omitempty" validate:"max=25"`
}

The field definition of the BootNotification request payload sent by the Charge Point to the Central System.

func NewBootNotificationRequest

func NewBootNotificationRequest(chargePointModel string, chargePointVendor string) *BootNotificationRequest

Creates a new BootNotificationRequest, containing all required fields. Optional fields may be set afterwards.

func (BootNotificationRequest) GetFeatureName

func (r BootNotificationRequest) GetFeatureName() string

type CentralSystemHandler

type CentralSystemHandler interface {
	OnAuthorize(chargePointId string, request *AuthorizeRequest) (confirmation *AuthorizeConfirmation, err error)
	OnBootNotification(chargePointId string, request *BootNotificationRequest) (confirmation *BootNotificationConfirmation, err error)
	OnDataTransfer(chargePointId string, request *DataTransferRequest) (confirmation *DataTransferConfirmation, err error)
	OnHeartbeat(chargePointId string, request *HeartbeatRequest) (confirmation *HeartbeatConfirmation, err error)
	OnMeterValues(chargePointId string, request *MeterValuesRequest) (confirmation *MeterValuesConfirmation, err error)
	OnStatusNotification(chargePointId string, request *StatusNotificationRequest) (confirmation *StatusNotificationConfirmation, err error)
	OnStartTransaction(chargePointId string, request *StartTransactionRequest) (confirmation *StartTransactionConfirmation, err error)
	OnStopTransaction(chargePointId string, request *StopTransactionRequest) (confirmation *StopTransactionConfirmation, err error)
}

Needs to be implemented by Central systems for handling messages part of the OCPP 1.6 Core profile.

type ChangeAvailabilityConfirmation

type ChangeAvailabilityConfirmation struct {
	Status AvailabilityStatus `json:"status" validate:"required,availabilityStatus"`
}

This field definition of the ChangeAvailability confirmation payload, sent by the Charge Point to the Central System in response to a ChangeAvailabilityRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewChangeAvailabilityConfirmation

func NewChangeAvailabilityConfirmation(status AvailabilityStatus) *ChangeAvailabilityConfirmation

Creates a new ChangeAvailabilityConfirmation, containing all required fields. There are no optional fields for this message.

func (ChangeAvailabilityConfirmation) GetFeatureName

func (c ChangeAvailabilityConfirmation) GetFeatureName() string

type ChangeAvailabilityFeature

type ChangeAvailabilityFeature struct{}

Central System can request a Charge Point to change its availability. A Charge Point is considered available (“operative”) when it is charging or ready for charging. A Charge Point is considered unavailable when it does not allow any charging. The Central System SHALL send a ChangeAvailabilityRequest for requesting a Charge Point to change its availability. The Central System can change the availability to available or unavailable.

func (ChangeAvailabilityFeature) GetFeatureName

func (f ChangeAvailabilityFeature) GetFeatureName() string

func (ChangeAvailabilityFeature) GetRequestType

func (f ChangeAvailabilityFeature) GetRequestType() reflect.Type

func (ChangeAvailabilityFeature) GetResponseType

func (f ChangeAvailabilityFeature) GetResponseType() reflect.Type

type ChangeAvailabilityRequest

type ChangeAvailabilityRequest struct {
	ConnectorId int              `json:"connectorId" validate:"gte=0"`
	Type        AvailabilityType `json:"type" validate:"required,availabilityType"`
}

The field definition of the ChangeAvailability request payload sent by the Central System to the Charge Point.

func NewChangeAvailabilityRequest

func NewChangeAvailabilityRequest(connectorId int, availabilityType AvailabilityType) *ChangeAvailabilityRequest

Creates a new ChangeAvailabilityRequest, containing all required fields. There are no optional fields for this message.

func (ChangeAvailabilityRequest) GetFeatureName

func (r ChangeAvailabilityRequest) GetFeatureName() string

type ChangeConfigurationConfirmation

type ChangeConfigurationConfirmation struct {
	Status ConfigurationStatus `json:"status" validate:"required,configurationStatus"`
}

This field definition of the ChangeConfiguration confirmation payload, sent by the Charge Point to the Central System in response to a ChangeConfigurationRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewChangeConfigurationConfirmation

func NewChangeConfigurationConfirmation(status ConfigurationStatus) *ChangeConfigurationConfirmation

Creates a new ChangeConfigurationConfirmation, containing all required fields. There are no optional fields for this message.

func (ChangeConfigurationConfirmation) GetFeatureName

func (c ChangeConfigurationConfirmation) GetFeatureName() string

type ChangeConfigurationFeature

type ChangeConfigurationFeature struct{}

Central System can request a Charge Point to change configuration parameters, by sending a ChangeConfigurationRequest. This request contains a key-value pair, where "key" is the name of the configuration setting to change and "value" contains the new setting for the configuration setting. A Charge Point SHALL reply with a ChangeConfigurationConfirmation indicating whether it was able to apply the change to its configuration. The Charge Point SHALL set the status field in the ChangeConfiguration.conf according to the following rules: - If the change was applied successfully, and the change if effective immediately, the Charge Point SHALL respond with a status 'Accepted'. - If the change was applied successfully, but a reboot is needed to make it effective, the Charge Point SHALL respond with status 'RebootRequired'. - If "key" does not correspond to a configuration setting supported by Charge Point, it SHALL respond with a status 'NotSupported'. - If the Charge Point did not set the configuration, and none of the previous statuses applies, the Charge Point SHALL respond with status 'Rejected'.

If a key value is defined as a CSL, it MAY be accompanied with a [KeyName]MaxLength key, indicating the max length of the CSL in items. If this key is not set, a safe value of 1 (one) item SHOULD be assumed.

func (ChangeConfigurationFeature) GetFeatureName

func (f ChangeConfigurationFeature) GetFeatureName() string

func (ChangeConfigurationFeature) GetRequestType

func (f ChangeConfigurationFeature) GetRequestType() reflect.Type

func (ChangeConfigurationFeature) GetResponseType

func (f ChangeConfigurationFeature) GetResponseType() reflect.Type

type ChangeConfigurationRequest

type ChangeConfigurationRequest struct {
	Key   string `json:"key" validate:"required,max=50"`
	Value string `json:"value" validate:"required,max=500"`
}

The field definition of the ChangeConfiguration request payload sent by the Central System to the Charge Point.

func NewChangeConfigurationRequest

func NewChangeConfigurationRequest(key string, value string) *ChangeConfigurationRequest

Creates a new ChangeConfigurationRequest, containing all required fields. There are no optional fields for this message.

func (ChangeConfigurationRequest) GetFeatureName

func (r ChangeConfigurationRequest) GetFeatureName() string

type ChargePointErrorCode

type ChargePointErrorCode string

Charge Point status reported in StatusNotificationRequest.

type ChargePointHandler

type ChargePointHandler interface {
	OnChangeAvailability(request *ChangeAvailabilityRequest) (confirmation *ChangeAvailabilityConfirmation, err error)
	OnChangeConfiguration(request *ChangeConfigurationRequest) (confirmation *ChangeConfigurationConfirmation, err error)
	OnClearCache(request *ClearCacheRequest) (confirmation *ClearCacheConfirmation, err error)
	OnDataTransfer(request *DataTransferRequest) (confirmation *DataTransferConfirmation, err error)
	OnGetConfiguration(request *GetConfigurationRequest) (confirmation *GetConfigurationConfirmation, err error)
	OnRemoteStartTransaction(request *RemoteStartTransactionRequest) (confirmation *RemoteStartTransactionConfirmation, err error)
	OnRemoteStopTransaction(request *RemoteStopTransactionRequest) (confirmation *RemoteStopTransactionConfirmation, err error)
	OnReset(request *ResetRequest) (confirmation *ResetConfirmation, err error)
	OnUnlockConnector(request *UnlockConnectorRequest) (confirmation *UnlockConnectorConfirmation, err error)
}

Needs to be implemented by Charge points for handling messages part of the OCPP 1.6 Core profile.

type ChargePointStatus

type ChargePointStatus string

Status reported in StatusNotificationRequest. A status can be reported for the Charge Point main controller (connectorId = 0) or for a specific connector. Status for the Charge Point main controller is a subset of the enumeration: Available, Unavailable or Faulted.

type ClearCacheConfirmation

type ClearCacheConfirmation struct {
	Status ClearCacheStatus `json:"status" validate:"required,cacheStatus"`
}

This field definition of the ClearCache confirmation payload, sent by the Charge Point to the Central System in response to a ClearCacheRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewClearCacheConfirmation

func NewClearCacheConfirmation(status ClearCacheStatus) *ClearCacheConfirmation

Creates a new ClearCacheConfirmation, containing all required fields. There are no optional fields for this message.

func (ClearCacheConfirmation) GetFeatureName

func (c ClearCacheConfirmation) GetFeatureName() string

type ClearCacheFeature

type ClearCacheFeature struct{}

Central System can request a Charge Point to clear its Authorization Cache. The Central System SHALL send a ClearCacheRequest PDU for clearing the Charge Point’s Authorization Cache. Upon receipt of a ClearCacheRequest, the Charge Point SHALL respond with a ClearCacheConfirmation PDU. The response PDU SHALL indicate whether the Charge Point was able to clear its Authorization Cache.

func (ClearCacheFeature) GetFeatureName

func (f ClearCacheFeature) GetFeatureName() string

func (ClearCacheFeature) GetRequestType

func (f ClearCacheFeature) GetRequestType() reflect.Type

func (ClearCacheFeature) GetResponseType

func (f ClearCacheFeature) GetResponseType() reflect.Type

type ClearCacheRequest

type ClearCacheRequest struct {
}

The field definition of the ClearCache request payload sent by the Central System to the Charge Point.

func NewClearCacheRequest

func NewClearCacheRequest() *ClearCacheRequest

Creates a new ClearCacheRequest, which doesn't contain any required or optional fields.

func (ClearCacheRequest) GetFeatureName

func (r ClearCacheRequest) GetFeatureName() string

type ClearCacheStatus

type ClearCacheStatus string

Status returned in response to ClearCacheRequest.

const (
	ClearCacheStatusAccepted ClearCacheStatus = "Accepted"
	ClearCacheStatusRejected ClearCacheStatus = "Rejected"
)

type ConfigurationKey

type ConfigurationKey struct {
	Key      string  `json:"key" validate:"required,max=50"`
	Readonly bool    `json:"readonly"`
	Value    *string `json:"value,omitempty" validate:"omitempty,max=500"`
}

Contains information about a specific configuration key. It is returned in GetConfigurationConfirmation

type ConfigurationStatus

type ConfigurationStatus string

Status in ChangeConfigurationConfirmation.

const (
	ConfigurationStatusAccepted       ConfigurationStatus = "Accepted"
	ConfigurationStatusRejected       ConfigurationStatus = "Rejected"
	ConfigurationStatusRebootRequired ConfigurationStatus = "RebootRequired"
	ConfigurationStatusNotSupported   ConfigurationStatus = "NotSupported"
)

type DataTransferConfirmation

type DataTransferConfirmation struct {
	Status DataTransferStatus `json:"status" validate:"required,dataTransferStatus"`
	Data   interface{}        `json:"data,omitempty"`
}

This field definition of the DataTransfer confirmation payload, sent by an endpoint in response to a DataTransferRequest, coming from the other endpoint. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewDataTransferConfirmation

func NewDataTransferConfirmation(status DataTransferStatus) *DataTransferConfirmation

Creates a new DataTransferConfirmation. Optional fields may be set afterwards.

func (DataTransferConfirmation) GetFeatureName

func (c DataTransferConfirmation) GetFeatureName() string

type DataTransferFeature

type DataTransferFeature struct{}

If a Charge Point needs to send information to the Central System for a function not supported by OCPP, it SHALL use a DataTransfer message. The same functionality may also be offered the other way around, allowing a Central System to send arbitrary custom commands to a Charge Point.

func (DataTransferFeature) GetFeatureName

func (f DataTransferFeature) GetFeatureName() string

func (DataTransferFeature) GetRequestType

func (f DataTransferFeature) GetRequestType() reflect.Type

func (DataTransferFeature) GetResponseType

func (f DataTransferFeature) GetResponseType() reflect.Type

type DataTransferRequest

type DataTransferRequest struct {
	VendorId  string      `json:"vendorId" validate:"required,max=255"`
	MessageId string      `json:"messageId,omitempty" validate:"max=50"`
	Data      interface{} `json:"data,omitempty"`
}

The field definition of the DataTransfer request payload sent by an endpoint to ther other endpoint.

func NewDataTransferRequest

func NewDataTransferRequest(vendorId string) *DataTransferRequest

Creates a new DataTransferRequest, containing all required fields. Optional fields may be set afterwards.

func (DataTransferRequest) GetFeatureName

func (r DataTransferRequest) GetFeatureName() string

type DataTransferStatus

type DataTransferStatus string

Status in DataTransferConfirmation messages.

const (
	DataTransferStatusAccepted         DataTransferStatus = "Accepted"
	DataTransferStatusRejected         DataTransferStatus = "Rejected"
	DataTransferStatusUnknownMessageId DataTransferStatus = "UnknownMessageId"
	DataTransferStatusUnknownVendorId  DataTransferStatus = "UnknownVendorId"
)

type GetConfigurationConfirmation

type GetConfigurationConfirmation struct {
	ConfigurationKey []ConfigurationKey `json:"configurationKey,omitempty" validate:"omitempty,dive"`
	UnknownKey       []string           `json:"unknownKey,omitempty" validate:"omitempty,dive,max=50"`
}

TODO: validation of cardinalities for the two fields should be handled somewhere (#configurationKey + #unknownKey > 0) TODO: add uniqueness of configurationKey in slice, once PR is merged (https://github.com/go-playground/validator/pull/496) This field definition of the GetConfiguration confirmation payload, sent by the Charge Point to the Central System in response to a GetConfigurationRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewGetConfigurationConfirmation

func NewGetConfigurationConfirmation(configurationKey []ConfigurationKey) *GetConfigurationConfirmation

Creates a new GetConfigurationConfirmation, containing all required fields. Optional fields may be set afterwards.

func (GetConfigurationConfirmation) GetFeatureName

func (c GetConfigurationConfirmation) GetFeatureName() string

type GetConfigurationFeature

type GetConfigurationFeature struct{}

To retrieve the value of configuration settings, the Central System SHALL send a GetConfigurationRequest to the Charge Point. If the list of keys in the request is empty or missing (it is optional), the Charge Point SHALL return a list of all configuration settings in GetConfigurationConfirmation. Otherwise Charge Point SHALL return a list of recognized keys and their corresponding values and read-only state. Unrecognized keys SHALL be placed in the response payload as part of the optional unknown key list element of GetConfigurationConfirmation. The number of configuration keys requested in a single payload MAY be limited by the Charge Point. This maximum can be retrieved by reading the configuration key GetConfigurationMaxKeys.

func (GetConfigurationFeature) GetFeatureName

func (f GetConfigurationFeature) GetFeatureName() string

func (GetConfigurationFeature) GetRequestType

func (f GetConfigurationFeature) GetRequestType() reflect.Type

func (GetConfigurationFeature) GetResponseType

func (f GetConfigurationFeature) GetResponseType() reflect.Type

type GetConfigurationRequest

type GetConfigurationRequest struct {
	Key []string `json:"key,omitempty" validate:"omitempty,unique,dive,max=50"`
}

The field definition of the GetConfiguration request payload sent by the Central System to the Charge Point.

func NewGetConfigurationRequest

func NewGetConfigurationRequest(keys []string) *GetConfigurationRequest

Creates a new GetConfigurationRequest, containing all required fields. There are no optional fields for this message.

func (GetConfigurationRequest) GetFeatureName

func (r GetConfigurationRequest) GetFeatureName() string

type HeartbeatConfirmation

type HeartbeatConfirmation struct {
	CurrentTime *types.DateTime `json:"currentTime" validate:"required"`
}

This field definition of the Heartbeat confirmation payload, sent by the Central System to the Charge Point in response to a HeartbeatRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewHeartbeatConfirmation

func NewHeartbeatConfirmation(currentTime *types.DateTime) *HeartbeatConfirmation

Creates a new HeartbeatConfirmation, containing all required fields.

func (HeartbeatConfirmation) GetFeatureName

func (c HeartbeatConfirmation) GetFeatureName() string

type HeartbeatFeature

type HeartbeatFeature struct{}

To let the Central System know that a Charge Point is still connected, a Charge Point sends a heartbeat after a configurable time interval. The Charge Point SHALL send a HeartbeatRequest for ensuring that the Central System knows that a Charge Point is still alive. Upon receipt of a Heartbeat.req PDU, the Central System SHALL respond with a HeartbeatConfirmation. The response payload SHALL contain the current time of the Central System, which is RECOMMENDED to be used by the Charge Point to synchronize its internal clock. The Charge Point MAY skip sending a HeartbeatRequest when another payload has been sent to the Central System within the configured heartbeat interval. This implies that a Central System SHOULD assume availability of a Charge Point whenever a request has been received, the same way as it would have, when it received a HeartbeatRequest. With JSON over WebSocket, sending heartbeats is not mandatory. However, for time synchronization it is advised to at least send one heartbeat per 24 hour.

func (HeartbeatFeature) GetFeatureName

func (f HeartbeatFeature) GetFeatureName() string

func (HeartbeatFeature) GetRequestType

func (f HeartbeatFeature) GetRequestType() reflect.Type

func (HeartbeatFeature) GetResponseType

func (f HeartbeatFeature) GetResponseType() reflect.Type

type HeartbeatRequest

type HeartbeatRequest struct {
}

The field definition of the Heartbeat request payload sent by the Charge Point to the Central System.

func NewHeartbeatRequest

func NewHeartbeatRequest() *HeartbeatRequest

Creates a new HeartbeatRequest, which doesn't contain any required or optional fields.

func (HeartbeatRequest) GetFeatureName

func (r HeartbeatRequest) GetFeatureName() string

type MeterValuesConfirmation

type MeterValuesConfirmation struct {
}

This field definition of the Authorize confirmation payload, sent by the Charge Point to the Central System in response to an AuthorizeRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewMeterValuesConfirmation

func NewMeterValuesConfirmation() *MeterValuesConfirmation

Creates a new MeterValuesConfirmation, which doesn't contain any required or optional fields.

func (MeterValuesConfirmation) GetFeatureName

func (c MeterValuesConfirmation) GetFeatureName() string

type MeterValuesFeature

type MeterValuesFeature struct{}

A Charge Point MAY sample the electrical meter or other sensor/transducer hardware to provide extra information about its meter values. It is up to the Charge Point to decide when it will send meter values. This can be configured using the ChangeConfiguration message to specify data acquisition intervals and specify data to be acquired & reported. The Charge Point SHALL send a MeterValuesRequest for offloading meter values. The request PDU SHALL contain for each sample: 1. The id of the Connector from which samples were taken. If the connectorId is 0, it is associated with the entire Charge Point. If the connectorId is 0 and the Measurand is energy related, the sample SHOULD be taken from the main energy meter. 2. The transactionId of the transaction to which these values are related, if applicable. If there is no transaction in progress or if the values are taken from the main meter, then transaction id may be omitted. 3. One or more meterValue elements, of type MeterValue, each representing a set of one or more data values taken at a particular point in time. Each MeterValue element contains a timestamp and a set of one or more individual sampledValue elements, all captured at the same point in time. Each sampledValue element contains a single value datum. The nature of each sampledValue is determined by the optional measurand, context, location, unit, phase, and format fields. The optional measurand field specifies the type of value being measured/reported. The optional context field specifies the reason/event triggering the reading. The optional location field specifies where the measurement is taken (e.g. Inlet, Outlet). The optional phase field specifies to which phase or phases of the electric installation the value applies. The Charging Point SHALL report all phase number dependent values from the electrical meter (or grid connection when absent) point of view. For individual connector phase rotation information, the Central System MAY query the ConnectorPhaseRotation configuration key on the Charging Point via GetConfiguration. The Charge Point SHALL report the phase rotation in respect to the grid connection. Possible values per connector are: NotApplicable, Unknown, RST, RTS, SRT, STR, TRS and TSR. see section Standard Configuration Key Names & Values for more information. The EXPERIMENTAL optional format field specifies whether the data is represented in the normal (default) form as a simple numeric value ("Raw"), or as “SignedData”, an opaque digitally signed binary data block, represented as hex data. This experimental field may be deprecated and subsequently removed in later versions, when a more mature solution alternative is provided. To retain backward compatibility, the default values of all of the optional fields on a sampledValue element are such that a value without any additional fields will be interpreted, as a register reading of active import energy in Wh (Watt-hour) units. Upon receipt of a MeterValuesRequest, the Central System SHALL respond with a MeterValuesConfirmation. It is likely that The Central System applies sanity checks to the data contained in a MeterValuesRequest it received. The outcome of such sanity checks SHOULD NOT ever cause the Central System to not respond with a MeterValuesConfirmation. Failing to respond with a MeterValues.conf will only cause the Charge Point to try the same message again as specified in Error responses to transaction-related messages.

func (MeterValuesFeature) GetFeatureName

func (f MeterValuesFeature) GetFeatureName() string

func (MeterValuesFeature) GetRequestType

func (f MeterValuesFeature) GetRequestType() reflect.Type

func (MeterValuesFeature) GetResponseType

func (f MeterValuesFeature) GetResponseType() reflect.Type

type MeterValuesRequest

type MeterValuesRequest struct {
	ConnectorId   int                `json:"connectorId" validate:"gte=0"`
	TransactionId *int               `json:"transactionId,omitempty"`
	MeterValue    []types.MeterValue `json:"meterValue" validate:"required,min=1,dive"`
}

The field definition of the MeterValues request payload sent by the Charge Point to the Central System.

func NewMeterValuesRequest

func NewMeterValuesRequest(connectorId int, meterValues []types.MeterValue) *MeterValuesRequest

Creates a new MeterValuesRequest, containing all required fields. Optional fields may be set afterwards.

func (MeterValuesRequest) GetFeatureName

func (r MeterValuesRequest) GetFeatureName() string

type Reason

type Reason string

Reason for stopping a transaction in StopTransactionRequest.

const (
	ReasonDeAuthorized   Reason = "DeAuthorized"
	ReasonEmergencyStop  Reason = "EmergencyStop"
	ReasonEVDisconnected Reason = "EVDisconnected"
	ReasonHardReset      Reason = "HardReset"
	ReasonLocal          Reason = "Local"
	ReasonOther          Reason = "Other"
	ReasonPowerLoss      Reason = "PowerLoss"
	ReasonReboot         Reason = "Reboot"
	ReasonRemote         Reason = "Remote"
	ReasonSoftReset      Reason = "SoftReset"
	ReasonUnlockCommand  Reason = "UnlockCommand"
)

type RegistrationStatus

type RegistrationStatus string

Result of registration in response to a BootNotification request.

const (
	RegistrationStatusAccepted RegistrationStatus = "Accepted"
	RegistrationStatusPending  RegistrationStatus = "Pending"
	RegistrationStatusRejected RegistrationStatus = "Rejected"
)

type RemoteStartTransactionConfirmation

type RemoteStartTransactionConfirmation struct {
	Status types.RemoteStartStopStatus `json:"status" validate:"required,remoteStartStopStatus"`
}

This field definition of the RemoteStartTransaction confirmation payload, sent by the Charge Point to the Central System in response to a RemoteStartTransactionRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewRemoteStartTransactionConfirmation

func NewRemoteStartTransactionConfirmation(status types.RemoteStartStopStatus) *RemoteStartTransactionConfirmation

Creates a new RemoteStartTransactionConfirmation, containing all required fields. There are no optional fields for this message.

func (RemoteStartTransactionConfirmation) GetFeatureName

func (c RemoteStartTransactionConfirmation) GetFeatureName() string

type RemoteStartTransactionFeature

type RemoteStartTransactionFeature struct{}

Central System can request a Charge Point to start a transaction by sending a RemoteStartTransactionRequest. Upon receipt, the Charge Point SHALL reply with RemoteStartTransactionConfirmation and a status indicating whether it has accepted the request and will attempt to start a transaction. The effect of the RemoteStartTransactionRequest message depends on the value of the AuthorizeRemoteTxRequests configuration key in the Charge Point.

• If the value of AuthorizeRemoteTxRequests is true, the Charge Point SHALL behave as if in response to a local action at the Charge Point to start a transaction with the idTag given in the RemoteStartTransactionRequest message. This means that the Charge Point will first try to authorize the idTag, using the Local Authorization List, Authorization Cache and/or an AuthorizeRequest request. A transaction will only be started after authorization was obtained.

• If the value of AuthorizeRemoteTxRequests is false, the Charge Point SHALL immediately try to start a transaction for the idTag given in the RemoteStartTransactionRequest message. Note that after the transaction has been started, the Charge Point will send a StartTransaction request to the Central System, and the Central System will check the authorization status of the idTag when processing this StartTransaction request.

The following typical use cases are the reason for Remote Start Transaction:

• Enable a CPO operator to help an EV driver that has problems starting a transaction.

• Enable mobile apps to control charging transactions via the Central System.

• Enable the use of SMS to control charging transactions via the Central System.

The RemoteStartTransactionRequest SHALL contain an identifier (idTag), which Charge Point SHALL use, if it is able to start a transaction, to send a StartTransactionRequest to Central System. The transaction is started in the same way as described in StartTransaction. The RemoteStartTransactionRequest MAY contain a connector id if the transaction is to be started on a specific connector. When no connector id is provided, the Charge Point is in control of the connector selection. A Charge Point MAY reject a RemoteStartTransactionRequest without a connector id. The Central System MAY include a ChargingProfile in the RemoteStartTransaction request. The purpose of this ChargingProfile SHALL be set to TxProfile. If accepted, the Charge Point SHALL use this ChargingProfile for the transaction.

func (RemoteStartTransactionFeature) GetFeatureName

func (f RemoteStartTransactionFeature) GetFeatureName() string

func (RemoteStartTransactionFeature) GetRequestType

func (f RemoteStartTransactionFeature) GetRequestType() reflect.Type

func (RemoteStartTransactionFeature) GetResponseType

func (f RemoteStartTransactionFeature) GetResponseType() reflect.Type

type RemoteStartTransactionRequest

type RemoteStartTransactionRequest struct {
	ConnectorId     *int                   `json:"connectorId,omitempty" validate:"omitempty,gt=0"`
	IdTag           string                 `json:"idTag" validate:"required,max=20"`
	ChargingProfile *types.ChargingProfile `json:"chargingProfile,omitempty"`
}

The field definition of the RemoteStartTransaction request payload sent by the Central System to the Charge Point.

func NewRemoteStartTransactionRequest

func NewRemoteStartTransactionRequest(idTag string) *RemoteStartTransactionRequest

Creates a new RemoteStartTransactionRequest, containing all required fields. Optional fields may be set afterwards.

func (RemoteStartTransactionRequest) GetFeatureName

func (r RemoteStartTransactionRequest) GetFeatureName() string

type RemoteStopTransactionConfirmation

type RemoteStopTransactionConfirmation struct {
	Status types.RemoteStartStopStatus `json:"status" validate:"required,remoteStartStopStatus"`
}

This field definition of the RemoteStopTransaction confirmation payload, sent by the Charge Point to the Central System in response to a RemoteStopTransactionRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewRemoteStopTransactionConfirmation

func NewRemoteStopTransactionConfirmation(status types.RemoteStartStopStatus) *RemoteStopTransactionConfirmation

Creates a new RemoteStopTransactionConfirmation, containing all required fields. There are no optional fields for this message.

func (RemoteStopTransactionConfirmation) GetFeatureName

func (c RemoteStopTransactionConfirmation) GetFeatureName() string

type RemoteStopTransactionFeature

type RemoteStopTransactionFeature struct{}

Central System can request a Charge Point to stop a transaction by sending a RemoteStopTransactionRequest to Charge Point with the identifier of the transaction. Charge Point SHALL reply with RemoteStopTransactionConfirmation and a status indicating whether it has accepted the request and a transaction with the given transactionId is ongoing and will be stopped. This remote request to stop a transaction is equal to a local action to stop a transaction. Therefore, the transaction SHALL be stopped, The Charge Point SHALL send a StopTransactionRequest and, if applicable, unlock the connector. The following two main use cases are the reason for Remote Stop Transaction: • Enable a CPO operator to help an EV driver that has problems stopping a transaction. • Enable mobile apps to control charging transactions via the Central System.

func (RemoteStopTransactionFeature) GetFeatureName

func (f RemoteStopTransactionFeature) GetFeatureName() string

func (RemoteStopTransactionFeature) GetRequestType

func (f RemoteStopTransactionFeature) GetRequestType() reflect.Type

func (RemoteStopTransactionFeature) GetResponseType

func (f RemoteStopTransactionFeature) GetResponseType() reflect.Type

type RemoteStopTransactionRequest

type RemoteStopTransactionRequest struct {
	TransactionId int `json:"transactionId"`
}

The field definition of the RemoteStopTransaction request payload sent by the Central System to the Charge Point.

func NewRemoteStopTransactionRequest

func NewRemoteStopTransactionRequest(transactionId int) *RemoteStopTransactionRequest

Creates a new RemoteStopTransactionRequest, containing all required fields. There are no optional fields for this message.

func (RemoteStopTransactionRequest) GetFeatureName

func (r RemoteStopTransactionRequest) GetFeatureName() string

type ResetConfirmation

type ResetConfirmation struct {
	Status ResetStatus `json:"status" validate:"required,resetStatus"`
}

This field definition of the Reset confirmation payload, sent by the Charge Point to the Central System in response to a ResetRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewResetConfirmation

func NewResetConfirmation(status ResetStatus) *ResetConfirmation

Creates a new ResetConfirmation, containing all required fields. There are no optional fields for this message.

func (ResetConfirmation) GetFeatureName

func (c ResetConfirmation) GetFeatureName() string

type ResetFeature

type ResetFeature struct{}

The Central System SHALL send a ResetRequest for requesting a Charge Point to reset itself. The Central System can request a hard or a soft reset. Upon receipt of a ResetRequest, the Charge Point SHALL respond with a ResetConfirmation message. The response SHALL include whether the Charge Point will attempt to reset itself. After receipt of a ResetRequest, The Charge Point SHALL send a StopTransactionRequest for any ongoing transaction before performing the reset. If the Charge Point fails to receive a StopTransactionConfirmation form the Central System, it shall queue the StopTransactionRequest. At receipt of a soft reset, the Charge Point SHALL stop ongoing transactions gracefully and send StopTransactionRequest for every ongoing transaction. It should then restart the application software (if possible, otherwise restart the processor/controller). At receipt of a hard reset the Charge Point SHALL restart (all) the hardware, it is not required to gracefully stop ongoing transaction. If possible the Charge Point sends a StopTransactionRequest for previously ongoing transactions after having restarted and having been accepted by the Central System via a BootNotificationConfirmation. This is a last resort solution for a not correctly functioning Charge Points, by sending a "hard" reset, (queued) information might get lost.

func (ResetFeature) GetFeatureName

func (f ResetFeature) GetFeatureName() string

func (ResetFeature) GetRequestType

func (f ResetFeature) GetRequestType() reflect.Type

func (ResetFeature) GetResponseType

func (f ResetFeature) GetResponseType() reflect.Type

type ResetRequest

type ResetRequest struct {
	Type ResetType `json:"type" validate:"required,resetType"`
}

The field definition of the Reset request payload sent by the Central System to the Charge Point.

func NewResetRequest

func NewResetRequest(resetType ResetType) *ResetRequest

Creates a new ResetRequest, containing all required fields. There are no optional fields for this message.

func (ResetRequest) GetFeatureName

func (r ResetRequest) GetFeatureName() string

type ResetStatus

type ResetStatus string

Result of ResetRequest.

type ResetType

type ResetType string

Type of reset requested by ResetRequest.

type StartTransactionConfirmation

type StartTransactionConfirmation struct {
	IdTagInfo     *types.IdTagInfo `json:"idTagInfo" validate:"required"`
	TransactionId int              `json:"transactionId"`
}

This field definition of the StartTransactionConfirmation payload sent by the Central System to the Charge Point in response to a StartTransactionRequest.

func NewStartTransactionConfirmation

func NewStartTransactionConfirmation(idTagInfo *types.IdTagInfo, transactionId int) *StartTransactionConfirmation

Creates a new StartTransaction confirmation. All signature parameters are required fields. There are no optional fields for this message.

func (StartTransactionConfirmation) GetFeatureName

func (c StartTransactionConfirmation) GetFeatureName() string

type StartTransactionFeature

type StartTransactionFeature struct{}

The Charge Point SHALL send a StartTransactionRequest to the Central System to inform about a transaction that has been started. If this transaction ends a reservation (see ReserveNow operation), then the StartTransaction MUST contain the reservationId. Upon receipt of a StartTransactionRequest, the Central System SHOULD respond with a StartTransactionConfirmation. This response payload MUST include a transaction id and an authorization status value. The Central System MUST verify validity of the identifier in the StartTransactionRequest, because the identifier might have been authorized locally by the Charge Point using outdated information. If Charge Point has implemented an Authorization Cache, then upon receipt of a StartTransactionConfirmation the Charge Point SHALL update the cache entry, if the idTag is not in the Local Authorization List, with the IdTagInfo value from the response as described under Authorization Cache. It is likely that The Central System applies sanity checks to the data contained in a StartTransactionRequest it received. The outcome of such sanity checks SHOULD NOT ever cause the Central System to not respond with a StartTransactionConfirmation. Failing to respond with a StartTransactionConfirmation will only cause the Charge Point to try the same message again as specified in Error responses to transaction-related messages.

func (StartTransactionFeature) GetFeatureName

func (f StartTransactionFeature) GetFeatureName() string

func (StartTransactionFeature) GetRequestType

func (f StartTransactionFeature) GetRequestType() reflect.Type

func (StartTransactionFeature) GetResponseType

func (f StartTransactionFeature) GetResponseType() reflect.Type

type StartTransactionRequest

type StartTransactionRequest struct {
	ConnectorId   int             `json:"connectorId" validate:"gt=0"`
	IdTag         string          `json:"idTag" validate:"required,max=20"`
	MeterStart    int             `json:"meterStart" validate:"gte=0"`
	ReservationId *int            `json:"reservationId,omitempty" validate:"omitempty"`
	Timestamp     *types.DateTime `json:"timestamp" validate:"required"`
}

This field definition of the StartTransactionRequest payload sent by the Charge Point to the Central System.

func NewStartTransactionRequest

func NewStartTransactionRequest(connectorId int, idTag string, meterStart int, timestamp *types.DateTime) *StartTransactionRequest

Creates a new StartTransaction request. All signature parameters are required fields. Optional fields may be set directly on the created request.

func (StartTransactionRequest) GetFeatureName

func (r StartTransactionRequest) GetFeatureName() string

type StatusNotificationConfirmation

type StatusNotificationConfirmation struct {
}

This field definition of the StatusNotification confirmation payload, sent by the Central System to the Charge Point in response to a StatusNotificationRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewStatusNotificationConfirmation

func NewStatusNotificationConfirmation() *StatusNotificationConfirmation

Creates a new StatusNotificationConfirmation, which doesn't contain any required or optional fields.

func (StatusNotificationConfirmation) GetFeatureName

func (c StatusNotificationConfirmation) GetFeatureName() string

type StatusNotificationFeature

type StatusNotificationFeature struct{}

A Charge Point sends a notification to the Central System to inform the Central System about a status change or an error within the Charge Point. Refer to the official OCPP specification for a full list of status changes that may trigger such a message. To limit the number of transitions, the Charge Point MAY omit sending a StatusNotificationRequest if it was active for less time than defined in the optional configuration key MinimumStatusDuration. This way, a Charge Point MAY choose not to send certain StatusNotificationRequest payloads. The Charge Point MAY send a StatusNotificationRequest to inform the Central System of fault conditions. When the 'status' field is not Faulted, the condition should be considered a warning since charging operations are still possible. When a Charge Point is configured with StopTransactionOnEVSideDisconnect set to false, a transaction is running and the EV becomes disconnected on EV side, then a StatusNotificationRequest with the state: SuspendedEV SHOULD be send to the Central System, with the 'errorCode' field set to: 'NoError'. The Charge Point SHOULD add additional information in the 'info' field, Notifying the Central System with the reason of suspension: 'EV side disconnected'. The current transaction is not stopped. When a Charge Point is configured with StopTransactionOnEVSideDisconnect set to true, a transaction is running and the EV becomes disconnected on EV side, then a StatusNotificationRequest with the state: 'Finishing' SHOULD be send to the Central System, with the 'errorCode' field set to: 'NoError'. The Charge Point SHOULD add additional information in the 'info' field, Notifying the Central System with the reason of stopping: 'EV side disconnected'. The current transaction is stopped. When a Charge Point connects to a Central System after having been offline, it updates the Central System about its status according to the following rules: 1. The Charge Point SHOULD send a StatusNotificationRequest with its current status if the status changed while the Charge Point was offline. 2. The Charge Point MAY send a StatusNotificationRequest to report an error that occurred while the Charge Point was offline. 3. The Charge Point SHOULD NOT send StatusNotificationRequest payloads for historical status change events that happened while the Charge Point was offline and that do not inform the Central System of Charge Point errors or the Charge Point’s current status. 4. The StatusNotificationRequest messages MUST be sent in the order in which the events that they describe occurred. Upon receipt of a StatusNotificationRequest, the Central System SHALL respond with a StatusNotificationConfirmation.

func (StatusNotificationFeature) GetFeatureName

func (f StatusNotificationFeature) GetFeatureName() string

func (StatusNotificationFeature) GetRequestType

func (f StatusNotificationFeature) GetRequestType() reflect.Type

func (StatusNotificationFeature) GetResponseType

func (f StatusNotificationFeature) GetResponseType() reflect.Type

type StatusNotificationRequest

type StatusNotificationRequest struct {
	ConnectorId     int                  `json:"connectorId" validate:"gte=0"`
	ErrorCode       ChargePointErrorCode `json:"errorCode" validate:"required,chargePointErrorCode"`
	Info            string               `json:"info,omitempty" validate:"max=50"`
	Status          ChargePointStatus    `json:"status" validate:"required,chargePointStatus"`
	Timestamp       *types.DateTime      `json:"timestamp,omitempty" validate:"omitempty"`
	VendorId        string               `json:"vendorId,omitempty" validate:"max=255"`
	VendorErrorCode string               `json:"vendorErrorCode,omitempty" validate:"max=50"`
}

The field definition of the StatusNotification request payload sent by the Charge Point to the Central System.

func NewStatusNotificationRequest

func NewStatusNotificationRequest(connectorId int, errorCode ChargePointErrorCode, status ChargePointStatus) *StatusNotificationRequest

Creates a new StatusNotificationRequest, containing all required fields. Optional fields may be set directly on the created request.

func (StatusNotificationRequest) GetFeatureName

func (r StatusNotificationRequest) GetFeatureName() string

type StopTransactionConfirmation

type StopTransactionConfirmation struct {
	IdTagInfo *types.IdTagInfo `json:"idTagInfo,omitempty" validate:"omitempty"`
}

This field definition of the StopTransaction confirmation payload, sent by the Central System to the Charge Point in response to a StopTransactionRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewStopTransactionConfirmation

func NewStopTransactionConfirmation() *StopTransactionConfirmation

Creates a new StopTransactionConfirmation. Optional fields may be set afterwards.

func (StopTransactionConfirmation) GetFeatureName

func (c StopTransactionConfirmation) GetFeatureName() string

type StopTransactionFeature

type StopTransactionFeature struct{}

When a transaction is stopped, the Charge Point SHALL send a StopTransactionRequest, notifying to the Central System that the transaction has stopped. A StopTransactionRequest MAY contain an optional TransactionData element to provide more details about transaction usage. The optional TransactionData element is a container for any number of MeterValues, using the same data structure as the meterValue elements of the MeterValuesRequest payload. Upon receipt of a StopTransactionRequest, the Central System SHALL respond with a StopTransactionConfirmation. The idTag in the request payload MAY be omitted when the Charge Point itself needs to stop the transaction. For instance, when the Charge Point is requested to reset. If a transaction is ended in a normal way (e.g. EV-driver presented his identification to stop the transaction), the Reason element MAY be omitted and the Reason SHOULD be assumed 'Local'. If the transaction is not ended normally, the Reason SHOULD be set to a correct value. As part of the normal transaction termination, the Charge Point SHALL unlock the cable (if not permanently attached). The Charge Point MAY unlock the cable (if not permanently attached) when the cable is disconnected at the EV. If supported, this functionality is reported and controlled by the configuration key UnlockConnectorOnEVSideDisconnect. The Charge Point MAY stop a running transaction when the cable is disconnected at the EV. If supported, this functionality is reported and controlled by the configuration key StopTransactionOnEVSideDisconnect. If StopTransactionOnEVSideDisconnect is set to false, the transaction SHALL not be stopped when the cable is disconnected from the EV. If the EV is reconnected, energy transfer is allowed again. In this case there is no mechanism to prevent other EVs from charging and disconnecting during that same ongoing transaction. With UnlockConnectorOnEVSideDisconnect set to false, the Connector SHALL remain locked at the Charge Point until the user presents the identifier. By setting StopTransactionOnEVSideDisconnect to true, the transaction SHALL be stopped when the cable is disconnected from the EV. If the EV is reconnected, energy transfer is not allowed until the transaction is stopped and a new transaction is started. If UnlockConnectorOnEVSideDisconnect is set to true, also the Connector on the Charge Point will be unlocked. It is likely that The Central System applies sanity checks to the data contained in a StopTransactionRequest it received. The outcome of such sanity checks SHOULD NOT ever cause the Central System to not respond with a StopTransactionConfirmation. Failing to respond with a StopTransactionConfirmation will only cause the Charge Point to try the same message again as specified in Error responses to transaction-related messages. If Charge Point has implemented an Authorization Cache, then upon receipt of a StopTransactionConfirmation the Charge Point SHALL update the cache entry, if the idTag is not in the Local Authorization List, with the IdTagInfo value from the response as described under Authorization Cache.

func (StopTransactionFeature) GetFeatureName

func (f StopTransactionFeature) GetFeatureName() string

func (StopTransactionFeature) GetRequestType

func (f StopTransactionFeature) GetRequestType() reflect.Type

func (StopTransactionFeature) GetResponseType

func (f StopTransactionFeature) GetResponseType() reflect.Type

type StopTransactionRequest

type StopTransactionRequest struct {
	IdTag           string             `json:"idTag,omitempty" validate:"max=20"`
	MeterStop       int                `json:"meterStop"`
	Timestamp       *types.DateTime    `json:"timestamp" validate:"required"`
	TransactionId   int                `json:"transactionId"`
	Reason          Reason             `json:"reason,omitempty" validate:"omitempty,reason"`
	TransactionData []types.MeterValue `json:"transactionData,omitempty" validate:"omitempty,dive"`
}

The field definition of the StopTransaction request payload sent by the Charge Point to the Central System.

func NewStopTransactionRequest

func NewStopTransactionRequest(meterStop int, timestamp *types.DateTime, transactionId int) *StopTransactionRequest

Creates a new StopTransactionRequest, containing all required fields. Optional fields may be set directly on the created request.

func (StopTransactionRequest) GetFeatureName

func (r StopTransactionRequest) GetFeatureName() string

type UnlockConnectorConfirmation

type UnlockConnectorConfirmation struct {
	Status UnlockStatus `json:"status" validate:"required,unlockStatus"`
}

This field definition of the UnlockConnector confirmation payload, sent by the Charge Point to the Central System in response to an UnlockConnectorRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewUnlockConnectorConfirmation

func NewUnlockConnectorConfirmation(status UnlockStatus) *UnlockConnectorConfirmation

Creates a new UnlockConnectorConfirmation, containing all required fields. There are no optional fields for this message.

func (UnlockConnectorConfirmation) GetFeatureName

func (c UnlockConnectorConfirmation) GetFeatureName() string

type UnlockConnectorFeature

type UnlockConnectorFeature struct{}

Central System can request a Charge Point to unlock a connector. To do so, the Central System SHALL send an UnlockConnectorRequest. The purpose of this message: Help EV drivers that have problems unplugging their cable from the Charge Point in case of malfunction of the Connector cable retention. When a EV driver calls the CPO help-desk, an operator could manually trigger the sending of an UnlockConnectorRequest to the Charge Point, forcing a new attempt to unlock the connector. Hopefully this time the connector unlocks and the EV driver can unplug the cable and drive away. The UnlockConnectorRequest SHOULD NOT be used to remotely stop a running transaction, use the Remote Stop Transaction instead. Upon receipt of an UnlockConnectorRequest, the Charge Point SHALL respond with a UnlockConnectorConfirmation. The response payload SHALL indicate whether the Charge Point was able to unlock its connector. If there was a transaction in progress on the specific connector, then Charge Point SHALL finish the transaction first as described in Stop Transaction.

func (UnlockConnectorFeature) GetFeatureName

func (f UnlockConnectorFeature) GetFeatureName() string

func (UnlockConnectorFeature) GetRequestType

func (f UnlockConnectorFeature) GetRequestType() reflect.Type

func (UnlockConnectorFeature) GetResponseType

func (f UnlockConnectorFeature) GetResponseType() reflect.Type

type UnlockConnectorRequest

type UnlockConnectorRequest struct {
	ConnectorId int `json:"connectorId" validate:"gt=0"`
}

The field definition of the UnlockConnector request payload sent by the Central System to the Charge Point.

func NewUnlockConnectorRequest

func NewUnlockConnectorRequest(connectorId int) *UnlockConnectorRequest

Creates a new UnlockConnectorRequest, containing all required fields. There are no optional fields for this message.

func (UnlockConnectorRequest) GetFeatureName

func (r UnlockConnectorRequest) GetFeatureName() string

type UnlockStatus

type UnlockStatus string

Status in response to UnlockConnectorRequest.

const (
	UnlockStatusUnlocked     UnlockStatus = "Unlocked"
	UnlockStatusUnlockFailed UnlockStatus = "UnlockFailed"
	UnlockStatusNotSupported UnlockStatus = "NotSupported"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL