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.

emberAfPluginDeviceDatabaseFindDeviceByStatus(EmberAfDeviceDiscoveryStatus status)

Find device by status.

Find device by EUI64.

emberAfPluginDeviceDatabaseAdd(EmberEUI64 eui64, uint8_t zigbeeCapabilities)

add to the device database

bool

Erase device from device database.

bool
emberAfPluginDeviceDatabaseSetEndpoints(const EmberEUI64 eui64, const uint8_t *endpointList, uint8_t endpointCount)

Set device endpoints.

uint8_t
emberAfPluginDeviceDatabaseGetDeviceEndpointFromIndex(const EmberEUI64 eui64, uint8_t index)

Get device endpoint from index.

uint8_t
emberAfPluginDeviceDatabaseGetIndexFromEndpoint(uint8_t endpoint, const EmberEUI64 eui64)

Get index from endpoint.

bool
emberAfPluginDeviceDatabaseSetClustersForEndpoint(const EmberEUI64 eui64, const EmberAfClusterList *clusterList)

Set clusters from endpoint.

bool

Clears the failed DB discovery count.

const char *
emberAfPluginDeviceDatabaseGetStatusString(EmberAfDeviceDiscoveryStatus status)

Get device database status string.

bool
emberAfPluginDeviceDatabaseSetStatus(const EmberEUI64 deviceEui64, EmberAfDeviceDiscoveryStatus newStatus)

Set device database status.

emberAfPluginDeviceDatabaseAddDeviceWithAllInfo(const EmberAfDeviceInfo *newDevice)

Add device to database with all information.

EmberStatus
emberAfPluginDeviceDatabaseDoesDeviceHaveCluster(EmberEUI64 deviceEui64, EmberAfClusterId clusterToFind, bool server, uint8_t *returnEndpoint)

Checks if a device has cluster.

void
emberAfPluginDeviceDatabaseCreateNewSearch(EmberAfDeviceDatabaseIterator *iterator)

create a new search

EmberStatus
emberAfPluginDeviceDatabaseFindDeviceSupportingCluster(EmberAfDeviceDatabaseIterator *iterator, EmberAfClusterId clusterToFind, bool server, uint8_t *returnEndpoint)

Find device supporting cluster.

API Documentation#

emberAfPluginDeviceDatabaseGetDeviceByIndex#

const EmberAfDeviceInfo* emberAfPluginDeviceDatabaseGetDeviceByIndex (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

emberAfPluginDeviceDatabaseFindDeviceByStatus#

const EmberAfDeviceInfo* emberAfPluginDeviceDatabaseFindDeviceByStatus (EmberAfDeviceDiscoveryStatus 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

emberAfPluginDeviceDatabaseFindDeviceByEui64#

const EmberAfDeviceInfo* emberAfPluginDeviceDatabaseFindDeviceByEui64 (EmberEUI64 eui64)

Find device by EUI64.

Parameters
N/Aeui64

Returns


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

emberAfPluginDeviceDatabaseAdd#

const EmberAfDeviceInfo* emberAfPluginDeviceDatabaseAdd (EmberEUI64 eui64, uint8_t zigbeeCapabilities)

add to the device database

Parameters
N/Aeui64

Ver.: always

N/AzigbeeCapabilities

Ver.: always

Returns

  • EmberDeviceInfo


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

emberAfPluginDeviceDatabaseEraseDevice#

bool emberAfPluginDeviceDatabaseEraseDevice (EmberEUI64 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

emberAfPluginDeviceDatabaseSetEndpoints#

bool emberAfPluginDeviceDatabaseSetEndpoints (const EmberEUI64 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

emberAfPluginDeviceDatabaseGetDeviceEndpointFromIndex#

uint8_t emberAfPluginDeviceDatabaseGetDeviceEndpointFromIndex (const EmberEUI64 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

emberAfPluginDeviceDatabaseGetIndexFromEndpoint#

uint8_t emberAfPluginDeviceDatabaseGetIndexFromEndpoint (uint8_t endpoint, const EmberEUI64 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

emberAfPluginDeviceDatabaseSetClustersForEndpoint#

bool emberAfPluginDeviceDatabaseSetClustersForEndpoint (const EmberEUI64 eui64, const EmberAfClusterList * 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

emberAfPluginDeviceDatabaseClearAllFailedDiscoveryStatus#

bool emberAfPluginDeviceDatabaseClearAllFailedDiscoveryStatus (uint8_t maxFailureCount)

Clears 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

emberAfPluginDeviceDatabaseGetStatusString#

const char* emberAfPluginDeviceDatabaseGetStatusString (EmberAfDeviceDiscoveryStatus 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

emberAfPluginDeviceDatabaseSetStatus#

bool emberAfPluginDeviceDatabaseSetStatus (const EmberEUI64 deviceEui64, EmberAfDeviceDiscoveryStatus 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

emberAfPluginDeviceDatabaseAddDeviceWithAllInfo#

const EmberAfDeviceInfo* emberAfPluginDeviceDatabaseAddDeviceWithAllInfo (const EmberAfDeviceInfo * newDevice)

Add device to database with all information.

Parameters
N/AnewDevice

Struct pointer to device infor

Returns

  • EmberDeviceInfo


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

emberAfPluginDeviceDatabaseDoesDeviceHaveCluster#

EmberStatus emberAfPluginDeviceDatabaseDoesDeviceHaveCluster (EmberEUI64 deviceEui64, EmberAfClusterId clusterToFind, bool server, uint8_t * returnEndpoint)

Checks if a device has cluster.

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

Returns

  • EmberStatus status code


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

emberAfPluginDeviceDatabaseCreateNewSearch#

void emberAfPluginDeviceDatabaseCreateNewSearch (EmberAfDeviceDatabaseIterator * iterator)

create a new search

Parameters
N/Aiterator

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

emberAfPluginDeviceDatabaseFindDeviceSupportingCluster#

EmberStatus emberAfPluginDeviceDatabaseFindDeviceSupportingCluster (EmberAfDeviceDatabaseIterator * iterator, EmberAfClusterId clusterToFind, bool server, uint8_t * returnEndpoint)

Find device supporting cluster.

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

Returns

  • EmberStatus status code


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