Modules#

EmberAfPluginDeviceTableEntry

Device Table#

API and Callbacks for the Device Table Component.

Simple C-based rules engine for demonstrating automatic control through a gateway.

API#

void

Send a message using the device table.

void
emberAfDeviceTableSend(EmberEUI64 eui64, uint8_t endpoint)

Send a message using the device table.

void
emberAfDeviceTableCliIndexSendWithEndpoint(uint16_t index, uint8_t endpoint)

Send a CLI command based on an index and an endpoint.

void

Send an internally-generated command.

void
emberAfDeviceTableCommandSendWithEndpoint(EmberEUI64 eui64, uint8_t endpoint)

Send an internally-generated command.

void
emberAfDeviceTableCommandIndexSendWithEndpoint(uint16_t index, uint8_t endpoint)

Send an internally-generated command.

bool
emberAfDeviceTableGetEui64FromNodeId(EmberNodeId emberNodeId, EmberEUI64 eui64)

Compute the EUI64 from the node ID in the device table.

uint16_t

Compute the node ID from the device table index.

uint16_t
emberAfDeviceTableGetEndpointFromNodeIdAndEndpoint(EmberNodeId emberNodeId, uint8_t endpoint)

Find the endpoint index from node ID and endpoint number.

uint16_t
emberAfDeviceTableGetIndexFromNodeId(EmberNodeId emberNodeId)

Find the index based on the node ID.

uint16_t

Find the index based on the EUI64.

uint16_t
emberAfDeviceTableGetIndexFromEui64AndEndpoint(EmberEUI64 eui64, uint8_t endpoint)

Find the index based on the EUI64 and endpoint.

uint16_t

Find the node ID based on the EUI64.

void
emberAfPluginDeviceTableMessageSentStatus(EmberNodeId nodeId, EmberStatus status, uint16_t profileId, uint16_t clusterId)

Change the device status based on the last sent message.

void

Send a leave message to a device based on the index.

void

Inform the device table that a message was received.

void

Kick off device table route repair.

Return a pointer to the device table structure.

Return a pointer to the device table entry.

void
emberAfDeviceTableNewDeviceJoinHandler(EmberNodeId newNodeId, EmberEUI64 newNodeEui64)

Inform the device table that a new device joined.

uint32_t

Calculate time since the device heard the last message.

bool
emberAfDeviceTableMatchEui64(EmberEUI64 a, EmberEUI64 b)

Return true if the two EUI64 parameters match.

void

Clear the device table.

Enumerations#

enum
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_NULL = 0x00
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_JOINED = 0x10
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_UNRESPONSIVE = 0x11
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_LEAVE_SENT = 0x20
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_LEFT = 0x30
EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_UNKNOWN = 0xff
}

Macros#

#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define

API Documentation#

emberAfDeviceTableCliIndexSend#

void emberAfDeviceTableCliIndexSend (uint16_t index)

Send a message using the device table.

Parameters
N/Aindex

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.


Definition at line 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.

Parameters
N/Aeui64

EUI64 to which to send the CLI command.

N/Aendpoint

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.


Definition at line 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.

Parameters
N/Aindex

The index of the device to which to send the command.

N/Aendpoint

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.


Definition at line 99 of file app/framework/plugin/device-table/device-table.h

emberAfDeviceTableCommandIndexSend#

void emberAfDeviceTableCommandIndexSend (uint16_t index)

Send an internally-generated command.

Parameters
N/Aindex

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.


Definition at line 111 of file app/framework/plugin/device-table/device-table.h

emberAfDeviceTableCommandSendWithEndpoint#

void emberAfDeviceTableCommandSendWithEndpoint (EmberEUI64 eui64, uint8_t endpoint)

Send an internally-generated command.

Parameters
N/Aeui64

EUI64 of the device to which to send the command.

N/Aendpoint

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.


Definition at line 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.

Parameters
N/Aindex

The index of the device to which to send the command.

N/Aendpoint

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.


Definition at line 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.

Parameters
N/AemberNodeId

The node ID of the device.

N/Aeui64

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.


Definition at line 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.

Parameters
N/Aindex

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.


Definition at line 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.

Parameters
N/AemberNodeId

The node ID of the device.

N/Aendpoint

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.


Definition at line 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.

Parameters
N/AemberNodeId

The node ID of the current device.

Computes the device-table index based on the node ID.

Returns

  • The index in the device-table.


Definition at line 184 of file app/framework/plugin/device-table/device-table.h

emberAfDeviceTableGetFirstIndexFromEui64#

uint16_t emberAfDeviceTableGetFirstIndexFromEui64 (EmberEUI64 eui64)

Find the index based on the EUI64.

Parameters
N/Aeui64

