Documentation ¶
Overview ¶
Contains support for reservation of a Charge Point.
Index ¶
Constants ¶
const CancelReservationFeatureName = "CancelReservation"
const ProfileName = "Reservation"
The profile name
const ReserveNowFeatureName = "ReserveNow"
Variables ¶
var Profile = ocpp.NewProfile( ProfileName, ReserveNowFeature{}, CancelReservationFeature{})
Provides support for for reservation of a Charge Point.
Functions ¶
This section is empty.
Types ¶
type CancelReservationConfirmation ¶
type CancelReservationConfirmation struct {
Status CancelReservationStatus `json:"status" validate:"required,cancelReservationStatus16"`
}
This field definition of the CancelReservation confirmation payload, sent by the Charge Point to the Central System in response to a CancelReservationRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewCancelReservationConfirmation ¶
func NewCancelReservationConfirmation(status CancelReservationStatus) *CancelReservationConfirmation
Creates a new CancelReservationConfirmation, containing all required fields. There are no optional fields for this message.
func (CancelReservationConfirmation) GetFeatureName ¶
func (c CancelReservationConfirmation) GetFeatureName() string
type CancelReservationFeature ¶
type CancelReservationFeature struct{}
To cancel a reservation the Central System SHALL send an CancelReservationRequest to the Charge Point. If the Charge Point has a reservation matching the reservationId in the request payload, it SHALL return status ‘Accepted’. Otherwise it SHALL return ‘Rejected’.
func (CancelReservationFeature) GetFeatureName ¶
func (f CancelReservationFeature) GetFeatureName() string
func (CancelReservationFeature) GetRequestType ¶
func (f CancelReservationFeature) GetRequestType() reflect.Type
func (CancelReservationFeature) GetResponseType ¶
func (f CancelReservationFeature) GetResponseType() reflect.Type
type CancelReservationRequest ¶
type CancelReservationRequest struct {
ReservationId int `json:"reservationId"`
}
The field definition of the CancelReservation request payload sent by the Central System to the Charge Point.
func NewCancelReservationRequest ¶
func NewCancelReservationRequest(reservationId int) *CancelReservationRequest
Creates a new CancelReservationRequest, containing all required fields. There are no optional fields for this message.
func (CancelReservationRequest) GetFeatureName ¶
func (r CancelReservationRequest) GetFeatureName() string
type CancelReservationStatus ¶
type CancelReservationStatus string
Status reported in CancelReservationConfirmation.
const ( CancelReservationStatusAccepted CancelReservationStatus = "Accepted" CancelReservationStatusRejected CancelReservationStatus = "Rejected" )
type CentralSystemHandler ¶
type CentralSystemHandler interface { }
Needs to be implemented by Central systems for handling messages part of the OCPP 1.6 Reservation profile.
type ChargePointHandler ¶
type ChargePointHandler interface { OnReserveNow(request *ReserveNowRequest) (confirmation *ReserveNowConfirmation, err error) OnCancelReservation(request *CancelReservationRequest) (confirmation *CancelReservationConfirmation, err error) }
Needs to be implemented by Charge points for handling messages part of the OCPP 1.6 Reservation profile.
type ReservationStatus ¶
type ReservationStatus string
Status reported in ReserveNowConfirmation.
const ( ReservationStatusAccepted ReservationStatus = "Accepted" ReservationStatusFaulted ReservationStatus = "Faulted" ReservationStatusOccupied ReservationStatus = "Occupied" ReservationStatusRejected ReservationStatus = "Rejected" )
type ReserveNowConfirmation ¶
type ReserveNowConfirmation struct {
Status ReservationStatus `json:"status" validate:"required,reservationStatus"`
}
This field definition of the ReserveNow confirmation payload, sent by the Charge Point to the Central System in response to a ReserveNowRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewReserveNowConfirmation ¶
func NewReserveNowConfirmation(status ReservationStatus) *ReserveNowConfirmation
Creates a new ReserveNowConfirmation, containing all required fields. There are no optional fields for this message.
func (ReserveNowConfirmation) GetFeatureName ¶
func (c ReserveNowConfirmation) GetFeatureName() string
type ReserveNowFeature ¶
type ReserveNowFeature struct{}
A Central System can issue a ReserveNowRequest to a Charge Point to reserve a connector for use by a specific idTag. The Central System MAY specify a connector to be reserved. If the reservationId in the request matches a reservation in the Charge Point, then the Charge Point SHALL replace that reservation with the new reservation in the request. If the reservationId does not match any reservation in the Charge Point, then the Charge Point SHALL return the status value ‘Accepted’ if it succeeds in reserving a connector. The Charge Point SHALL return ‘Occupied’ if the Charge Point or the specified connector are occupied. The Charge Point SHALL also return ‘Occupied’ when the Charge Point or connector has been reserved for the same or another idTag. The Charge Point SHALL return ‘Faulted’ if the Charge Point or the connector are in the Faulted state. The Charge Point SHALL return ‘Unavailable’ if the Charge Point or connector are in the Unavailable state. The Charge Point SHALL return ‘Rejected’ if it is configured not to accept reservations. If the Charge Point accepts the reservation request, then it SHALL refuse charging for all incoming idTags on the reserved connector, except when the incoming idTag or the parent idTag match the idTag or parent idTag of the reservation. A reservation SHALL be terminated on the Charge Point when either (1) a transaction is started for the reserved idTag or parent idTag and on the reserved connector or any connector when the reserved connectorId is 0, or (2) when the time specified in expiryDate is reached, or (3) when the Charge Point or connector are set to Faulted or Unavailable. If a transaction for the reserved idTag is started, then Charge Point SHALL send the reservationId in the StartTransactionRequest payload (see Start Transaction) to notify the Central System that the reservation is terminated. When a reservation expires, the Charge Point SHALL terminate the reservation and make the connector available.
func (ReserveNowFeature) GetFeatureName ¶
func (f ReserveNowFeature) GetFeatureName() string
func (ReserveNowFeature) GetRequestType ¶
func (f ReserveNowFeature) GetRequestType() reflect.Type
func (ReserveNowFeature) GetResponseType ¶
func (f ReserveNowFeature) GetResponseType() reflect.Type
type ReserveNowRequest ¶
type ReserveNowRequest struct { ConnectorId int `json:"connectorId" validate:"gte=0"` ExpiryDate *types.DateTime `json:"expiryDate" validate:"required"` IdTag string `json:"idTag" validate:"required,max=20"` ParentIdTag string `json:"parentIdTag,omitempty" validate:"max=20"` ReservationId int `json:"reservationId"` }
The field definition of the ReserveNow request payload sent by the Central System to the Charge Point.
func NewReserveNowRequest ¶
func NewReserveNowRequest(connectorId int, expiryDate *types.DateTime, idTag string, reservationId int) *ReserveNowRequest
Creates a new ReserveNowRequest, containing all required fields. Optional fields may be set afterwards.
func (ReserveNowRequest) GetFeatureName ¶
func (r ReserveNowRequest) GetFeatureName() string