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)
/** * @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 */