<?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 advertising BLE devices&amp;#39; name?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98754/how-to-read-advertising-ble-devices-name</link><description>I&amp;#39;ve google the heck out of this, but I feel like I&amp;#39;m missing something because there are zero results. 
 I am developing a BLE central device, and the program is supposed to scan for advertising BLE devices, and list their address and name. Since the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 Oct 2023 08:16:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98754/how-to-read-advertising-ble-devices-name" /><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/451211?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2023 08:16:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f58a8b06-1b45-420d-80cd-a93ebec58d1d</guid><dc:creator>caoliyu1086</dc:creator><description>&lt;p&gt;thx，i create a new ticket for it now&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/451184?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2023 05:56:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37a17044-9165-4c9c-9394-39bdacb501b6</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In order to keep things clean, could you kindly create a new ticket with your issue and also include which&amp;nbsp;SDK and device you are using?&lt;br /&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/451168?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2023 01:49:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77b6b6fb-9bc2-4b8f-b7c9-6da2327bf235</guid><dc:creator>caoliyu1086</dc:creator><description>&lt;p&gt;in &amp;quot;device_found()&amp;quot; callback:&amp;nbsp; I can only get the type: 0x01 0x06&amp;nbsp; 0xFF,&amp;nbsp; and the 0xFF 0x09 after this can&amp;#39;t get&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/451167?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2023 01:45:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5709554f-3642-4436-bab4-6c142a04a803</guid><dc:creator>caoliyu1086</dc:creator><description>&lt;p&gt;I get the same problem when I want to get the&amp;nbsp; BLE devices&amp;#39; name&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; the &amp;quot;BLE Central&amp;quot;&amp;nbsp; can only get&amp;nbsp; 31-Bytes adv data in &amp;quot;device_found()&amp;quot; callback,&amp;nbsp; &amp;nbsp;but the device-name need more than 31-Bytes&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;in &amp;quot;nRF Connect&amp;quot;&amp;nbsp; I get the BLE-device like this:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1697679632704v1.jpeg" alt=" " /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1697679644087v2.jpeg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;but in the &amp;quot;BLE Central&amp;quot; example, can only get 31-Bytes adv data like this:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1697679870869v4.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#ff0000;"&gt;How can i get more than 31-Bytes adv data in&amp;nbsp;&amp;nbsp;&amp;quot;device_found()&amp;quot; callback?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/422042?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 12:29:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f564d17-2833-43e5-95f6-00694044afca</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Neither &amp;quot;peripheral&amp;quot; or &amp;quot;peripheral_uart&amp;quot; includes any code that changes the transmission gain rom what I can see, so they should be similar.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As for the code snippet&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (rssi &amp;lt; -70) {
		return;
	}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Its only for connecting to a device. The data from the advertisement package should be readable without connecting to the device. So the filter should not have any effect on the readout that happens before any connection.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you say without any modifications: Did you remove the parsing of the &lt;span&gt;advertisement&amp;nbsp;&lt;/span&gt;data to extract the device name?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/421848?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 18:51:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1da358b7-e13e-4d89-b4e0-0824ad311305</guid><dc:creator>Bk37</dc:creator><description>&lt;p&gt;I am working with a clean &amp;#39;central&amp;#39; and clean &amp;#39;peripheral&amp;#39; example,&lt;em&gt; except&lt;/em&gt; the changes you suggested.&lt;/p&gt;
&lt;p&gt;I believe I found the cause of the issue, maybe you could explain why it&amp;#39;s happening.&lt;/p&gt;
&lt;p&gt;In the &amp;#39;central&amp;#39; sketch, in &amp;#39;device_found()&amp;#39; there&amp;#39;s a filter for proximity:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;if (rssi &amp;lt; -70) {
		return;
	}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When I changed &amp;#39;-70&amp;#39; to &amp;#39;-50&amp;#39;, this fixed the issue, however, I&amp;#39;m confused as to why, since the average RSSI for that device is -60, and often times around -40 to -50, but when the filter is set to -70, it NEVER reports the peripheral device name (even though it DOES find the MAC address).&lt;/p&gt;
&lt;p&gt;Even more confusing is why the signal strength is different for the &amp;#39;peripheral&amp;#39; and &amp;#39;peripheral_uart&amp;#39; examples when they&amp;#39;re performed on the exact same device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/421653?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 07:38:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a21579e9-80c9-4d83-94d6-6ed748cdaf47</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi, can you please upload your projects. I tested with the peripheral example and central example and I had no problems finding the peripheral device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/421631?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 06:29:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8e42cae-41fd-4323-b1f1-41ff5505be2b</guid><dc:creator>Bk37</dc:creator><description>&lt;p&gt;Just tried this, but no change to the result.&lt;/p&gt;
&lt;p&gt;&amp;quot;peripheral_uart&amp;quot; to &amp;quot;central&amp;quot; shows the name.&lt;/p&gt;
&lt;p&gt;&amp;quot;peripheral&amp;quot; to &amp;quot;central&amp;quot; does &lt;em&gt;not&lt;/em&gt; show the name.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/421628?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 06:07:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9710b2e-98a8-48a1-9fb9-d161fcba6e74</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you try to change &amp;quot;start_scan&amp;quot; to:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;err = bt_le_scan_start(BT_LE_SCAN_PASSIVE, device_found);

