Modules#
Device Table#
API and Callbacks for the Device Table Component.
Simple C-based rules engine for demonstrating automatic control through a gateway.
API#
Send a message using the device table.
Send a message using the device table.
Send a CLI command based on an index and an endpoint.
Send an internally-generated command.
Send an internally-generated command.
Send an internally-generated command.
Compute the EUI64 from the node ID in the device table.
Compute the node ID from the device table index.
Find the endpoint index from node ID and endpoint number.
Find the index based on the node ID.
Find the index based on the EUI64.
Find the index based on the EUI64 and endpoint.
Find the node ID based on the EUI64.
Change the device status based on the last sent message.
Send a leave message to a device based on the index.
Inform the device table that a message was received.
Kick off device table route repair.
Return a pointer to the device table structure.
Return a pointer to the device table entry.
Inform the device table that a new device joined.
Calculate time since the device heard the last message.
Return true if the two EUI64 parameters match.
Clear the device table.
Called when a device has been removed from the device table.
Called when the device table has been initialized.
Enumerations#
Typedefs#
Macros#
API Documentation#
emberAfDeviceTableCliIndexSend#
void emberAfDeviceTableCliIndexSend (uint16_t index)
Send a message using the device table.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | index | The index of the device to which to send the CLI command. |
Sends the current framework ZCL command to the device specified by an index.
79
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableSend#
void emberAfDeviceTableSend (EmberEUI64 eui64, uint8_t endpoint)
Send a message using the device table.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEUI64 | N/A | eui64 | EUI64 to which to send the CLI command. |
uint8_t | N/A | endpoint | Endpoint of the device to which to send the CLI command. |
Sends the current framework ZCL command using a device specified by the EUI64 and endpoint.
89
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableCliIndexSendWithEndpoint#
void emberAfDeviceTableCliIndexSendWithEndpoint (uint16_t index, uint8_t endpoint)
Send a CLI command based on an index and an endpoint.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | index | The index of the device to which to send the command. |
uint8_t | N/A | endpoint | The endpoint of the device to which to send the command. |
Sends the current framework ZCL command using a device indexed in the device table.
99
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableCommandIndexSend#
void emberAfDeviceTableCommandIndexSend (uint16_t index)
Send an internally-generated command.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | index | index of the device to which to send the command. |
Sends an internally-generated command, such as generated by the emberAfFillCommandOnOffClusterOn(); command. Note: this is different from the above send command, which works with the CLI-generated outgoing commands.
111
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableCommandSendWithEndpoint#
void emberAfDeviceTableCommandSendWithEndpoint (EmberEUI64 eui64, uint8_t endpoint)
Send an internally-generated command.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEUI64 | N/A | eui64 | EUI64 of the device to which to send the command. |
uint8_t | N/A | endpoint | The endpoint of the device to which to send the command. |
Sends an internally-generated command, such as generated by the emberAfFillCommandOnOffClusterOn(); command. Note: this is different from the above send command, which works with the CLI-generated outgoing commands.
123
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableCommandIndexSendWithEndpoint#
void emberAfDeviceTableCommandIndexSendWithEndpoint (uint16_t index, uint8_t endpoint)
Send an internally-generated command.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | index | The index of the device to which to send the command. |
uint8_t | N/A | endpoint | The endpoint of the device to which to send the command. |
Sends an internally-generated command, such as generated by the emberAfFillCommandOnOffClusterOn(); command. Note: this is different from the above send command, which works with the CLI-generated outgoing commands.
136
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableGetEui64FromNodeId#
bool emberAfDeviceTableGetEui64FromNodeId (EmberNodeId emberNodeId, EmberEUI64 eui64)
Compute the EUI64 from the node ID in the device table.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | emberNodeId | The node ID of the device. |
EmberEUI64 | N/A | eui64 | The location of the EUI64 variable. |
This function looks up the device-table entry using the node ID and return the EUI64.
Returns
bool True if an EUI can be found, false if not.
149
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableGetNodeIdFromIndex#
uint16_t emberAfDeviceTableGetNodeIdFromIndex (uint16_t index)
Compute the node ID from the device table index.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | index | The index of the device. |
Looks up the device table entry based on the index and returns the node ID.
Returns
The node ID of the device.
161
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableGetEndpointFromNodeIdAndEndpoint#
uint16_t emberAfDeviceTableGetEndpointFromNodeIdAndEndpoint (EmberNodeId emberNodeId, uint8_t endpoint)
Find the endpoint index from node ID and endpoint number.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | emberNodeId | The node ID of the device. |
uint8_t | N/A | endpoint | The desired endpoint. |
Computes the index into the endpoint table based on the node ID and the endpoint number.
Returns
The index of the device.
173
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableGetIndexFromNodeId#
uint16_t emberAfDeviceTableGetIndexFromNodeId (EmberNodeId emberNodeId)
Find the index based on the node ID.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | emberNodeId | The node ID of the current device. |
Computes the device-table index based on the node ID.
Returns
The index in the device-table.
184
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableGetFirstIndexFromEui64#
uint16_t emberAfDeviceTableGetFirstIndexFromEui64 (EmberEUI64 eui64)
Find the index based on the EUI64.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEUI64 | N/A | eui64 | EUI64 of the desired node ID. |
Computes the first device table index from the EUI64.
Returns
The first index that matches the EUI64.
194
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableGetIndexFromEui64AndEndpoint#
uint16_t emberAfDeviceTableGetIndexFromEui64AndEndpoint (EmberEUI64 eui64, uint8_t endpoint)
Find the index based on the EUI64 and endpoint.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEUI64 | N/A | eui64 | EUI64 of the desired index. |
uint8_t | N/A | endpoint | The endpoint for the desired index. |
Computes the node ID based on the device table entry that matches the EUI64.
Returns
Index that matches the EUI64
205
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableGetNodeIdFromEui64#
uint16_t emberAfDeviceTableGetNodeIdFromEui64 (EmberEUI64 eui64)
Find the node ID based on the EUI64.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEUI64 | N/A | eui64 | EUI64 of the desired node ID. |
Computes the node ID based on the device table entry that matches the EUI64.
Returns
The node ID that matches the EUI64.
216
of file app/framework/plugin/device-table/device-table.h
emberAfPluginDeviceTableMessageSentStatus#
void emberAfPluginDeviceTableMessageSentStatus (EmberNodeId nodeId, EmberStatus status, uint16_t profileId, uint16_t clusterId)
Change the device status based on the last sent message.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | nodeId | The node ID in the last outgoing message. |
EmberStatus | N/A | status | EmberStatus of the last outgoing message. |
uint16_t | N/A | profileId | The profile ID of the last outgoing message. |
uint16_t | N/A | clusterId | The cluster ID of the last outgoing message. |
If the last sent message was a success, change the device state to "joined". However, if the last message sent was not a success, change the device state to unresponsive.
229
of file app/framework/plugin/device-table/device-table.h
emberAfPluginDeviceTableSendLeave#
void emberAfPluginDeviceTableSendLeave (uint16_t index)
Send a leave message to a device based on the index.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | index | The index of the device to whom to send the leave message. |
Sends a leave message to the device indicated by the index.
240
of file app/framework/plugin/device-table/device-table.h
emberAfPluginDeviceTableMessageReceived#
void emberAfPluginDeviceTableMessageReceived (EmberNodeId nodeId)
Inform the device table that a message was received.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | nodeId | The node ID from which the last incoming message came. |
The device table keeps track of whether a device has become unresponsive. Hearing from a known device causes the device table to transition the device state from "unresponsive" to "joined". Hearing from an unknown device causes the device table to discover the device, potentially fixing routing issues (i.e., if the node ID has changed).
252
of file app/framework/plugin/device-table/device-table.h
emberAfPluginDeviceTableInitiateRouteRepair#
void emberAfPluginDeviceTableInitiateRouteRepair (EmberNodeId nodeId)
Kick off device table route repair.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | nodeId | The node ID of the newly unresponsive node. |
A message was sent to the device and failed. Therefore, the route repair will be attempted and the node marked as unresponsive. Currently, route repair simply sends a broadcast message looking for the node ID based on the EUI64. It may be replaced with something more sophisticated in the future.
264
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTablePointer#
EmberAfPluginDeviceTableEntry* emberAfDeviceTablePointer (void )
Return a pointer to the device table structure.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns a pointer to the device table structure.
Returns
A pointer to the device table structure.
272
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableFindDeviceTableEntry#
EmberAfPluginDeviceTableEntry* emberAfDeviceTableFindDeviceTableEntry (uint16_t index)
Return a pointer to the device table entry.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | index | The index of the device table entry in which we are interested. |
Returns a pointer to the device table entry based on the device table index.
Returns
A pointer to the device table entry.
282
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableNewDeviceJoinHandler#
void emberAfDeviceTableNewDeviceJoinHandler (EmberNodeId newNodeId, EmberEUI64 newNodeEui64)
Inform the device table that a new device joined.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | newNodeId | The node ID of the newly joined device. |
EmberEUI64 | N/A | newNodeEui64 | The EUI64 of the newly joined device. |
Call this function in the device table when a device joins, rejoins, or sends an end-device announce. If the device is new, it will generate a new device table entry and kick off the discovery process. If the device is not new, the device-table will make sure the node ID matches the EUI64 and make an update if necessary. It will also check to verify the discovery process has completed and attempt to complete it.
298
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableTimeSinceLastMessage#
uint32_t emberAfDeviceTableTimeSinceLastMessage (uint16_t index)
Calculate time since the device heard the last message.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | index | The index of the device. |
Computes the amount of time, in seconds, since receiving a message from the device.
Returns
The time since the last message (in seconds).
310
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableMatchEui64#
bool emberAfDeviceTableMatchEui64 (EmberEUI64 a, EmberEUI64 b)
Return true if the two EUI64 parameters match.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEUI64 | N/A | a | The first EUI64 to compare. |
EmberEUI64 | N/A | b | The second EUI64 to compare. |
Determines whether two EUI64 values are the same. The function will print a feedback message to indicate if both EUI64 values are NULL. The function will also print out a feedback message to indicate if the EUI64 values match but in reverse order.
322
of file app/framework/plugin/device-table/device-table.h
emberAfDeviceTableClear#
void emberAfDeviceTableClear (void )
Clear the device table.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Clears the device table and the backup file of the device table is also cleared if it is a host.
330
of file app/framework/plugin/device-table/device-table.h
emberAfPluginDeviceTableIndexRemovedCallback#
void emberAfPluginDeviceTableIndexRemovedCallback (uint16_t currentIndex)
Called when a device has been removed from the device table.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | currentIndex | Index of the removed device. |
Called when the device has been removed from the table.
338
of file app/framework/plugin/device-table/device-table.h
emberAfPluginDeviceTableInitialized#
void emberAfPluginDeviceTableInitialized (void )
Called when the device table has been initialized.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Called when the device table has been initialized
345
of file app/framework/plugin/device-table/device-table.h
Enumeration Documentation#
EmberAfPluginDeviceTableDeviceState#
EmberAfPluginDeviceTableDeviceState
Enumerator | |
---|---|
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_NULL | |
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_JOINED | |
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_UNRESPONSIVE | |
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_LEAVE_SENT | |
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_LEFT | |
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_UNKNOWN |
41
of file app/framework/plugin/device-table/device-table.h
Typedef Documentation#
EmberAfPluginDeviceTableDeviceState#
typedef uint8_t EmberAfPluginDeviceTableDeviceState
35
of file app/framework/plugin/device-table/device-table.h