Documentation ¶
Overview ¶
The authorization functional block contains OCPP 2.0 features that show tariff and costs to an EV driver, when supported by the charging station.
Index ¶
Constants ¶
const CostUpdatedFeatureName = "CostUpdated"
const ProfileName = "tariffCost"
Variables ¶
var Profile = ocpp.NewProfile( ProfileName, CostUpdatedFeature{}, )
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 Tariff and cost profile.
type ChargingStationHandler ¶
type ChargingStationHandler interface { // OnCostUpdated is called on a charging station whenever a CostUpdatedRequest is received from the CSMS. OnCostUpdated(request *CostUpdatedRequest) (confirmation *CostUpdatedResponse, err error) }
Needs to be implemented by Charging stations for handling messages part of the OCPP 2.0 Tariff and cost profile.
type CostUpdatedFeature ¶
type CostUpdatedFeature struct{}
The driver wants to know how much the running total cost is, updated at a relevant interval, while a transaction is ongoing. To fulfill this requirement, the CSMS sends a CostUpdatedRequest to the Charging Station to update the current total cost, every Y seconds. Upon receipt of the CostUpdatedRequest, the Charging Station responds with a CostUpdatedResponse, then shows the updated cost to the driver.
func (CostUpdatedFeature) GetFeatureName ¶
func (f CostUpdatedFeature) GetFeatureName() string
func (CostUpdatedFeature) GetRequestType ¶
func (f CostUpdatedFeature) GetRequestType() reflect.Type
func (CostUpdatedFeature) GetResponseType ¶
func (f CostUpdatedFeature) GetResponseType() reflect.Type
type CostUpdatedRequest ¶
type CostUpdatedRequest struct { TotalCost float64 `json:"totalCost" validate:"required"` TransactionID string `json:"transactionId" validate:"required,max=36"` }
The field definition of the CostUpdated request payload sent by the CSMS to the Charging Station.
func NewCostUpdatedRequest ¶
func NewCostUpdatedRequest(totalCost float64, transactionID string) *CostUpdatedRequest
Creates a new CostUpdatedRequest, containing all required fields. There are no optional fields for this message.
func (CostUpdatedRequest) GetFeatureName ¶
func (r CostUpdatedRequest) GetFeatureName() string
type CostUpdatedResponse ¶
type CostUpdatedResponse struct { }
This field definition of the CostUpdated response payload, sent by the Charging Station to the CSMS in response to a CostUpdatedRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewCostUpdatedResponse ¶
func NewCostUpdatedResponse() *CostUpdatedResponse
Creates a new CostUpdatedResponse, which doesn't contain any required or optional fields.
func (CostUpdatedResponse) GetFeatureName ¶
func (c CostUpdatedResponse) GetFeatureName() string