to

err = bt_le_scan_start(BT_LE_SCAN_ACTIVE, device_found);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;add update device_found with this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;	if (type != BT_GAP_ADV_TYPE_ADV_IND &amp;amp;&amp;amp;
	    type != BT_GAP_ADV_TYPE_ADV_DIRECT_IND &amp;amp;&amp;amp;
		type != BT_GAP_ADV_TYPE_SCAN_RSP  ) {
		return;
	}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/421535?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2023 14:28:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b6c1f16-a221-4254-be13-f199e09d0a5c</guid><dc:creator>Bk37</dc:creator><description>[quote userid="122502" url="~/f/nordic-q-a/98754/how-to-read-advertising-ble-devices-name/421495"]Do you advertise device name from your &lt;span&gt;peripheral&lt;/span&gt;? [/quote]
&lt;p&gt;Yes, but also so do the other devices around me.&lt;/p&gt;
&lt;p&gt;I tried with a brand new project, totally clean, same issue.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Device found: C6:65:16:45:84:67 (public) (RSSI -75)
Device found:
Connected: C6:65:16:45:84:67 (public)
Disconnected: C6:65:16:45:84:67 (reason 0x3e)
Scanning successfully started&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;After uploading the &amp;quot;peripheral_uart&amp;quot; example to the peripheral device, the name now DOES show up in the terminal on the central device DK. However, other devices still do not, including the &amp;quot;peripheral&amp;quot; (without uart) example.&lt;/p&gt;
&lt;p&gt;Why is that? I want to use the &amp;quot;peripheral&amp;quot; example, not the &amp;quot;peripheral_uart&amp;quot;. What is causing this issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/421495?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2023 12:30:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc9bf240-01e0-4012-ba8f-518c6f0a83fe</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Do you advertise device name from your &lt;span&gt;peripheral&lt;/span&gt;? I tested with the &lt;span&gt;peripheral&lt;/span&gt;_uart example and I could find it without any problems using the code I have you,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/421288?ContentTypeID=1</link><pubDate>Wed, 19 Apr 2023 14:35:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b0aeda6-2def-45c0-9564-533f99c901dd</guid><dc:creator>Bk37</dc:creator><description>[quote userid="122502" url="~/f/nordic-q-a/98754/how-to-read-advertising-ble-devices-name/421149"]You could not find any names at all?&amp;nbsp;[/quote]
&lt;p&gt;None, and there are at least 4 bluetooth devices advertising their name nearby.&lt;/p&gt;
[quote userid="122502" url="~/f/nordic-q-a/98754/how-to-read-advertising-ble-devices-name/421149"]do you have another dk you can set up as an peripheral?&amp;nbsp;[/quote]
&lt;p&gt;My central device is an nRF52840 DK, and I&amp;#39;ve been using an nRF52840 MDK Dongle as a peripheral.&lt;/p&gt;
&lt;p&gt;In case this helps, here&amp;#39;s what the prj.conf and CMakeLists.txt files look like:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;CONFIG_BT=y
CONFIG_BT_CENTRAL=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(central)

target_sources(app PRIVATE
  src/main.c
)

zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/421149?ContentTypeID=1</link><pubDate>Wed, 19 Apr 2023 06:18:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cddbeb4d-6fad-44ac-8482-17bc37d84204</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Interesting, I will see if I can replicate it. You could not find any names at all?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also,&amp;nbsp;do you have another dk you can set up as an peripheral?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/421137?ContentTypeID=1</link><pubDate>Wed, 19 Apr 2023 02:28:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2903c4a1-622b-4530-b003-c6fab41ecd2e</guid><dc:creator>Bk37</dc:creator><description>&lt;p&gt;Thanks for the reply. I added this code, but I&amp;#39;m still not getting anything.&lt;/p&gt;
&lt;p&gt;The terminal says &amp;quot;Device Found: &amp;quot;, but does not actually list a name. However, the available devices definitely &lt;em&gt;do&lt;/em&gt; have friendly names, as proven by my iPhone.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Scanning successfully started
Device Found: xx:xx:xx:xx:xx:x1 (random) (RSSI -79)
Device Found:
Device Found: xx:xx:xx:xx:xx:x2 (random) (RSSI -82)
Device Found:
Device Found: xx:xx:xx:xx:xx:x3 (random) (RSSI -60)
Device Found:
Connected: xx:xx:xx:xx:xx:x3 (public)
Disconnected: xx:xx:xx:xx:xx:x3 (public) (reason 0x3e)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here are the functions after I&amp;#39;ve edited them:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static bool data_cb(struct bt_data *data, void *user_data){

	char *name = user_data;

	switch(data-&amp;gt;type){
		case BT_DATA_NAME_SHORTENED:
		case BT_DATA_NAME_COMPLETE:
			memcpy(name, data-&amp;gt;data, MIN(data-&amp;gt;data_len, NAME_LEN - 1));
			return false;
		default:
			return false;
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type,
			 struct net_buf_simple *ad)
{
	char addr_str[BT_ADDR_LE_STR_LEN];
	char name[30];
	int err;

