cs

package
v1.0.1-0...-deaadd6 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CentralSystem

type CentralSystem interface {
	// Run the central system on the given port
	// and handles each incoming ChargepointRequest
	Run(port string, cphandler ChargePointMessageHandler) error

	// GetServiceOf a chargepoint to enable
	// communication with the chargepoint
	//
	// the url parameter is *NOT* used if
	// the link between the CentralSystem
	// and Chargepoint is via Websocket
	GetServiceOf(cpID string, version ocpp.Version, url string) (service.ChargePoint, error)

	SetChargePointConnectionListener(ChargePointConnectionListener)
	SetChargePointDisconnectionListener(ChargePointConnectionListener)
	WaitConnect(cpID string) <-chan struct{}
	WaitDisconnect(cpID string) <-chan struct{}
}

func New

func New() CentralSystem

type ChargePointConnectionListener

type ChargePointConnectionListener func(cpID string)

type ChargePointMessageHandler

type ChargePointMessageHandler func(cprequest cpreq.ChargePointRequest, metadata ChargePointRequestMetadata) (cpresp.ChargePointResponse, error)

ChargePointMessageHandler handles the OCPP messages coming from the charger

type ChargePointRequestMetadata

type ChargePointRequestMetadata struct {
	ChargePointID string
	HTTPRequest   *http.Request
}

Jump to

Keyboard shortcuts

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