<?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>Central - use public address</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18846/central---use-public-address</link><description>Hi.
I&amp;#39;m new to Nordic BLE devices. Using the nrf51-DK.
I have a peripheral device (non-Nordic) which I want to connect to from a Nordic central (S130) using the public address. It seems that by default the address used by the central is the random one</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Jan 2017 10:12:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18846/central---use-public-address" /><item><title>RE: Central - use public address</title><link>https://devzone.nordicsemi.com/thread/72799?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2017 10:12:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51bdbe2e-0ef4-4d4d-a010-00c5a492c5c2</guid><dc:creator>M</dc:creator><description>&lt;p&gt;Ok.
Thank you very much.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central - use public address</title><link>https://devzone.nordicsemi.com/thread/72798?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2017 09:57:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5be6d90d-fa5d-4f74-b52b-e725b80e0149</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You set it in the &lt;code&gt;ble_gap_addr_t&lt;/code&gt; structure, along with the address. As mentioned above, you do not have to do this, as the softdevice handles this for you. If you want to set the address from FICR yourself, you can use the following code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static ble_gap_addr_t m_central_addr;

m_central_addr.addr_type     = BLE_GAP_ADDR_TYPE_RANDOM_STATIC;
m_central_addr.addr[0] = (uint8_t)NRF_FICR-&amp;gt;DEVICEADDR[0];
m_central_addr.addr[1] = (uint8_t)(NRF_FICR-&amp;gt;DEVICEADDR[0] &amp;gt;&amp;gt; 8);
m_central_addr.addr[2] = (uint8_t)(NRF_FICR-&amp;gt;DEVICEADDR[0] &amp;gt;&amp;gt; 16);
m_central_addr.addr[3] = (uint8_t)(NRF_FICR-&amp;gt;DEVICEADDR[0] &amp;gt;&amp;gt; 24);
m_central_addr.addr[4] = (uint8_t)NRF_FICR-&amp;gt;DEVICEADDR[1];
m_central_addr.addr[5] = (uint8_t)((NRF_FICR-&amp;gt;DEVICEADDR[1] &amp;gt;&amp;gt; 8) | 0xC0); // 2MSB must be set 11

