Documentation ¶
Index ¶
- type AddRemoveNodeCallback
- type AppData
- type ApplicationCommand
- type Capabilities
- type ControllerTimeouts
- type ControllerUpdate
- type ILayer
- type InitAppData
- type Layer
- func (s *Layer) AddNode() (*AddRemoveNodeCallback, error)
- func (s *Layer) ControllerCommands() chan ApplicationCommand
- func (s *Layer) ControllerUpdates() chan ControllerUpdate
- func (s *Layer) FactoryReset()
- func (s *Layer) GetCapabilities() (*Capabilities, error)
- func (s *Layer) GetInitAppData() (*InitAppData, error)
- func (s *Layer) GetNodeProtocolInfo(nodeID byte) (nodeInfo *NodeProtocolInfo, err error)
- func (s *Layer) GetVersion() (version *Version, err error)
- func (s *Layer) IsFailedNode(nodeID byte) (failed bool, err error)
- func (s *Layer) MemoryGetID() (homeID uint32, nodeID byte, err error)
- func (s *Layer) RemoveFailedNode(nodeID byte) (removed bool, err error)
- func (s *Layer) RemoveNode() (*AddRemoveNodeCallback, error)
- func (s *Layer) RequestNodeInfo(nodeID byte) (*NodeInfoFrame, error)
- func (s *Layer) SendData(nodeID byte, payload []byte) (txTime uint16, err error)
- func (s *Layer) SetControllerTimeouts() (*ControllerTimeouts, error)
- func (s *Layer) SoftReset()
- type NodeInfoFrame
- type NodeProtocolInfo
- type Version
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 }
AddRemoveNodeCallback contains callback info for add/remove node.
type AppData ¶
type AppData interface { GetAPIType() string TimerFunctionsSupported() bool IsPrimaryController() bool GetNodeIDs() []byte }
InitAppData contains data to initialize application
type ApplicationCommand ¶
type ApplicationCommand struct { CommandID byte ReceiveStatus byte DstNodeID byte SrcNodeID byte CmdLength byte CommandData []byte }
ApplicationCommand contains an application level command.
type Capabilities ¶
type Capabilities struct { ApplicationVersion byte ApplicationRevision byte Manufacturer1 byte Manufacturer2 byte ProductType1 byte ProductType2 byte ProductID1 byte ProductID2 byte SupportedFunctions []byte }
Capabilities contains the serial api capabilities of the controller.
func (*Capabilities) GetSupportedFunctions ¶
func (s *Capabilities) GetSupportedFunctions() []byte
GetSupportedFunctions returns the supported functions.
type ControllerTimeouts ¶
type ControllerUpdate ¶
type ControllerUpdate struct { Status byte NodeID byte Length byte Basic byte Generic byte Specific byte CommandClasses []byte }
ControllerUpdate .
func (*ControllerUpdate) GetStatusString ¶
func (a *ControllerUpdate) GetStatusString() string
GetStatusString will get the controller status as a string
type ILayer ¶
type ILayer interface { ControllerUpdates() chan ControllerUpdate ControllerCommands() chan ApplicationCommand AddNode() (*AddRemoveNodeCallback, error) RemoveNode() (*AddRemoveNodeCallback, error) SetControllerTimeouts() (*ControllerTimeouts, error) GetCapabilities() (*Capabilities, 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) (*NodeInfoFrame, error) SoftReset() FactoryReset() }
ILayer is an interface for the serialapi layer.
type InitAppData ¶
type InitAppData struct { AppData CommandID byte Version byte Capabilities byte Nodes []byte ChipType byte ChipVersion byte }
func (*InitAppData) GetAPIType ¶
func (n *InitAppData) GetAPIType() string
GetAPIType will return the API type (slave or controller)
func (*InitAppData) GetNodeIDs ¶
func (n *InitAppData) GetNodeIDs() []byte
GetNodeIDs will return all node ids
func (*InitAppData) IsPrimaryController ¶
func (n *InitAppData) IsPrimaryController() bool
IsPrimaryController returns if this is the primary controller.
func (*InitAppData) TimerFunctionsSupported ¶
func (n *InitAppData) TimerFunctionsSupported() bool
TimerFunctionsSupported returns whether timer functions are supported.
type Layer ¶
type Layer struct {
// contains filtered or unexported fields
}
Layer contains the serial api layer.
func (*Layer) AddNode ¶
func (s *Layer) AddNode() (*AddRemoveNodeCallback, error)
AddNode will put the controller into add node mode and handle operations for adding a node.
func (*Layer) ControllerCommands ¶
func (s *Layer) ControllerCommands() chan ApplicationCommand
ControllerCommands returns a channel for application commands.
func (*Layer) ControllerUpdates ¶
func (s *Layer) ControllerUpdates() chan ControllerUpdate
ControllerUpdates returns a channel for controller updates.
func (*Layer) FactoryReset ¶
func (s *Layer) FactoryReset()
FactoryReset will clear the network configuration and Soft Reset the controller WARNING: This can (and often will) cause the device to get a new USB address, rendering the serial port's file descriptor invalid.
func (*Layer) GetCapabilities ¶
func (s *Layer) GetCapabilities() (*Capabilities, error)
GetCapabilities will return the serial api capabilities.
func (*Layer) GetInitAppData ¶
func (s *Layer) GetInitAppData() (*InitAppData, error)
GetInitAppData will return data required to initialize the application.
func (*Layer) GetNodeProtocolInfo ¶
func (s *Layer) GetNodeProtocolInfo(nodeID byte) (nodeInfo *NodeProtocolInfo, err error)
GetNodeProtocolInfo will retrieve protocol info for a node.
func (*Layer) GetVersion ¶
GetVersion will retrieve version information.
func (*Layer) IsFailedNode ¶
IsFailedNode Will return if a node has failed.
func (*Layer) MemoryGetID ¶
MemoryGetID will get the home/node id.
func (*Layer) RemoveFailedNode ¶
RemoveFailedNode will remove a failed node.
func (*Layer) RemoveNode ¶
func (s *Layer) RemoveNode() (*AddRemoveNodeCallback, error)
RemoveNode will put the controller into remove node mode and handle all operations.
func (*Layer) RequestNodeInfo ¶
func (s *Layer) RequestNodeInfo(nodeID byte) (*NodeInfoFrame, error)
RequestNodeInfo will request info for a node.
func (*Layer) SetControllerTimeouts ¶
func (s *Layer) SetControllerTimeouts() (*ControllerTimeouts, error)
type NodeProtocolInfo ¶
type NodeProtocolInfo struct { Capability byte Security byte BasicDeviceClass byte GenericDeviceClass byte SpecificDeviceClass byte }
NodeProtocolInfo contains protocol info for a node.
func (*NodeProtocolInfo) GetBasicDeviceClassName ¶
func (n *NodeProtocolInfo) GetBasicDeviceClassName() string
GetBasicDeviceClassName will return the basic device class as a string
func (*NodeProtocolInfo) GetGenericDeviceClassName ¶
func (n *NodeProtocolInfo) GetGenericDeviceClassName() string
GetGenericDeviceClassName will return the generic device class as a string
func (*NodeProtocolInfo) GetSpecificDeviceClassName ¶
func (n *NodeProtocolInfo) GetSpecificDeviceClassName() string
GetSpecificDeviceClassName will return the specific device class as a string
func (*NodeProtocolInfo) IsListening ¶
func (n *NodeProtocolInfo) IsListening() bool
IsListening returns whether a node is listening.
Source Files ¶
- add_remove_node.go
- application_command.go
- application_node_information.go
- capabilities.go
- controller_timeouts.go
- controller_update.go
- factory_reset.go
- init_data.go
- is_failed_node.go
- layer.go
- memory_get_id.go
- node_protocol_info.go
- remove_failed_node.go
- request_node_info.go
- send_data.go
- soft_reset.go
- version.go