<?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 read the target device name and address  in s120,nrf51</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7642/how-to-read-the-target-device-name-and-address-in-s120-nrf51</link><description>hii, 
 i am working on ble project where i would want to read the name and address of a slave.The example i am looking at is &amp;quot;nrf51_sdk_v6_1_0_b2ec2e6\nrf51822\Board\nrf6310\s120\ble_app_multilink_central&amp;quot;. In the main() you can see function definition</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Jul 2015 08:57:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7642/how-to-read-the-target-device-name-and-address-in-s120-nrf51" /><item><title>RE: how to read the target device name and address  in s120,nrf51</title><link>https://devzone.nordicsemi.com/thread/27243?ContentTypeID=1</link><pubDate>Tue, 07 Jul 2015 08:57:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f2d801e-da50-48b7-8a4e-3967589034d4</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Sorry for a very late response. Not sure if my response will be useful by now, but I will give it a try.&lt;/p&gt;
&lt;p&gt;The p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report.data struct contains the advertising data so if you comment that out you will not get any advertising data in adv_data.p_data.&lt;/p&gt;
&lt;p&gt;The complete local name is then parsed and put into type_data.&lt;/p&gt;
&lt;p&gt;I have quickly seen the name in the debugger with defining an array and copying the name into the array, with the following code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        uint8_t complete_name[20];

        // Initialize advertisement report for parsing.
        adv_data.p_data = p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report.data;
        adv_data.data_len = p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report.dlen;

        err_code = adv_report_parse(BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME,
                                  &amp;amp;adv_data,
                                  &amp;amp;type_data);
        memcpy(complete_name, type_data.p_data, type_data.data_len);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then if I set a breakpoint after the memcpy line and add complete_name to a watch window, then I can see the whole name in the watch window.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>