v16

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChargePoint

type ChargePoint struct {
	Settings *settings.Settings
	// Hardware components
	TagReader reader.Reader
	Indicator indicator.Indicator
	LCD       display.LCD
	// contains filtered or unexported fields
}

func NewChargePoint

func NewChargePoint(manager connectorManager.Manager, scheduler *gocron.Scheduler, cache *auth.Cache, opts ...Options) *ChargePoint

NewChargePoint creates a new ChargePoint for OCPP version 1.6.

func (*ChargePoint) AddConnectors

func (cp *ChargePoint) AddConnectors(connectors []*settingsData.Connector)

AddConnectors Add the Connectors from the connectors.json file to the handler. Create and add all their components and initialize the struct.

func (*ChargePoint) CleanUp

func (cp *ChargePoint) CleanUp(reason core.Reason)

CleanUp When exiting the client, stop all the transactions, clean up all the peripherals and terminate the connection.

func (*ChargePoint) Connect

func (cp *ChargePoint) Connect(ctx context.Context, serverUrl string)

Connect to the central system and send a BootNotification

func (*ChargePoint) GetConnectorStatus

func (cp *ChargePoint) GetConnectorStatus(evseId, connectorId int) (*api.GetConnectorStatusResponse, error)

GetConnectorStatus Notify the central system about the connector's status and updates the LED indicator.

func (*ChargePoint) HandleChargingRequest

func (cp *ChargePoint) HandleChargingRequest(tagId string) (*api.HandleChargingResponse, error)

HandleChargingRequest Entry point for determining if the request is to start or stop charging. Trying to find a connector that has the tag stored in the Session; if such a connector exists, execute stopChargingConnector, otherwise startCharging.

func (*ChargePoint) Init

func (cp *ChargePoint) Init(settings *settings.Settings)

Init initializes the charge point based on the settings and listens to the Reader.

func (*ChargePoint) ListenForConnectorStatusChange

func (cp *ChargePoint) ListenForConnectorStatusChange(ctx context.Context, ch <-chan rxgo.Item)

ListenForConnectorStatusChange listen for change in connector and notify the central system about the state

func (*ChargePoint) ListenForTag

func (cp *ChargePoint) ListenForTag(ctx context.Context, tagChannel <-chan string)

ListenForTag Listen for an RFID/NFC tag on a separate thread. If a tag is detected, call the HandleChargingRequest. Blink the LED if indication is enabled.

func (*ChargePoint) OnCancelReservation

func (cp *ChargePoint) OnCancelReservation(request *reservation.CancelReservationRequest) (confirmation *reservation.CancelReservationConfirmation, err error)

func (*ChargePoint) OnChangeAvailability

func (cp *ChargePoint) OnChangeAvailability(request *core.ChangeAvailabilityRequest) (confirmation *core.ChangeAvailabilityConfirmation, err error)

func (*ChargePoint) OnChangeConfiguration

func (cp *ChargePoint) OnChangeConfiguration(request *core.ChangeConfigurationRequest) (confirmation *core.ChangeConfigurationConfirmation, err error)

func (*ChargePoint) OnClearCache

func (cp *ChargePoint) OnClearCache(request *core.ClearCacheRequest) (confirmation *core.ClearCacheConfirmation, err error)

func (*ChargePoint) OnDataTransfer

func (cp *ChargePoint) OnDataTransfer(request *core.DataTransferRequest) (confirmation *core.DataTransferConfirmation, err error)

func (*ChargePoint) OnGetConfiguration

func (cp *ChargePoint) OnGetConfiguration(request *core.GetConfigurationRequest) (confirmation *core.GetConfigurationConfirmation, err error)

func (*ChargePoint) OnRemoteStartTransaction

func (cp *ChargePoint) OnRemoteStartTransaction(request *core.RemoteStartTransactionRequest) (confirmation *core.RemoteStartTransactionConfirmation, err error)

func (*ChargePoint) OnRemoteStopTransaction

func (cp *ChargePoint) OnRemoteStopTransaction(request *core.RemoteStopTransactionRequest) (confirmation *core.RemoteStopTransactionConfirmation, err error)

func (*ChargePoint) OnReserveNow

func (cp *ChargePoint) OnReserveNow(request *reservation.ReserveNowRequest) (confirmation *reservation.ReserveNowConfirmation, err error)

func (*ChargePoint) OnReset

func (cp *ChargePoint) OnReset(request *core.ResetRequest) (confirmation *core.ResetConfirmation, err error)

func (*ChargePoint) OnTriggerMessage

func (cp *ChargePoint) OnTriggerMessage(request *remotetrigger.TriggerMessageRequest) (confirmation *remotetrigger.TriggerMessageConfirmation, err error)

func (*ChargePoint) OnUnlockConnector

func (cp *ChargePoint) OnUnlockConnector(request *core.UnlockConnectorRequest) (confirmation *core.UnlockConnectorConfirmation, err error)

func (*ChargePoint) StartCharging

func (cp *ChargePoint) StartCharging(tagId string, connectorId int) (*api.StartTransactionResponse, error)

StartCharging Start charging on the first available Connector. If there is no available Connector, reject the request.

func (*ChargePoint) StopCharging

func (cp *ChargePoint) StopCharging(tagId string, connectorId int) (*api.StopTransactionResponse, error)

StopCharging Stop charging a connector

type ChargePointV16

type ChargePointV16 interface {
	chargePoint.ChargePoint
	// contains filtered or unexported methods
}

type Options

type Options func(point *ChargePoint)

func WithDisplay

func WithDisplay(ctx context.Context, display display.LCD) Options

WithDisplay add the provided LCD to the ChargePoint.

func WithDisplayFromSettings

func WithDisplayFromSettings(ctx context.Context, lcdSettings settings.Lcd) Options

WithDisplayFromSettings create a LCD based on the provided settings.

func WithLogger

func WithLogger(logger *log.Logger) Options

WithLogger add logger to the ChargePoint

func WithReader

func WithReader(ctx context.Context, tagReader reader.Reader) Options

WithReader adds the reader to the charge point and starts listening to the Reader.

func WithReaderFromSettings

func WithReaderFromSettings(ctx context.Context, readerSettings settings.TagReader) Options

WithReaderFromSettings creates a TagReader based on the settings.

Jump to

Keyboard shortcuts

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