display

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

The display functional block contains OCPP 2.0 features for managing message that get displayed on a charging station.

Index

Constants

View Source
const (
	MessagePriorityAlwaysFront MessagePriority = "AlwaysFront"
	MessagePriorityInFront     MessagePriority = "InFront"
	MessagePriorityNormalCycle MessagePriority = "NormalCycle"
	MessageStateCharging       MessageState    = "Charging"
	MessageStateFaulted        MessageState    = "Faulted"
	MessageStateIdle           MessageState    = "Idle"
	MessageStateUnavailable    MessageState    = "Unavailable"
	MessageStatusAccepted      MessageStatus   = "Accepted"
	MessageStatusUnknown       MessageStatus   = "Unknown"
)
View Source
const ClearDisplayFeatureName = "ClearDisplay"
View Source
const GetDisplayMessagesFeatureName = "GetDisplayMessages"
View Source
const ProfileName = "display"

Variables

Functions

This section is empty.

Types

type CSMSHandler

type CSMSHandler interface {
}

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)
}

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" validate:"required,gte=0"`
}

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"`
}

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. There are no optional fields for this message.

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 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 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.

Jump to

Keyboard shortcuts

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