<?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>Ble advertise custom MAC address does not chance the last 2 MSB</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32877/ble-advertise-custom-mac-address-does-not-chance-the-last-2-msb</link><description>Hi guys, 
 I have custom MAC address that saved in the flash. I used the sd_ble_gap_address_set function to change the Mac address to my custom address.. I found out in phone that the Mac address that advertise is the same on the (MSB) part. The 2 MSB</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Apr 2018 06:17:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32877/ble-advertise-custom-mac-address-does-not-chance-the-last-2-msb" /><item><title>RE: Ble advertise custom MAC address does not chance the last 2 MSB</title><link>https://devzone.nordicsemi.com/thread/127941?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 06:17:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c07af604-3b71-48c7-9ab1-8efa48df59e0</guid><dc:creator>mc</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for the answer.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Marlon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Ble advertise custom MAC address does not chance the last 2 MSB</title><link>https://devzone.nordicsemi.com/thread/126893?ContentTypeID=1</link><pubDate>Wed, 04 Apr 2018 14:42:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80032f02-923e-4e36-a409-501985a0061e</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The custom MAC address will be whatever you set it to with&amp;nbsp;sd_ble_gap_address_set. The 2 MSB bit will not be set to 11 automatically when you are overriding the &amp;quot;default&amp;quot; MAC with your custom MAC.&lt;/p&gt;
&lt;p&gt;If you need the 2 MSB bit to be &amp;lsquo;11&amp;rsquo;, then you need to set this yourself.&lt;/p&gt;
&lt;p&gt;Note that if you have set the addr_type to BLE_GAP_ADDR_TYPE_RANDOM_STATIC, the sd_ble_gap_address_set function will return BLE_ERROR_GAP_INVALID_BLE_ADDR if the 2 MSB bit are not &amp;lsquo;11&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    ble_gap_addr_t m_my_addr;
    m_my_addr.addr_type = BLE_GAP_ADDR_TYPE_RANDOM_STATIC;
    m_my_addr.addr[0] = 0xAA;
    m_my_addr.addr[1] = 0xBB; 
    m_my_addr.addr[2] = 0xCC;
    m_my_addr.addr[3] = 0xDD;
    m_my_addr.addr[4] = 0xEE;
    m_my_addr.addr[5] = 0x00;
    
    /* Set 2 MSBit to &amp;#39;11 */
    m_my_addr.addr[5] |= 0xC0; // 2 MSBit must be &amp;#39;11&amp;#39; for RANDOM_STATIC address.&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>