serialapi

package
v0.0.0-...-02b3c19 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddRemoveNodeCallback

type AddRemoveNodeCallback struct {
	CommandID      byte
	CallbackID     byte
	Status         byte
	Source         byte
	Length         byte
	Basic          byte
	Generic        byte
	Specific       byte
	CommandClasses []byte
}

type ApplicationCommand

type ApplicationCommand struct {
	CommandID     byte
	ReceiveStatus byte
	DstNodeID     byte
	SrcNodeID     byte
	CmdLength     byte
	CommandData   []byte
}

type ControllerUpdate

type ControllerUpdate struct {
	Status         byte
	NodeID         byte
	Length         byte
	Basic          byte
	Generic        byte
	Specific       byte
	CommandClasses []byte
}

func (*ControllerUpdate) GetStatusString

func (a *ControllerUpdate) GetStatusString() string

type ILayer

type ILayer interface {
	ControllerUpdates() chan ControllerUpdate
	ControllerCommands() chan ApplicationCommand
	AddNode() (*AddRemoveNodeCallback, error)
	RemoveNode() (*AddRemoveNodeCallback, error)
	GetSerialAPICapabilities() (*SerialAPICapabilities, error)
	GetVersion() (version *Version, err error)
	MemoryGetID() (homeID uint32, nodeID byte, err error)
	GetInitAppData() (*InitAppData, error)
	GetNodeProtocolInfo(nodeID byte) (nodeInfo *NodeProtocolInfo, err error)
	SendData(nodeID byte, payload []byte) (txTime uint16, err error)
	IsFailedNode(nodeID byte) (failed bool, err error)
	RemoveFailedNode(nodeID byte) (removed bool, err error)
	RequestNodeInfo(nodeInfo byte) (err error)
	SoftReset()
}

type InitAppData

type InitAppData struct {
	CommandID    byte
	Version      byte
	Capabilities byte
	Nodes        []byte
	ChipType     byte
	ChipVersion  byte
}

func (*InitAppData) GetAPIType

func (n *InitAppData) GetAPIType() string

func (*InitAppData) GetNodeIDs

func (n *InitAppData) GetNodeIDs() []byte

func (*InitAppData) IsPrimaryController

func (n *InitAppData) IsPrimaryController() bool

func (*InitAppData) TimerFunctionsSupported

func (n *InitAppData) TimerFunctionsSupported() bool

type Layer

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

func NewLayer

func NewLayer(sessionLayer session.ILayer) *Layer

func (*Layer) AddNode

func (s *Layer) AddNode() (*AddRemoveNodeCallback, error)

func (*Layer) ControllerCommands

func (s *Layer) ControllerCommands() chan ApplicationCommand

func (*Layer) ControllerUpdates

func (s *Layer) ControllerUpdates() chan ControllerUpdate

func (*Layer) GetInitAppData

func (s *Layer) GetInitAppData() (*InitAppData, error)

func (*Layer) GetNodeProtocolInfo

func (s *Layer) GetNodeProtocolInfo(nodeID byte) (nodeInfo *NodeProtocolInfo, err error)

func (*Layer) GetSerialAPICapabilities

func (s *Layer) GetSerialAPICapabilities() (*SerialAPICapabilities, error)

func (*Layer) GetVersion

func (s *Layer) GetVersion() (version *Version, err error)

func (*Layer) IsFailedNode

func (s *Layer) IsFailedNode(nodeID byte) (failed bool, err error)

func (*Layer) MemoryGetID

func (s *Layer) MemoryGetID() (homeID uint32, nodeID byte, err error)

func (*Layer) RemoveFailedNode

func (s *Layer) RemoveFailedNode(nodeID byte) (removed bool, err error)

func (*Layer) RemoveNode

func (s *Layer) RemoveNode() (*AddRemoveNodeCallback, error)

func (*Layer) RequestNodeInfo

func (s *Layer) RequestNodeInfo(nodeID byte) error

func (*Layer) SendData

func (s *Layer) SendData(nodeID byte, payload []byte) (txTime uint16, err error)

func (*Layer) SetLogger

func (s *Layer) SetLogger(logger *log.Logger)

func (*Layer) SoftReset

func (s *Layer) SoftReset()

WARNING: This can (and often will) cause the device to get a new USB address, rendering the serial port's file descriptor invalid.

type NodeProtocolInfo

type NodeProtocolInfo struct {
	Capability          byte
	Security            byte
	BasicDeviceClass    byte
	GenericDeviceClass  byte
	SpecificDeviceClass byte
}

func (*NodeProtocolInfo) GetBasicDeviceClassName

func (n *NodeProtocolInfo) GetBasicDeviceClassName() string

func (*NodeProtocolInfo) GetGenericDeviceClassName

func (n *NodeProtocolInfo) GetGenericDeviceClassName() string

func (*NodeProtocolInfo) GetSpecificDeviceClassName

func (n *NodeProtocolInfo) GetSpecificDeviceClassName() string

func (*NodeProtocolInfo) IsListening

func (n *NodeProtocolInfo) IsListening() bool

type SerialAPICapabilities

type SerialAPICapabilities struct {
	ApplicationVersion  byte
	ApplicationRevision byte
	Manufacturer1       byte
	Manufacturer2       byte
	ProductType1        byte
	ProductType2        byte
	ProductID1          byte
	ProductID2          byte
	SupportedFunctions  []byte
}

func (*SerialAPICapabilities) GetSupportedFunctions

func (s *SerialAPICapabilities) GetSupportedFunctions() []byte

type Version

type Version struct {
	Version     string
	LibraryType byte
}

func (*Version) GetLibraryTypeString

func (v *Version) GetLibraryTypeString() string

Jump to

Keyboard shortcuts

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