<?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>nRF52 Thread unicast mode ipaddr read and write</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83307/nrf52-thread-unicast-mode-ipaddr-read-and-write</link><description>Hi, I am currently working on nRF52 Thread v4.1.0 . 
 I am working on messaging transferring using coAP server an client . 
 previously using CLI commands to detect the ipaddr , ipaddr add, ipaddr del 
 i want to set the static ipaddr for my devices </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 11 Jan 2022 13:08:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83307/nrf52-thread-unicast-mode-ipaddr-read-and-write" /><item><title>RE: nRF52 Thread unicast mode ipaddr read and write</title><link>https://devzone.nordicsemi.com/thread/347167?ContentTypeID=1</link><pubDate>Tue, 11 Jan 2022 13:08:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1177a1e-7517-4261-b936-4aba5cd71155</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;Hi J&amp;oslash;rgen,&lt;/p&gt;
&lt;p&gt;Yes it works&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Thread unicast mode ipaddr read and write</title><link>https://devzone.nordicsemi.com/thread/346957?ContentTypeID=1</link><pubDate>Mon, 10 Jan 2022 13:32:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a9441bf-5a30-47f4-9a9d-21dc6dc80a7c</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Compiling your code gives warning about passing pointer from integer without cast to otIp6AddressFromString:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;warning: passing argument 1 of &amp;#39;otIp6AddressFromString&amp;#39; makes pointer from integer without a cast [-Wint-conversion]&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Try passing&amp;nbsp;stat_ip instead of&amp;nbsp;stat_ip[0].&lt;/p&gt;
&lt;p&gt;This gives me this output:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;gt; ipaddr
fdde:ad00:beef:0:0:ff:fe00:fc00
fdde:ad00:beef:0:0:ff:fe00:dc00
fdde:0:0:0:0:dead:beef:1002
fdde:ad00:beef:0:fd05:418f:3d65:fc76
fe80:0:0:0:4078:a2fb:2e53:a22a
Done&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Thread unicast mode ipaddr read and write</title><link>https://devzone.nordicsemi.com/thread/346783?ContentTypeID=1</link><pubDate>Sat, 08 Jan 2022 10:48:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fa16362-646c-4be1-bc7f-ab6f3d50e9df</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;Hi J&amp;oslash;rgen,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;const char  * stat_ip = &amp;quot;FDDE::DEAD:BEEF:1002&amp;quot;;
int aArgsLength = 10;

