<?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>Get received APS data from Zigbee stack</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71510/get-received-aps-data-from-zigbee-stack</link><description>We have a Zigbee device that doesn&amp;#39;t seem to use ZCL to transfer data and I have been trying to see if there is a way to get it working with an nrf52840 acting as a coordinator. The device successfully authenticates and starts sending data that I can</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 10 Mar 2021 15:41:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71510/get-received-aps-data-from-zigbee-stack" /><item><title>RE: Get received APS data from Zigbee stack</title><link>https://devzone.nordicsemi.com/thread/299082?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 15:41:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25404691-972d-45b0-87bc-eaf804bb2bcb</guid><dc:creator>carsonm</dc:creator><description>&lt;p&gt;I&amp;#39;ve tried this a number of different ways with no luck. First off I attempted to use the above call in both NCS v1.5.0 and&amp;nbsp;nRF5 SDK for Thread and Zigbee v4.1.0, it isn&amp;#39;t clear if one of those should be used over the other.&lt;/p&gt;
&lt;p&gt;First I&amp;#39;ll say that the code you gave doesn&amp;#39;t compile because it references calls that don&amp;#39;t exist in either SDK so I&amp;#39;m questioning if I&amp;#39;m trying to use the right SDKs. Is this internal code for zboss that isn&amp;#39;t available or is it part of a different SDK that I need to download?&lt;/p&gt;
&lt;p&gt;Given that the example code doesn&amp;#39;t compile I&amp;nbsp;replaced it&amp;nbsp;with the following just to test that I could see some output when the callback is called:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static zb_uint8_t data_indication(zb_uint8_t param)
{
  NRF_LOG_ERROR(&amp;quot;**** data_indication called&amp;quot;);

  return ZB_FALSE;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I modified the Zigbee CLI example code in thenRF5 SDK for Thread and Zigbee v4.1.0 source by adding a new command that simply calls&amp;nbsp;&lt;em&gt;zb_af_set_data_indication(data_indication);&amp;nbsp;&lt;/em&gt;as follows:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void cmd_app_stuff(nrf_cli_t const * p_cli, size_t argc, char **argv)
{
  nrf_cli_fprintf(p_cli, NRF_CLI_NORMAL, &amp;quot;Setting data indication.\n&amp;quot;);
  zb_af_set_data_indication(data_indication);
}

NRF_CLI_CMD_REGISTER(set_di, NULL, &amp;quot;Set data indication&amp;quot;, cmd_app_stuff);&lt;/pre&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I also set the ZIGBEE_TRACE_MASK setting to TRACE_SUBSYSTEM_NWK to see if that would show the interaction. I used the following set of commands to configure the Zigbee CLI example once running:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;log enable info app
log enable info zboss
log go

bdb channel 26
bdb nwkkey 0xanetworkkey
bdb extpanid 0xapanid
bdb role zc
set_di
bdb start
bdb legacy enable&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The end device connects and authorizes but the data_indication is never called:&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;&amp;lt;info&amp;gt; zboss: DE AD 0A 02 B2 A5 36 00|......6.&lt;br /&gt;&amp;lt;info&amp;gt; zboss: 26 01 A5 05 DE AD 0E 02|&amp;amp;.......&lt;br /&gt;&amp;lt;info&amp;gt; zboss: B4 A5 37 00 2B 01 05 01|..7.+...&lt;br /&gt;&amp;lt;info&amp;gt; zboss: 0F 00 00 00 DE AD 0A 02|........&lt;br /&gt;&amp;lt;info&amp;gt; zboss: B4 A5 38 00 2B 01 18 01|..8.+...&lt;br /&gt;&amp;lt;info&amp;gt; zboss: DE AD 1A 02 D7 A5 39 00|......9.&lt;br /&gt;&amp;lt;info&amp;gt; zboss: 3E 01 66 01 A8 07 00 00|&amp;gt;.f.....&lt;br /&gt;&amp;lt;info&amp;gt; zboss: A8 07 00 00 4E 56 00 41|....NV.A&lt;br /&gt;&amp;lt;info&amp;gt; app: Device update received (short: 0x07A8, long: 564d52544100564e, status: 3)&lt;br /&gt;&amp;lt;info&amp;gt; app: Device authorization event received (short: 0x07A8, long: 564d5254, authorization type: 0, authorization status: 0)&lt;br /&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;The data_indication callback is never called. I can see from the wireshark trace that the end device sends the data right after the authorization but I don&amp;#39;t see anything more from the CLI until other devices authorize.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is there something more specific that needs to be done to enable this callback?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get received APS data from Zigbee stack</title><link>https://devzone.nordicsemi.com/thread/297722?ContentTypeID=1</link><pubDate>Thu, 04 Mar 2021 10:06:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40c0ce72-00d7-451f-b823-554d41ea7d6f</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I got the Zigbee team to look at the screenshot of the sniffer log. It is not ZCL that&amp;#39;s the problem, but the profile ID (0x0001), which is not recognized by the stack. In such situations, the only solution is to use the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/group__af__management__service.html#ga318b4a6d90d299884187d2080c65cd2f"&gt;zb_af_set_data_indication&lt;/a&gt;&amp;nbsp;API.&lt;/p&gt;
&lt;p&gt;Please register the callback before zboss_start:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;...
zb_af_set_data_indication(data_indication);
...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Example callback implementation:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static zb_uint8_t data_indication(zb_uint8_t param)
{
  zb_buf_t *buf = ZB_BUF_FROM_REF(param);
  zb_uint8_t aps_payload_size = 0;
  zb_uint8_t *aps_payload_ptr = zb_aps_get_aps_payload(param, &amp;amp;aps_payload_size);
  zb_apsde_data_indication_t *data_ind = ZB_GET_BUF_PARAM(buf, zb_apsde_data_indication_t);
  zb_bool_t processed = ZB_FALSE;
  if ((data_ind-&amp;gt;profileid == 0x0001) &amp;amp;&amp;amp;
      (data_ind-&amp;gt;clusterid == 0x0001))
  {
    NRF_LOG_DEBUG(&amp;quot;zb_buf_len: %hd, aps_payload_size: %hd&amp;quot;,
                  ZB_BUF_LEN(buf), aps_payload_size));
    for (zb_uint8_t i = 0; i &amp;lt; aps_payload_size; ++i)
    {
      NRF_LOG_DEBUG(&amp;quot;aps_payload[%hd] == 0x%hx&amp;quot;,
                    i, aps_payload_ptr[i]));
    }
    ZB_FREE_BUF(buf);
    processed = ZB_TRUE;
  }
  return processed;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get received APS data from Zigbee stack</title><link>https://devzone.nordicsemi.com/thread/296025?ContentTypeID=1</link><pubDate>Wed, 24 Feb 2021 13:06:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:479edb45-3a91-430e-a33b-d21212020ae2</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry for the late reply. I&amp;#39;ve asked our Zigbee team internally about your issue, and I&amp;#39;ll come back to you when I get a response from them.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get received APS data from Zigbee stack</title><link>https://devzone.nordicsemi.com/thread/294640?ContentTypeID=1</link><pubDate>Tue, 16 Feb 2021 13:32:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c4fb72c-8ab9-4181-af33-0f2f25d35fd9</guid><dc:creator>carsonm</dc:creator><description>&lt;p&gt;Is there a way to know when to call&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/group__aps__user__payload.html#ga59a1a8403d887ca3b10b0da6a34119ab"&gt;zb_aps_get_aps_payload&lt;/a&gt;? The issue I have is that there seems to be no way to get triggered when the data I need comes in.&lt;/p&gt;
