<?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>what is the conn_handle? And when does it use?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19615/what-is-the-conn_handle-and-when-does-it-use</link><description>I don&amp;#39;t know where it is used.. 
 example, when I use sd_ble_gatts_hvx(conn_handle, &amp;amp;p_hvx_params), conn_handle was BLE_GATT_HANDLE_INVALID(0x0000) result of debugging. 
 Why is conn_handle exist? although charateristic handle actually used is included</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Feb 2017 14:54:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19615/what-is-the-conn_handle-and-when-does-it-use" /><item><title>RE: what is the conn_handle? And when does it use?</title><link>https://devzone.nordicsemi.com/thread/76344?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 14:54:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0c94aa9-82b6-419f-a318-f60cbd7148b4</guid><dc:creator>JoonDong</dc:creator><description>&lt;p&gt;Thank you for your answer. That is very helpful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what is the conn_handle? And when does it use?</title><link>https://devzone.nordicsemi.com/thread/76343?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 14:08:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:677a1726-fa88-4cea-9b42-7e92c597c882</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Yes, it&amp;#39;s assigned by softdevice each connection. If you are using nRF5 as a peripheral , you simply only have conn_handle = 0x0000 as there is only one connection at a time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what is the conn_handle? And when does it use?</title><link>https://devzone.nordicsemi.com/thread/76342?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 14:06:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72cfd8db-a18d-4feb-b594-670274060594</guid><dc:creator>JoonDong</dc:creator><description>&lt;p&gt;So is it just assigned per each connection?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what is the conn_handle? And when does it use?</title><link>https://devzone.nordicsemi.com/thread/76341?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 13:56:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0774ab01-8c9a-4b2b-8064-83b6a8f0480d</guid><dc:creator>JoonDong</dc:creator><description>&lt;p&gt;I already checked p_ble_evt-&amp;gt;evt.gap_evt.conn_handle during debugging, but value is always 0xFFFF or 0x0000..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what is the conn_handle? And when does it use?</title><link>https://devzone.nordicsemi.com/thread/76340?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 13:19:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75e31d5c-5fcb-4688-8b41-5ce90b5b7b6c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;What do you mean by this &amp;quot;when connection event about second connection occurs &amp;quot; ?
You don&amp;#39;t have to guess/assume the conn_handle, you simply find it in the event  you got, for example in BLE_GAP_EVT_CONNECTED event , look for p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, as Alex suggested.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what is the conn_handle? And when does it use?</title><link>https://devzone.nordicsemi.com/thread/76339?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 13:11:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:411bef8e-01b4-44ee-80e3-bd1e48ae750c</guid><dc:creator>JoonDong</dc:creator><description>&lt;p&gt;So is conn_handle 0x0001 when connection event about second connection occurs if second connection is established?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what is the conn_handle? And when does it use?</title><link>https://devzone.nordicsemi.com/thread/76337?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 12:44:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0425bba8-da89-4f3f-b0b5-b0bae60c075b</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Connection handle is available in p_ble_evt-&amp;gt;evt.gap_evt.conn_handle on BLE_GAP_EVT_CONNECTED event. You need to save it during current connection and use in function calls such as sd_ble_gatts_hvx(). When you receive BLE_GAP_EVT_DISCONNECTED then you should update variable to BLE_CONN_HANDLE_INVALID. Variable has to be global, make sure you don&amp;#39;t use local variable with the same name.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what is the conn_handle? And when does it use?</title><link>https://devzone.nordicsemi.com/thread/76338?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 12:39:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c6b60c9-82da-4b8b-9a59-12ef88c92f7e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;BLE_GATT_HANDLE_INVALID is for attribute handle, not connection handle. The first connection will have value of 0x0000. So it&amp;#39;s normal.
If you have more than one connection at the same time, for example in a central application with more than one peripheral, you will have different connection handles for different connections.&lt;/p&gt;
&lt;p&gt;Do you have trouble using sd_ble_gatts_hvx() ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>