EUI64 of the desired node ID.

Computes the first device table index from the EUI64.

Returns

  • The first index that matches the EUI64.


Definition at line 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.

Parameters
N/Aeui64

EUI64 of the desired index.

N/Aendpoint

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


Definition at line 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.

Parameters
N/Aeui64

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.


Definition at line 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.

Parameters
N/AnodeId

The node ID in the last outgoing message.

N/Astatus

EmberStatus of the last outgoing message.

N/AprofileId

The profile ID of the last outgoing message.

N/AclusterId

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.


Definition at line 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.

Parameters
N/Aindex

The index of the device to whom to send the leave message.

Sends a leave message to the device indicated by the index.


Definition at line 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.

Parameters
N/AnodeId

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).


Definition at line 252 of file app/framework/plugin/device-table/device-table.h

emberAfPluginDeviceTableInitiateRouteRepair#

void emberAfPluginDeviceTableInitiateRouteRepair (EmberNodeId nodeId)

Kick off device table route repair.

Parameters
N/AnodeId

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.


Definition at line 264 of file app/framework/plugin/device-table/device-table.h

emberAfDeviceTablePointer#

EmberAfPluginDeviceTableEntry* emberAfDeviceTablePointer (void )

Return a pointer to the device table structure.

Parameters
N/A

Returns a pointer to the device table structure.

Returns

  • A pointer to the device table structure.


Definition at line 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.

Parameters
N/Aindex

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.


Definition at line 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.

Parameters
N/AnewNodeId

The node ID of the newly joined device.

N/AnewNodeEui64

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.


Definition at line 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.

Parameters
N/Aindex

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).


Definition at line 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.

Parameters
N/Aa

The first EUI64 to compare.

N/Ab

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.


Definition at line 322 of file app/framework/plugin/device-table/device-table.h

emberAfDeviceTableClear#

void emberAfDeviceTableClear (void )

Clear the device table.

Parameters
N/A

Clears the device table and the backup file of the device table is also cleared if it is a host.


Definition at line 330 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

Definition at line 37 of file app/framework/plugin/device-table/device-table.h

Typedef Documentation#

EmberAfPluginDeviceTableDeviceState#

typedef uint8_t EmberAfPluginDeviceTableDeviceState

Definition at line 35 of file app/framework/plugin/device-table/device-table.h

Macro Definition Documentation#

EMBER_AF_PLUGIN_DEVICE_TABLE_CLUSTER_SIZE#

#define EMBER_AF_PLUGIN_DEVICE_TABLE_CLUSTER_SIZE
Value:
20

Definition at line 50 of file app/framework/plugin/device-table/device-table.h

EMBER_AF_PLUGIN_DEVICE_TABLE_DEVICE_TABLE_SIZE#

#define EMBER_AF_PLUGIN_DEVICE_TABLE_DEVICE_TABLE_SIZE
Value:
250

Definition at line 63 of file app/framework/plugin/device-table/device-table.h

EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_NODE_ID#

#define EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_NODE_ID
Value:
0xffff

Definition at line 64 of file app/framework/plugin/device-table/device-table.h

EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_INDEX#

#define EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_INDEX
Value:
0xffff

Definition at line 65 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_ON_OFF_SWITCH#

#define DEVICE_ID_ON_OFF_SWITCH
Value:
0x0000

Definition at line 335 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_LEVEL_CONTROL_SWITCH#

#define DEVICE_ID_LEVEL_CONTROL_SWITCH
Value:
0x0001

Definition at line 336 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_ON_OFF_OUTPUT#

#define DEVICE_ID_ON_OFF_OUTPUT
Value:
0x0002

Definition at line 337 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_LEVEL_CONTROL_OUTPUT#

#define DEVICE_ID_LEVEL_CONTROL_OUTPUT
Value:
0x0003

Definition at line 338 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_SCENE_SELECTOR#

#define DEVICE_ID_SCENE_SELECTOR
Value:
0x0004

Definition at line 339 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_CONFIG_TOOL#

#define DEVICE_ID_CONFIG_TOOL
Value:
0x0005

Definition at line 340 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_REMOTE_CONTROL#

#define DEVICE_ID_REMOTE_CONTROL
Value:
0x0006

Definition at line 341 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_COMBINED_INTERFACE#

#define DEVICE_ID_COMBINED_INTERFACE
Value:
0x0007

Definition at line 342 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_RANGE_EXTENDER#

#define DEVICE_ID_RANGE_EXTENDER
Value:
0x0008

Definition at line 343 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_MAINS_POWER_OUTLET#

#define DEVICE_ID_MAINS_POWER_OUTLET
Value:
0x0009

Definition at line 344 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_DOOR_LOCK#

