ocpp

package
v0.0.0-...-f385b4b Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Core profile keys
	KeyNumberOfConnectors = "NumberOfConnectors"

	// Meter profile keys
	KeyMeterValuesSampledData   = "MeterValuesSampledData"
	KeyMeterValueSampleInterval = "MeterValueSampleInterval"

	// Smart Charging profile keys
	KeyChargeProfileMaxStackLevel              = "ChargeProfileMaxStackLevel"
	KeyChargingScheduleAllowedChargingRateUnit = "ChargingScheduleAllowedChargingRateUnit"
	KeyChargingScheduleMaxPeriods              = "ChargingScheduleMaxPeriods"
	KeyConnectorSwitch3to1PhaseSupported       = "ConnectorSwitch3to1PhaseSupported"
	KeyMaxChargingProfilesInstalled            = "MaxChargingProfilesInstalled"

	// Alfen specific keys
	KeyAlfenPlugAndChargeIdentifier = "PlugAndChargeIdentifier"
)

Variables

View Source
var (
	ErrInvalidRequest     = errors.New("invalid request")
	ErrInvalidConnector   = errors.New("invalid connector")
	ErrInvalidTransaction = errors.New("invalid transaction")
)

Functions

This section is empty.

Types

type CP

type CP struct {
	// contains filtered or unexported fields
}

func NewChargePoint

func NewChargePoint(log *util.Logger, id string) *CP

func (*CP) Authorize

func (cp *CP) Authorize(request *core.AuthorizeRequest) (*core.AuthorizeConfirmation, error)

func (*CP) BootNotification

func (cp *CP) BootNotification(request *core.BootNotificationRequest) (*core.BootNotificationConfirmation, error)

func (*CP) Connected

func (cp *CP) Connected() bool

func (*CP) DataTransfer

func (cp *CP) DataTransfer(request *core.DataTransferRequest) (*core.DataTransferConfirmation, error)

func (*CP) HasConnected

func (cp *CP) HasConnected() <-chan struct{}

func (*CP) Heartbeat

func (cp *CP) Heartbeat(request *core.HeartbeatRequest) (*core.HeartbeatConfirmation, error)

func (*CP) ID

func (cp *CP) ID() string

func (*CP) MeterValues

func (cp *CP) MeterValues(request *core.MeterValuesRequest) (*core.MeterValuesConfirmation, error)

func (*CP) RegisterID

func (cp *CP) RegisterID(id string)

func (*CP) StartTransaction

func (cp *CP) StartTransaction(request *core.StartTransactionRequest) (*core.StartTransactionConfirmation, error)

func (*CP) StatusNotification

func (cp *CP) StatusNotification(request *core.StatusNotificationRequest) (*core.StatusNotificationConfirmation, error)

func (*CP) StopTransaction

func (cp *CP) StopTransaction(request *core.StopTransactionRequest) (*core.StopTransactionConfirmation, error)

type CS

type CS struct {
	ocpp16.CentralSystem
	// contains filtered or unexported fields
}

func Instance

func Instance() *CS

func (*CS) ChargePointDisconnected

func (cs *CS) ChargePointDisconnected(chargePoint ocpp16.ChargePointConnection)

ChargePointDisconnected implements ocpp16.ChargePointConnectionHandler

func (*CS) ChargepointByID

func (cs *CS) ChargepointByID(id string) (*CP, error)

func (*CS) Debug

func (cs *CS) Debug(args ...interface{})

func (*CS) Debugf

func (cs *CS) Debugf(f string, args ...interface{})

func (*CS) Error

func (cs *CS) Error(args ...interface{})

func (*CS) Errorf

func (cs *CS) Errorf(f string, args ...interface{})

func (*CS) Info

func (cs *CS) Info(args ...interface{})

func (*CS) Infof

func (cs *CS) Infof(f string, args ...interface{})

func (*CS) NewChargePoint

func (cs *CS) NewChargePoint(chargePoint ocpp16.ChargePointConnection)

NewChargePoint implements ocpp16.ChargePointConnectionHandler

func (*CS) OnAuthorize

func (cs *CS) OnAuthorize(id string, request *core.AuthorizeRequest) (*core.AuthorizeConfirmation, error)

func (*CS) OnBootNotification

