<?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>using public MAC address</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84536/using-public-mac-address</link><description>We are using public MAC that was purchased from IEEE (20 low bits are available for us to set and the upper 28 bits are constant to value assigned to us by the IEEE). 
 We also see this code in your library (components/ble/nrf_ble_scan.c): 
 static uint16_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 Feb 2022 13:26:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84536/using-public-mac-address" /><item><title>RE: using public MAC address</title><link>https://devzone.nordicsemi.com/thread/353370?ContentTypeID=1</link><pubDate>Wed, 16 Feb 2022 13:26:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d9931a2-c978-43aa-8b2c-d90dcde254b8</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am not sure why, but for some reason I thought you were using the nRF Connect SDK, but I see that you are using the nRF5 SDK. What SDK version are you using? I discussed this with a colleague, who informed me that this was a bug in the older SDKs, but it is fixed in SDK17.1.0. If you examine thenrf_ble_scan.c file in SDK17.1.0, you can see that the function you refer to is removed (unfortunately, because it didn&amp;#39;t interpret the addresses correctly before, and it wasn&amp;#39;t possible to fix this parsing without an API change).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So I suggest that you use SDK17.1.0, set the address type to public, and use your public address as the entire address. The bit that suggests whether an address is public or private is not part of the Bluetooth LE address uin8_t addr[0-5], but actually a bit outside this. Please see &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/27012/how-to-distinguish-between-random-and-public-gap-addresses"&gt;this discussion&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]1. isn&amp;#39;t this code conflict with the use of IEEE MAC addresses?[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes it does. Fixed in the latest SDK.&lt;/p&gt;
[quote user=""]2. if our MAC is &amp;quot;uint8_t mac[6];&amp;quot; then these two bits settings the address type should be bits 6:7 in mac[5] or bits 6:7 in mac[0]?[/quote]
&lt;p&gt;Neither. The public/private domain is not determined by these two bits.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: using public MAC address</title><link>https://devzone.nordicsemi.com/thread/351813?ContentTypeID=1</link><pubDate>Mon, 07 Feb 2022 21:12:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76c2fbd0-6e3d-4c7c-9ece-82cfd9af5505</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;At first glance, this looks a bit weird, I agree.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I believe it is the bit 6:7 in mac[0], but I have not tested this in Zephyr yet. I am not 100% sure it is the same endianness as it was in the nRF5 SDK. I will check this tomorrow.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Some places I find indications that these bits can be anything (assigned by IEEE), while other places it looks like they need to be 0b01.&lt;/p&gt;
&lt;p&gt;I am sorry. I ran out of time today, but I will try to clear this up tomorrow. I have seen this question a couple of times before, but I don&amp;#39;t remember what the conclusion was. I will try to dig up some old cases tomorrow.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>