availability

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: MIT Imports: 4 Imported by: 0

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

View Source
const ChangeAvailabilityFeatureName = "ChangeAvailability"
View Source
const ProfileName = "availability"

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 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 {
	EvseID            int               `json:"evseId" validate:"gte=0"`
	OperationalStatus OperationalStatus `json:"operationalStatus" validate:"required,operationalStatus"`
}

The field definition of the ChangeAvailability request payload sent by the CSMS to the Charging Station.

func NewChangeAvailabilityRequest

func NewChangeAvailabilityRequest(evseID int, operationalStatus OperationalStatus) *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 ChangeAvailabilityResponse

type ChangeAvailabilityResponse struct {
	Status ChangeAvailabilityStatus `json:"status" validate:"required,changeAvailabilityStatus"`
}

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

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) (confirmation *ChangeAvailabilityResponse, err error)
}

Needs to be implemented by Charging stations for handling messages part of the OCPP 2.0 Availability profile.

type OperationalStatus

type OperationalStatus string

Requested availability change in ChangeAvailabilityRequest.

const (
	OperationalStatusInoperative OperationalStatus = "Inoperative"
	OperationalStatusOperative   OperationalStatus = "Operative"
)

Jump to

Keyboard shortcuts

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