ship

package
v0.0.0-...-c1aa92f Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const CMI_TIMEOUT = 10

Variables

This section is empty.

Functions

func ReadSkis

func ReadSkis() ([]string, []string)

func WriteSkis

func WriteSkis(newSkis []string, newDevices []string)

Types

type CloseHandler

type CloseHandler func(*SMEInstance)

type CmiMessage

type CmiMessage struct {
	MessageType  int `json:"MessageType"`
	MessageValue int `json:"MessageValue"`
}

type ConnectionManager

type ConnectionManager func(string, *websocket.Conn)

type ConnectionManagerSpine

type ConnectionManagerSpine func(*SMEInstance, string)

type DataValue

type DataValue struct {
	Header  HeaderType             `xml:"header"`
	Payload resources.DatagramType `xml:"payload"`
}

type HeaderType

type HeaderType struct {
	ProtocollId string `xml:"protocollId"`
}

type Message

type Message struct {
	MessageType  int `xml:"MessageType"`
	MessageValue DataValue
}

type Request

type Request struct {
	Path string
	Id   string
	Ski  string
}

type SMEInstance

type SMEInstance struct {
	Connection *websocket.Conn

	Ski string
	// contains filtered or unexported fields
}

func (*SMEInstance) Recieve

func (SME *SMEInstance) Recieve(handleFunc dataHandler)

func (*SMEInstance) RecieveOnce

func (SME *SMEInstance) RecieveOnce(handleFunc handler)
Use XML format

- Notify SPINE node that connection is active - Recieve and send methods should be available

func (*SMEInstance) RecieveTimeout

func (SME *SMEInstance) RecieveTimeout(seconds int) []byte

func (*SMEInstance) Send

func (SME *SMEInstance) Send(payload resources.DatagramType)

Sends messages in json format

func (*SMEInstance) StartCMI

func (SME *SMEInstance) StartCMI()

type ShipNode

type ShipNode struct {
	IsGateway             bool
	SME                   []*SMEInstance
	Requests              []*Request
	SpineConnectionNotify ConnectionManagerSpine
	SpineCloseHandler     CloseHandler
	CertName              string
	// contains filtered or unexported fields
}

func NewShipNode

func NewShipNode(hostname string, IsGateway bool, certName string, devId string, brand string, devType string) *ShipNode

func (*ShipNode) BrowseDns

func (shipNode *ShipNode) BrowseDns()

func (*ShipNode) Connect

func (shipNode *ShipNode) Connect(service string, ski string)

func (*ShipNode) RegisterDns

func (shipNode *ShipNode) RegisterDns()

func (*ShipNode) Start

func (shipNode *ShipNode) Start()

func (*ShipNode) StartServer

func (shipNode *ShipNode) StartServer()

Jump to

Keyboard shortcuts

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