<?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 include mac address in advertisement packet name?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26281/how-to-include-mac-address-in-advertisement-packet-name</link><description>Hello,
I am using sdk 12.2.2 and pca10040. I want to include the mac address in adv packet name. I am not aware of the api used to get mac address. I used sd_ble_gap_address_get(&amp;amp;m_devAddress); but it didn&amp;#39;t work. Can I get help related to this challenge</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Oct 2017 11:48:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26281/how-to-include-mac-address-in-advertisement-packet-name" /><item><title>RE: How to include mac address in advertisement packet name?</title><link>https://devzone.nordicsemi.com/thread/103441?ContentTypeID=1</link><pubDate>Thu, 26 Oct 2017 11:48:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70b7cb45-332f-4fad-b24a-89e08be98b0c</guid><dc:creator>Newbie</dc:creator><description>&lt;p&gt;Hi Sigurd,
That worked.
Thanks,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include mac address in advertisement packet name?</title><link>https://devzone.nordicsemi.com/thread/103442?ContentTypeID=1</link><pubDate>Thu, 26 Oct 2017 07:28:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31fdde72-8a34-4f50-96fe-f278d9d7c1ee</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It was renamed to &lt;code&gt;sd_ble_gap_addr_get()&lt;/code&gt;  in SDK 12.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include mac address in advertisement packet name?</title><link>https://devzone.nordicsemi.com/thread/103443?ContentTypeID=1</link><pubDate>Thu, 26 Oct 2017 04:56:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63799e45-3c6f-438b-8a7c-7ce1c7468960</guid><dc:creator>Newbie</dc:creator><description>&lt;p&gt;Hi,
I tried your suggestions but unfortunately I am getting error as
&amp;quot;._build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol sd_ble_gap_address_get (referred from main.o).&amp;quot;
Am I missing some files here? I am attaching my main.c file in question above.
Thanks for you help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include mac address in advertisement packet name?</title><link>https://devzone.nordicsemi.com/thread/103440?ContentTypeID=1</link><pubDate>Wed, 25 Oct 2017 13:27:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:682568f4-aece-4d22-8db8-676d6dafc040</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;By default the advertisement address (MAC ID) is part of the payload. Same as in WiFi or even 802.3 wired ethernet, it has to be there in order for the receiver to identify the source. If you use any BLE scanner you will see that it knows the MAC ID&amp;#39;s of the transmitters.&lt;/p&gt;
&lt;p&gt;There is insufficient room to also include it in a standard advertisement.  A BLE advert has up to 31 bytes available and the UUID takes a big chunk of it.  If you use a non-standard advertisement structure then you could include it, but you wouldn&amp;#39;t be able to take advantage of the API&amp;#39;s built into most operating systems to screen standard BLE advert structures (eg, eddystone, ibeacon, etc.)
Through the Nordic API&amp;#39;s you can choose different advertisement types such as random, random private resoveable, etc.  These styles are discussed at length in the bluetooth spec.&lt;/p&gt;
&lt;p&gt;To get the mac id you do the following. Once you have it in the struct you can place it where you wish:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	ble_gap_addr_t ble_addr;
    err_code = sd_ble_gap_address_get(&amp;amp;ble_addr);
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: How to include mac address in advertisement packet name?</title><link>https://devzone.nordicsemi.com/thread/103439?ContentTypeID=1</link><pubDate>Wed, 25 Oct 2017 13:09:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:259de52c-5b4c-4a16-b419-3ead576ac91c</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Despite fact that MAC is indeed in every BLE PDU including all forms of ADV packets (so why would you include it in payload data?) you can indeed put whatever you want into certain AD objects like Manufacturer Specific data. If you are using Nordic Soft Device then function &lt;code&gt;sd_ble_gap_address_get&lt;/code&gt; is the right one to get actual 6-byte value. If you have any problem while calling it please be very specific about how you define/init parameters of the function, what error/status code is returned by the function, what is in returned structure/pointer vs. what you see as current MAC address on the air (e.g. through any observer/scanner app like Nordic nRF Connect on the phone).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>