<?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>Directed advertising with pre-shared IRK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18512/directed-advertising-with-pre-shared-irk</link><description>Hello, I&amp;#39;d like to do directed avertising to a central which has a random private resolvable address. My idea: both devices share a pre-defined IRK so the peripheral can compute the central&amp;#39;s address and start advertising to this address. According to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Jan 2017 09:10:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18512/directed-advertising-with-pre-shared-irk" /><item><title>RE: Directed advertising with pre-shared IRK</title><link>https://devzone.nordicsemi.com/thread/71441?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2017 09:10:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8857fd8e-dd1c-4888-afeb-06fa794ff996</guid><dc:creator>KAoT</dc:creator><description>&lt;p&gt;Yep, that&amp;#39;s working!
I was not aware of the &lt;code&gt;adv_dir_report&lt;/code&gt; member of &lt;code&gt;ble_gap_scan_params_t&lt;/code&gt; struct. Setting this to one did the trick.
Thanks a lot for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directed advertising with pre-shared IRK</title><link>https://devzone.nordicsemi.com/thread/71440?ContentTypeID=1</link><pubDate>Tue, 27 Dec 2016 13:25:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4f33b96-f622-4a19-96c9-e053152f45b1</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Seems to be working.&lt;/p&gt;
&lt;p&gt;For the peripheral:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ret_code_t err_code;

const ble_gap_id_key_t m_peer1 = 
{
    .id_info =
    {
        .irk = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},
    }
};

const ble_gap_id_key_t * m_identities[] = {&amp;amp;m_peer1};

err_code = sd_ble_gap_device_identities_set(m_identities, NULL, 1);
APP_ERROR_CHECK(err_code);

ble_gap_addr_t gap_addr = 
{
    .addr_id_peer = 0,
};

ble_gap_adv_params_t adv_params;

memset(&amp;amp;adv_params, 0, sizeof(adv_params));
adv_params.type        = BLE_GAP_ADV_TYPE_ADV_DIRECT_IND; 
adv_params.p_peer_addr = &amp;amp;gap_addr;

err_code = sd_ble_gap_adv_start(&amp;amp;adv_params);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For the central:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t err_code;

ble_gap_irk_t irk = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};

ble_gap_privacy_params_t privacy_params;
privacy_params.privacy_mode = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY;

privacy_params.private_addr_cycle_s = 15*60;
privacy_params.private_addr_type = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;
privacy_params.p_device_irk = &amp;amp;irk;

err_code = sd_ble_gap_privacy_set(&amp;amp;privacy_params);
APP_ERROR_CHECK(err_code);

m_scan_param.active   = 0;
m_scan_param.interval = SCAN_INTERVAL;
m_scan_param.window   = SCAN_WINDOW;
m_scan_param.timeout  = 0x0000;

m_scan_param.use_whitelist  = 0;
m_scan_param.adv_dir_report = 1;

err_code = sd_ble_gap_scan_start(&amp;amp;m_scan_param);
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: Directed advertising with pre-shared IRK</title><link>https://devzone.nordicsemi.com/thread/71439?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 14:08:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:915c639a-d9dc-4a0c-af17-12fea5977e33</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Ok. I&amp;#39;ll see if I can make a small example. Let me know if you have any news.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directed advertising with pre-shared IRK</title><link>https://devzone.nordicsemi.com/thread/71438?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 13:53:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aba8c95f-3c85-436b-8fdc-39f3f59c9503</guid><dc:creator>KAoT</dc:creator><description>&lt;p&gt;I guess you&amp;#39;re right, not both should be set. I tested with a private peer + only id_info and static peer + only id_addr_info and it seems to work that way. But still, no connection so far.  Initiator replies with a connection request and then seems to stop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directed advertising with pre-shared IRK</title><link>https://devzone.nordicsemi.com/thread/71437?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 12:07:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85669fbd-6939-407b-8b36-4e1875e4e307</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I haven&amp;#39;t tested this myself, but I would think it would be something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const ble_gap_id_key_t m_peer1 = {
  .id_info ={
      .irk = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F},}
};
const ble_gap_id_key_t * m_identities[] = {&amp;amp;m_peer1};

err_code = sd_ble_gap_device_identities_set(m_identities,NULL,1);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I don&amp;#39;t think you should set id_addr_info and id_info.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directed advertising with pre-shared IRK</title><link>https://devzone.nordicsemi.com/thread/71436?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2016 16:37:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19a8e552-f1b8-4722-aa69-8227a5af25c3</guid><dc:creator>KAoT</dc:creator><description>&lt;p&gt;Thanks for the comment Petter Myhre, I found the part I was missing  in your link.&lt;/p&gt;
&lt;p&gt;In the scanning device right before starting to scan I&amp;#39;ve added the advertiser&amp;#39;s identity with&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const ble_gap_id_key_t m_peer1 = {
  .id_addr_info = {
    .addr_type = BLE_GAP_ADDR_TYPE_RANDOM_STATIC,
    .addr = {0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xfX},},
  .id_info ={
      .irk = {0x00,0x01,0x02,0x03,...,0x0F},}
};
const ble_gap_id_key_t * m_identities[] = {&amp;amp;m_peer1};

sd_ble_gap_device_identities_set(m_identities,NULL,1);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now the device responds to the advertising, but connection is not possible so far. Interestingly, the address type of the id key must be of type random static in order to make it work, although the advertiser is not using this address type. I&amp;#39;m still confused how I have to set this up correctly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directed advertising with pre-shared IRK</title><link>https://devzone.nordicsemi.com/thread/71435?ContentTypeID=1</link><pubDate>Wed, 21 Dec 2016 11:21:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ff01f5c-7aed-4595-9699-f77e8f5faccc</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Maybe try like shown in &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/group___b_l_e___g_a_p___p_r_i_v_a_c_y___a_d_v___d_i_r___p_r_i_v___m_s_c.html?cp=2_3_0_1_1_2_1_3_9_1"&gt;this&lt;/a&gt; MSC instead?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>