<?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>otThreadSetMasterKey()  usage</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73973/otthreadsetmasterkey-usage</link><description>This function succeeds only when Thread protocols are disabled. my question is: if the Thread protocols are enable,what should I do to disable them ，now what I do is: 
 &amp;quot;otThreadSetEnabled(otIns,false); errornum = otThreadSetMasterKey(otIns,otMasKey);</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Apr 2021 10:08:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73973/otthreadsetmasterkey-usage" /><item><title>RE: otThreadSetMasterKey()  usage</title><link>https://devzone.nordicsemi.com/thread/305036?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 10:08:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e806b749-0103-4568-899d-b2c88f460bea</guid><dc:creator>xiang san </dc:creator><description>&lt;p&gt;Dear Jorgen:&lt;/p&gt;
&lt;p&gt;I have try it ,it&amp;#39;s worked ,thank you very much&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: otThreadSetMasterKey()  usage</title><link>https://devzone.nordicsemi.com/thread/305033?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 09:58:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e14aee0d-a304-4794-b5d1-d40acdd9afb6</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You are creating a pointer to the otMasterKey object, but you do not create the object that it should point to. Assigning values to the pointer itself will not work correctly.&lt;/p&gt;
&lt;p&gt;Try creating an otMasterKey object first, and pass its reference to the otThreadSetMasterKey function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;otMasterKey otMasKey;

otMasKey.m8[0] = 0xff;
otMasKey.m8[1] = 0xee;
otMasKey.m8[2] = 0xaa;
otMasKey.m8[3] = 0xbb;
otMasKey.m8[4] = 0xcc;
otMasKey.m8[5] = 0x11;
otMasKey.m8[6] = 0x00;
otMasKey.m8[7] = 0x22;
otMasKey.m8[8] = 0x33;
otMasKey.m8[9] = 0x44;
otMasKey.m8[10] = 0x55;
otMasKey.m8[11] = 0x66;
otMasKey.m8[12] = 0x77;
otMasKey.m8[13] = 0x88;
otMasKey.m8[14] = 0x99;
otMasKey.m8[15] = 0xdd;

otThreadSetEnabled(otIns,false);
errornum = otThreadSetMasterKey(otIns,&amp;amp;otMasKey);
otThreadSetEnabled(otIns,true);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: otThreadSetMasterKey()  usage</title><link>https://devzone.nordicsemi.com/thread/305023?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 09:33:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d956175-ff74-4f3e-96d5-79fab03140a5</guid><dc:creator>xiang san </dc:creator><description>&lt;p&gt;Yes, the SDK is &amp;quot;nRF5_SDK_for_Thread_and_Zigbee_v4.1.0&amp;quot; , the examples is &amp;quot;examples\multiprotocol\ble_thread\ble_thread_dyn_template&amp;quot;&amp;nbsp; and the define of otMasKey is:&lt;/p&gt;
&lt;p&gt;otMasterKey *otMasKey;&lt;/p&gt;
&lt;p&gt;otMasKey-&amp;gt;m8[0] = 0xff;&lt;br /&gt; otMasKey-&amp;gt;m8[1] = 0xee;&lt;br /&gt; otMasKey-&amp;gt;m8[2] = 0xaa;&lt;br /&gt; otMasKey-&amp;gt;m8[3] = 0xbb;&lt;br /&gt; otMasKey-&amp;gt;m8[4] = 0xcc;&lt;br /&gt; otMasKey-&amp;gt;m8[5] = 0x11;&lt;br /&gt; otMasKey-&amp;gt;m8[6] = 0x00;&lt;br /&gt; otMasKey-&amp;gt;m8[7] = 0x22;&lt;br /&gt; otMasKey-&amp;gt;m8[8] = 0x33;&lt;br /&gt; otMasKey-&amp;gt;m8[9] = 0x44;&lt;br /&gt; otMasKey-&amp;gt;m8[10] = 0x55;&lt;br /&gt; otMasKey-&amp;gt;m8[11] = 0x66;&lt;br /&gt; otMasKey-&amp;gt;m8[12] = 0x77;&lt;br /&gt; otMasKey-&amp;gt;m8[13] = 0x88;&lt;br /&gt; otMasKey-&amp;gt;m8[14] = 0x99;&lt;br /&gt; otMasKey-&amp;gt;m8[15] = 0xdd;&lt;/p&gt;
&lt;p&gt;I think there&amp;nbsp;is no problem with this definition, I have modified this example when ble received some special string, it go into：&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;otThreadSetEnabled(otIns,false);&lt;/span&gt;&lt;br /&gt;&lt;span&gt;errornum = otThreadSetMasterKey(otIns,otMasKey);&lt;/span&gt;&lt;br /&gt;&lt;span&gt;otThreadSetEnabled(otIns,true);&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;then came the question above,&amp;nbsp;what problems can you find about the above ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: otThreadSetMasterKey()  usage</title><link>https://devzone.nordicsemi.com/thread/305012?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 08:45:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b2f666b-61f7-443a-8b26-714a28d98a4a</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;How is&amp;nbsp;&lt;span&gt;otMasKey set/defined? I assume this is correct, if you have tested the function before without first enabling Thread, but there is an ASSERT inside the function that checks that the key argument pointer is not NULL.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Which SDK version and example are you using? Can you reproduce this easily with one of the SDK examples?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: otThreadSetMasterKey()  usage</title><link>https://devzone.nordicsemi.com/thread/304948?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 01:51:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8d3153c-ce0a-43fe-98a0-9be57ad133f3</guid><dc:creator>xiang san </dc:creator><description>&lt;p&gt;&lt;span&gt;The otThreadSetEnabled() return 0 ,but&amp;nbsp;otThreadSetMasterKey() does not return ,it&amp;nbsp; like dead&amp;nbsp; in it&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: otThreadSetMasterKey()  usage</title><link>https://devzone.nordicsemi.com/thread/304769?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 10:30:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75674113-959f-419b-9adb-05499186bc82</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you checking the return codes from both&amp;nbsp;&lt;span&gt;otThreadSetEnabled() and&amp;nbsp;otThreadSetMasterKey()?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you get any errors, or is it just not updating the MasterKey?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>