[Zigbee] ZCL: Discover Attributes Extended Command

Setup: 

nrf52840dk

NCS v2.4.1

Hi,

ZCL Discover Attributes Extended Command allows to get the attribute access type. Based on the Zigbee Cluster Library spec 2.5.23.1.5 section the second bit of Attribute access control field should indicate if the discovered attribute is reportable or not. 

In zcl_general_commands.c: zb_zcl_disc_attr_handler() following line of code is used for putting the attribute access type to the ZCL Discover Attributes Extended Response.

ZB_ZCL_PACKET_PUT_DATA8(resp_data, ZB_ZCL_CONVERT_ATTR_ACCESS_BITMASK(attr_desc->access));
 
/*! Convert internal attribute access bitmask into ZCL/HA1.2 bitmask
* value (actually, support 0 and 1 bits) */
#define ZB_ZCL_CONVERT_ATTR_ACCESS_BITMASK(_access) ((_access) & 0x3U)

It seems that only bit 0 and bit 1 of access field are being put into the packet.
zb_zcl_common.h introduces the bits for setting attribute access as follows: 

/**
* @name ZCL attribute access values
* @anchor zcl_attr_access
*/
/** @{ */
#define ZB_ZCL_ATTR_ACCESS_READ_ONLY 0x01U
#define ZB_ZCL_ATTR_ACCESS_WRITE_ONLY 0x02U /*!< Attribute is write only */
/** Attribute is read/write */
#define ZB_ZCL_ATTR_ACCESS_READ_WRITE (ZB_ZCL_ATTR_ACCESS_READ_ONLY | ZB_ZCL_ATTR_ACCESS_WRITE_ONLY)
#define ZB_ZCL_ATTR_ACCESS_REPORTING 0x04U /*!< Attribute is allowed for reporting */
ZB_ZCL_ATTR_ACCESS_REPORTING is the bit 2 in the attribute descriptor access, so it seems that it is not possible to determine if discovered attribute is reportable or not. 

Could you elaborate on that topic ? 
Please, correct me if I am wrong and point me to the right direction.
My goal is to be able to determine if discovered attribute is reportable or not.
Related