data

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 data transfer functional block enables parties to add custom commands and extensions to OCPP 2.0.

Index

Constants

View Source
const DataTransferFeatureName = "DataTransfer"
View Source
const ProfileName = "data"

Variables

Functions

This section is empty.

Types

type CSMSHandler

type CSMSHandler interface {
	// OnDataTransfer is called on the CSMS whenever a DataTransferRequest is received from a charging station.
	OnDataTransfer(chargingStationID string, request *DataTransferRequest) (confirmation *DataTransferResponse, err error)
}

Needs to be implemented by a CSMS for handling messages part of the OCPP 2.0 Data transfer profile.

type ChargingStationHandler

type ChargingStationHandler interface {
	// OnDataTransfer is called on a charging station whenever a DataTransferRequest is received from the CSMS.
	OnDataTransfer(request *DataTransferRequest) (confirmation *DataTransferResponse, err error)
}

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

type DataTransferFeature

type DataTransferFeature struct{}

If a CS needs to send information to the CSMS for a function not supported by OCPP, it SHALL use a DataTransfer message. The same functionality may also be offered the other way around, allowing a CSMS to send arbitrary custom commands to a CS.

func (DataTransferFeature) GetFeatureName

func (f DataTransferFeature) GetFeatureName() string

func (DataTransferFeature) GetRequestType

func (f DataTransferFeature) GetRequestType() reflect.Type

func (DataTransferFeature) GetResponseType

func (f DataTransferFeature) GetResponseType() reflect.Type

type DataTransferRequest

type DataTransferRequest struct {
	MessageId string      `json:"messageId,omitempty" validate:"max=50"`
	Data      interface{} `json:"data,omitempty"`
	VendorId  string      `json:"vendorId" validate:"required,max=255"`
}

The field definition of the DataTransfer request payload sent by an endpoint to ther other endpoint.

func NewDataTransferRequest

func NewDataTransferRequest(vendorId string) *DataTransferRequest

Creates a new DataTransferRequest, containing all required fields. Optional fields may be set afterwards.

func (DataTransferRequest) GetFeatureName

func (r DataTransferRequest) GetFeatureName() string

type DataTransferResponse

type DataTransferResponse struct {
	Status DataTransferStatus `json:"status" validate:"required,dataTransferStatus"`
	Data   interface{}        `json:"data,omitempty"`
}

This field definition of the DataTransfer response payload, sent by an endpoint in response to a DataTransferRequest, coming from the other endpoint. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewDataTransferResponse

func NewDataTransferResponse(status DataTransferStatus) *DataTransferResponse

Creates a new DataTransferResponse. Optional fields may be set afterwards.

func (DataTransferResponse) GetFeatureName

func (c DataTransferResponse) GetFeatureName() string

type DataTransferStatus

type DataTransferStatus string

Status in DataTransferResponse messages.

const (
	DataTransferStatusAccepted         DataTransferStatus = "Accepted"
	DataTransferStatusRejected         DataTransferStatus = "Rejected"
	DataTransferStatusUnknownMessageId DataTransferStatus = "UnknownMessageId"
	DataTransferStatusUnknownVendorId  DataTransferStatus = "UnknownVendorId"
)

Jump to

Keyboard shortcuts

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