ZBOSS Manufacturer Specific Extension to Standard cluster

Hi,

I'm trying to add a manufacturing specific attribute to the On/Off cluster.

To do this I have so far created a custom attribute list with ZB_ZCL_DECLARE_ON_OFF_ATTRIB_LIST_CUSTOM, inside that macro I've used ZB_ZCL_SET_MANUF_SPEC_ATTR_DESC to add my attribute and I've redefined ZB_ZCL_CLUSTER_ID_ON_OFF_SERVER_ROLE_INIT to point to my own function because I want to do a value range check of the manufacturer specific attribute.

For the most part I think I have a decent grasp of how things fit together, and when I do a WriteAttributes command over the Zigbee network I can see my range check is called, and then the zcl_device_cb triggeres and I can see that the attribute has a new value.

My problem is that the attribute is successfully written to when the manufacturer specific flag is set to false. According to the Zigbee spec:

"All communications regarding manufacturer specific extensions SHALL be transmitted with the manufac-
turer specific sub-field of the frame control field set to 1 and the manufacturer code included in the frame.
If the manufacturer code in a command frame is not recognized, the command is not carried out."

So I'm wondering if I'm missing something in the setup of the attribute, or if I'm supposed to validate the manufacturer code in the check value callback. If the latter I'm not sure where to get the manufacturer code in the incoming frame as what seems to be the norm is calling ZB_BUF_GET_PARAM on the param argument to get zb_zcl_parsed_hdr_t in most callbacks, but the check value callback doesn't have that argument, and I'm struggling to find a global way of accessing it.

Kind regards,

Jonas

Related