Endpoint API

Zigbee Endpoint related APIs for ESP Zigbee SDK.

API Reference

Header File

Functions

esp_zb_ep_list_t *esp_zb_ep_list_create(void)

Create an empty endpoint list.

Note

This endpoint list is ready to add endpoint refer esp_zb_ep_list_add_ep.

Returns

pointer to esp_zb_ep_list_s

esp_err_t esp_zb_ep_list_add_ep(esp_zb_ep_list_t *ep_list, esp_zb_cluster_list_t *cluster_list, esp_zb_endpoint_config_t endpoint_config)

Add an endpoint (which includes cluster list) in a endpoint list.

Parameters
  • ep_list[in] A pointer to endpoint list esp_zb_ep_list_s

  • cluster_list[in] An cluster list which wants to add to endpoint

  • endpoint_config[in] A specific endpoint config esp_zb_endpoint_config_s

Returns

  • ESP_OK on success

  • ESP_ERR_INVALID_ARG if endpoint list not initialized

esp_err_t esp_zb_ep_list_add_gateway_ep(esp_zb_ep_list_t *ep_list, esp_zb_cluster_list_t *cluster_list, esp_zb_endpoint_config_t endpoint_config)

Add a gateway endpoint to the endpoint list.

Parameters
Returns

  • ESP_OK on success.

  • ESP_ERR_NO_MEM if the number of gateways reaches the limit.

  • ESP_ERR_INVALID_ARG if the endpoint list is not initialized.

esp_zb_cluster_list_t *esp_zb_ep_list_get_ep(const esp_zb_ep_list_t *ep_list, uint8_t ep_id)

Get endpoint (cluster list) from a endpoint list.

Parameters
  • ep_list[in] A pointer to endpoint list esp_zb_ep_list_s

  • ep_id[in] The endpoint id for cluster list

Returns

  • pointer to esp_zb_cluster_list_s, if the endpoint is found in the endpoint list

  • NULL if endpoint is not found