<?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 do I know the MAC address of the sending device when it receives a nus message?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56670/how-do-i-know-the-mac-address-of-the-sending-device-when-it-receives-a-nus-message</link><description>Hi Everyone, 
 My Environment: nRF52840, SDK15.3, Keil 
 I&amp;#39;m developing a central / peripheral device that can automatically connect up to three peripherals. 
 I want to know the mac address of the peripheral device sent when the central device receives</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Jan 2020 08:50:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56670/how-do-i-know-the-mac-address-of-the-sending-device-when-it-receives-a-nus-message" /><item><title>RE: How do I know the MAC address of the sending device when it receives a nus message?</title><link>https://devzone.nordicsemi.com/thread/231319?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2020 08:50:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7f502a6-db8e-4882-89b4-2364fb59a63f</guid><dc:creator>alex kim</dc:creator><description>&lt;p&gt;Hi, Vidar&lt;/p&gt;
&lt;p&gt;Thank you for your answer.&lt;br /&gt;I used the conn_handle to get the MAC address.&lt;/p&gt;
&lt;p&gt;Alex&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I know the MAC address of the sending device when it receives a nus message?</title><link>https://devzone.nordicsemi.com/thread/229855?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2020 13:27:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:723b3509-1c24-46df-80d3-9ace13223fa1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Alex,&lt;/p&gt;
&lt;p&gt;Write and notification events do not include the address of the peer device, but a connection handle that references an active&amp;nbsp;link with a specific device.&amp;nbsp;&amp;nbsp;The handle is assigned when a new&amp;nbsp;connection is established and freed on disconnect. So, in other words, the application has to keep track of the connections handles to determine which device the data came from.&lt;/p&gt;
&lt;p&gt;You can associate the connection handle with a MAC address if you want. The peer address is received in the BLE_GAP_CONNECTED event along with the connection handle (&lt;a title="ble_gap_evt_connected_t" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/structble__gap__evt__connected__t.html"&gt;ble_gap_evt_connected_t&lt;/a&gt;&lt;span&gt;))&lt;/span&gt;. &amp;quot;&lt;a title="BLE Link Context Manager" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_ble_link_ctx_manager.html"&gt;BLE Link Context Manager&lt;/a&gt;&amp;quot; is an SDK&amp;nbsp;module&amp;nbsp;that may be useful for managing the connection handles.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>