<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>is there a zigbee zb_zcl_set_attr_val for 32 bit bitmasks?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61551/is-there-a-zigbee-zb_zcl_set_attr_val-for-32-bit-bitmasks</link><description>Hi, I&amp;#39;d like to set the alarm state of a minimal power configuration cluster that only has the attributes &amp;quot;remaining battery percentage&amp;quot; and &amp;quot;battery alarm id&amp;quot;. However the function I&amp;#39;d normally use zb_zcl_set_attr_val is only working on uint8_t datatypes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 29 May 2020 08:45:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61551/is-there-a-zigbee-zb_zcl_set_attr_val-for-32-bit-bitmasks" /><item><title>RE: is there a zigbee zb_zcl_set_attr_val for 32 bit bitmasks?</title><link>https://devzone.nordicsemi.com/thread/252321?ContentTypeID=1</link><pubDate>Fri, 29 May 2020 08:45:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:595a5f8f-157b-421b-b25a-0e691a5df185</guid><dc:creator>Unitware</dc:creator><description>&lt;p&gt;I have now updated to SDK 4.1.0&lt;br /&gt;&lt;br /&gt;The code now works but there is a warning that the datatypes does not match, I guess it might work for the LSB in the 32 bit bitmask.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Found a bug in the attribute reporting:&lt;br /&gt;```&lt;br /&gt;diff --git a/components/zigbee/cli/zigbee_cli_cmd_attr_report.c b/components/zigbee/cli/zigbee_cli_cmd_attr_report.c&lt;br /&gt;index 85a3554..42cdb0c 100644&lt;br /&gt;--- a/components/zigbee/cli/zigbee_cli_cmd_attr_report.c&lt;br /&gt;+++ b/components/zigbee/cli/zigbee_cli_cmd_attr_report.c&lt;br /&gt;@@ -317,9 +317,9 @@ static void print_attr_update(zb_zcl_parsed_hdr_t * p_zcl_hdr, zb_bufid_t bufid)&lt;br /&gt; &lt;br /&gt;&amp;nbsp; &amp;nbsp; /* Get the contents of Read Attribute Response frame */&lt;br /&gt;&amp;nbsp; &amp;nbsp; ZB_ZCL_GENERAL_GET_NEXT_REPORT_ATTR_REQ(bufid, p_attr_resp);&lt;br /&gt;-&amp;nbsp; &amp;nbsp;bytes_written = 0;&lt;br /&gt;&amp;nbsp; &amp;nbsp; while (p_attr_resp != NULL)&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;+&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bytes_written = 0;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bytes_written = zcl_attr_to_str(&amp;amp;print_buf[bytes_written],&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sizeof(print_buf) - bytes_written,&lt;br /&gt; p_attr_resp-&amp;gt;attr_type,&lt;br /&gt;```&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: is there a zigbee zb_zcl_set_attr_val for 32 bit bitmasks?</title><link>https://devzone.nordicsemi.com/thread/251662?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 09:52:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0324d79-f38e-46b9-89e5-d757a6208fbf</guid><dc:creator>Unitware</dc:creator><description>&lt;p&gt;pm sent&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: is there a zigbee zb_zcl_set_attr_val for 32 bit bitmasks?</title><link>https://devzone.nordicsemi.com/thread/251659?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 09:35:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d246c8e-65cc-4461-9b04-365f24b2f406</guid><dc:creator>Unitware</dc:creator><description>&lt;p&gt;remaining percentage is ok (of type uint8_t), but the next commented line - battery alarm state (uint32_t) is not. if I uncomment it it will not even compile&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: is there a zigbee zb_zcl_set_attr_val for 32 bit bitmasks?</title><link>https://devzone.nordicsemi.com/thread/251658?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 09:33:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:302f44de-dc66-4a32-a426-a5b444e6795e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;You can send me a personal message here on devzone. Please remember to update this ticket when you have done so, because the PM system is not linked to individual tickets.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Unitware"]The &amp;quot;remaining percent&amp;quot; attribute is working.[/quote]
&lt;p&gt;&amp;nbsp;Ok, so what part is missing then?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: is there a zigbee zb_zcl_set_attr_val for 32 bit bitmasks?</title><link>https://devzone.nordicsemi.com/thread/251594?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 06:31:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3909d142-b274-451f-ac57-7f95e6c3e097</guid><dc:creator>Unitware</dc:creator><description>&lt;p&gt;Is there a way I can share code with you out of band from this public ticket?&lt;br /&gt;&lt;br /&gt;I am looking on the radio trafficTo see if it works with a sniffer and with the cli application with zigbee.report logging on. The &amp;quot;remaining percent&amp;quot; attribute is working.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: is there a zigbee zb_zcl_set_attr_val for 32 bit bitmasks?</title><link>https://devzone.nordicsemi.com/thread/251485?ContentTypeID=1</link><pubDate>Mon, 25 May 2020 12:39:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a0267e1-61ed-4c49-b2e3-cc2a7478e793</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I agree, but we don&amp;#39;t have a ton of examples, so I don&amp;#39;t know if we have anything that would match the issue that you describe, with a cluster containing a 32bit value. I can&amp;#39;t tell from the snippets that you have included whether it is set up correctly or not. What does zb_zcl_set_attr_val() return inside radio_iic_cb_battery_status? Is the value updated? How do you check whether the value is updated or not?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: is there a zigbee zb_zcl_set_attr_val for 32 bit bitmasks?</title><link>https://devzone.nordicsemi.com/thread/250857?ContentTypeID=1</link><pubDate>Wed, 20 May 2020 06:35:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a77e13a-a40c-4212-9eb6-32f1d9fa6cd1</guid><dc:creator>Unitware</dc:creator><description>&lt;p&gt;Hi, thanks for looking into this.&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/61551/is-there-a-zigbee-zb_zcl_set_attr_val-for-32-bit-bitmasks/250772"]Is there a way for me to reproduce this?[/quote]
&lt;p&gt;Not easily, I&amp;#39;d prefer if we could pingpong a few basic questions first.&lt;br /&gt;&lt;br /&gt;My project is based on the multiprotocol doorlock example in sdk 4.0.0 and I am using SDK 16.0 to fill in the gaps to make it compile. Changes that I have meade includes moving the application out of the sdk-directory structure and I am using make and gcc to build it.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/61551/is-there-a-zigbee-zb_zcl_set_attr_val-for-32-bit-bitmasks/250772"]Have you tried to write to it using the Zigbee Cluster?[/quote]
&lt;p&gt;That is the question I guess, I do not know how to do this properly.&lt;br /&gt;&lt;br /&gt;Here is the code I am using today for the remaining percentage which works:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;...

