0.前言
本文旨在说明创建endpoint。
创建哪一个endpoint,以及什么类型的endpoint。
1.函数原型
static QCLI_Command_Status_t cmd_ZB_CL_CreateEndpoint(uint32_t Parameter_Count, QCLI_Parameter_t *Parameter_List)
Parameter_Count:Parameter_List中有多少个元素
Parameter_List: 包含有实际值,Parameter_List[0]表示endpoint使用的数字,Parameter_List[1]表示endpoint的类型
2.常量
(1)endpoint使用的范围:
#define QAPI_ZB_APS_MIN_ENDPOINT (0x01) /**< Minimum endpoint that can be created. */
#define QAPI_ZB_APS_MAX_ENDPOINT (0xF0) /**< Maximum endpoint that can be created. */
(2)endpoint的类型范围
#define ZCL_DEMO_ENDPOINT_TYPE_START_INDEX (1)
#define ZCL_DEMO_MAX_CLUSTER_LIST_SIZE (16)
3.qapi_ZB_APS_Add_Endpoint_t
endpoint配置类型的结构体
typedef struct qapi_ZB_APS_Add_Endpoint_s
{
uint8_t Endpoint; //endpoint
uint8_t Version; //版本号
uint16_t ProfileId; //profile ID
uint16_t DeviceId; //endpoint 的设备ID
uint8_t InputClusterCount; //输入cluster的数量
const uint16_t *InputClusterList; //输入cluster的列表(服务器)
uint8_t OutputClusterCount; //输出cluster的数量
const uint16_t *OutputClusterList; //输出cluster的列表(客户端)
uint8_t BDBCommissioningMode; //BDB 调试模式
uint16_t BDBCommissioningGroupId; //BDB 调试组ID
} qapi_ZB_APS_Add_Endpoint_t;
4.ZCL_Demo_Cluster_Info_t
/*
Structure represents the information for a cluster.
*/
typedef struct ZCL_Demo_Cluster_Info_s
{
qapi_ZB_Cluster_t Handle; //cluster的handle
uint16_t ClusterID; //cluster的ID
uint8_t Endpoint; //cluster的endpoint
ZCL_Demo_ClusterType_t ClusterType; //指示cluster是服务器或者客户端
const char *ClusterName; //cluster的名称
const char *DeviceName; //cluster的设备名称
void *PrivData; //cluster的私有数据
ZCL_Cluster_Cleanup_CB_t Cleanup_CB; //cluster被移除时调用的函数
} ZCL_Demo_Cluster_Info_t;
5.源码