<?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 does sd_ble_gatts_hvx() queue messages?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64461/how-does-sd_ble_gatts_hvx-queue-messages</link><description>Does `sd_ble_gatts_hvx()` queue indications and if so then when does the next message get sent; after the previous one is sent or after the receiver acks the previous one? 
 We are using `sd_ble_gatts_hvx()` in our application to send BLE indications</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 11 Aug 2020 09:00:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64461/how-does-sd_ble_gatts_hvx-queue-messages" /><item><title>RE: How does sd_ble_gatts_hvx() queue messages?</title><link>https://devzone.nordicsemi.com/thread/263972?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2020 09:00:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bee707b-ac3e-4f3f-ac35-123535808c43</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;&lt;span&gt;You would need to wait for the confirmation of the peer after you send the first indication (BLE_GATTS_EVT_HVC event) before you can send the next indication. See the&amp;nbsp;&lt;a title="GATTS Handle Value Indication" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/group___b_l_e___g_a_t_t_s___h_v_i___m_s_c.html?cp=4_7_4_1_2_4_3_2"&gt;GATTS Handle Value Indication&lt;/a&gt;&amp;nbsp;documentation&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How does sd_ble_gatts_hvx() queue messages?</title><link>https://devzone.nordicsemi.com/thread/263068?ContentTypeID=1</link><pubDate>Tue, 04 Aug 2020 15:28:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d0f8c3a-d01c-4d17-9d17-c76b0468644b</guid><dc:creator>PRvdO</dc:creator><description>&lt;p&gt;Hi Amanda, thanks for the reply.&lt;/p&gt;
&lt;p&gt;I read &amp;quot;&lt;em&gt;Only one indication procedure can be ongoing per connection at a time.&lt;/em&gt;&amp;quot; to mean that we can have multiple indication procedures at a time as long as they are to a different connection and that is what seems to not work. Am I miss-reading this or should we be able to have n indications at a time as long as they are all going to a different conn_handle?&lt;/p&gt;
&lt;p&gt;Currently we have:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Indication to conn 0.&lt;/li&gt;
&lt;li&gt;Waiting for ack.&lt;/li&gt;
&lt;li&gt;Ack from conn 0.&lt;/li&gt;
&lt;li&gt;Indication to conn 1.&lt;/li&gt;
&lt;li&gt;Waiting for ack.&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;We would like to have it so that we don&amp;#39;t have to wait on conn 0 to ack before we send to conn 1.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Indication to conn 0.&lt;/li&gt;
&lt;li&gt;Indication to conn 1.&lt;/li&gt;
&lt;li&gt;Ack from conn 0.&lt;/li&gt;
&lt;li&gt;Ack from conn 1.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Is this possible? Does&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx() handle this?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks for the help!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How does sd_ble_gatts_hvx() queue messages?</title><link>https://devzone.nordicsemi.com/thread/263013?ContentTypeID=1</link><pubDate>Tue, 04 Aug 2020 13:08:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:923550d4-6327-4761-92c8-ce8ab95a5c09</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Note that&amp;nbsp;&lt;/span&gt;&lt;code&gt;NRF_ERROR_BUSY&lt;/code&gt;&lt;span&gt;&amp;nbsp;is sometimes a symptom on a function that is not used as intended. Example; if you use sd_ble_gatts_hvx() to send an Indication, but calls the sd_ble_gatts_hvx() again before you receive confirmation from GATT client on the previous Indication, you will get&amp;nbsp;&lt;/span&gt;&lt;code&gt;NRF_ERROR_BUSY&lt;/code&gt;&lt;span&gt;. In this case, the solution is to wait for confirmation in the BLE event BLE_GATTS_EVT_HVC before calling sd_ble_gatts_hvx() again. See the&amp;nbsp;&lt;a title="GATTS Handle Value Indication" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/group___b_l_e___g_a_t_t_s___h_v_i___m_s_c.html?cp=4_7_4_1_2_4_3_2"&gt;GATTS Handle Value Indication&lt;/a&gt;&amp;nbsp;documentation:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;Only one indication procedure can be ongoing per connection at a time. If the application tries to indicate an attribute value while another indication procedure is ongoing, the function call will return&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/group__nrf__error.html#ga5d2d8608f6d6a0329f58961a969e946e"&gt;NRF_ERROR_BUSY&lt;/a&gt;. A&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/group___b_l_e___g_a_t_t_s___e_n_u_m_e_r_a_t_i_o_n_s.html#ggae537647902af1b05c1e32f12d6b401c7af6a065c5c7e0682989ddd6cc557e0ffa"&gt;BLE_GATTS_EVT_HVC&lt;/a&gt;&amp;nbsp;event will be issued as soon as the confirmation arrives from the peer.&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How does sd_ble_gatts_hvx() queue messages?</title><link>https://devzone.nordicsemi.com/thread/262953?ContentTypeID=1</link><pubDate>Tue, 04 Aug 2020 10:23:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dc8613c-6d69-4952-a6dc-5f6bdffc9dd9</guid><dc:creator>PRvdO</dc:creator><description>&lt;p&gt;Thanks for your input.&lt;/p&gt;
&lt;p&gt;I thought that nrf_ble_qwr is for&amp;nbsp;queuing messages written to our characteristic (Rx) whereas I&amp;#39;m talking about us sending a message to other devices (Tx). Is this not the case?&lt;/p&gt;
&lt;p&gt;Also, as we are using indications then I&amp;#39;m not sure that this normal write functionality works for us. We have to use&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx() to send.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately&lt;span&gt;&amp;nbsp;I don&amp;#39;t think that option will help much either as we want to send messages to multiple devices and I think that chaining them only works for sending multiple messages to the same connection.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How does sd_ble_gatts_hvx() queue messages?</title><link>https://devzone.nordicsemi.com/thread/262857?ContentTypeID=1</link><pubDate>Mon, 03 Aug 2020 16:31:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8630bc93-2b0d-4e94-a521-28dfec8fd101</guid><dc:creator>Shahar</dc:creator><description>&lt;p&gt;Adding my relevant points here,&lt;/p&gt;
&lt;p&gt;If you use S140 or S132 you have the option of using the nrf_ble_qwr library, which AFAIK can queue the messages.&lt;/p&gt;
&lt;p&gt;This is what being used in the throughput examples.&lt;/p&gt;
&lt;p&gt;Further more, if you use enable BLE_COMMON_OPT_CONN_EVT_EXT&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void conn_evt_len_ext_set(bool status)
{
    ret_code_t err_code;
    ble_opt_t  opt = {0};

    opt.common_opt.conn_evt_ext.enable = status ? 1 : 0;

    err_code = sd_ble_opt_set(BLE_COMMON_OPT_CONN_EVT_EXT, &amp;amp;opt);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can chain multiple packets into the same connection&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>