<?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>[nRF52840 + zigbee] About install codes</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50491/nrf52840-zigbee-about-install-codes</link><description>Hi, 
 I will add feature &amp;quot;installation codes&amp;quot;. 
 I guess that security API do work. 
 At coordinator side, zb_secur_ic_add, zb_set_installcode_policy functions 
 At end device side, zb_secur_ic_set and zb_set_installcode_policy functions 
 Questions </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 05 Aug 2019 06:49:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50491/nrf52840-zigbee-about-install-codes" /><item><title>RE: [nRF52840 + zigbee] About install codes</title><link>https://devzone.nordicsemi.com/thread/202310?ContentTypeID=1</link><pubDate>Mon, 05 Aug 2019 06:49:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a15a0db7-2f87-4350-91f4-c2f304906a5c</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Can we please clarify what you need help with at this moment? I find it a bit confusing when you have created 4 different tickets in a short time span.&lt;/p&gt;
&lt;p&gt;(&lt;a href="https://devzone.nordicsemi.com/support-private/support/233623)"&gt;devzone.nordicsemi.com/.../233623)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(&lt;a href="https://devzone.nordicsemi.com/support-private/support/233787)"&gt;devzone.nordicsemi.com/.../233787)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(&lt;a href="https://devzone.nordicsemi.com/support-private/support/233781)"&gt;devzone.nordicsemi.com/.../233781)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(&lt;a href="https://devzone.nordicsemi.com/support-private/support/233766)"&gt;devzone.nordicsemi.com/.../233766)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Can we please keep the discussion in one ticket?&lt;/p&gt;
&lt;p&gt;I would like to keep the discussion in this ticket.&lt;/p&gt;
&lt;p&gt;I will have to talk with out developers about your question, please be patient&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f60a.svg" title="Blush"&gt;&amp;#x1f60a;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52840 + zigbee] About install codes</title><link>https://devzone.nordicsemi.com/thread/202171?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2019 13:36:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:802f42c7-0496-423e-9aa4-985520007c89</guid><dc:creator>embedholic</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;Sorry for more questions.&lt;/p&gt;
&lt;p&gt;1. Is there any API to retrieve registered Install Codes with mac at coordinator side ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp; (same question for end device)&lt;/p&gt;
&lt;p&gt;2. How can erase registered(in NVRAM) specific MAC-IC&amp;nbsp; pair ?&lt;/p&gt;
&lt;p&gt;If there is no way to erase specific tuple, then how to erase all the secure IC ?&lt;/p&gt;
&lt;p&gt;zigbee_erase_persistent_storage(ZB_TRUE) does that ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3. I found that PAN_ID setting function in cli souces(in zigbee cli cmd_bdb.c).&lt;/p&gt;
&lt;p&gt;but Changing pan id with &amp;quot;ZB_PIBCACHE_PAN_ID() = pan_id&amp;quot; only update&lt;/p&gt;
&lt;p&gt;cached structure.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In comment in zboss_api_nwk.h,&amp;nbsp; &amp;quot;must sync it with MLME-SET&amp;quot;.&lt;/p&gt;
&lt;p&gt;What api correspoding &amp;quot;MLME-SET&amp;quot; ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sincerely yours.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52840 + zigbee] About install codes</title><link>https://devzone.nordicsemi.com/thread/202028?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2019 06:42:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4581e290-9e86-46bf-b3dd-1289fb699783</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;1.&lt;/p&gt;
&lt;p&gt;The router is a joining device before it becomes a router, so you should use zb_secur_ic_set.&lt;/p&gt;
&lt;p&gt;2.&lt;/p&gt;
&lt;p&gt;The information is stored in NVRAM.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52840 + zigbee] About install codes</title><link>https://devzone.nordicsemi.com/thread/202020?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2019 05:23:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c67d546-ee65-4df0-b9c1-c7998b85b9ec</guid><dc:creator>embedholic</dc:creator><description>&lt;p&gt;Thanks for reply.&lt;/p&gt;
&lt;p&gt;I have&amp;nbsp; more questionㄴ.&lt;/p&gt;
&lt;p&gt;1. At ZR(router) side, what to do for security ?&lt;/p&gt;
&lt;p&gt;2. using&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;zb_secur_ic_set&amp;quot; and&lt;/p&gt;
&lt;p&gt;&amp;quot;zb_secur_ic_add&amp;quot;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Information is saved in flash ? or volatile ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best reguards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52840 + zigbee] About install codes</title><link>https://devzone.nordicsemi.com/thread/201835?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2019 11:38:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16dc99d1-660c-4111-83c6-544d202bc547</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;You can take a look at how installation codes are used in the CLI, you can find the code in the SDK under &lt;strong&gt;components\zigbee\cli\zigbee_cli_cmd_bdb.c&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/** @brief Set install code on the device, add information about the install code
 *  on the trust center, set the trust center install code policy.
 *
 * @code
 * bdb ic add &amp;lt;h:install code&amp;gt; &amp;lt;h:eui64&amp;gt;
 * bdb ic set &amp;lt;h:install code&amp;gt;
 * bdb ic policy &amp;lt;enable|disable&amp;gt;
 * @endcode
 *
 * @pre Setting and defining policy only before @ref start &amp;quot;bdb start&amp;quot;.
 * Adding only after @ref start &amp;quot;bdb start&amp;quot;.
 * 
 * &amp;lt;tt&amp;gt;bdb ic set&amp;lt;/tt&amp;gt; must only be used on a joining device.
 *
 * &amp;lt;tt&amp;gt;bdb ic add&amp;lt;/tt&amp;gt; must only be used on a coordinator.
 *
 * &amp;lt;tt&amp;gt;bdb ic policy&amp;lt;/tt&amp;gt; must only be used on a coordinator.
 *
 * Provide the install code as an ASCII-encoded hex including CRC16.
 *
 * For production devices, an install code must be installed by the production
 * configuration present in flash.
 *
 *
 * Example:
 * @code
 * &amp;gt; bdb ic add 83FED3407A939723A5C639B26916D505C3B5 0B010E2F79E9DBFA
 * Done
 * @endcode
 */