&lt;p&gt;Here is a screenshot of the data in question:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screen-Shot-2021_2D00_02_2D00_16-at-8.29.38-AM.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get received APS data from Zigbee stack</title><link>https://devzone.nordicsemi.com/thread/294629?ContentTypeID=1</link><pubDate>Tue, 16 Feb 2021 13:01:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13d3cba1-384f-4ae7-bc38-399420c79a4a</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can use&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/group__aps__user__payload.html#ga59a1a8403d887ca3b10b0da6a34119ab"&gt;zb_aps_get_aps_payload&lt;/a&gt;&amp;nbsp;to get access to the APS payload, which returns a pointer to the payload.&amp;nbsp;The functions in the links I added in my last reply are the only APS functions that are available to the user and the application. The rest is a part of the ZBOSS stack and therefore unavailable.&lt;/p&gt;
&lt;p&gt;As for the sniffer log it would help to get the pcap file, or a picture of the packet itself if the former isn&amp;#39;t possible. The part you&amp;#39;ve already added here doesn&amp;#39;t tell me much, and it would help to get something that gives&amp;nbsp;more information about the packet, such as showing the application layer, and the cluster library frame if it&amp;#39;s a Zigbee HA packet, like shown below.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/500x500/__key/communityserver-discussions-components-files/4/sniffer_5F00_log_5F00_off_5F00_with_5F00_effect.png" /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get received APS data from Zigbee stack</title><link>https://devzone.nordicsemi.com/thread/294066?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2021 18:58:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1d98bc8-545f-4186-b7f0-7cf6093c4247</guid><dc:creator>carsonm</dc:creator><description>&lt;p&gt;Out of those two links are there specific commands that I would use to receive the APS data? I thought there would be a simple callback that I could use to intercept the incoming data and then flag it as processed before any of the ZCL processing happens. Is there a way to go farther up in the stack potentially to get the data? Is there something that can be done with&amp;nbsp;zb_af_set_data_indication? I tried using&amp;nbsp;&lt;span&gt;zb_af_set_data_indication but the callback never seems to be called.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What part of the sniffer log would you need? I included&amp;nbsp;an example packet for the specific&amp;nbsp;incoming data that doesn&amp;#39;t work. The device joins and immediately starts sending data. I can&amp;#39;t include the entire log since it would have sensitive information in it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get received APS data from Zigbee stack</title><link>https://devzone.nordicsemi.com/thread/294003?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2021 14:01:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f70412b8-a4f7-417a-aa7f-accdb7910412</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;We have some APS functions that are visible to the application, which can be found&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/group__aps__api.html"&gt;here&lt;/a&gt;, and some specifically for APS user payload, which can be found&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/group__aps__user__payload.html"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Could you please attach the sniffer log so I can take a look?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>