sd_ble_gap_addr_set(&amp;amp;m_central_addr);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central - use public address</title><link>https://devzone.nordicsemi.com/thread/72791?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2017 14:45:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bba3d86-9950-4b2e-99b4-35725cc60786</guid><dc:creator>M</dc:creator><description>&lt;p&gt;Where do I use this setting BLE_GAP_ADDR_TYPE_RANDOM_STATIC?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central - use public address</title><link>https://devzone.nordicsemi.com/thread/72797?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2017 13:57:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:918e87f3-508b-4029-bab1-58bb640ba9a4</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;If you set the address type to &lt;code&gt;BLE_GAP_ADDR_TYPE_RANDOM_STATIC&lt;/code&gt;, the address will be constant but not entirely unique, as it is randomly generated during production. However, with 2^46 combinations of addresses, the chance of getting two devices with the same address is practically zero. As long as you do not call &lt;code&gt;sd_ble_gap_address_set()&lt;/code&gt; anywhere in your code, this is the default behaviour of the softdevice, so you should not have to change anything. The FICR registers cannot be changed, meaning your device will keep the same address for its whole lifetime.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central - use public address</title><link>https://devzone.nordicsemi.com/thread/72796?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2017 13:45:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0acec3a-5e61-46d5-82e8-8990665b8eca</guid><dc:creator>M</dc:creator><description>&lt;p&gt;*constant and unique&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central - use public address</title><link>https://devzone.nordicsemi.com/thread/72795?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2017 13:43:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2d52988-8097-44cf-bef3-a8d253748b1d</guid><dc:creator>M</dc:creator><description>&lt;p&gt;I don&amp;#39;t mind the address type being random, as long as the address is &lt;strong&gt;constant&lt;/strong&gt; (i.e. each time the central  connects to the peripheral it will identify itself using &lt;strong&gt;the same address&lt;/strong&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central - use public address</title><link>https://devzone.nordicsemi.com/thread/72794?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2017 13:36:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:430b4f77-08ef-4289-9fa6-1280e863539d</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You can use the &lt;a href="https://devzone.nordicsemi.com/question/39375/bluetooth-address-built-in-or-random/?answer=39380#post-id-39380"&gt;device address from FICR&lt;/a&gt; to fill the address struct, but this is what the softdevice does by default (if no address is found in FICR, a random address is generated). If you want a public address, you have to register this with the IEEE Registration Authority.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central - use public address</title><link>https://devzone.nordicsemi.com/thread/72793?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2017 13:30:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90da1cc3-b87c-4300-a269-0013a01ca267</guid><dc:creator>M</dc:creator><description>&lt;p&gt;Does this mean that I have to generate my own address for the central? I wanted to use the one that is already preprogrammed inside the chip by Nordic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central - use public address</title><link>https://devzone.nordicsemi.com/thread/72792?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2017 13:11:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b85912f9-8f4d-4d3a-bf31-1fc423bd5e9e</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You can set the address using &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v2.0.1/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html#ga78b1e409a55beedde9902e2c35a5b5c9"&gt;&lt;code&gt;sd_ble_gap_address_set()&lt;/code&gt;&lt;/a&gt; for S130 v2.0.1 softdevice (sd_ble_gap_addr_set() for latest S132 v3.x.x softdevice for nRF52832). It takes the same address struct as described above, &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v2.0.1/structble__gap__addr__t.html"&gt;&lt;code&gt;ble_gap_addr_t&lt;/code&gt;&lt;/a&gt;, as agrument, and you should set the &lt;code&gt;addr_cycle_mode&lt;/code&gt; argument to &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v2.0.1/group___b_l_e___g_a_p___a_d_d_r___c_y_c_l_e___m_o_d_e_s.html#ga876e1c374d17d451d901e3e8d151a20d"&gt;&lt;code&gt;BLE_GAP_ADDR_CYCLE_MODE_NONE&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central - use public address</title><link>https://devzone.nordicsemi.com/thread/72790?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2017 13:00:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1bc8aaa-30e7-4604-a825-742c80db354c</guid><dc:creator>M</dc:creator><description>&lt;p&gt;Hi Jorden.
Thank you for your reply.
It seems that I didn&amp;#39;t explain myself correctly.
I need the central to &lt;strong&gt;identify itself&lt;/strong&gt; using the public address. Right now when it connects to my peripheral, the peripheral shows peer (central) address type as random.
Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central - use public address</title><link>https://devzone.nordicsemi.com/thread/72789?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2017 12:31:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa91c633-a191-42d2-965d-d388bc3d7e9d</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There should be no difference in the way you connect to a peripheral with a public or a random address.&lt;/p&gt;
&lt;p&gt;The softdevice function &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html#gacb36dc9947591179acb83aef50b04282"&gt;&lt;code&gt;sd_ble_gap_connect()&lt;/code&gt;&lt;/a&gt; takes a pointer to the address struct, &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/structble__gap__addr__t.html"&gt;&lt;code&gt;ble_gap_addr_t&lt;/code&gt;&lt;/a&gt;, as agrument. This should be filled with the address and the address type. By setting the type to &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/group___b_l_e___g_a_p___a_d_d_r___t_y_p_e_s.html#gaa5e499423d88b16817efd4d5ec10fd6e"&gt;&lt;code&gt;BLE_GAP_ADDR_TYPE_PUBLIC&lt;/code&gt;&lt;/a&gt;, you can connect to a device that has a public address.&lt;/p&gt;
&lt;p&gt;If your central is scanning for advertising packets from the device before connecting, you can pass the address struct included in the advertising report, &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/structble__gap__evt__scan__req__report__t.html#a04caea311ecf7e424375ed05e4075b20"&gt;&lt;code&gt;peer_addr&lt;/code&gt;&lt;/a&gt;, directly to the connect function.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>