<?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>Reading the device name as central from adv data</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23155/reading-the-device-name-as-central-from-adv-data</link><description>Hi, 
 im running my DK as a central of a BLE connection and i&amp;#39;d like to read the device_name of the peripheral board that im communication with. how do i do this? i cannot find a fieldname in the ble structures that stores it. 
 thank you :)</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 30 Jun 2017 14:46:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23155/reading-the-device-name-as-central-from-adv-data" /><item><title>RE: Reading the device name as central from adv data</title><link>https://devzone.nordicsemi.com/thread/91081?ContentTypeID=1</link><pubDate>Fri, 30 Jun 2017 14:46:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3504d1cf-a672-41e1-b92f-3b2ec8212f85</guid><dc:creator>uC_newbie</dc:creator><description>&lt;p&gt;Worked perfectly, thank you :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading the device name as central from adv data</title><link>https://devzone.nordicsemi.com/thread/91083?ContentTypeID=1</link><pubDate>Fri, 30 Jun 2017 09:35:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56be18f0-2716-459b-b734-736c8b3057f9</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;First, the central is always the one initiating a connection. The peripheral only advertise its precence and the central is the one to decide if it wants to connect, and initiate the connection. What you are describing is exactly what happens in the examle I linked above:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You get a &lt;code&gt;BLE_GAP_EVT_ADV_REPORT&lt;/code&gt; event in the &lt;code&gt;on_ble_evt()&lt;/code&gt;handler, and the function &lt;code&gt;on_adv_report()&lt;/code&gt; is called.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;on_adv_report()&lt;/code&gt; checks if the name given in &lt;code&gt;m_target_periph_name&lt;/code&gt; is found in the advertising data.&lt;/li&gt;
&lt;li&gt;If the name is found, the central connects to the device. If not, the advertising packet is discarded and scanning continues.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading the device name as central from adv data</title><link>https://devzone.nordicsemi.com/thread/91082?ContentTypeID=1</link><pubDate>Thu, 29 Jun 2017 14:38:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bdf82f5-2a83-434e-89b4-e123d09ab5ab</guid><dc:creator>uC_newbie</dc:creator><description>&lt;p&gt;hi, thank you.&lt;/p&gt;
&lt;p&gt;i think i want to do something else:
i want to check the peripherals name that wants to connect to my central before connecting and in case of not matching a desired name declining the connection/not connecting.&lt;/p&gt;
&lt;p&gt;i thought i can do this inside the on_ble_evt() function. am i wrong?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading the device name as central from adv data</title><link>https://devzone.nordicsemi.com/thread/91080?ContentTypeID=1</link><pubDate>Thu, 29 Jun 2017 14:29:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba568d25-267b-4f03-bbcd-c40296e0ac1a</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is no separate field in the struct for the name. The name can be put in the advertising data (&lt;code&gt;data&lt;/code&gt; field), but it is not required.&lt;/p&gt;
&lt;p&gt;Check out the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/ble_sdk_app_multilink.html?cp=4_0_0_4_1_0_1"&gt;BLE multilink central example&lt;/a&gt; and the function &lt;code&gt;adv_report_parse()&lt;/code&gt; for details on how tha name can be extracted from the advertising data.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>