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#

sl_zigbee_af_device_database_find_device_by_status(sl_zigbee_af_device_discovery_status_t status)

Find device by status.

Find device by EUI64.

sl_zigbee_af_device_database_add(sl_802154_long_addr_t eui64, uint8_t zigbeeCapabilities)

Add to the device database.

bool
sl_zigbee_af_device_database_erase_device(sl_802154_long_addr_t eui64)

Erase device from device database.

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.

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.

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.

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.

bool

Clear the failed DB discovery count.

const char *
sl_zigbee_af_device_database_get_status_string(sl_zigbee_af_device_discovery_status_t status)

Get device database status string.

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.

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.

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.

void
sl_zigbee_af_device_database_create_new_search(sl_zigbee_af_device_database_iterator_t *iterator)

Create a new search.

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.

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.

Parameters
N/Aindex

Ver.: always

Returns


Definition at line 44 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/Astatus

Ver.: always

Returns


Definition at line 53 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/Aeui64

Returns


Definition at line 62 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/Aeui64

Ver.: always

N/AzigbeeCapabilities

Ver.: always

Returns

  • sl_zigbee_device_info_t


Definition at line 72 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/Aeui64

Ver.: always

Returns

  • bool true is success


Definition at line 81 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/Aeui64
N/AendpointList
N/AendpointCount

Returns

  • bool true is success


Definition at line 92 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/Aeui64
N/Aindex

Returns

  • uint8_t


Definition at line 104 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/Aendpoint
N/Aeui64

Note

  • Explicitly made the eui64 the second argument to prevent confusion between this function and the emberAfPluginDeviceDatabaseGetDeviceEndpointsFromIndex()


Definition at line 116 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/Aeui64
N/AclusterList

Returns

  • bool true is success


Definition at line 127 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/AmaxFailureCount

Returns

  • bool true is success


Definition at line 135 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/Astatus

Returns

  • const char* status string


Definition at line 144 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/AdeviceEui64
N/AnewStatus

Returns

  • bool true is success.


Definition at line 154 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/AnewDevice

Struct pointer to device infor

Returns

  • sl_zigbee_device_info_t


Definition at line 163 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/AdeviceEui64
N/AclusterToFind
N/Aserver
N/AreturnEndpoint

Returns

  • sl_status_t status code


Definition at line 175 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/Aiterator

Definition at line 185 of file app/framework/plugin/device-database/device-database.h

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.

Parameters
N/Aiterator
N/AclusterToFind
N/Aserver
N/AreturnEndpoint

Returns

  • sl_status_t status code


Definition at line 196 of file app/framework/plugin/device-database/device-database.h