<?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>Peripheral MAC change</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18330/peripheral-mac-change</link><description>Hello, 
 if we want protect our (central) device against tracking and still allow it to connect with specific Peripheral we can use whitelist with IRK (and?) mac address (is mac still mandatory on the list with IRK?). My question - what if we want to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Dec 2016 11:42:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18330/peripheral-mac-change" /><item><title>RE: Peripheral MAC change</title><link>https://devzone.nordicsemi.com/thread/70775?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 11:42:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d1ae8da-f2e3-46d6-8dae-7229276fb467</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Yes :) Great! Then I would appreciate if you could accept my answer by clicking the grey circle next to it. Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral MAC change</title><link>https://devzone.nordicsemi.com/thread/70774?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 11:40:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c80b0a1-b7eb-4faf-9624-8542ce4eba0b</guid><dc:creator>adriand</dc:creator><description>&lt;p&gt;Ah, yes you&amp;#39;re right, ble_opt_t.privacy has a pointer to ble_gap_irk_t not object. Ok, I&amp;#39;ll go further later with that and add new question if I come accross any problems.
Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral MAC change</title><link>https://devzone.nordicsemi.com/thread/70776?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 11:33:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab148d64-ebde-402b-82a8-8e3470aaf169</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Then I think you must do something like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_opt_t prv_opt2;
ble_gap_irk_t mm_irk2;

prv_opt2.gap_opt.privacy.p_irk = &amp;amp;mm_irk2;

err_code = sd_ble_opt_get(BLE_GAP_OPT_PRIVACY, &amp;amp;prv_opt2);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can&amp;#39;t provice more than one key with this method. The device address will be derived from the IRK set.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral MAC change</title><link>https://devzone.nordicsemi.com/thread/70777?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 11:20:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69301436-db5b-4669-a23c-6e9406a013d2</guid><dc:creator>adriand</dc:creator><description>&lt;p&gt;Hm, ok, I printed the exact key from your code, but shouldn&amp;#39;t I be able to manage sd_ble_opt_get() on different object of ble_opt_t? When I create for eg. ble_opt_t prv_opt2 (so I used prv_opt for set and after that prv_opt2 for get) and manage sd_ble_opt_get(BLE_GAP_OPT_PRIVACY, &amp;amp;prv_opt2) then I have a rubbish printed from irk..
And still there is a question - how can I provide more than one key with that method?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral MAC change</title><link>https://devzone.nordicsemi.com/thread/70778?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 09:58:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ab59749-a8d4-46f0-aead-f62cfd85ab3f</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;This should work:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_gap_irk_t mm_irk = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
ble_opt_t prv_opt;
prv_opt.gap_opt.privacy.interval_s = 180;

prv_opt.gap_opt.privacy.p_irk = &amp;amp;mm_irk;

err_code = sd_ble_opt_set(BLE_GAP_OPT_PRIVACY, &amp;amp;prv_opt);
APP_ERROR_CHECK(err_code);

memset(prv_opt.gap_opt.privacy.p_irk, 0, BLE_GAP_SEC_KEY_LEN);