void ipaddrAdd()
{
    otError        error;
    otNetifAddress aAddress;

    otInstance * mInstance = thread_ot_instance_get();   
    otIp6AddressFromString(stat_ip[0], &amp;amp;aAddress.mAddress);
    aAddress.mPrefixLength = 64;
    aAddress.mPreferred    = true;
    aAddress.mValid        = true;
    error                  = otIp6AddUnicastAddress(mInstance, &amp;amp;aAddress);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;added these lines and call the ipaddrAdd()&amp;nbsp;&lt;/p&gt;
&lt;p&gt;under&lt;/p&gt;
&lt;p&gt;thread_instance_init();&lt;br /&gt;thread_coap_init();&lt;br /&gt;thread_bsp_init();&lt;br /&gt;ipaddrAdd();&lt;/p&gt;
&lt;p&gt;output is&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;gt; 
&amp;gt; ipaddr
fdde:ad00:beef:0:0:ff:fe00:fc00
fdde:ad00:beef:0:0:ff:fe00:c000
0:0:0:0:0:0:0:0
fdde:ad00:beef:0:263c:9c02:6ca0:1fb2
fe80:0:0:0:a894:c859:4d2d:2302
Done
&amp;gt; 
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Thread unicast mode ipaddr read and write</title><link>https://devzone.nordicsemi.com/thread/345972?ContentTypeID=1</link><pubDate>Tue, 04 Jan 2022 16:52:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21d5ee53-8096-4771-911f-7d782a2b5ef0</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The addresses are assigned during different part of the initialization and/or network formation/attachment process. Some of the addresses are also dynamic, and may change during runtime if the Thread network change.&lt;/p&gt;
&lt;p&gt;I would recommend you to read about the different &lt;a href="https://openthread.io/guides/thread-primer/ipv6-addressing"&gt;IPv6 addressing types&lt;/a&gt; in the OpenThread documentation.&lt;/p&gt;
&lt;p&gt;From your example output:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;&lt;strong&gt;fe80:0:0:0:3448:71b0:2147:7e41&lt;/strong&gt; is the&amp;nbsp;Link-Local Address (assigned during CLI command &amp;quot;ifconfig up&amp;quot;)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;strong&gt;fdde:ad00:beef:0:c1f7:fe04:39ec:79ad&lt;/strong&gt; is the&amp;nbsp;Mesh-Local EID address of the device. This address is not dependent&amp;nbsp;on network topology, so this is the recommended address to use when you want to address a specific node.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;strong&gt;fdde:ad00:beef:0:0:ff:fe00:5c00&lt;/strong&gt; is the&amp;nbsp;Routing Locator (RLOC)&amp;nbsp;address of the node, which is dependent on the nodes placement in the network. If the node changes it state to child, or REED, this address will change. The address may also change due to other changes in the network.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;strong&gt;fdde:ad00:beef:0:0:ff:fe00:fc00&lt;/strong&gt; is the&amp;nbsp;Anycast Locator for the network Leader node. If another node in the network takes over the role as leader, it will be assigned this address. The address will then disappear from this node (you can test this by adding another node to your network, it will have only the 3 above addresses)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Thread unicast mode ipaddr read and write</title><link>https://devzone.nordicsemi.com/thread/345964?ContentTypeID=1</link><pubDate>Tue, 04 Jan 2022 16:01:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c41f4d79-beb3-46c4-b7a2-71db39a0530b</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;Hi J&amp;oslash;rgen, Thanks for your reply.&lt;/p&gt;
&lt;p&gt;During initialization of Thread itself ipaddress is set?&lt;/p&gt;
&lt;p&gt;if so during that time itself we give static ipaddress or&lt;/p&gt;
&lt;p&gt;there should be 3 or 4 set of ipaddress will generate&lt;/p&gt;
&lt;p&gt;&amp;gt; ipaddr&lt;br /&gt;fdde:ad00:beef:0:0:ff:fe00:fc00&lt;br /&gt;fdde:ad00:beef:0:0:ff:fe00:5c00&lt;br /&gt;fdde:ad00:beef:0:c1f7:fe04:39ec:79ad&lt;br /&gt;fe80:0:0:0:3448:71b0:2147:7e41&lt;br /&gt;Done&lt;/p&gt;
&lt;p&gt;can we set only one ipaddr and it should be static is it possible&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 Thread unicast mode ipaddr read and write</title><link>https://devzone.nordicsemi.com/thread/345954?ContentTypeID=1</link><pubDate>Tue, 04 Jan 2022 15:14:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bed7e89a-1b68-4b13-9c82-c23ebac80dd5</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can reference the &lt;a href="https://github.com/openthread/openthread/blob/c6a258e3a5bd90aa26d8245c435c0ae5797027f4/src/cli/cli.cpp#L1444-L1522"&gt;CLI source implementation&lt;/a&gt;&amp;nbsp;in OpenThread, and use the same functions in your application to add/remove/detect IP addresses.&lt;/p&gt;
&lt;p&gt;The sources are located in the OpenThread GitHub directory, e.g.:&amp;nbsp;&lt;a href="https://github.com/openthread/openthread/blob/c6a258e3a5bd90aa26d8245c435c0ae5797027f4/src/core/api/ip6_api.cpp"&gt;https://github.com/openthread/openthread/blob/c6a258e3a5bd90aa26d8245c435c0ae5797027f4/src/core/api/ip6_api.cpp&lt;/a&gt;. The SDK is delivered with pre-build libraries of OpenThread, without source files. You can &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/thread_ot_libraries_building.html"&gt;clone and build the libraries&lt;/a&gt; on your local PC for the debugger to find the correct paths to the source files.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>