Documentation
¶
Index ¶
- Constants
- func JsonFromEEBUSJson(json []byte) []byte
- func JsonIntoEEBUSJson(data []byte) (string, error)
- type ShipConnection
- func (c *ShipConnection) AbortPendingHandshake()
- func (c *ShipConnection) ApprovePendingHandshake()
- func (c *ShipConnection) CloseConnection(safe bool, code int, reason string)
- func (c *ShipConnection) DataHandler() api.WebsocketDataWriterInterface
- func (c *ShipConnection) HandleIncomingWebsocketMessage(message []byte)
- func (c *ShipConnection) RemoteSKI() string
- func (c *ShipConnection) ReportConnectionError(err error)
- func (c *ShipConnection) Run()
- func (c *ShipConnection) ShipHandshakeState() (model.ShipMessageExchangeState, error)
- func (c *ShipConnection) WriteShipMessageWithPayload(message []byte)
Constants ¶
View Source
const ( ShipRoleServer shipRole = "server" ShipRoleClient shipRole = "client" )
Variables ¶
This section is empty.
Functions ¶
func JsonFromEEBUSJson ¶
convert incoming EEBUS json format into standard json format
func JsonIntoEEBUSJson ¶
convert json into the EEBUS json format
Types ¶
type ShipConnection ¶
type ShipConnection struct {
// contains filtered or unexported fields
}
A ShipConnection handles the data connection and coordinates SHIP and SPINE messages i/o
func NewConnectionHandler ¶
func NewConnectionHandler( dataProvider api.ShipConnectionInfoProviderInterface, dataHandler api.WebsocketDataWriterInterface, role shipRole, localShipID, remoteSki, remoteShipId string) *ShipConnection
func (*ShipConnection) AbortPendingHandshake ¶
func (c *ShipConnection) AbortPendingHandshake()
invoked when pairing for a pending request is denied
func (*ShipConnection) ApprovePendingHandshake ¶
func (c *ShipConnection) ApprovePendingHandshake()
invoked when pairing for a pending request is approved
func (*ShipConnection) CloseConnection ¶
func (c *ShipConnection) CloseConnection(safe bool, code int, reason string)
close this ship connection
func (*ShipConnection) DataHandler ¶
func (c *ShipConnection) DataHandler() api.WebsocketDataWriterInterface
func (*ShipConnection) HandleIncomingWebsocketMessage ¶
func (c *ShipConnection) HandleIncomingWebsocketMessage(message []byte)
route the incoming message to either SHIP or SPINE message handlers
func (*ShipConnection) RemoteSKI ¶
func (c *ShipConnection) RemoteSKI() string
func (*ShipConnection) ReportConnectionError ¶
func (c *ShipConnection) ReportConnectionError(err error)
the websocket data connection was closed from remote
func (*ShipConnection) ShipHandshakeState ¶
func (c *ShipConnection) ShipHandshakeState() (model.ShipMessageExchangeState, error)
provides the current ship state and error value if the state is in error
func (*ShipConnection) WriteShipMessageWithPayload ¶
func (c *ShipConnection) WriteShipMessageWithPayload(message []byte)
SpineDataConnection interface implementation
Click to show internal directories.
Click to hide internal directories.