Documentation ¶
Overview ¶
The availability functional block contains OCPP 2.0 features for notifying the CSMS of availability and status changes. A CSMS can also instruct a charging station to change its availability.
Index ¶
- Constants
- Variables
- type CSMSHandler
- type ChangeAvailabilityFeature
- type ChangeAvailabilityRequest
- type ChangeAvailabilityResponse
- type ChangeAvailabilityStatus
- type ChargingStationHandler
- type ConnectorStatus
- type HeartbeatFeature
- type HeartbeatRequest
- type HeartbeatResponse
- type OperationalStatus
- type StatusNotificationFeature
- type StatusNotificationRequest
- type StatusNotificationResponse
Constants ¶
const ChangeAvailabilityFeatureName = "ChangeAvailability"
const HeartbeatFeatureName = "Heartbeat"
const ProfileName = "availability"
const StatusNotificationFeatureName = "StatusNotification"
Variables ¶
var Profile = ocpp.NewProfile( ProfileName, ChangeAvailabilityFeature{}, HeartbeatFeature{}, StatusNotificationFeature{}, )
Functions ¶
This section is empty.
Types ¶
type CSMSHandler ¶
type CSMSHandler interface { // OnHeartbeat is called on the CSMS whenever a HeartbeatResponse is received from a charging station. OnHeartbeat(chargingStationID string, request *HeartbeatRequest) (response *HeartbeatResponse, err error) // OnStatusNotification is called on the CSMS whenever a StatusNotificationRequest is received from a charging station. OnStatusNotification(chargingStationID string, request *StatusNotificationRequest) (response *StatusNotificationResponse, err error) }
Needs to be implemented by a CSMS for handling messages part of the OCPP 2.0 Availability profile.
type ChangeAvailabilityFeature ¶
type ChangeAvailabilityFeature struct{}
CSMS can request a Charging Station to change its availability. A Charging Station is considered available (“operative”) when it is charging or ready for charging. A Charging Station is considered unavailable when it does not allow any charging. The CSMS SHALL send a ChangeAvailabilityRequest for requesting a Charging Station to change its availability. The CSMS 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 { OperationalStatus OperationalStatus `json:"operationalStatus" validate:"required,operationalStatus"` Evse *types.EVSE `json:"evse,omitempty" validate:"omitempty"` }
The field definition of the ChangeAvailability request payload sent by the CSMS to the Charging Station.
func NewChangeAvailabilityRequest ¶
func NewChangeAvailabilityRequest(operationalStatus OperationalStatus) *ChangeAvailabilityRequest
Creates a new ChangeAvailabilityRequest, containing all required fields. Optional fields may be set afterwards.
func (ChangeAvailabilityRequest) GetFeatureName ¶
func (r ChangeAvailabilityRequest) GetFeatureName() string
type ChangeAvailabilityResponse ¶
type ChangeAvailabilityResponse struct { Status ChangeAvailabilityStatus `json:"status" validate:"required,changeAvailabilityStatus"` StatusInfo *types.StatusInfo `json:"statusInfo,omitempty" validate:"omitempty"` }
This field definition of the ChangeAvailability response payload, sent by the Charging Station to the CSMS in response to a ChangeAvailabilityRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewChangeAvailabilityResponse ¶
func NewChangeAvailabilityResponse(status ChangeAvailabilityStatus) *ChangeAvailabilityResponse
Creates a new ChangeAvailabilityResponse, containing all required fields. Optional fields may be set afterwards.
func (ChangeAvailabilityResponse) GetFeatureName ¶
func (c ChangeAvailabilityResponse) GetFeatureName() string
type ChangeAvailabilityStatus ¶
type ChangeAvailabilityStatus string
Status returned in response to ChangeAvailabilityRequest
const ( ChangeAvailabilityStatusAccepted ChangeAvailabilityStatus = "Accepted" ChangeAvailabilityStatusRejected ChangeAvailabilityStatus = "Rejected" ChangeAvailabilityStatusScheduled ChangeAvailabilityStatus = "Scheduled" )
type ChargingStationHandler ¶
type ChargingStationHandler interface { // OnChangeAvailability is called on a charging station whenever a ChangeAvailabilityRequest is received from the CSMS. OnChangeAvailability(request *ChangeAvailabilityRequest) (response *ChangeAvailabilityResponse, err error) }
Needs to be implemented by Charging stations for handling messages part of the OCPP 2.0 Availability profile.
type ConnectorStatus ¶
type ConnectorStatus string
const ( ConnectorStatusAvailable ConnectorStatus = "Available" // When a Connector becomes available for a new User (Operative) ConnectorStatusOccupied ConnectorStatus = "Occupied" // When a Connector becomes occupied, so it is not available for a new EV driver. (Operative) ConnectorStatusReserved ConnectorStatus = "Reserved" // When a Connector becomes reserved as a result of ReserveNow command (Operative) ConnectorStatusFaulted ConnectorStatus = "Faulted" // When a Connector (or the EVSE or the entire Charging Station it belongs to) has reported an error and is not available for energy delivery. (Inoperative). )
type HeartbeatFeature ¶
type HeartbeatFeature struct{}
A Charging Station may send a heartbeat to let the CSMS know the Charging Station is still connected, after a configurable time interval.
Upon receipt of HeartbeatRequest, the CSMS responds with HeartbeatResponse. The response message contains the current time of the CSMS, which the Charging Station MAY use to synchronize its internal clock.
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 Charging Station to the CSMS.
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 HeartbeatResponse ¶
type HeartbeatResponse struct {
CurrentTime types.DateTime `json:"currentTime" validate:"required"`
}
This field definition of the Heartbeat response payload, sent by the CSMS to the Charging Station in response to a HeartbeatRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewHeartbeatResponse ¶
func NewHeartbeatResponse(currentTime types.DateTime) *HeartbeatResponse
Creates a new HeartbeatResponse, containing all required fields. There are no optional fields for this message.
func (HeartbeatResponse) GetFeatureName ¶
func (c HeartbeatResponse) GetFeatureName() string
type OperationalStatus ¶
type OperationalStatus string
Requested availability change in ChangeAvailabilityRequest.
const ( OperationalStatusInoperative OperationalStatus = "Inoperative" OperationalStatusOperative OperationalStatus = "Operative" )
type StatusNotificationFeature ¶
type StatusNotificationFeature struct{}
The Charging Station notifies the CSMS about a connector status change. This may typically be after on of the following events:
- (re)boot
- reset
- any transaction event (start/stop/authorization)
- reservation events
- change availability operations
- remote triggers
The charging station sends a StatusNotificationRequest to the CSMS with information about the new status. The CSMS responds with a StatusNotificationResponse.
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 { Timestamp *types.DateTime `json:"timestamp" validate:"required"` ConnectorStatus ConnectorStatus `json:"connectorStatus" validate:"required,connectorStatus"` EvseID int `json:"evseId" validate:"gte=0"` ConnectorID int `json:"connectorId" validate:"gte=0"` }
The field definition of the StatusNotification request payload sent by the Charging Station to the CSMS.
func NewStatusNotificationRequest ¶
func NewStatusNotificationRequest(timestamp *types.DateTime, status ConnectorStatus, evseID int, connectorID int) *StatusNotificationRequest
Creates a new StatusNotificationRequest, containing all required fields. There are no optional fields for this message.
func (StatusNotificationRequest) GetFeatureName ¶
func (r StatusNotificationRequest) GetFeatureName() string
type StatusNotificationResponse ¶
type StatusNotificationResponse struct { }
This field definition of the StatusNotification response payload, sent by the CSMS to the Charging Station in response to a StatusNotificationRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewStatusNotificationResponse ¶
func NewStatusNotificationResponse() *StatusNotificationResponse
Creates a new StatusNotificationResponse, which doesn't contain any required or optional fields.
func (StatusNotificationResponse) GetFeatureName ¶
func (c StatusNotificationResponse) GetFeatureName() string