1.这个问题是因为按照你的配置basic cluster下只会注册这一个attr,zigbee 3.0 spec中规定basic下是有要强制注册的attr的,sdk内部会检测是否有注册这些强制要求注册的attr list。
2.下面的sdk内部的basic attr list,你可以在这个基础在加上你要求的attr,其中 0xFFXX 是涂鸦私有attr,不过为了保证sdk功能完整,在不影响你需求的情况下建议保留这些私有属性。
Code: Select all
#ifdef TUYA_ZG_ROUTER
CONST TAL_ATTR_T g_base_server_attr_list[] = {
{ 0x0000, ATTR_INT8U_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x03 }, /* 0 / Basic / ZCL version*/\
{ 0x0001, ATTR_INT8U_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x41 }, /* 1 / Basic / application version*/\
{ 0x0002, ATTR_INT8U_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x01 }, /* 2 / Basic / stack version*/\
{ 0x0003, ATTR_INT8U_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x02 }, /* 3 / Basic / hardware version*/\
{ 0x0004, ATTR_CHAR_STRING_ATTRIBUTE_TYPE, 33, (ATTR_MASK_TOKEN_FAST), 0, NULL }, /* 4 / Basic / manufacturer name*/\
{ 0x0005, ATTR_CHAR_STRING_ATTRIBUTE_TYPE, 33, (ATTR_MASK_READABLE), 0, NULL }, /* 5 / Basic / model identifier*/\
{ 0x0006, ATTR_CHAR_STRING_ATTRIBUTE_TYPE, 17, (ATTR_MASK_READABLE), 0, NULL }, /* 6 / Basic / date code*/\
{ 0x0007, ATTR_ENUM8_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x01 }, /* 7 / Basic / power source*/\
{ 0xFFC0, ATTR_CHAR_STRING_ATTRIBUTE_TYPE, 33, (ATTR_MASK_TOKEN_FAST), 0, NULL },/*14 / tuya private Basic /reserverd*/\
{ 0xFFCF, ATTR_INT16U_ATTRIBUTE_TYPE, 2, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x00B4},/*default heartbeat 3*60s*/
{ 0xFFDE, ATTR_INT8U_ATTRIBUTE_TYPE, 1, (ATTR_MASK_WRITABLE), 0, (UINT8_T*)0x0D }, /* 8 / basic / tx power cfg*/\
{ 0xFFFD, ATTR_INT16U_ATTRIBUTE_TYPE, 2, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x0002 }, /* 8 / Basic / cluster revision*/\
{ 0xFFFE, ATTR_ENUM8_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x00 },/*9*/\
{ 0xFFE0, ATTR_ARRAY_ATTRIBUTE_TYPE, 41, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x00 },/*10 / tuya private Basic /pub key*/\
{ 0xFFE1, ATTR_ARRAY_ATTRIBUTE_TYPE, 41, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x00 },/*11 / tuya private Basic /sign info*/\
{ 0xFFE2, ATTR_INT8U_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)TUYA_ZIGBEE_SDK_VER },/*12 / tuya private Basic /sdk ver*/\
{ 0xFFE3, ATTR_CHAR_STRING_ATTRIBUTE_TYPE, 41, (ATTR_MASK_READABLE), 0, NULL },/*13 / tuya private Basic /reserverd*/\
};
#else
CONST TAL_ATTR_T g_base_server_attr_list[] = {
{ 0x0000, ATTR_INT8U_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x03 }, /* 0 / Basic / ZCL version*/\
{ 0x0001, ATTR_INT8U_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x41 }, /* 1 / Basic / application version*/\
{ 0x0002, ATTR_INT8U_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x01 }, /* 2 / Basic / stack version*/\
{ 0x0003, ATTR_INT8U_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x02 }, /* 3 / Basic / hardware version*/\
{ 0x0004, ATTR_CHAR_STRING_ATTRIBUTE_TYPE, 33, (ATTR_MASK_TOKEN_FAST), 0, NULL }, /* 4 / Basic / manufacturer name*/\
{ 0x0005, ATTR_CHAR_STRING_ATTRIBUTE_TYPE, 33, (ATTR_MASK_READABLE), 0, NULL }, /* 5 / Basic / model identifier*/\
{ 0x0006, ATTR_CHAR_STRING_ATTRIBUTE_TYPE, 17, (ATTR_MASK_READABLE), 0, NULL }, /* 6 / Basic / date code*/\
{ 0x0007, ATTR_ENUM8_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x01 }, /* 7 / Basic / power source*/\
{ 0xFFC0, ATTR_CHAR_STRING_ATTRIBUTE_TYPE, 33, (ATTR_MASK_TOKEN_FAST), 0, NULL },/*14 / tuya private Basic /reserverd*/\
{ 0xFFCF, ATTR_INT16U_ATTRIBUTE_TYPE, 2, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x3840},/*default heartbeat 4*3600s*/
{ 0xFFDE, ATTR_INT8U_ATTRIBUTE_TYPE, 1, (ATTR_MASK_WRITABLE), 0, (UINT8_T*)0x0D }, /* 8 / basic / tx power cfg*/\
{ 0xFFFD, ATTR_INT16U_ATTRIBUTE_TYPE, 2, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x0002 }, /* 8 / Basic / cluster revision*/\
{ 0xFFFE, ATTR_ENUM8_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x00 },/*9*/\
{ 0xFFE0, ATTR_ARRAY_ATTRIBUTE_TYPE, 41, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x00 },/*10 / tuya private Basic /pub key*/\
{ 0xFFE1, ATTR_ARRAY_ATTRIBUTE_TYPE, 41, (ATTR_MASK_READABLE), 0, (UINT8_T*)0x00 },/*11 / tuya private Basic /sign info*/\
{ 0xFFE2, ATTR_INT8U_ATTRIBUTE_TYPE, 1, (ATTR_MASK_READABLE), 0, (UINT8_T*)TUYA_ZIGBEE_SDK_VER },/*12 / tuya private Basic /sdk ver*/\
{ 0xFFE3, ATTR_CHAR_STRING_ATTRIBUTE_TYPE, 41, (ATTR_MASK_READABLE), 0, NULL },/*13 / tuya private Basic /reserverd*/\
};
#endif