<?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>cli_agent_ep_handler_ping When to free zb_bufid_t</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60887/cli_agent_ep_handler_ping-when-to-free-zb_bufid_t</link><description>Setup: Segger Embedded Studio v3.52, nRF5_SDK_for_Thread_and_Zigbee_v4, nRF52840 Custom Board 
 Hello, 
 I based my code off of your Zigbee cli_agent_router example. In the routine cli_agent_ep_handler_ping(zb_bufid_t bufid), the buffer &amp;quot;bufid&amp;quot; is released</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 May 2020 22:16:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60887/cli_agent_ep_handler_ping-when-to-free-zb_bufid_t" /><item><title>RE: cli_agent_ep_handler_ping When to free zb_bufid_t</title><link>https://devzone.nordicsemi.com/thread/248027?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 22:16:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8c34fa7-d733-469a-a365-924a684ce87e</guid><dc:creator>johnmartin117</dc:creator><description>&lt;p&gt;Thank you Edvin!&lt;/p&gt;
&lt;p&gt;That clears it up for me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cli_agent_ep_handler_ping When to free zb_bufid_t</title><link>https://devzone.nordicsemi.com/thread/247942?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 14:49:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b920827d-5c91-4794-86c6-9162f5aac7f0</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello John,&lt;/p&gt;
&lt;p&gt;I checked with the Zigbee team. They said that if the endpoint handler returns ZB_FALSE, then the zigbee stack will process the frame, and then free the buffer, so you can&amp;#39;t free it in this handler. Only if you return ZB_TRUE, you will need to manually free the buffer from the handler.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So in this case, since it will return ZB_FALSE, the stack needs the buffer for further processing, and it will later be freed by the stack itself.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>