<?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>GET PERIPHERAL DEVICES&amp;#39; MAC ADDRESS AND SEND THROUGH UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45188/get-peripheral-devices-mac-address-and-send-through-uart</link><description>Hi all, I am working on a project for which I use nRF52832 with SDK15.2 and SD132. What I need is that nRF52 should transmit and receive command through serial UART as a central, can scan all NUS peripheral devices, read all the scanned NUS peripheral</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 29 Mar 2019 12:35:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45188/get-peripheral-devices-mac-address-and-send-through-uart" /><item><title>RE: GET PERIPHERAL DEVICES' MAC ADDRESS AND SEND THROUGH UART</title><link>https://devzone.nordicsemi.com/thread/179223?ContentTypeID=1</link><pubDate>Fri, 29 Mar 2019 12:35:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a14d357-57b7-4e84-80af-c14a1b74cfa3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please try the attached example below. I made some small changes so that only devices with the NUS service are added to the device list. I hope this helps.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-1b5b35709f2444e79a56529a3db8c61b/ble_5F00_app_5F00_interactive.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_interactive.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GET PERIPHERAL DEVICES' MAC ADDRESS AND SEND THROUGH UART</title><link>https://devzone.nordicsemi.com/thread/178036?ContentTypeID=1</link><pubDate>Mon, 25 Mar 2019 09:50:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18d9134e-c1a1-4cea-bc82-90dd198e140d</guid><dc:creator>AnthonyThet</dc:creator><description>&lt;p&gt;What I need is&lt;br /&gt;1. scan the NUS peripherals and store all the scanned peripheral addresses.&lt;br /&gt;2. when UART received &amp;quot;devices&amp;quot;, it transmit all the scanned peripheral addresses.&lt;/p&gt;
&lt;p&gt;3. when UART received &amp;quot;connect AA:BB:CC:DD:EE:FF&amp;quot;, the central will connect to that particular peripheral.&lt;/p&gt;
&lt;p&gt;But still I couldn&amp;#39;t make it yet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GET PERIPHERAL DEVICES' MAC ADDRESS AND SEND THROUGH UART</title><link>https://devzone.nordicsemi.com/thread/178018?ContentTypeID=1</link><pubDate>Mon, 25 Mar 2019 08:55:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f90643f-d176-4d38-99e8-ee1eb95e3b4d</guid><dc:creator>AnthonyThet</dc:creator><description>&lt;p&gt;Thanks Vidar, but I still stuck at this. I created a ble_m.c file as in the &amp;quot;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/ble_sdk_app_interactive"&gt;ble_app_interactive&lt;/a&gt;&amp;quot; and I created a case in ble_evt_handler but I don&amp;#39;t know how to get the data from ble_adv_report (I just checked if the uuid check is matched or not.).&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
    ret_code_t            err_code;
    ble_gap_evt_t const * p_gap_evt = &amp;amp;p_ble_evt-&amp;gt;evt.gap_evt;
		scan_evt_t						scan_evt;
		// I need to get data from ble adv report 
    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
				case BLE_GAP_EVT_ADV_REPORT:
						if(/*UUID_check match*//*scan_evt.params.filter_match.filter_match.uuid_filter_match == true*/)
						{
						    /* do the device to add list */
							NRF_LOG_DEBUG(&amp;quot;BLE_GAP_EVT_ADV_REPORT\n&amp;quot;);
							device_to_list_add(&amp;amp;p_gap_evt-&amp;gt;params.adv_report);
							
						}
						
						break;
			
                case BLE_GAP_EVT_CONNECTED:
                        break;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And to be honest, I also quite don&amp;#39;t know how to proceed like where do I need to get scan NUS devices address (in ble_app_interactive, it uses m_device to display the scan devices list when you type in &amp;quot;Devices&amp;quot; , but I don&amp;#39;t know how can I do?)&lt;/p&gt;
&lt;p&gt;Sorry, I am just a newbie in BLE world especially Nordic, please help me and really thanks again and appreciate your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GET PERIPHERAL DEVICES' MAC ADDRESS AND SEND THROUGH UART</title><link>https://devzone.nordicsemi.com/thread/177999?ContentTypeID=1</link><pubDate>Mon, 25 Mar 2019 07:44:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c81f09b8-9d10-4207-8eba-d5851e636af3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You typically parse the advertisement packet to determine if the advertisement&amp;nbsp;packet belongs to&amp;nbsp;a&amp;nbsp;peripheral you want to connect to. Like in this case, you want to connect to peripherals&amp;nbsp;including the NUS service UUID in the advertisement packet.&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;use ble_adv_uuid_find() function to check the UUID of the NUS and then connected if it&amp;#39;s match&lt;/span&gt;&amp;quot; Correct.&amp;nbsp;&lt;/p&gt;
[quote user="AnthonyThet"]and do I still need to check for the service match check if the UUID is matched?[/quote]
&lt;p&gt;It&amp;#39;s optional to include service UUIDs in the advertisement&amp;nbsp;packet (unless you&amp;#39;re using a BT SIG defined service/profile that requires it). Normally you include a subset of the service UUIDs, enough to uniquely identify the type of peripheral.&amp;nbsp; You will&amp;nbsp;still have to do a service discovery after connection.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GET PERIPHERAL DEVICES' MAC ADDRESS AND SEND THROUGH UART</title><link>https://devzone.nordicsemi.com/thread/177956?ContentTypeID=1</link><pubDate>Sun, 24 Mar 2019 02:42:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5550ad1-fbd4-42ae-931a-aa04f36dc874</guid><dc:creator>AnthonyThet</dc:creator><description>&lt;p&gt;Hi Vidar Berg, thanks so much for your answer. Please let me correct if I am wrong. In the&lt;a href="https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-central-tutorial"&gt; central mode tutorial &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;use ble_adv_uuid_find() function to check the UUID of the NUS and then connected if it&amp;#39;s match. Is that right? and do I still need to check for the service match check if the UUID is matched?&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GET PERIPHERAL DEVICES' MAC ADDRESS AND SEND THROUGH UART</title><link>https://devzone.nordicsemi.com/thread/177754?ContentTypeID=1</link><pubDate>Fri, 22 Mar 2019 08:44:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed77dcfb-9b42-45e9-9b64-4200a4931a5a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I think you can start by modifying the event handling for&amp;nbsp;BLE_GAP_EVT_ADV_REPORT in ble_m.c so that only NUS peripherals are added to the device list (i.e., only call to&amp;nbsp;device_to_list_add and&amp;nbsp;address_to_cmd_add when a NUS peripheral is found).&amp;nbsp;You can &lt;span&gt;ble_app_uart_c as a reference on how you can filter NUS peripherals based on the NUS&amp;nbsp;UUID. First, you need to add the base NUS UUID with&amp;nbsp;sd_ble_uuid_vs_add() in your central code, then&amp;nbsp;you can check for&amp;nbsp;BLE_UUID_NUS_SERVICE match in the advertisement report.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>