Documentation
¶
Index ¶
- Constants
- func DefaultEventCallback(c *Client, nodeID byte, e cc.Command)
- func NewLogger() (*zap.Logger, error)
- type Client
- func (c *Client) AddNode() (*Node, error)
- func (c *Client) Node(nodeID byte) (*Node, error)
- func (c *Client) Nodes() map[byte]*Node
- func (c *Client) RemoveFailedNode(nodeID byte) (ok bool, err error)
- func (c *Client) RemoveNode() (byte, error)
- func (c *Client) SendData(dstNode byte, payload encoding.BinaryMarshaler) error
- func (c *Client) SendDataSecure(dstNode byte, message encoding.BinaryMarshaler) error
- func (c *Client) SetEventCallback(callback func(c *Client, nodeID byte, e cc.Command))
- func (c *Client) SetLogger(logger *zap.Logger)
- func (c *Client) Shutdown() error
- type Controller
- type Node
- func (n *Node) AddAssociation(groupID byte, nodeIDs ...byte) error
- func (n *Node) GetBasicDeviceClassName() string
- func (n *Node) GetGenericDeviceClassName() string
- func (n *Node) GetSpecificDeviceClassName() string
- func (n *Node) GetSupportedCommandClassStrings() []string
- func (n *Node) GetSupportedSecureCommandClassStrings() []string
- func (n *Node) IsListening() bool
- func (n *Node) IsSecure() bool
- func (n *Node) LoadCommandClassVersions() error
- func (n *Node) LoadManufacturerInfo() error
- func (n *Node) LoadSupportedSecurityCommands() error
- func (n *Node) RequestNodeInformationFrame() error
- func (n *Node) SendCommand(command cc.Command) error
- func (n *Node) SendRawCommand(payload []byte) error
- func (n *Node) String() string
Constants ¶
const ( SecurePayloadMaxSizeExplore = 26 // in bytes SecurePayloadMaxSizeAutoRoute = 28 SecurePayloadMaxSizeNoRoute = 34 )
Maximum possible size (in bytes) of the plaintext payload to be sent when sending a secure frame, based on the SendData options. The smallest possible must be used based on the given option bitset (e.g. if using both no route and explore, the maximum size is 26).
const MaxSecureInclusionDuration = time.Second * 60
MaxSecureInclusionDuration is the timeout for secure inclusion mode. If this timeout expires, secure inclusion will be canceled no matter how far the process has proceeded.
Variables ¶
This section is empty.
Functions ¶
func DefaultEventCallback ¶
DefaultEventCallback is the default callback for handling events.
Types ¶
type Client ¶
type Client struct {
Controller Controller
// REPLACE THIS WITH A GENERIC CALLBACK FUNCTION
// EventBus EventBus.Bus
EventCallback func(*Client, byte, cc.Command)
// contains filtered or unexported fields
}
func NewDefaultClient ¶
func (*Client) RemoveFailedNode ¶
func (*Client) RemoveNode ¶
func (*Client) SendData ¶
func (c *Client) SendData(dstNode byte, payload encoding.BinaryMarshaler) error
func (*Client) SendDataSecure ¶
func (c *Client) SendDataSecure(dstNode byte, message encoding.BinaryMarshaler) error
SendDataSecure encapsulates payload in a security encapsulation command and sends it to the destination node.
func (*Client) SetEventCallback ¶
SetEventCallback will set the event callback for any events received
type Controller ¶
type Controller struct {
APIVersion string `json:"apiversion"`
APILibraryType string `json:"apilibrary_type"`
HomeID uint32 `json:"home_id"`
NodeID byte `json:"node_id"`
Version byte `json:"version"`
APIType string `json:"apitype"`
IsPrimaryController bool `json:"is_primary_controller"`
ApplicationVersion byte `json:"application_version"`
ApplicationRevision byte `json:"application_revision"`
SupportedFunctions []byte `json:"supported_functions"`
NodeList []byte `json:"node_list"`
}
Controller contains information for the controller.
type Node ¶
type Node struct {
NodeID byte
Capability byte
BasicDeviceClass byte
GenericDeviceClass byte
SpecificDeviceClass byte
Failing bool
CommandClasses cc.CommandClassSet
NetworkKeySent bool
ManufacturerID uint16
ProductTypeID uint16
ProductID uint16
QueryStageSecurity bool
QueryStageManufacturer bool
QueryStageVersions bool
// contains filtered or unexported fields
}