typedef struct
{
    uint8_t percentage_remaining_x2;
    uint32_t alarm_state;
} power_config_state_t;

...

typedef struct door_lock_ctx_s
{
    door_lock_configuration_t         configuration;
    zb_zcl_basic_attrs_ext_t          basic_attr;
    zb_zcl_identify_attrs_t           identify_attr;
    zb_zcl_scenes_attrs_t             scenes_attr;
    zb_zcl_groups_attrs_t             groups_attr;
    zb_zcl_door_lock_attrs_extended_t door_lock_attr;
    power_config_state_t              battery;
} door_lock_ctx_t;

static door_lock_ctx_t m_dev_ctx;

...

void radio_iic_cb_battery_status(radio_iic_percentage_t percent, bool battery_is_low)
{
    NRF_LOG_INFO(&amp;quot;main got battery status from radio_iic %d%%, %s&amp;quot;, percent, battery_is_low ? &amp;quot;LOW&amp;quot;:&amp;quot;ok&amp;quot;);

    m_dev_ctx.battery.percentage_remaining_x2 = percent * 2;
    m_dev_ctx.battery.alarm_state = battery_is_low ? ZB_ZCL_POWER_CONFIG_BATTERY_ALARM_STATE_SOURCE1_MIN_THRESHOLD : 0;

    UNUSED_RETURN_VALUE(zb_zcl_set_attr_val(DOOR_LOCK_ENDPOINT,
                                            ZB_ZCL_CLUSTER_ID_POWER_CONFIG,
                                            ZB_ZCL_CLUSTER_SERVER_ROLE,
                                            ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_PERCENTAGE_REMAINING_ID,
                                            &amp;amp;m_dev_ctx.battery.percentage_remaining_x2,
                                            ZB_FALSE));

    // UNUSED_RETURN_VALUE(zb_zcl_set_attr_val(DOOR_LOCK_ENDPOINT,
    //                                         ZB_ZCL_CLUSTER_ID_POWER_CONFIG,
    //                                         ZB_ZCL_CLUSTER_SERVER_ROLE,
    //                                         ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_ALARM_STATE_ID,
    //                                         &amp;amp;m_dev_ctx.battery.alarm_state,
    //                                         ZB_FALSE));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Note that the commented row at the end is how I expected it to work with the alarm_state but that line does not compile because of the datatype of alarm_state. So my question is what to do instead to notify the stack that the new value should be reported.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: is there a zigbee zb_zcl_set_attr_val for 32 bit bitmasks?</title><link>https://devzone.nordicsemi.com/thread/250772?ContentTypeID=1</link><pubDate>Tue, 19 May 2020 14:13:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:203d6052-0f25-4d85-8baf-b436b7449592</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Is there a way for me to reproduce this?&lt;/p&gt;
&lt;p&gt;Do you have a project with a Zigbee node that has the Battery cluster?&lt;/p&gt;
&lt;p&gt;Have you tried to write to it using the Zigbee Cluster?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>