<?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>Missing variable value in zb_zdo_ep_resp_t stuct</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55430/missing-variable-value-in-zb_zdo_ep_resp_t-stuct</link><description>It appears to me that the zb_zdo_ep_resp_t struct is missing a variable value attribute since the actual list of end points is missing. Should it not be similar to zb_zdo_match_desc_param_t which has a variable length cluster_list[1]. 
 
 
 Thoughts?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Dec 2019 09:49:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55430/missing-variable-value-in-zb_zdo_ep_resp_t-stuct" /><item><title>RE: Missing variable value in zb_zdo_ep_resp_t stuct</title><link>https://devzone.nordicsemi.com/thread/225111?ContentTypeID=1</link><pubDate>Thu, 12 Dec 2019 09:49:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96a0f44c-f25a-40b9-aee5-c7c048044fae</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;The list of EPs is in the p_buf, which you can get from the zb_uint8_t param in the callback:&lt;/p&gt;
&lt;p&gt;If you look in zmd_zb_active_ep_cb():&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static zb_void_t cmd_zb_active_ep_cb(zb_uint8_t param)
{
    zb_buf_t         * p_buf  = ZB_BUF_FROM_REF(param);
    zb_zdo_ep_resp_t * p_resp = (zb_zdo_ep_resp_t *)ZB_BUF_BEGIN(p_buf);
    zdo_tsn_ctx_t    * p_tsn_ctx;

    p_tsn_ctx = get_ctx_by_tsn(p_resp-&amp;gt;tsn);
    if (!p_tsn_ctx)
    {
        ZB_FREE_BUF_BY_REF(param);
        return;
    }

    if (p_resp-&amp;gt;status == ZB_ZDP_STATUS_SUCCESS)
    {
        nrf_cli_fprintf(p_tsn_ctx-&amp;gt;p_cli,
                        NRF_CLI_NORMAL,
                        &amp;quot;src_addr=%0hx &amp;quot;,
                        p_resp-&amp;gt;nwk_addr);

        PRINT_LIST(p_tsn_ctx-&amp;gt;p_cli, &amp;quot;ep=&amp;quot;, &amp;quot;%d&amp;quot;, zb_uint8_t, 
                   (zb_uint8_t *)p_resp + sizeof(zb_zdo_ep_resp_t),
                   p_resp-&amp;gt;ep_count);

        print_done(p_tsn_ctx-&amp;gt;p_cli, ZB_TRUE);
    }
    else
    {
        print_error(p_tsn_ctx-&amp;gt;p_cli,
                    &amp;quot;active ep request failed&amp;quot;);
    }

    invalidate_ctx(p_tsn_ctx);
    ZB_FREE_BUF_BY_REF(param);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the function PRINT_LIST() will print all of the EPs.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you look at the definition of PRINT_LIST:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@breif Print a list of items.
 * 
 * Individual items in the list are delimited by comma.
 *
 * @param p_cli a pointer to CLI instance
 * @param hdr   the list header string
 * @param fmt   a printf like format of an individual list item
 * @param type  type of the list item
 * @param size  the list size (in items)
 */
#define PRINT_LIST(p_cli, hdr, fmt, type, ptr, size)                 \
{                                                                    \
    /*lint -e662 */                                                  \
    nrf_cli_fprintf(p_cli, NRF_CLI_NORMAL, hdr);                     \
    for (type * p_item = (ptr); p_item &amp;lt; (ptr) + size - 1; p_item++) \
    {                                                                \
        nrf_cli_fprintf(p_cli,                                       \
                        NRF_CLI_NORMAL,                              \
                        fmt &amp;quot;,&amp;quot;,                                     \
                        *p_item);                                    \
    }                                                                \
                                                                     \
    if (size &amp;gt; 0)                                                    \
    {                                                                \
        nrf_cli_fprintf(p_cli,                                       \
                        NRF_CLI_NORMAL,                              \
                        fmt &amp;quot; &amp;quot;,                                     \
                        *((ptr) + size - 1));                        \
    }                                                                \
    /*lint -restore */                                               \
} &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can see that it takes&amp;nbsp;6 parameters, where the 5th is a pointer, which is fetched from p_resp, which is fetched from p_buf, which again is fetched from zb_uint8_t param in the callback.&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: Missing variable value in zb_zdo_ep_resp_t stuct</title><link>https://devzone.nordicsemi.com/thread/225010?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2019 17:35:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7963bb7-535e-4b6c-a5e2-5c3d92cfc718</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The zb_zdo_ep_resp_t includes a variable list of endpoints.&amp;nbsp; The actual number of endpoints returned is&amp;nbsp;stored in ep_count but there is no actual entry in the structure for the start of the end point list.&amp;nbsp; Shouldn&amp;#39;t the structure look like the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/** @brief Active EP response */
typedef ZB_PACKED_PRE struct zb_zdo_ep_resp_s
{
  zb_uint8_t tsn;       /*!&amp;lt; ZDP transaction sequence number */
  zb_uint8_t status;    /*!&amp;lt; The status of the Active_EP_req command. */
  zb_uint16_t nwk_addr; /*!&amp;lt; NWK address for the request. */
  zb_uint8_t ep_count;  /*!&amp;lt; The count of active endpoints on the Remote Device. */
  zb_uint8_t ep_list[1]; /!&amp;lt; variable size: [ep_count] */
}
ZB_PACKED_STRUCT
zb_zdo_ep_resp_t;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Darren&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Missing variable value in zb_zdo_ep_resp_t stuct</title><link>https://devzone.nordicsemi.com/thread/224913?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2019 12:32:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14321a04-a610-40c0-bc69-06f63e5f32cb</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Darren,&lt;/p&gt;
&lt;p&gt;So you are talking about the active_ep CLI command, is that correct?&lt;/p&gt;
&lt;p&gt;When I tested this command on the multisensor example, it gave:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;gt; zdo active_ep 0xC639
&amp;gt; src_addr=C639 ep=10
Done&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Is there something missing? I didn&amp;#39;t understand what exactly you refer to.&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>