I used ZAP to add a few attributes to the lighting clusters, this is a snippet from the lighting.zap:
{
"name": "manufacturer name",
"code": 4,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "Tridonic GmbH & Co KG",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "model identifier",
"code": 5,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "Opportune",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
#define GENERATED_DEFAULTS { \
21, 'T', 'r', 'i', 'd', 'o', 'n', 'i', 'c', ' ', 'G', 'm', 'b', 'H', ' ', '&', ' ', 'C', 'o', ' ', 'K', 'G', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Default for cluster: "Basic", attribute: "manufacturer name". side: server, little-endian */ \
9, 'O', 'p', 'p', 'o', 'r', 't', 'u', 'n', 'e', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Default for cluster: "Basic", attribute: "model identifier". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Default for cluster: "Basic", attribute: "date code". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Default for cluster: "Basic", attribute: "product code". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Default for cluster: "Basic", attribute: "product url". side: server, little-endian */ \
}
There seems to be a length tag in the beginning, which is not being accounted for in
#define GENERATED_ATTRIBUTES { \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 3 } }, /* Basic (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(INT8U), 1, 0, { (uint8_t *) 0x08 } }, /* Basic (server): ZCL version */ \
{ 0x0001, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0x00 } }, /* Basic (server): application version */ \
{ 0x0002, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0x00 } }, /* Basic (server): stack version */ \
{ 0x0003, ZAP_TYPE(INT8U), 1, 0, { (uint8_t *) 0x01 } }, /* Basic (server): hardware version */ \
{ 0x0004, ZAP_TYPE(CHAR_STRING), 32, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(0) } }, /* Basic (server): manufacturer name */ \
{ 0x0005, ZAP_TYPE(CHAR_STRING), 32, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(32) } }, /* Basic (server): model identifier */ \
{ 0x0006, ZAP_TYPE(CHAR_STRING), 16, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(64) } }, /* Basic (server): date code */ \
{ 0x0005, ZAP_TYPE(CHAR_STRING), 32, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(32+1) } }, /* Basic (server): model identifier */ \
{ 0x0006, ZAP_TYPE(CHAR_STRING), 16, 0, { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(64+2) } }, /* Basic (server): date code */ \
allows to be able to read not only the first, but also the following attributes.
Is the length tag supposed to be there? If yes, please account for it when indexing into the array.