	if (default_conn) {
		return;
	}

	/* We&amp;#39;re only interested in connectable events */
	if (type != BT_GAP_ADV_TYPE_ADV_IND &amp;amp;&amp;amp;
	    type != BT_GAP_ADV_TYPE_ADV_DIRECT_IND) {
		return;
	}

	bt_addr_le_to_str(addr, addr_str, sizeof(addr_str));
	printk(&amp;quot;Device found: %s (RSSI %d)\n&amp;quot;, addr_str, rssi);

	//setting up the bt_data_parse function and prints it.
	bt_data_parse(ad, data_cb, name);
	printk(&amp;quot;Device found: %s \n&amp;quot;, name);

	/* connect only to devices in close proximity */
	if (rssi &amp;lt; -70) {
		return;
	}

	if (bt_le_scan_stop()) {
		return;
	}

	err = bt_conn_le_create(addr, BT_CONN_LE_CREATE_CONN,
				BT_LE_CONN_PARAM_DEFAULT, &amp;amp;default_conn);
	if (err) {
		printk(&amp;quot;Create conn to %s failed (%u)\n&amp;quot;, addr_str, err);
		start_scan();
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In the switch-case statement in the &amp;#39;data_cb&amp;#39; function, it is triggering &amp;#39;default&amp;#39;, not &amp;#39;BT_DATA_NAME_SHORTENED&amp;#39; or &amp;#39;BT_DATA_NAME_COMPLETE&amp;#39;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/421037?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2023 12:52:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cde2da7b-cd24-4fed-a945-1898c08cbfda</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you use the bt_central example I you can add the following lines and functions to print out the device names:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Updated device found function:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type,
			 struct net_buf_simple *ad)
{
	char addr_str[BT_ADDR_LE_STR_LEN];
	char name[30];
	int err;

	if (default_conn) {
		return;
	}

	/* We&amp;#39;re only interested in connectable events */
	if (type != BT_GAP_ADV_TYPE_ADV_IND &amp;amp;&amp;amp;
	    type != BT_GAP_ADV_TYPE_ADV_DIRECT_IND) {
		return;
	}

	bt_addr_le_to_str(addr, addr_str, sizeof(addr_str));
	printk(&amp;quot;Device found: %s (RSSI %d)\n&amp;quot;, addr_str, rssi);

	//seting up the bt_data_parse function and prints it. 
	//
	bt_data_parse(ad, data_cb, name);
	printk(&amp;quot;Device found: %s \n&amp;quot;, name);

	/* connect only to devices in close proximity */
	if (rssi &amp;lt; -70) {
		return;
	}

	if (bt_le_scan_stop()) {
		return;
	}

	err = bt_conn_le_create(addr, BT_CONN_LE_CREATE_CONN,
				BT_LE_CONN_PARAM_DEFAULT, &amp;amp;default_conn);
	if (err) {
		printk(&amp;quot;Create conn to %s failed (%u)\n&amp;quot;, addr_str, err);
		start_scan();
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Added function data_cb&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define NAME_LEN 30

static bool data_cb(struct bt_data *data, void *user_data)
{
	char *name = user_data;

	switch (data-&amp;gt;type) {
	case BT_DATA_NAME_SHORTENED:
	case BT_DATA_NAME_COMPLETE:
		memcpy(name, data-&amp;gt;data, MIN(data-&amp;gt;data_len, NAME_LEN - 1));
		return false;
	default:
		return true;
	}
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Now your central will print out the name of the devices found during scanning.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/420925?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2023 07:47:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0eaca86-d0aa-4b73-a6e9-0e8e5fd8250d</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m working on making an example on this. In short what needs to be done is to decode the advertisement package&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/connectivity/bluetooth/api/gap.html#c.bt_data"&gt;data&lt;/a&gt;&amp;nbsp; and extract the name from there. The function &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/connectivity/bluetooth/api/gap.html#c.bt_data_parse"&gt;bt_data_parse&lt;/a&gt; is used to parse the advertising data. The device name may not be broadcasted from all devices, this depends on the settings for the advertainment on the peripheral device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read advertising BLE devices' name?</title><link>https://devzone.nordicsemi.com/thread/420759?ContentTypeID=1</link><pubDate>Mon, 17 Apr 2023 12:02:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e8662d6-d504-4941-b795-8becc1fa331a</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I&amp;#39;m looking into it and will get back to you tomorrow&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>