<?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>Assigning Random BLE MAC Address - Am I doing it right?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37865/assigning-random-ble-mac-address---am-i-doing-it-right</link><description>Hi 
 I am developing a healthcare device which is paired via NFC. The NFC pairing is non-standard as it needs to work on iOS, I place records for a MAC and a service UUID on the tag. My app learns these from NFC then makes a pairing. The service ID is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Aug 2018 09:34:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37865/assigning-random-ble-mac-address---am-i-doing-it-right" /><item><title>RE: Assigning Random BLE MAC Address - Am I doing it right?</title><link>https://devzone.nordicsemi.com/thread/146264?ContentTypeID=1</link><pubDate>Wed, 29 Aug 2018 09:34:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d294a38-1ae9-4a35-a8be-16a085224780</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="73171" url="~/f/nordic-q-a/37865/assigning-random-ble-mac-address---am-i-doing-it-right"]1) Is there a better way?[/quote]
&lt;p&gt;Another approach could be to use whitelist and &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.1.0/lib_ble_advertising.html?cp=4_0_0_3_2_1"&gt;directed advertising&lt;/a&gt;. Take a look at how this is done in the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.1.0/ble_sdk_app_hid_keyboard_pairing_nfc.html?cp=4_0_0_4_1_2_32"&gt;ble_app_hids_keyboard_pairing_nfc example&lt;/a&gt;.&lt;/p&gt;
[quote userid="73171" url="~/f/nordic-q-a/37865/assigning-random-ble-mac-address---am-i-doing-it-right"]2) Are there any dangers in doing it the way I am (eg addresses considered invalid that centrals will refuse to connect to?)[/quote]
&lt;p&gt;If you go for this approach, make sure that you are generating a valid random static address, where the 2 MSB is set to &amp;#39;11&amp;#39;. See &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/32877/ble-advertise-custom-mac-address-does-not-chance-the-last-2-msb/126893#126893"&gt;this&lt;/a&gt; and &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/18877/i-want-to-change-the-ble-address#post-id-110344"&gt;this post&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>