#define DEVICE_ID_DOOR_LOCK
Value:
0x000a

Definition at line 345 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_DOOR_LOCK_CONTROLLER#

#define DEVICE_ID_DOOR_LOCK_CONTROLLER
Value:
0x000b

Definition at line 346 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_SIMPLE_SENSOR#

#define DEVICE_ID_SIMPLE_SENSOR
Value:
0x000c

Definition at line 347 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_CONSUMPTION_AWARENESS_DEVICE#

#define DEVICE_ID_CONSUMPTION_AWARENESS_DEVICE
Value:
0x000d

Definition at line 348 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_HOME_GATEWAY#

#define DEVICE_ID_HOME_GATEWAY
Value:
0x0050

Definition at line 349 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_SMART_PLUG#

#define DEVICE_ID_SMART_PLUG
Value:
0x0051

Definition at line 350 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_WHITE_GOODS#

#define DEVICE_ID_WHITE_GOODS
Value:
0x0052

Definition at line 351 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_METER_INTERFACE#

#define DEVICE_ID_METER_INTERFACE
Value:
0x0053

Definition at line 352 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_ON_OFF_LIGHT#

#define DEVICE_ID_ON_OFF_LIGHT
Value:
0x0100

Definition at line 354 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_DIMMABLE_LIGHT#

#define DEVICE_ID_DIMMABLE_LIGHT
Value:
0x0101

Definition at line 355 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_COLOR_DIMMABLE_LIGHT#

#define DEVICE_ID_COLOR_DIMMABLE_LIGHT
Value:
0x0102

Definition at line 356 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_ON_OFF_LIGHT_SWITCH#

#define DEVICE_ID_ON_OFF_LIGHT_SWITCH
Value:
0x0103

Definition at line 357 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_DIMMER_SWITCH#

#define DEVICE_ID_DIMMER_SWITCH
Value:
0x0104

Definition at line 358 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_COLOR_DIMMER_SWITCH#

#define DEVICE_ID_COLOR_DIMMER_SWITCH
Value:
0x0105

Definition at line 359 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_LIGHT_SENSOR#

#define DEVICE_ID_LIGHT_SENSOR
Value:
0x0106

Definition at line 360 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_OCCUPANCY_SENSOR#

#define DEVICE_ID_OCCUPANCY_SENSOR
Value:
0x0107

Definition at line 361 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_SHADE#

#define DEVICE_ID_SHADE
Value:
0x0200

Definition at line 363 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_SHADE_CONTROLLER#

#define DEVICE_ID_SHADE_CONTROLLER
Value:
0x0201

Definition at line 364 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_WINDOW_COVERING_DEVICE#

#define DEVICE_ID_WINDOW_COVERING_DEVICE
Value:
0x0202

Definition at line 365 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_WINDOW_COVERING_CONTROLLER#

#define DEVICE_ID_WINDOW_COVERING_CONTROLLER
Value:
0x0203

Definition at line 366 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_HEATING_COOLING_UNIT#

#define DEVICE_ID_HEATING_COOLING_UNIT
Value:
0x0300

Definition at line 368 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_THERMOSTAT#

#define DEVICE_ID_THERMOSTAT
Value:
0x0301

Definition at line 369 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_TEMPERATURE_SENSOR#

#define DEVICE_ID_TEMPERATURE_SENSOR
Value:
0x0302

Definition at line 370 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_PUMP#

#define DEVICE_ID_PUMP
Value:
0x0303

Definition at line 371 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_PUMP_CONTROLLER#

#define DEVICE_ID_PUMP_CONTROLLER
Value:
0x0304

Definition at line 372 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_PRESSURE_SENSOR#

#define DEVICE_ID_PRESSURE_SENSOR
Value:
0x0305

Definition at line 373 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_FLOW_SENSOR#

#define DEVICE_ID_FLOW_SENSOR
Value:
0x0306

Definition at line 374 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_MINI_SPLIT_AC#

#define DEVICE_ID_MINI_SPLIT_AC
Value:
0x0307

Definition at line 375 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_IAS_CIE#

#define DEVICE_ID_IAS_CIE
Value:
0x0400

Definition at line 377 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_IAS_ANCILLARY_CONTROL#

#define DEVICE_ID_IAS_ANCILLARY_CONTROL
Value:
0x0401

Definition at line 378 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_IAS_ZONE#

#define DEVICE_ID_IAS_ZONE
Value:
0x0402

Definition at line 379 of file app/framework/plugin/device-table/device-table.h

DEVICE_ID_IAS_WARNING#

#define DEVICE_ID_IAS_WARNING
Value:
0x0403

Definition at line 380 of file app/framework/plugin/device-table/device-table.h