<?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 know which physical device is disconnected in disconnect event?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27367/how-to-know-which-physical-device-is-disconnected-in-disconnect-event</link><description>Here the connect method is called 
 err_code = 
	sd_ble_gap_connect(
 peer_addr, 
 &amp;amp;m_scan_params, 
 &amp;amp;m_connection_param, 
 APP_BLE_CONN_CFG_TAG);
 
 In the ble event handler there is the event BLE_GAP_EVT_DISCONNECTED 
 static void ble_evt_handler</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 18 Nov 2017 08:38:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27367/how-to-know-which-physical-device-is-disconnected-in-disconnect-event" /><item><title>RE: How to know which physical device is disconnected in disconnect event?</title><link>https://devzone.nordicsemi.com/thread/108086?ContentTypeID=1</link><pubDate>Sat, 18 Nov 2017 08:38:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06667a86-641b-4637-aef5-0142ed3ea074</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;The only identifier of the connection link is connection handle. Once you ask GAP layer to initiate connection at that moment you know what MAC/device name/whatever proprietary ID you are try to connect to. So once the link is established and you get &lt;code&gt;BLE_GAP_EVT_CONNECTED&lt;/code&gt; you can associate this link/handle with any other information you got before (typically through advertising/scanning) if you want, it&amp;#39;s you business, just do it in your application logic.&lt;/p&gt;
&lt;p&gt;This question looks to me like duplicate of this: &lt;a href="https://devzone.nordicsemi.com/question/179283/how-to-map-a-gap-event-to-a-physical-device/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to know which physical device is disconnected in disconnect event?</title><link>https://devzone.nordicsemi.com/thread/108085?ContentTypeID=1</link><pubDate>Sat, 18 Nov 2017 02:33:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9353e1ca-2437-4d05-b94d-fb84dc266047</guid><dc:creator>MichaelNordicUser</dc:creator><description>&lt;p&gt;No, advertisement data has all zero values and so does peer address. It has zero values after disconnect event. Maybe after connect event, advertisement data and peer address information is preserved?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to know which physical device is disconnected in disconnect event?</title><link>https://devzone.nordicsemi.com/thread/108084?ContentTypeID=1</link><pubDate>Sat, 18 Nov 2017 02:31:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca9278a4-34b1-4d81-9e17-bea793747e63</guid><dc:creator>MichaelNordicUser</dc:creator><description>&lt;p&gt;You say the connection handle is within the advertisement data? I thought the handle was assigned in soft device after connection is established. Am I wrong?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to know which physical device is disconnected in disconnect event?</title><link>https://devzone.nordicsemi.com/thread/108083?ContentTypeID=1</link><pubDate>Sat, 18 Nov 2017 02:26:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd876b07-8ef8-4398-b908-0554bb7dd2d2</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;since you claim in your question to be able to figure it out from the advertising data while the device is connected then you do that, then you remember the connection handle then when it disconnects you know what it was.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to know which physical device is disconnected in disconnect event?</title><link>https://devzone.nordicsemi.com/thread/108082?ContentTypeID=1</link><pubDate>Sat, 18 Nov 2017 02:18:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6fa518e-582d-4e30-84a9-5a6531090680</guid><dc:creator>MichaelNordicUser</dc:creator><description>&lt;p&gt;Your answer doesn&amp;#39;t help because your answer leads to similar question. How do I know which connection handle maps to which physical device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to know which physical device is disconnected in disconnect event?</title><link>https://devzone.nordicsemi.com/thread/108081?ContentTypeID=1</link><pubDate>Sat, 18 Nov 2017 01:44:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:264c3c77-e365-4f50-a7b7-e0969c5781e8</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;just use the connection handle. That&amp;#39;s the unique identifier for everything on one connection. So if you know what the device was when it connected, you know which one disconnected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>