static void cmd_zb_install_code(nrf_cli_t const * p_cli, size_t argc, char **argv)
{
    const char *   p_err_msg = NULL;
    zb_ieee_addr_t addr;
    zb_uint8_t     ic[ZB_CCM_KEY_SIZE + 2]; // +2 for CRC16

    if (nrf_cli_help_requested(p_cli) || (argc == 1))
    {
        print_usage(p_cli, argv[0],
                    &amp;quot;ic - set or add install code. Enable IC policy.\r\n&amp;quot;
                    &amp;quot;ic set &amp;lt;h:install code&amp;gt; - set the ic code to &amp;lt;install_code&amp;gt;\r\n&amp;quot;
                    &amp;quot;ic add &amp;lt;h:install code&amp;gt; &amp;lt;h:eui64&amp;gt; - add ic for device with given eui43\r\n&amp;quot;
                    &amp;quot;ic policy - set Trust Center install code policy&amp;quot;);
        return;
    }

    if ((argc == 2) &amp;amp;&amp;amp; (strcmp(argv[0], &amp;quot;set&amp;quot;) == 0))
    {
        if (!parse_hex_str(argv[1], ic, 2*sizeof(ic), false))
        {
            p_err_msg = &amp;quot;Failed to parse IC&amp;quot;;
            goto exit;
        }

        if (zb_secur_ic_set(ic) != RET_OK)
        {
            p_err_msg = &amp;quot;Failed to set IC&amp;quot;;
            goto exit;
        }
    }
    else if ((argc == 3) &amp;amp;&amp;amp; (strcmp(argv[0], &amp;quot;add&amp;quot;) == 0))
    {
        if (!parse_hex_str(argv[1], ic, 2*sizeof(ic), false))
        {
            p_err_msg = &amp;quot;Failed to parse IC&amp;quot;;
            goto exit;
        }

        if (!parse_long_address(argv[2], addr))
        {
            p_err_msg = &amp;quot;Failed to parse eui64&amp;quot;;
            goto exit;
        }

        if (zb_secur_ic_add(addr, ic) != RET_OK)
        {
            p_err_msg = &amp;quot;Failed to add IC&amp;quot;;
            goto exit;
        }
    }
    else if ((argc == 2) &amp;amp;&amp;amp; (strcmp(argv[0], &amp;quot;policy&amp;quot;) == 0))
    {
        if (strcmp(argv[1], &amp;quot;enable&amp;quot;) == 0)
        {
            zb_set_installcode_policy(ZB_TRUE);
        }
        else if (strcmp(argv[1], &amp;quot;disable&amp;quot;) == 0)
        {
            zb_set_installcode_policy(ZB_FALSE);
        }
        else
        {
            p_err_msg = &amp;quot;Syntax error&amp;quot;;
            goto exit;
        }
    }
    else
    {
        p_err_msg =&amp;quot;Syntax error&amp;quot;;
    }

exit:
    if (p_err_msg)
    {
        print_error(p_cli, p_err_msg);
    }
    else
    {
        print_done(p_cli, ZB_FALSE);
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You have to run zb_secur_ic_set at the client side (the side without TC) and you have to run zb_secur_ic_add at the ZC (the side with TC).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>