Documentation ¶
Overview ¶
The display functional block contains OCPP 2.0 features for managing message that get displayed on a charging station.
Index ¶
- Constants
- Variables
- type CSMSHandler
- type ChargingStationHandler
- type ClearDisplayFeature
- type ClearDisplayRequest
- type ClearDisplayResponse
- type ClearMessageStatus
- type DisplayMessageStatus
- type GetDisplayMessagesFeature
- type GetDisplayMessagesRequest
- type GetDisplayMessagesResponse
- type MessageInfo
- type MessagePriority
- type MessageState
- type MessageStatus
- type NotifyDisplayMessagesFeature
- type NotifyDisplayMessagesRequest
- type NotifyDisplayMessagesResponse
- type SetDisplayMessageFeature
- type SetDisplayMessageRequest
- type SetDisplayMessageResponse
Constants ¶
const ( MessagePriorityAlwaysFront MessagePriority = "AlwaysFront" MessagePriorityInFront MessagePriority = "InFront" MessagePriorityNormalCycle MessagePriority = "NormalCycle" MessageStateCharging MessageState = "Charging" MessageStateFaulted MessageState = "Faulted" MessageStateIdle MessageState = "Idle" MessageStatusAccepted MessageStatus = "Accepted" MessageStatusUnknown MessageStatus = "Unknown" )
const ClearDisplayMessageFeatureName = "ClearDisplayMessage"
const GetDisplayMessagesFeatureName = "GetDisplayMessages"
const NotifyDisplayMessagesFeatureName = "NotifyDisplayMessages"
const ProfileName = "display"
const SetDisplayMessageFeatureName = "SetDisplayMessage"
Variables ¶
var Profile = ocpp.NewProfile( ProfileName, ClearDisplayFeature{}, GetDisplayMessagesFeature{}, NotifyDisplayMessagesFeature{}, SetDisplayMessageFeature{}, )
Functions ¶
This section is empty.
Types ¶
type CSMSHandler ¶
type CSMSHandler interface { // OnNotifyDisplayMessages is called on the CSMS whenever a NotifyDisplayMessagesRequest is received from a Charging Station. OnNotifyDisplayMessages(chargingStationID string, request *NotifyDisplayMessagesRequest) (response *NotifyDisplayMessagesResponse, err error) }
Needs to be implemented by a CSMS for handling messages part of the OCPP 2.0 Display profile.
type ChargingStationHandler ¶
type ChargingStationHandler interface { // OnClearDisplay is called on a charging station whenever a ClearDisplayRequest is received from the CSMS. OnClearDisplay(request *ClearDisplayRequest) (confirmation *ClearDisplayResponse, err error) // OnGetDisplayMessages is called on a charging station whenever a GetDisplayMessagesRequest is received from the CSMS. OnGetDisplayMessages(request *GetDisplayMessagesRequest) (confirmation *GetDisplayMessagesResponse, err error) // OnSetDisplayMessage is called on a charging station whenever a SetDisplayMessageRequest is received from the CSMS. OnSetDisplayMessage(request *SetDisplayMessageRequest) (response *SetDisplayMessageResponse, err error) }
Needs to be implemented by Charging stations for handling messages part of the OCPP 2.0 Display profile.
type ClearDisplayFeature ¶
type ClearDisplayFeature struct{}
The CSMS asks the Charging Station to clear a display message that has been configured in the Charging Station to be cleared/removed. The Charging station checks for a message with the requested ID and removes it. The Charging station then responds with a ClearDisplayResponse. The response payload indicates whether the Charging Station was able to remove the message from display or not.
func (ClearDisplayFeature) GetFeatureName ¶
func (f ClearDisplayFeature) GetFeatureName() string
func (ClearDisplayFeature) GetRequestType ¶
func (f ClearDisplayFeature) GetRequestType() reflect.Type
func (ClearDisplayFeature) GetResponseType ¶
func (f ClearDisplayFeature) GetResponseType() reflect.Type
type ClearDisplayRequest ¶
type ClearDisplayRequest struct {
ID int `json:"id"` // Id of the message that SHALL be removed from the Charging Station.
}
The field definition of the ClearDisplay request payload sent by the CSMS to the Charging Station.
func NewClearDisplayRequest ¶
func NewClearDisplayRequest(id int) *ClearDisplayRequest
Creates a new ClearDisplayRequest, containing all required fields. There are no optional fields for this message.
func (ClearDisplayRequest) GetFeatureName ¶
func (r ClearDisplayRequest) GetFeatureName() string
type ClearDisplayResponse ¶
type ClearDisplayResponse struct { Status ClearMessageStatus `json:"status" validate:"required,clearMessageStatus"` StatusInfo *types.StatusInfo `json:"statusInfo,omitempty" validate:"omitempty"` }
This field definition of the ClearDisplay response payload, sent by the Charging Station to the CSMS in response to a ClearDisplayRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewClearDisplayResponse ¶
func NewClearDisplayResponse(status ClearMessageStatus) *ClearDisplayResponse
Creates a new ClearDisplayResponse, containing all required fields. Optional fields may be set afterwards.
func (ClearDisplayResponse) GetFeatureName ¶
func (c ClearDisplayResponse) GetFeatureName() string
type ClearMessageStatus ¶
type ClearMessageStatus string
Status returned in response to ClearDisplayRequest.
const ( ClearMessageStatusAccepted ClearMessageStatus = "Accepted" ClearMessageStatusUnknown ClearMessageStatus = "Unknown" )
type DisplayMessageStatus ¶
type DisplayMessageStatus string
Status returned in response to SetDisplayMessageRequest.
const ( DisplayMessageStatusAccepted DisplayMessageStatus = "Accepted" DisplayMessageStatusNotSupportedMessageFormat DisplayMessageStatus = "NotSupportedMessageFormat" DisplayMessageStatusRejected DisplayMessageStatus = "Rejected" DisplayMessageStatusNotSupportedPriority DisplayMessageStatus = "NotSupportedPriority" DisplayMessageStatusNotSupportedState DisplayMessageStatus = "NotSupportedState" DisplayMessageStatusUnknownTransaction DisplayMessageStatus = "UnknownTransaction" )
type GetDisplayMessagesFeature ¶
type GetDisplayMessagesFeature struct{}
A Charging Station can remove messages when they are out-dated, or transactions have ended. It can be very useful for a CSO to be able to view to current list of messages, so the CSO knows which messages are (still) configured.
A CSO MAY request all the installed DisplayMessages configured via OCPP in a Charging Station. For this the CSO asks the CSMS to retrieve all messages. The CSMS sends a GetDisplayMessagesRequest message to the Charging Station. The Charging Station responds with a GetDisplayMessagesResponse Accepted, indicating it has configured messages and will send them.
The Charging Station asynchronously sends one or more NotifyDisplayMessagesRequest messages to the CSMS (depending on the amount of messages to be sent).
func (GetDisplayMessagesFeature) GetFeatureName ¶
func (f GetDisplayMessagesFeature) GetFeatureName() string
func (GetDisplayMessagesFeature) GetRequestType ¶
func (f GetDisplayMessagesFeature) GetRequestType() reflect.Type
func (GetDisplayMessagesFeature) GetResponseType ¶
func (f GetDisplayMessagesFeature) GetResponseType() reflect.Type
type GetDisplayMessagesRequest ¶
type GetDisplayMessagesRequest struct { RequestID int `json:"requestId" validate:"gte=0"` Priority MessagePriority `json:"priority,omitempty" validate:"omitempty,messagePriority"` State MessageState `json:"state,omitempty" validate:"omitempty,messageState"` ID []int `json:"id,omitempty" validate:"omitempty,dive,gte=0"` }
The field definition of the GetDisplayMessages request payload sent by the CSMS to the Charging Station.
func NewGetDisplayMessagesRequest ¶
func NewGetDisplayMessagesRequest(requestId int) *GetDisplayMessagesRequest
Creates a new GetDisplayMessagesRequest, containing all required fields. Optional fields may be set afterwards.
func (GetDisplayMessagesRequest) GetFeatureName ¶
func (r GetDisplayMessagesRequest) GetFeatureName() string
type GetDisplayMessagesResponse ¶
type GetDisplayMessagesResponse struct {
Status MessageStatus `json:"status" validate:"required,messageStatus"`
}
This field definition of the GetDisplayMessages response payload, sent by the Charging Station to the CSMS in response to a GetDisplayMessagesRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewGetDisplayMessagesResponse ¶
func NewGetDisplayMessagesResponse(status MessageStatus) *GetDisplayMessagesResponse
Creates a new GetDisplayMessagesResponse, containing all required fields. There are no optional fields for this message.
func (GetDisplayMessagesResponse) GetFeatureName ¶
func (c GetDisplayMessagesResponse) GetFeatureName() string
type MessageInfo ¶
type MessageInfo struct { ID int `json:"id" validate:"gte=0"` // Master resource identifier, unique within an exchange context. It is defined within the OCPP context as a positive Integer value (greater or equal to zero). Priority MessagePriority `json:"priority" validate:"required,messagePriority"` // With what priority should this message be shown State MessageState `json:"state,omitempty" validate:"omitempty,messageState"` // During what state should this message be shown. When omitted this message should be shown in any state of the Charging Station. StartDateTime *types.DateTime `json:"startDateTime,omitempty" validate:"omitempty"` // From what date-time should this message be shown. If omitted: directly. EndDateTime *types.DateTime `json:"endDateTime,omitempty" validate:"omitempty"` // Until what date-time should this message be shown, after this date/time this message SHALL be removed. TransactionID string `json:"transactionId,omitempty" validate:"omitempty,max=36"` // During which transaction shall this message be shown. Message SHALL be removed by the Charging Station after transaction has ended. Message types.MessageContent `json:"message" validate:"required"` // Contains message details for the message to be displayed on a Charging Station. Display *types.Component `json:"display,omitempty" validate:"omitempty"` // When a Charging Station has multiple Displays, this field can be used to define to which Display this message belongs. }
Contains message details, for a message to be displayed on a Charging Station.
type MessagePriority ¶
type MessagePriority string
Priority with which a message should be displayed on a Charging Station. Used within a GetDisplayMessagesRequest.
type MessageState ¶
type MessageState string
State of the Charging Station during which a message SHALL be displayed. Used within a GetDisplayMessagesRequest.
type MessageStatus ¶
type MessageStatus string
MessageStatus represents the status of the request, used in a GetDisplayMessagesResponse.
type NotifyDisplayMessagesFeature ¶
type NotifyDisplayMessagesFeature struct{}
A CSO MAY request all the installed DisplayMessages configured via OCPP in a Charging Station. For this the CSO asks the CSMS to retrieve all messages (see GetDisplayMessagesFeature). If the Charging Station responded with a status Accepted, it will then send these messages asynchronously to the CSMS.
The Charging Station sends one or more NotifyDisplayMessagesRequest message to the CSMS (depending on the amount of messages to be send). The CSMS responds to every notification with a NotifyDisplayMessagesResponse message.
func (NotifyDisplayMessagesFeature) GetFeatureName ¶
func (f NotifyDisplayMessagesFeature) GetFeatureName() string
func (NotifyDisplayMessagesFeature) GetRequestType ¶
func (f NotifyDisplayMessagesFeature) GetRequestType() reflect.Type
func (NotifyDisplayMessagesFeature) GetResponseType ¶
func (f NotifyDisplayMessagesFeature) GetResponseType() reflect.Type
type NotifyDisplayMessagesRequest ¶
type NotifyDisplayMessagesRequest struct { RequestID int `json:"requestId" validate:"gte=0"` // The id of the GetDisplayMessagesRequest that requested this message. Tbc bool `json:"tbc,omitempty" validate:"omitempty"` // "to be continued" indicator. Indicates whether another part of the report follows in an upcoming NotifyDisplayMessagesRequest message. Default value when omitted is false. MessageInfo []MessageInfo `json:"messageInfo,omitempty" validate:"omitempty,dive"` // The requested display message as configured in the Charging Station. }
The field definition of the NotifyDisplayMessages request payload sent by the CSMS to the Charging Station.
func NewNotifyDisplayMessagesRequest ¶
func NewNotifyDisplayMessagesRequest(requestID int) *NotifyDisplayMessagesRequest
Creates a new NotifyDisplayMessagesRequest, containing all required fields. Optional fields may be set afterwards.
func (NotifyDisplayMessagesRequest) GetFeatureName ¶
func (r NotifyDisplayMessagesRequest) GetFeatureName() string
type NotifyDisplayMessagesResponse ¶
type NotifyDisplayMessagesResponse struct { }
This field definition of the NotifyDisplayMessages response payload, sent by the Charging Station to the CSMS in response to a NotifyDisplayMessagesRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewNotifyDisplayMessagesResponse ¶
func NewNotifyDisplayMessagesResponse() *NotifyDisplayMessagesResponse
Creates a new NotifyDisplayMessagesResponse, which doesn't contain any required or optional fields.
func (NotifyDisplayMessagesResponse) GetFeatureName ¶
func (c NotifyDisplayMessagesResponse) GetFeatureName() string
type SetDisplayMessageFeature ¶
type SetDisplayMessageFeature struct{}
The CSMS may send a SetDisplayMessageRequest message to a Charging Station, instructing it to display a new message, which is not part of its firmware. The Charging Station accepts the request by replying with a SetDisplayMessageResponse.
Depending on different parameters, the message may be displayed in different ways and/or at a configured time.
func (SetDisplayMessageFeature) GetFeatureName ¶
func (f SetDisplayMessageFeature) GetFeatureName() string
func (SetDisplayMessageFeature) GetRequestType ¶
func (f SetDisplayMessageFeature) GetRequestType() reflect.Type
func (SetDisplayMessageFeature) GetResponseType ¶
func (f SetDisplayMessageFeature) GetResponseType() reflect.Type
type SetDisplayMessageRequest ¶
type SetDisplayMessageRequest struct {
Message MessageInfo `json:"message" validate:"required"`
}
The field definition of the SetDisplayMessage request payload sent by the CSMS to the Charging Station.
func NewSetDisplayMessageRequest ¶
func NewSetDisplayMessageRequest(message MessageInfo) *SetDisplayMessageRequest
Creates a new SetDisplayMessageRequest, containing all required fields. There are no optional fields for this message.
func (SetDisplayMessageRequest) GetFeatureName ¶
func (r SetDisplayMessageRequest) GetFeatureName() string
type SetDisplayMessageResponse ¶
type SetDisplayMessageResponse struct { Status DisplayMessageStatus `json:"status" validate:"required,displayMessageStatus"` StatusInfo *types.StatusInfo `json:"statusInfo,omitempty" validate:"omitempty"` }
This field definition of the SetDisplayMessage response payload, sent by the Charging Station to the CSMS in response to a SetDisplayMessageRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewSetDisplayMessageResponse ¶
func NewSetDisplayMessageResponse(status DisplayMessageStatus) *SetDisplayMessageResponse
Creates a new SetDisplayMessageResponse, containing all required fields. Optional fields may be set afterwards.
func (SetDisplayMessageResponse) GetFeatureName ¶
func (c SetDisplayMessageResponse) GetFeatureName() string