err_code = sd_ble_opt_get(BLE_GAP_OPT_PRIVACY, &amp;amp;prv_opt);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral MAC change</title><link>https://devzone.nordicsemi.com/thread/70779?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 07:41:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de2e1f33-fa68-428d-a149-a72614680158</guid><dc:creator>adriand</dc:creator><description>&lt;p&gt;Ok, please let me know if you figure out something.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral MAC change</title><link>https://devzone.nordicsemi.com/thread/70773?ContentTypeID=1</link><pubDate>Tue, 20 Dec 2016 15:16:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db5c2d6e-09db-4ac8-aa0c-0716bd61bde1</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I see. I&amp;#39;m getting the same behavior here. Which was unexpected, I need to look into this further.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral MAC change</title><link>https://devzone.nordicsemi.com/thread/70772?ContentTypeID=1</link><pubDate>Tue, 20 Dec 2016 12:42:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e63e9dcd-0def-4546-85e8-f156598c6546</guid><dc:creator>adriand</dc:creator><description>&lt;p&gt;Yes indeed, I tried Hung&amp;#39;s idea with sd_ble_opt_set(), I tried:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    static void set_irk()
{
	ble_gap_irk_t mm_irk = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
	ble_opt_t prv_opt;
	prv_opt.gap_opt.privacy.interval_s = 180;

	prv_opt.gap_opt.privacy.p_irk = &amp;amp;mm_irk;

	uint32_t err = sd_ble_opt_set(BLE_GAP_OPT_PRIVACY, &amp;amp;prv_opt);
	LOG_INFO(&amp;quot;sd_ble_opt_set err: 0x%x&amp;quot;, err);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Operation return success (0), but after when I read the settings with sd_ble_opt_get() the key parameter (p_irk) was null.. Another question is how to provide more than one key with that method. I should be able to set up to 8 keys.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral MAC change</title><link>https://devzone.nordicsemi.com/thread/70771?ContentTypeID=1</link><pubDate>Tue, 20 Dec 2016 11:04:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e59d4aa4-e750-4ca8-872f-179c509e6230</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I haven&amp;#39;t tried it myself, but it seems to be possible with S130 v2.0.0. Isn&amp;#39;t that what Hung is also saying in the question you linked to? Use sd_ble_opt_set() with BLE_GAP_OPT_PRIVACY and supply the IRK in ble_gap_opt_privacy_t.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral MAC change</title><link>https://devzone.nordicsemi.com/thread/70770?ContentTypeID=1</link><pubDate>Tue, 20 Dec 2016 10:33:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1228cffa-a5ab-450b-804e-1dba1408a38e</guid><dc:creator>adriand</dc:creator><description>&lt;p&gt;Great, I will. So just to be sure: there is no option to manage IRK-based connection with own pre-programmed IRKs using s130 v2.0.0 SDK11 (nRF51) without bonding, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral MAC change</title><link>https://devzone.nordicsemi.com/thread/70768?ContentTypeID=1</link><pubDate>Tue, 20 Dec 2016 10:14:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c9304ae-7b9a-4bc2-a4f3-ed5b23085e73</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;That should work. If you get into trouble implementing it, I think you should add a new question and explain what you have done. Link to this if it is relevant.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral MAC change</title><link>https://devzone.nordicsemi.com/thread/70769?ContentTypeID=1</link><pubDate>Mon, 19 Dec 2016 22:11:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fbaa7ee-4b93-4d28-aed3-973753c397a0</guid><dc:creator>adriand</dc:creator><description>&lt;p&gt;Sorry I&amp;#39;m answering so late, however thank you for your answer. Possibility of setting my own IRK keys without previous bonding is probably what I&amp;#39;m looking for. I was a little bit confused finding different answers about that. For eg. according to this post &lt;a href="https://devzone.nordicsemi.com/question/60416/irk-as-the-only-security-perimeter/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt; I try to set IRK with sd_ble_opt_set() with S130 v2.0.0, but I couldn&amp;#39;t do that.
So, to sum up, to accomplish my task I should set the same IRKs on both central and peripheral, use Resolvable Addresses for both of them, put IRKs into peripheral&amp;#39;s advertising whitelist as well as into central connection scan parameters whitelist, am I right?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peripheral MAC change</title><link>https://devzone.nordicsemi.com/thread/70767?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2016 11:16:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78dd4354-f889-4ce7-8c3b-1b26d3c25d4e</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;If you want to protect your central device against tracking, but still be recognizable by trusted devices you can use the random private resolvable address type. Keep in mind that as long as the device is not sending out scan requests and connection requests it is difficult to track it, because it will only be scanning.&lt;/p&gt;
&lt;p&gt;The peripheral needs the IRK to resolve the address. It can put the IRK (only) into a whitelist if it wants to filter away scan requests and/or connection requests from other centrals.&lt;/p&gt;
&lt;p&gt;If the peripheral uses the random private resolvable address type the central needs the IRK to resolve the address. It can put the IRK into a whitelist if it wants to filter away advertisments from other peripherals.&lt;/p&gt;
&lt;p&gt;Typically the IRK is distributed when you bond, but with SoftDevice S130 v3.0.0 and later you can set the IRK to use with sd_ble_gap_privacy_set().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>