func (cs *CS) OnBootNotification(id string, request *core.BootNotificationRequest) (*core.BootNotificationConfirmation, error)

func (*CS) OnDataTransfer

func (cs *CS) OnDataTransfer(id string, request *core.DataTransferRequest) (*core.DataTransferConfirmation, error)

func (*CS) OnDiagnosticsStatusNotification

func (cs *CS) OnDiagnosticsStatusNotification(id string, request *firmware.DiagnosticsStatusNotificationRequest) (confirmation *firmware.DiagnosticsStatusNotificationConfirmation, err error)

func (*CS) OnFirmwareStatusNotification

func (cs *CS) OnFirmwareStatusNotification(id string, request *firmware.FirmwareStatusNotificationRequest) (confirmation *firmware.FirmwareStatusNotificationConfirmation, err error)

func (*CS) OnHeartbeat

func (cs *CS) OnHeartbeat(id string, request *core.HeartbeatRequest) (*core.HeartbeatConfirmation, error)

func (*CS) OnMeterValues

func (cs *CS) OnMeterValues(id string, request *core.MeterValuesRequest) (*core.MeterValuesConfirmation, error)

func (*CS) OnStartTransaction

func (cs *CS) OnStartTransaction(id string, request *core.StartTransactionRequest) (*core.StartTransactionConfirmation, error)

func (*CS) OnStatusNotification

func (cs *CS) OnStatusNotification(id string, request *core.StatusNotificationRequest) (*core.StatusNotificationConfirmation, error)

func (*CS) OnStopTransaction

func (cs *CS) OnStopTransaction(id string, request *core.StopTransactionRequest) (*core.StopTransactionConfirmation, error)

func (*CS) Register

func (cs *CS) Register(id string, cp *CP) error

Register registers a charge point with the central system. The charge point identified by id may already be connected in which case initial connection is triggered.

func (*CS) TriggerMessageRequest

func (cs *CS) TriggerMessageRequest(id string, requestedMessage remotetrigger.MessageTrigger, props ...func(request *remotetrigger.TriggerMessageRequest))

func (*CS) TriggerResetRequest

func (cs *CS) TriggerResetRequest(id string, resetType core.ResetType)

type Connector

type Connector struct {
	// contains filtered or unexported fields
}

func NewConnector

func NewConnector(log *util.Logger, id int, cp *CP, timeout time.Duration) (*Connector, error)

func (*Connector) ChargePoint

func (conn *Connector) ChargePoint() *CP

func (*Connector) CurrentPower

func (conn *Connector) CurrentPower() (float64, error)

func (*Connector) Currents

func (conn *Connector) Currents() (float64, float64, float64, error)

func (*Connector) ID

func (conn *Connector) ID() int

func (*Connector) IdTag

func (conn *Connector) IdTag() string

func (*Connector) Initialized

func (conn *Connector) Initialized() error

Initialized waits for initial charge point status notification

func (*Connector) MeterValues

func (conn *Connector) MeterValues(request *core.MeterValuesRequest) (*core.MeterValuesConfirmation, error)

func (*Connector) StartTransaction

func (conn *Connector) StartTransaction(request *core.StartTransactionRequest) (*core.StartTransactionConfirmation, error)

func (*Connector) Status

func (conn *Connector) Status() (api.ChargeStatus, error)

func (*Connector) StatusNotification

func (conn *Connector) StatusNotification(request *core.StatusNotificationRequest) (*core.StatusNotificationConfirmation, error)

func (*Connector) StopTransaction

func (conn *Connector) StopTransaction(request *core.StopTransactionRequest) (*core.StopTransactionConfirmation, error)

func (*Connector) TestClock

func (conn *Connector) TestClock(clock clock.Clock)

func (*Connector) TotalEnergy

func (conn *Connector) TotalEnergy() (float64, error)

func (*Connector) TransactionID

func (conn *Connector) TransactionID() (int, error)

TransactionID returns the current transaction id

func (*Connector) TriggerMessageRequest

func (conn *Connector) TriggerMessageRequest(feature remotetrigger.MessageTrigger, f ...func(request *remotetrigger.TriggerMessageRequest))

func (*Connector) WatchDog

func (conn *Connector) WatchDog(timeout time.Duration)

WatchDog triggers meter values messages if older than timeout. Must be wrapped in a goroutine.

Jump to

Keyboard shortcuts

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