<?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>How to set my nRF device to use the private resolvable address</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39921/how-to-set-my-nrf-device-to-use-the-private-resolvable-address</link><description>Hello~ I&amp;#39;m using the nRF52832 board, s132_nrf52_6.1.0_softdevice, SDK 15.2. I&amp;#39;m focusing on 3 peripheral examples; 
 ble_app_hrs &amp;amp; ble_app_eddystone &amp;amp; ble_app_beacon 
 
 If I understood correctly, I think these examples&amp;#39; MAC address doesn&amp;#39;t change. 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Nov 2018 11:43:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39921/how-to-set-my-nrf-device-to-use-the-private-resolvable-address" /><item><title>RE: How to set my nRF device to use the private resolvable address</title><link>https://devzone.nordicsemi.com/thread/155736?ContentTypeID=1</link><pubDate>Fri, 02 Nov 2018 11:43:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09ec7315-44af-43d7-9474-6a20dc7f02e5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Sure, just replace BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S with 300. Default interval is 15 minutes. Same code as I posted earlier but without PM:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void gap_init(void)
{
    uint32_t err_code;
    ble_gap_privacy_params_t privacy_params;

    memset(&amp;amp;privacy_params, 0, sizeof(ble_gap_privacy_params_t));

    privacy_params.privacy_mode         = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY;
    privacy_params.private_addr_type    = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;
    privacy_params.private_addr_cycle_s = 300;

    err_code = sd_ble_gap_privacy_set(&amp;amp;privacy_params);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set my nRF device to use the private resolvable address</title><link>https://devzone.nordicsemi.com/thread/155647?ContentTypeID=1</link><pubDate>Thu, 01 Nov 2018 18:29:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7042a379-ee67-4300-825b-6e919a5f07b7</guid><dc:creator>Matthew K</dc:creator><description>&lt;p&gt;Thank you, Vidar. One last question, please.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;ble_gap.h&amp;quot;

    ble_gap_privacy_params_t ble_gap_privacy_params = {0};
    
    ble_gap_privacy_params.privacy_mode = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY;
    ble_gap_privacy_params.private_addr_type = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;
    ble_gap_privacy_params.private_addr_cycle_s = BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S;
    ble_gap_privacy_params.p_device_irk = NULL;
    err_code = sd_ble_gap_privacy_set(&amp;amp;ble_gap_privacy_params);
    APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I tried this by referring this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/19098/how-to-set-ble-gap-address-type-to-random_private_resolvable"&gt;thread&lt;/a&gt;. I noticed that the MAC address of the beacon changes after I turn off/on the device. When using the sd_ble_gap_privacy_set, is there a way to set the period for changing the address? just like you this this;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;privacy_params.private_addr_cycle_s = 300; // Change address every 5 minutes&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set my nRF device to use the private resolvable address</title><link>https://devzone.nordicsemi.com/thread/155184?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 15:00:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0238b848-dfed-473d-bc55-934e3d5f1342</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for the clarification. The peer manager is meant for bond management, so will not be needed in a beacon application.&amp;nbsp; I would suggest to use the SD API to enable privacy instead.&lt;/p&gt;
&lt;p&gt;API to enable privacy:&amp;nbsp;&lt;a title="sd_ble_gap_privacy_set" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v6.1.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=2_3_1_1_0_2_1_2_28#ga2203b7709d7178bc35e7f903bd0e913f"&gt;sd_ble_gap_privacy_set&lt;/a&gt;()&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set my nRF device to use the private resolvable address</title><link>https://devzone.nordicsemi.com/thread/155167?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 14:32:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6844bbee-537e-4cc4-ba33-e3e31bcb4434</guid><dc:creator>Matthew K</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/39921/how-to-set-my-nrf-device-to-use-the-private-resolvable-address/155038"]Do you intend to support pairing/bonding in your app?[/quote]
&lt;p&gt;Nope, except the ble_app_hrs example. I just wanted to change the address every 5 minutes for each example ( ble_app_eddystone &amp;amp; ble_app_beacon).&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/39921/how-to-set-my-nrf-device-to-use-the-private-resolvable-address/155038"]I think ble_app_hrs/ble_app_template would be a better starting point. [/quote]
&lt;p&gt;Thanks, I will try with the Heart Rate example.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/39921/how-to-set-my-nrf-device-to-use-the-private-resolvable-address/155038"]The beacon example&amp;nbsp;is missing several source files typically used to manage BLE connections. [/quote]
&lt;p&gt;Then, what should I add to make the beacon example (both iBeacon and Eddystone) to change its address every 5 minutes?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set my nRF device to use the private resolvable address</title><link>https://devzone.nordicsemi.com/thread/155038?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 09:16:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf95326a-d169-4652-84f1-160083771562</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Do you intend to support pairing/bonding in your app? In that case I think ble_app_hrs/ble_app_template would be a better starting point. The beacon example&amp;nbsp;is missing several source files typically used to manage BLE connections. sdk_config.h will only enable compilation of source files included in the project.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set my nRF device to use the private resolvable address</title><link>https://devzone.nordicsemi.com/thread/154969?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 22:13:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d30bd1c-4e32-4d56-9a10-655e7de59ea1</guid><dc:creator>Matthew K</dc:creator><description>&lt;p&gt;Thanks for your help, Vidar!&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// in sdk_config.h
#define PEER_MANAGER_ENABLED 1
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screen-Shot-2018_2D00_10_2D00_29-at-5.08.54-PM.png" /&gt;&lt;/p&gt;
&lt;p&gt;I tried the ble_app_beacon example from Embedded Studio 4.10.&lt;/p&gt;
&lt;p&gt;I thought simply enabling the &lt;em&gt;&lt;strong&gt;PEER_MANAGER_ENABLED&lt;/strong&gt;&lt;/em&gt; macro and adding the source file &lt;strong&gt;&lt;em&gt;peer_manager.c&lt;/em&gt;&lt;/strong&gt; would end this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Are there extra steps left for solving this error?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set my nRF device to use the private resolvable address</title><link>https://devzone.nordicsemi.com/thread/154899?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 14:07:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33babf24-3c76-4005-95d0-0c0ffdd7339f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes, your observation is correct, the SDK examples uses the random static address by default.&amp;nbsp; In SDK 15.2.0 you can use the&amp;nbsp;peer manager&amp;nbsp;API to enable privacy. E.g.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for the Peer Manager initialization.
 */
static void peer_manager_init(void)
{
    ble_gap_sec_params_t sec_param;
    pm_privacy_params_t  privacy_params;
    ret_code_t           err_code;
...

    err_code = pm_sec_params_set(&amp;amp;sec_param);
    APP_ERROR_CHECK(err_code);

    memset(&amp;amp;privacy_params, 0, sizeof(pm_privacy_params_t));

    privacy_params.privacy_mode         = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY;
    privacy_params.private_addr_type    = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;
    privacy_params.private_addr_cycle_s = 300; // Change address every 5 minutes

    err_code = pm_privacy_set(&amp;amp;privacy_params);
...
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>