Device Database#
API and Callbacks for the Device Database Component.
This component provides an API to add/remove a device from a list of known devices, and to record their list of endpoints and clusters.
API#
Get device by index.
Find device by status.
Find device by EUI64.
Add to the device database.
Erase device from device database.
Set device endpoints.
Get device endpoint from index.
Get index from endpoint.
Set clusters from endpoint.
Clear the failed DB discovery count.
Get device database status string.
Set device database status.
Add device to database with all information.
Check if a device has cluster.
Create a new search.
Find device supporting cluster.
API Documentation#
sl_zigbee_af_device_database_get_device_by_index#
const sl_zigbee_af_device_info_t * sl_zigbee_af_device_database_get_device_by_index (uint16_t index)
Get device by index.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | index | Ver.: always |
Returns
sl_zigbee_af_device_info_t Device Information struct
sl_zigbee_af_device_database_find_device_by_status#
const sl_zigbee_af_device_info_t * sl_zigbee_af_device_database_find_device_by_status (sl_zigbee_af_device_discovery_status_t status)
Find device by status.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_zigbee_af_device_discovery_status_t | N/A | status | Ver.: always |
Returns
sl_zigbee_af_device_info_t Device Information struct
sl_zigbee_af_device_database_find_device_by_eui64#
const sl_zigbee_af_device_info_t * sl_zigbee_af_device_database_find_device_by_eui64 (sl_802154_long_addr_t eui64)
Find device by EUI64.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_802154_long_addr_t | N/A | eui64 |
Returns
sl_zigbee_af_device_info_t Device Information struct
sl_zigbee_af_device_database_add#
const sl_zigbee_af_device_info_t * sl_zigbee_af_device_database_add (sl_802154_long_addr_t eui64, uint8_t zigbeeCapabilities)
Add to the device database.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_802154_long_addr_t | N/A | eui64 | Ver.: always |
uint8_t | N/A | zigbeeCapabilities | Ver.: always |
Returns
sl_zigbee_device_info_t
sl_zigbee_af_device_database_erase_device#
bool sl_zigbee_af_device_database_erase_device (sl_802154_long_addr_t eui64)
Erase device from device database.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_802154_long_addr_t | N/A | eui64 | Ver.: always |
Returns
bool true is success
sl_zigbee_af_device_database_set_endpoints#
bool sl_zigbee_af_device_database_set_endpoints (const sl_802154_long_addr_t eui64, const uint8_t * endpointList, uint8_t endpointCount)
Set device endpoints.
Type | Direction | Argument Name | Description |
---|---|---|---|
const sl_802154_long_addr_t | N/A | eui64 | |
const uint8_t * | N/A | endpointList | |
uint8_t | N/A | endpointCount |
Returns
bool true is success
sl_zigbee_af_device_database_get_device_endpoint_from_index#
uint8_t sl_zigbee_af_device_database_get_device_endpoint_from_index (const sl_802154_long_addr_t eui64, uint8_t index)
Get device endpoint from index.
Type | Direction | Argument Name | Description |
---|---|---|---|
const sl_802154_long_addr_t | N/A | eui64 | |
uint8_t | N/A | index |
Returns
uint8_t
sl_zigbee_af_device_database_get_index_from_endpoint#
uint8_t sl_zigbee_af_device_database_get_index_from_endpoint (uint8_t endpoint, const sl_802154_long_addr_t eui64)
Get index from endpoint.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
const sl_802154_long_addr_t | N/A | eui64 |
Note
Explicitly made the eui64 the second argument to prevent confusion between this function and the emberAfPluginDeviceDatabaseGetDeviceEndpointsFromIndex()
sl_zigbee_af_device_database_set_clusters_for_endpoint#
bool sl_zigbee_af_device_database_set_clusters_for_endpoint (const sl_802154_long_addr_t eui64, const sl_zigbee_af_cluster_list_t * clusterList)
Set clusters from endpoint.
Type | Direction | Argument Name | Description |
---|---|---|---|
const sl_802154_long_addr_t | N/A | eui64 | |
const sl_zigbee_af_cluster_list_t * | N/A | clusterList |
Returns
bool true is success
sl_zigbee_af_device_database_clear_all_failed_discovery_status#
bool sl_zigbee_af_device_database_clear_all_failed_discovery_status (uint8_t maxFailureCount)
Clear the failed DB discovery count.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | maxFailureCount |
Returns
bool true is success
sl_zigbee_af_device_database_get_status_string#
const char * sl_zigbee_af_device_database_get_status_string (sl_zigbee_af_device_discovery_status_t status)
Get device database status string.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_zigbee_af_device_discovery_status_t | N/A | status |
Returns
const char* status string
sl_zigbee_af_device_database_set_status#
bool sl_zigbee_af_device_database_set_status (const sl_802154_long_addr_t deviceEui64, sl_zigbee_af_device_discovery_status_t newStatus)
Set device database status.
Type | Direction | Argument Name | Description |
---|---|---|---|
const sl_802154_long_addr_t | N/A | deviceEui64 | |
sl_zigbee_af_device_discovery_status_t | N/A | newStatus |
Returns
bool true is success.
sl_zigbee_af_device_database_add_device_with_all_info#
const sl_zigbee_af_device_info_t * sl_zigbee_af_device_database_add_device_with_all_info (const sl_zigbee_af_device_info_t * newDevice)
Add device to database with all information.
Type | Direction | Argument Name | Description |
---|---|---|---|
const sl_zigbee_af_device_info_t * | N/A | newDevice | Struct pointer to device infor |
Returns
sl_zigbee_device_info_t
sl_zigbee_af_device_database_does_device_have_cluster#
sl_status_t sl_zigbee_af_device_database_does_device_have_cluster (sl_802154_long_addr_t deviceEui64, sl_zigbee_af_cluster_id_t clusterToFind, bool server, uint8_t * returnEndpoint)
Check if a device has cluster.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_802154_long_addr_t | N/A | deviceEui64 | |
sl_zigbee_af_cluster_id_t | N/A | clusterToFind | |
bool | N/A | server | |
uint8_t * | N/A | returnEndpoint |
Returns
sl_status_t status code
sl_zigbee_af_device_database_create_new_search#
void sl_zigbee_af_device_database_create_new_search (sl_zigbee_af_device_database_iterator_t * iterator)
Create a new search.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_zigbee_af_device_database_iterator_t * | N/A | iterator |
sl_zigbee_af_device_database_find_device_supporting_cluster#
sl_status_t sl_zigbee_af_device_database_find_device_supporting_cluster (sl_zigbee_af_device_database_iterator_t * iterator, sl_zigbee_af_cluster_id_t clusterToFind, bool server, uint8_t * returnEndpoint)
Find device supporting cluster.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_zigbee_af_device_database_iterator_t * | N/A | iterator | |
sl_zigbee_af_cluster_id_t | N/A | clusterToFind | |
bool | N/A | server | |
uint8_t * | N/A | returnEndpoint |
Returns
sl_status_t status code