Good day!
I have implemented some manufacturer specific attributes according to:
ZigBee Cluster Library (for ZigBee 3.0) User Guide / Appenix E.1
I am attempting to add a configuration variable in the OnOff cluster that will modify OnOff behaviours.
zcl_options.h
#define CLD_ONOFF_ATTR_MAN_SPEC // "enable manufacturer specific attribute(s)
#define CLD_ONOFF_ATTR_MAN_SPEC_CONFIG
#define E_CLD_ONOFF_ATTR_ID_MAN_SPEC_CONFIG 0x10 // attribute ID
OnOff.h
/* On/Off Cluster */
typedef struct
{
...
#ifdef CLD_ONOFF_ATTR_MAN_SPEC_CONFIG
zuint16 u16Config;
#endif
} tsCLD_OnOff;
OnOff.c
const tsZCL_AttributeDefinition asCLD_OnOffClusterAttributeDefinitions[] = {
...
#ifdef CLD_ONOFF_ATTR_MAN_SPEC_CONFIG
{E_CLD_ONOFF_ATTR_ID_MAN_SPEC_CONFIG, (E_ZCL_AF_RD|E_ZCL_AF_WR|E_ZCL_AF_MS), E_ZCL_UINT16, (uint32)(&((tsCLD_OnOff*)(0))->u16Config),0},
#endif
};
app_zcl_task.c
PRIVATE void APP_vZCL_DeviceSpecific_Init( uint8_t type )
{
...
#ifdef CLD_ONOFF_ATTR_MAN_SPEC_CONFIG
sBaseDevice.sOnOffServerCluster.u16Config = 0x00;
#endif
}
When I attempt to write a value of 0x03 to Attribute 0x10 of Cluster 0x0006, I see the following error(s):
BDB: APP_vGenCallback [1 1] Pass to ZCL
ZCL_Task endpoint event:1 WRITE Individual attribute for Cluster = 6
AttributeDataType = 255 u16AttributeEnum = 16 eAttributeStatus = 134
EP EVT: Write Individual Attribute Status 00
EP EVT: Write Attributes
AttributeDataType = 255 - is unknown (should be uint16 / 0x21)
u16AttributeEnum = 16 / 0x10 - correct
eAttributeStatus = 134 / 0x86 - E_ZCL_CMDS_UNSUPPORTED_ATTRIBUTE
I'm not sure where I've gone wrong.
Appendix E.1.4 states:
"Add the new attribute to the source (.c) file for the cluster, being careful to add the attribute in the correct sequential position" ...
This is unclear to me. I've positioned it directly after the mandatory attributes (OFF/ON/TOGGLE) and chose 0x10 as it's > 2 < 0x40 (E_CLD_ONOFF_CMD_OFF_EFFECT) ...
Attached are grabs of the command and reply from wireshark.
Best regards, and thank you in advance.