Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidEvseId = errors.New("invalid evse id") ErrInvalidConnectorId = errors.New("invalid connector id") ErrInvalidReservationId = errors.New("invalid reservation id") ErrInvalidConnectorStatus = errors.New("invalid connector status") ErrRelayPointerNil = errors.New("relay pointer cannot be nil") ErrSessionTimeLimitExceeded = errors.New("session time limit exceeded") ErrNotCharging = errors.New("connector not charging") )
Functions ¶
func NewConnector ¶
func NewConnector(evseId int, connectorId int, connectorType string, relay hardware.Relay, powerMeter powerMeter.PowerMeter, powerMeterEnabled bool, maxChargingTime int) (*connectorImpl, error)
NewConnector Create a new connector object from the provided arguments. EvseId, connectorId and maxChargingTime must be greater than zero. When created, it makes an empty session, turns off the relay and defaults the status to Available.
Types ¶
type Connector ¶
type Connector interface { StartCharging(transactionId string, tagId string) error ResumeCharging(session session.Session) (error, int) StopCharging(reason core.Reason) error SetNotificationChannel(notificationChannel chan<- rxgo.Item) SetMeterValuesChannel(notificationChannel chan<- models.MeterValueNotification) ReserveConnector(reservationId int, tagId string) error RemoveReservation() error GetReservationId() int GetTagId() string GetTransactionId() string GetConnectorId() int GetEvseId() int CalculateSessionAvgEnergyConsumption() float64 SamplePowerMeter(measurands []types.Measurand) SetStatus(status core.ChargePointStatus, errCode core.ChargePointErrorCode) GetStatus() (core.ChargePointStatus, core.ChargePointErrorCode) IsAvailable() bool IsPreparing() bool IsCharging() bool IsReserved() bool GetPowerMeter() powerMeter.PowerMeter GetMaxChargingTime() int }
Click to show internal directories.
Click to hide internal directories.