eebus

package
v0.0.0-...-717d9f9 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BrandName  string = "EVCC"
	Model      string = "HEMS"
	DeviceCode string = "EVCC_HEMS_01" // used as common name in cert generation
)

Variables

This section is empty.

Functions

func CreateCertificate

func CreateCertificate() (tls.Certificate, error)

CreateCertificate returns a newly created EEBUS compatible certificate

func GetX509KeyPair

func GetX509KeyPair(cert tls.Certificate) (string, string, error)

GetX509KeyPair saves returns the cert and key string values

func SkiFromCert

func SkiFromCert(cert tls.Certificate) (string, error)

SkiFromCert extracts SKI from certificate

func WrapError

func WrapError(err error) error

Types

type Config

type Config struct {
	URI         string
	ShipID      string
	Interfaces  []string
	Certificate struct {
		Public, Private string
	}
}

func (Config) Configured

func (c Config) Configured() bool

Configured returns true if the EEbus server is configured

type Connector

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

func NewConnector

func NewConnector() *Connector

func (*Connector) Connect

func (c *Connector) Connect(connected bool)

func (*Connector) Wait

func (c *Connector) Wait(timeout time.Duration) error

type Device

type Device interface {
	Connect(connected bool)
	UseCaseEvent(device spineapi.DeviceRemoteInterface, entity spineapi.EntityRemoteInterface, event eebusapi.EventType)
}

type EEBus

type EEBus struct {
	SKI string
	// contains filtered or unexported fields
}
var Instance *EEBus

func NewServer

func NewServer(other Config) (*EEBus, error)

func (*EEBus) ControllableSystem

func (c *EEBus) ControllableSystem() *UseCasesCS

func (*EEBus) Debug

func (c *EEBus) Debug(args ...interface{})

func (*EEBus) Debugf

func (c *EEBus) Debugf(format string, args ...interface{})

func (*EEBus) Error

func (c *EEBus) Error(args ...interface{})

func (*EEBus) Errorf

func (c *EEBus) Errorf(format string, args ...interface{})

func (*EEBus) Evse

func (c *EEBus) Evse() *UseCasesEVSE

func (*EEBus) Info

func (c *EEBus) Info(args ...interface{})

func (*EEBus) Infof

func (c *EEBus) Infof(format string, args ...interface{})

func (*EEBus) RegisterDevice

func (c *EEBus) RegisterDevice(ski, ip string, device Device) error

func (*EEBus) RemoteSKIConnected

func (c *EEBus) RemoteSKIConnected(service eebusapi.ServiceInterface, ski string)

func (*EEBus) RemoteSKIDisconnected

func (c *EEBus) RemoteSKIDisconnected(service eebusapi.ServiceInterface, ski string)

func (*EEBus) Run

func (c *EEBus) Run()

func (*EEBus) ServicePairingDetailUpdate

func (c *EEBus) ServicePairingDetailUpdate(ski string, detail *shipapi.ConnectionStateDetail)

Provides the current pairing state for the remote service This is called whenever the state changes and can be used to provide user information for the pairing/connection process

func (*EEBus) ServiceShipIDUpdate

func (c *EEBus) ServiceShipIDUpdate(ski string, shipdID string)

Provides the SHIP ID the remote service reported during the handshake process This needs to be persisted and passed on for future remote service connections when using `PairRemoteService`

func (*EEBus) Shutdown

func (c *EEBus) Shutdown()

func (*EEBus) Trace

func (c *EEBus) Trace(args ...interface{})

func (*EEBus) Tracef

func (c *EEBus) Tracef(format string, args ...interface{})

func (*EEBus) VisibleRemoteServicesUpdated

func (c *EEBus) VisibleRemoteServicesUpdated(service eebusapi.ServiceInterface, entries []shipapi.RemoteService)

report all currently visible EEBUS services this is needed to provide an UI for pairing with other devices if not all incoming pairing requests should be accepted

type UseCasesCS

type UseCasesCS struct {
	LPC  ucapi.CsLPCInterface
	LPP  ucapi.CsLPPInterface
	MGCP ucapi.MaMGCPInterface
}

type UseCasesEVSE

EVSE UseCases

Jump to

Keyboard shortcuts

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