Documentation ¶
Index ¶
- Constants
- Variables
- type AdapterInfo
- type ApplicationMessage
- type ClusterID
- type Endpoint
- type EndpointDescription
- type EndpointRegistration
- type Error
- type EventReceiver
- type ExtendedPANID
- type GroupID
- type IEEEAddress
- type IncomingMessage
- type LogicalType
- type ManufacturerCode
- type MockProvider
- func (m *MockProvider) AdapterNode() Node
- func (m *MockProvider) BindNodeToController(ctx context.Context, nodeAddress IEEEAddress, sourceEndpoint Endpoint, ...) error
- func (m *MockProvider) DenyJoin(ctx context.Context) error
- func (m *MockProvider) ForceNodeLeave(ctx context.Context, networkAddress IEEEAddress) error
- func (m *MockProvider) PermitJoin(ctx context.Context, allRouters bool) error
- func (m *MockProvider) QueryNodeDescription(ctx context.Context, networkAddress IEEEAddress) (NodeDescription, error)
- func (m *MockProvider) QueryNodeEndpointDescription(ctx context.Context, networkAddress IEEEAddress, endpoint Endpoint) (EndpointDescription, error)
- func (m *MockProvider) QueryNodeEndpoints(ctx context.Context, networkAddress IEEEAddress) ([]Endpoint, error)
- func (m *MockProvider) ReadEvent(ctx context.Context) (interface{}, error)
- func (m *MockProvider) RegisterAdapterEndpoint(ctx context.Context, endpoint Endpoint, appProfileId ProfileID, ...) error
- func (m *MockProvider) RequestNodeLeave(ctx context.Context, networkAddress IEEEAddress) error
- func (m *MockProvider) SendApplicationMessageToNode(ctx context.Context, destinationAddress IEEEAddress, ...) error
- func (m *MockProvider) UnbindNodeFromController(ctx context.Context, nodeAddress IEEEAddress, sourceEndpoint Endpoint, ...) error
- type NetworkAddress
- type NetworkConfiguration
- type NetworkJoining
- type NetworkKey
- type Node
- type NodeBinder
- type NodeDescription
- type NodeIncomingMessageEvent
- type NodeJoinEvent
- type NodeLeaveEvent
- type NodeQuerier
- type NodeRemover
- type NodeSender
- type NodeUpdateEvent
- type PANID
- type ProfileID
- type Provider
- type Relationship
- type SourceAddress
Constants ¶
View Source
const NoManufacturer = ManufacturerCode(0x0000)
Variables ¶
View Source
var ChannelToFrequencies = map[uint8]uint16{
11: 2405,
12: 2410,
13: 2415,
14: 2420,
15: 2425,
16: 2430,
17: 2435,
18: 2440,
19: 2445,
20: 2450,
21: 2455,
22: 2460,
23: 2465,
24: 2470,
25: 2475,
26: 2480,
}
View Source
var Channels = []uint8{11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26}
View Source
var DefaultChannel = ZLLChannels[1]
View Source
var EmptyIEEEAddress = IEEEAddress(0)
View Source
var TCLinkKey = NetworkKey{0x5a, 0x69, 0x67, 0x42, 0x65, 0x65, 0x41, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x30, 0x39}
View Source
var ZLLChannels = []uint8{11, 15, 20, 25}
Functions ¶
This section is empty.
Types ¶
type AdapterInfo ¶
type AdapterInfo interface {
AdapterNode() Node
}
type ApplicationMessage ¶
type EndpointDescription ¶
type EndpointRegistration ¶
type EventReceiver ¶
type ExtendedPANID ¶
type ExtendedPANID uint64
type IEEEAddress ¶
type IEEEAddress uint64
func GenerateLocalAdministeredIEEEAddress ¶
func GenerateLocalAdministeredIEEEAddress() IEEEAddress
func (IEEEAddress) String ¶
func (a IEEEAddress) String() string
type IncomingMessage ¶
type IncomingMessage struct { GroupID GroupID SourceAddress SourceAddress Broadcast bool Secure bool LinkQuality uint8 Sequence uint8 ApplicationMessage ApplicationMessage }
type LogicalType ¶
type LogicalType uint8
const ( Coordinator LogicalType = 0x00 Router LogicalType = 0x01 EndDevice LogicalType = 0x02 Unknown LogicalType = 0xff )
func (LogicalType) String ¶
func (l LogicalType) String() string
type ManufacturerCode ¶
type ManufacturerCode uint16
type MockProvider ¶
func (*MockProvider) AdapterNode ¶
func (m *MockProvider) AdapterNode() Node
func (*MockProvider) BindNodeToController ¶
func (m *MockProvider) BindNodeToController(ctx context.Context, nodeAddress IEEEAddress, sourceEndpoint Endpoint, destinationEndpoint Endpoint, cluster ClusterID) error
func (*MockProvider) ForceNodeLeave ¶
func (m *MockProvider) ForceNodeLeave(ctx context.Context, networkAddress IEEEAddress) error
func (*MockProvider) PermitJoin ¶
func (m *MockProvider) PermitJoin(ctx context.Context, allRouters bool) error
func (*MockProvider) QueryNodeDescription ¶
func (m *MockProvider) QueryNodeDescription(ctx context.Context, networkAddress IEEEAddress) (NodeDescription, error)
func (*MockProvider) QueryNodeEndpointDescription ¶
func (m *MockProvider) QueryNodeEndpointDescription(ctx context.Context, networkAddress IEEEAddress, endpoint Endpoint) (EndpointDescription, error)
func (*MockProvider) QueryNodeEndpoints ¶
func (m *MockProvider) QueryNodeEndpoints(ctx context.Context, networkAddress IEEEAddress) ([]Endpoint, error)
func (*MockProvider) ReadEvent ¶
func (m *MockProvider) ReadEvent(ctx context.Context) (interface{}, error)
func (*MockProvider) RegisterAdapterEndpoint ¶
func (*MockProvider) RequestNodeLeave ¶
func (m *MockProvider) RequestNodeLeave(ctx context.Context, networkAddress IEEEAddress) error
func (*MockProvider) SendApplicationMessageToNode ¶
func (m *MockProvider) SendApplicationMessageToNode(ctx context.Context, destinationAddress IEEEAddress, message ApplicationMessage, requireAck bool) error
func (*MockProvider) UnbindNodeFromController ¶
func (m *MockProvider) UnbindNodeFromController(ctx context.Context, nodeAddress IEEEAddress, sourceEndpoint Endpoint, destinationEndpoint Endpoint, cluster ClusterID) error
type NetworkAddress ¶
type NetworkAddress uint16
const ( BroadcastAll NetworkAddress = 0xffff BroadcastAlwaysOnReceivers NetworkAddress = 0xfffd BroadcastRoutersCoordinators NetworkAddress = 0xfffc BroadcastLowPowerRouters NetworkAddress = 0xfffb )
type NetworkConfiguration ¶
type NetworkConfiguration struct { PANID PANID ExtendedPANID ExtendedPANID NetworkKey NetworkKey Channel uint8 }
func GenerateNetworkConfiguration ¶
func GenerateNetworkConfiguration() (nc NetworkConfiguration, err error)
type NetworkJoining ¶
type NetworkKey ¶
type NetworkKey [16]byte
type Node ¶
type Node struct { IEEEAddress IEEEAddress NetworkAddress NetworkAddress LogicalType LogicalType LQI uint8 Depth uint8 LastDiscovered time.Time LastReceived time.Time }
type NodeBinder ¶
type NodeBinder interface { BindNodeToController(ctx context.Context, nodeAddress IEEEAddress, sourceEndpoint Endpoint, destinationEndpoint Endpoint, cluster ClusterID) error UnbindNodeFromController(ctx context.Context, nodeAddress IEEEAddress, sourceEndpoint Endpoint, destinationEndpoint Endpoint, cluster ClusterID) error }
type NodeDescription ¶
type NodeDescription struct { LogicalType LogicalType ManufacturerCode ManufacturerCode }
type NodeIncomingMessageEvent ¶
type NodeIncomingMessageEvent struct { Node IncomingMessage }
type NodeJoinEvent ¶
type NodeJoinEvent struct {
Node
}
type NodeLeaveEvent ¶
type NodeLeaveEvent struct {
Node
}
type NodeQuerier ¶
type NodeQuerier interface { QueryNodeDescription(ctx context.Context, networkAddress IEEEAddress) (NodeDescription, error) QueryNodeEndpoints(ctx context.Context, networkAddress IEEEAddress) ([]Endpoint, error) QueryNodeEndpointDescription(ctx context.Context, networkAddress IEEEAddress, endpoint Endpoint) (EndpointDescription, error) }
type NodeRemover ¶
type NodeRemover interface { RequestNodeLeave(ctx context.Context, networkAddress IEEEAddress) error ForceNodeLeave(ctx context.Context, networkAddress IEEEAddress) error }
type NodeSender ¶
type NodeSender interface {
SendApplicationMessageToNode(ctx context.Context, destinationAddress IEEEAddress, message ApplicationMessage, requireAck bool) error
}
type NodeUpdateEvent ¶
type NodeUpdateEvent struct {
Node
}
type ProfileID ¶
type ProfileID uint16
const ( ProfileIndustrialPlantMonitoring ProfileID = 0x0101 ProfileHomeAutomation ProfileID = 0x0104 ProfileCommercialBuildingAutomation ProfileID = 0x0105 ProfileTelecomApplications ProfileID = 0x0107 ProfilePersonalHomeAndHospitalCare ProfileID = 0x0108 ProfileAdvancedMeteringInitiative ProfileID = 0x0109 )
type Provider ¶
type Provider interface { NetworkJoining AdapterInfo NodeQuerier NodeBinder NodeSender NodeRemover EventReceiver EndpointRegistration }
type Relationship ¶
type Relationship uint8
const ( RelationshipParent Relationship = 0x00 RelationshipChild Relationship = 0x01 RelationshipSibling Relationship = 0x02 RelationshipUnknown Relationship = 0x03 )
type SourceAddress ¶
type SourceAddress struct { IEEEAddress IEEEAddress NetworkAddress NetworkAddress }
Click to show internal directories.
Click to hide internal directories.