<?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 shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84802/how-to-shorten-the-data-transmission-cycle-using-sd_ble_gatts_hvx</link><description>Hello. 
 
 Log data is transmitted to APP(phone) using sd_ble_gatts_hvx(). 
 The length of one packet is 20 bytes, and the expected total number of packets is about 3,200. 
 The connection interval I set is min. 7.5mS as shown below log. 
 The connection</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Mar 2022 14:19:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84802/how-to-shorten-the-data-transmission-cycle-using-sd_ble_gatts_hvx" /><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/355844?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 14:19:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73112891-1718-4917-b79c-b2edc6829030</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, you can test with a DK. And you can also test your firmware (on DK&amp;nbsp; or custom board) against the nRF Connect apps for iOS and Android, to have another reference for that part.&lt;/p&gt;
&lt;p&gt;(To have a simple example that push data you could perhaps use the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_nus_eval.html"&gt;UART/Serial Port Emulation over BLE&lt;/a&gt;&amp;nbsp;example, and slightly modify it to send test data as fast as possible instead getting data via UART - you should adjust the&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH to a higher value in that case, as the default value is low).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/355694?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 05:45:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35d55295-8c24-4934-9c7c-1df71096df0f</guid><dc:creator>air</dc:creator><description>&lt;p&gt;&lt;span class="Y2IQFc" lang="en"&gt;I understand.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="Y2IQFc" lang="en"&gt;If so, is there a way to configure and test my app environment in DK etc?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="Y2IQFc" lang="en"&gt;&lt;/span&gt;&lt;span class="Y2IQFc" lang="en"&gt;Of course, I know that I need test code, etc.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="Y2IQFc" lang="en"&gt;&lt;/span&gt;&lt;span class="Y2IQFc" lang="en"&gt;I want to check the difference.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="Y2IQFc" lang="en"&gt;I&amp;#39;m looking for it.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="Y2IQFc" lang="en"&gt;&lt;/span&gt;&lt;span class="Y2IQFc" lang="en"&gt;I&amp;#39;d like some help on which part to refer to.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="Y2IQFc" lang="en"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="Y2IQFc" lang="en"&gt;&amp;nbsp;thanks.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/354849?ContentTypeID=1</link><pubDate>Thu, 24 Feb 2022 14:16:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf7635d0-1918-4d2b-acb2-e26b7f8ad927</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I must admit I am no iOS developer, and generally DevZone is not staffed by mobile developers. That said, I know iOS is capable of exchanging multiple packets per connection event so it is interesting that you see this. What do you see if you test with nRF Connect for iOS instead of your custom app?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/354712?ContentTypeID=1</link><pubDate>Thu, 24 Feb 2022 04:28:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9876ca0-6a7e-4c1c-9292-328ece59fcb3</guid><dc:creator>air</dc:creator><description>&lt;p&gt;&lt;span class="Y2IQFc" lang="en"&gt;Other phones have a similar result too.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The current configuration is 1-tx / 1-rx characteristic.&lt;/p&gt;
&lt;p&gt;I want to check once again whether multi notification is possible even in this configuration.&lt;/p&gt;
&lt;p&gt;I am talking about this with the APP part (android / ios).&lt;/p&gt;
&lt;p&gt;If possible, I would like to ask for advice on which parts of the APP to be checked.&lt;/p&gt;
&lt;p&gt;Of course, there is a way to increase the data length, but due to various restrictions such as compatibility&lt;/p&gt;
&lt;p&gt;between existing field products and APPs, I want to keep the current configuration.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;thanks.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/354521?ContentTypeID=1</link><pubDate>Wed, 23 Feb 2022 10:14:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfa57334-76c8-47ee-91d9-a1749b44253c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks. This shows that the connection interval is 7,5 ms in the beginning, and then it is updated to 15 ms. It also shows that the nRF always has the more data flag set, indicating that it has more packets to send. However,&amp;nbsp;if you look at the empty packets from the master in between and the NESN/SN indicates a lot of retransmissions for some reason. A retransmission always happens on the next connection event, so this&amp;nbsp;expected given that.&lt;/p&gt;
&lt;p&gt;What I do not understand is why you have all these requests for retransmissions/retransmissions. What device is the central in this case? Which phone model, OS version, etc.? Have you tested with a different central?&lt;/p&gt;
&lt;p&gt;(If&amp;nbsp;this issue persists, or actually in any case, another good way to increase the throughput is to increase the packet lengt using data length extension - if that is supported by the central.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/354499?ContentTypeID=1</link><pubDate>Wed, 23 Feb 2022 09:33:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8bbd379-c283-4ecf-813c-c6691e8445f8</guid><dc:creator>air</dc:creator><description>&lt;p&gt;&amp;nbsp;Hello,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I attach my captured data.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanks.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/packet_5F00_capture.pcapng"&gt;devzone.nordicsemi.com/.../packet_5F00_capture.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/354286?ContentTypeID=1</link><pubDate>Tue, 22 Feb 2022 08:52:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad76b897-280a-468b-9f73-57d2e5360ee8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You need to select a specific device while it is advertising, and then the sniffer will attempt to follow the&amp;nbsp;connection once it is established. See &lt;a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/sniffer_usage.html"&gt;nRF Sniffer usage&lt;/a&gt;&amp;nbsp;for details.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/354236?ContentTypeID=1</link><pubDate>Tue, 22 Feb 2022 00:17:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab056f48-245b-478c-ab7d-70ce4cb67fcd</guid><dc:creator>air</dc:creator><description>&lt;p&gt;&lt;span style="font-size:inherit;"&gt;I installed it using the version below.&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;sniffer : _for_bluteooth_le_4.1.0&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;wireshark : 3.6.2&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;There is no information about communication after the connection.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;Only advertising packets are shown.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;There was a similar case while I was looking for related content.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;So I followed it,&amp;nbsp;but I still see only advertising packets.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp;First of all, can you give me some advice on this?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;thanks.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/354085?ContentTypeID=1</link><pubDate>Mon, 21 Feb 2022 10:16:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00b6d03e-ce8d-4174-9b0d-477ae9118cc6</guid><dc:creator>air</dc:creator><description>&lt;p&gt;I didn&amp;#39;t understand well. I&amp;#39;ll get a new one.&lt;/p&gt;
&lt;p&gt;thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/354080?ContentTypeID=1</link><pubDate>Mon, 21 Feb 2022 09:59:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e130a8f6-b1aa-4614-aa21-24a0709e7535</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The sniffer trace only shows advertising, and what we are interested in happens in the connection. So you need to make a new trace which follows the connection in order to see anything useful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/354035?ContentTypeID=1</link><pubDate>Mon, 21 Feb 2022 07:26:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea12df76-80aa-4557-ae7d-9e43a1180e20</guid><dc:creator>air</dc:creator><description>&lt;p&gt;I tried to capture packets with sniffer.&lt;/p&gt;
&lt;p&gt;I attach it and check why the malformed packet occurs.&lt;/p&gt;
&lt;p&gt;Please tell me if there is anything wrong.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/20220221_5F00_162443.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/packet.pcapng"&gt;devzone.nordicsemi.com/.../packet.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/353821?ContentTypeID=1</link><pubDate>Fri, 18 Feb 2022 11:33:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdb68aa6-1ae7-4f0a-b77e-719f056c4713</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The thing is that even if you configure&amp;nbsp;NRF_SDH_BLE_GAP_GAP_EVENT_LENGTH to a value, that will not necessarily be what is used on the link, that is up to the central. I assume that is the case here, and if so you need to make adjustments on the central side. A sniffer trace should show what happens on air (including the event length and if the peripheral indicates that it has more data by setting the MD bit, which should be the case here).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/353808?ContentTypeID=1</link><pubDate>Fri, 18 Feb 2022 10:46:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e3e34cd-c49f-4beb-9b4f-b89794af5a2d</guid><dc:creator>air</dc:creator><description>&lt;p&gt;Do you mean &lt;strong&gt;the event length used on the link&lt;/strong&gt; to &lt;strong&gt;NRF_SDH_BLE_GAP_GAP_EVENT_LENGTH&lt;/strong&gt;?&lt;/p&gt;
&lt;p&gt;Then I wrote the wrong value in the code window.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tested many values ​​like 200/400/600 etc.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If not, what does it mean?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also, what are the things to check in the APP?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll try a sniffer trace as you suggested. and I will inquire again.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/353793?ContentTypeID=1</link><pubDate>Fri, 18 Feb 2022 09:49:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e434dd05-7029-4b45-ace5-e06131ffc00b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Looking at the timestamp it looks like you only get one packet per connection event. What is the event length used on the link (not just what you configure in the peripheral)? Can you make a sniffer trace so that we see what is happening on air?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/353757?ContentTypeID=1</link><pubDate>Fri, 18 Feb 2022 07:25:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e74a2b7b-1593-4f24-8bb4-32baa947d052</guid><dc:creator>air</dc:creator><description>&lt;p&gt;As you suggested, I tried to transmit after storing the transmission data in the buffer.&lt;/p&gt;
&lt;p&gt;The results did not change significantly.&lt;/p&gt;
&lt;p&gt;the process&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Stacking the transmission data in the buffer&lt;/li&gt;
&lt;li&gt;Send Until Fail&lt;/li&gt;
&lt;li&gt;Listen for BLE_GATTS_EVT_HVN_TX_COMPLETE event on failure&lt;/li&gt;
&lt;li&gt;Repeat from step 1. when receiving BLE_GATTS_EVT_HVN_TX_COMPLETE event&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I attach the code I used and log data.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m looking for a related part, but I don&amp;#39;t know what the particular problem is.&lt;/p&gt;
&lt;p&gt;Please advise.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;thanks.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH
#define NRF_SDH_BLE_GAP_EVENT_LENGTH 		// 400:500mS		// old : 6
#endif


#define MIN_CONN_INTERVAL						MSEC_TO_UNITS(7.5, UNIT_1_25_MS)	// 7.5, Minimum connection interval */
#define MAX_CONN_INTERVAL						MSEC_TO_UNITS(500, UNIT_1_25_MS)	// 100, Maximum connection interval. */
#define SLAVE_LATENCY							0											// 5, Slave latency
#define CONN_SUP_TIMEOUT						MSEC_TO_UNITS(4000, UNIT_10_MS)	// 3,000, Connection supervisory timeout. */

#define FIRST_CONN_PARAMS_UPDATE_DELAY		APP_TIMER_TICKS(1000)				// 100, Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */
#define NEXT_CONN_PARAMS_UPDATE_DELAY		APP_TIMER_TICKS(5000)				// 5000, Time between each call to sd_ble_gap_conn_param_update after the first call (30 seconds). */
#define MAX_CONN_PARAM_UPDATE_COUNT			3											/**&amp;lt; Number of attempts before giving up the connection parameter negotiation. */


static void packet_transmit_handler(void)
{
	uint32_t err_code __attribute__((unused)) = NRF_SUCCESS;
	ble_gatts_hvx_params_t hvx_params __attribute__((unused));
	ble_gatts_conn_cfg_t queue_size __attribute__((unused));

#if 1
	if(flagBle.txBusy == true)
	{
		if(m_tx_packet_buffer.counter)
		{
			flagBle.txDelay = true;
			m_packet_timer_start();
		}
		#ifdef MSG_BLE
			NRF_LOG_RAW_INFO(&amp;quot;@%s() busy error !!!\r\n&amp;quot;, M_FUNCTION);
		#endif

		return;
	}
#endif

//	CRITICAL_REGION_ENTER();
//	memset(&amp;amp;queue_size, 0, sizeof(queue_size));

	while(1)
	{
		if(m_tx_packet_buffer.rear_index != m_tx_packet_buffer.front_index)
		{
#if 0
			err_code = ble_dls_tx_string_send(mp_dls,
													(void *)&amp;amp;m_tx_packet_buffer.list[m_tx_packet_buffer.rear_index].data,
													m_tx_packet_buffer.list[m_tx_packet_buffer.rear_index].len);
#else
			uint16_t len = m_tx_packet_buffer.list[m_tx_packet_buffer.rear_index].len;
			memset(&amp;amp;hvx_params, 0, sizeof(hvx_params));
			hvx_params.handle = mp_dls-&amp;gt;tx_handles.value_handle;
			hvx_params.type   = BLE_GATT_HVX_NOTIFICATION;
			hvx_params.offset = 0;
			hvx_params.p_len  = &amp;amp;len;
			hvx_params.p_data = (void *)&amp;amp;m_tx_packet_buffer.list[m_tx_packet_buffer.rear_index].data;

			err_code = sd_ble_gatts_hvx(mp_dls-&amp;gt;conn_handle, &amp;amp;hvx_params);
#endif

			if(err_code == NRF_SUCCESS)
			{
				m_tx_packet_buffer.rear_index++;
				m_tx_packet_buffer.rear_index %= PACKET_BUFFER_TX_NUM;
				m_tx_packet_buffer.counter--;
			#if 1	// def _MSG_BLE
				NRF_LOG_RAW_INFO(&amp;quot;sussess - time:%u\r\n&amp;quot;, CURRENT_TIME_MS);
			#endif
			}
			else
			{
			#ifdef MSG_BLE
				extern uint16_t m_log_current_index;
//				NRF_LOG_RAW_INFO(&amp;quot;@%s fail - num:%d!!! - err_code:%d, time:%u\r\n&amp;quot;, M_FUNCTION, m_log_current_index, err_code, CURRENT_TIME_MS);
				NRF_LOG_RAW_INFO(&amp;quot;fail!!! - err_code:%d, time:%u\r\n&amp;quot;, err_code, CURRENT_TIME_MS);
			#endif
				flagBle.txBusy = true;
				flagBle.txDelay = true;
				break;
			}
		}
		else
		{
//NRF_LOG_RAW_INFO(&amp;quot;@%s() same index\r\n&amp;quot;);
			break;
		}
	}
//	CRITICAL_REGION_EXIT();

#ifdef _MSG_BLE
	NRF_LOG_RAW_INFO(&amp;quot;%s() result:%d, time:%u\r\n&amp;quot;, M_FUNCTION, err_code, CURRENT_TIME_MS);
#endif

	if(m_tx_packet_buffer.counter)
	{
		m_packet_timer_start();
	}
}
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; BLE_GAP_EVT_CONN_PARAM_UPDATE - conn_interval min:6, conn_interval max:6
00&amp;gt; sussess - time:20699
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:20714
00&amp;gt; sussess - time:20730
00&amp;gt; BLE_GAP_EVT_CONN_PARAM_UPDATE - conn_interval min:12, conn_interval max:12
00&amp;gt; log_flash_delete : index-0 number-0
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:20744
00&amp;gt; sussess - time:20775
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:20804
00&amp;gt; sussess - time:20805
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:20834
00&amp;gt; log_flash_delete : index-0 number-0
00&amp;gt; sussess - time:20840
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:20864
00&amp;gt; sussess - time:21015
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21044
00&amp;gt; sussess - time:21360
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21389

00&amp;gt; ******* log tx request *******
00&amp;gt;    CMD(229) : log transfer request (0 -&amp;gt; 90)(1, 0)=&amp;gt;(1, 90)
00&amp;gt; tx log (91, 0-1), time:21405						// log save to buffer
00&amp;gt; tx log (91, 0-2), time:21405
00&amp;gt; tx log (90, 1-1), time:21406
00&amp;gt; tx log (90, 1-2), time:21406
00&amp;gt; tx log (89, 2-1), time:21406
00&amp;gt; tx log (89, 2-2), time:21407
00&amp;gt; tx log (88, 3-1), time:21407
00&amp;gt; tx log (88, 3-2), time:21407
00&amp;gt; tx log (87, 4-1), time:21408
00&amp;gt; tx log (87, 4-2), time:21408
00&amp;gt; tx log (86, 5-1), time:21409
00&amp;gt; tx log (86, 5-2), time:21409
00&amp;gt; tx log (85, 6),   time:21409
00&amp;gt; tx log (84, 7-1), time:21410
00&amp;gt; tx log (84, 7-2), time:21410
00&amp;gt; sussess - time:21410								// tx to APP success
00&amp;gt; sussess - time:21410
00&amp;gt; sussess - time:21410
00&amp;gt; sussess - time:21410
00&amp;gt; fail!!! - err_code:19, time:21410				// tx fail, error code : 19
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21419	// BLE_GATTS_EVT_HVN_TX_COMPLETE event
00&amp;gt; tx log (83, 8-1), time:21420						// log save to buffer
00&amp;gt; tx log (83, 8-2), time:21420
00&amp;gt; tx log (82, 9-1), time:21421
00&amp;gt; tx log (82, 9-2), time:21421
00&amp;gt; sussess - time:21421								// tx to APP success
00&amp;gt; fail!!! - err_code:19, time:21421				// tx fail, error code : 19
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21434	// BLE_GATTS_EVT_HVN_TX_COMPLETE event
00&amp;gt; tx log (81, 10-1), time:21435
00&amp;gt; sussess - time:21435
00&amp;gt; fail!!! - err_code:19, time:21435
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21449
00&amp;gt; tx log (81, 10-2), time:21450
00&amp;gt; sussess - time:21450
00&amp;gt; fail!!! - err_code:19, time:21450
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21464
00&amp;gt; tx log (80, 11-1), time:21465
00&amp;gt; sussess - time:21465
00&amp;gt; fail!!! - err_code:19, time:21465
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21479
00&amp;gt; tx log (80, 11-2), time:21479
00&amp;gt; sussess - time:21479
00&amp;gt; fail!!! - err_code:19, time:21479
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21494
00&amp;gt; tx log (79, 12-1), time:21495
00&amp;gt; sussess - time:21495
00&amp;gt; fail!!! - err_code:19, time:21495
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21509
00&amp;gt; tx log (79, 12-2), time:21509
00&amp;gt; sussess - time:21509
00&amp;gt; fail!!! - err_code:19, time:21509
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21524
00&amp;gt; tx log (78, 13-1), time:21525
00&amp;gt; sussess - time:21525
00&amp;gt; fail!!! - err_code:19, time:21525
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21539
00&amp;gt; tx log (78, 13-2), time:21539
00&amp;gt; sussess - time:21539
00&amp;gt; fail!!! - err_code:19, time:21539
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21554
00&amp;gt; tx log (77, 14-1), time:21554
00&amp;gt; sussess - time:21554
00&amp;gt; fail!!! - err_code:19, time:21554
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21569
00&amp;gt; tx log (77, 14-2), time:21570
00&amp;gt; sussess - time:21570
00&amp;gt; fail!!! - err_code:19, time:21570
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21584
00&amp;gt; tx log (76, 15-1), time:21584
00&amp;gt; sussess - time:21584
00&amp;gt; fail!!! - err_code:19, time:21584
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21599
00&amp;gt; tx log (76, 15-2), time:21599
00&amp;gt; sussess - time:21599
00&amp;gt; fail!!! - err_code:19, time:21599
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21614
00&amp;gt; tx log (75, 16-1), time:21614
00&amp;gt; sussess - time:21614
00&amp;gt; fail!!! - err_code:19, time:21614
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21629
00&amp;gt; tx log (75, 16-2), time:21630
00&amp;gt; sussess - time:21630
00&amp;gt; fail!!! - err_code:19, time:21630
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21644
00&amp;gt; tx log (74, 17),   time:21645
00&amp;gt; sussess - time:21645
00&amp;gt; fail!!! - err_code:19, time:21645
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21659
00&amp;gt; tx log (73, 18-1), time:21659
00&amp;gt; sussess - time:21659
00&amp;gt; fail!!! - err_code:19, time:21659
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21674
00&amp;gt; tx log (73, 18-2), time:21675
00&amp;gt; sussess - time:21675
00&amp;gt; fail!!! - err_code:19, time:21675
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21689
00&amp;gt; tx log (72, 19),   time:21689
00&amp;gt; sussess - time:21689
00&amp;gt; fail!!! - err_code:19, time:21689
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21704
00&amp;gt; tx log (71, 20-1), time:21705
00&amp;gt; sussess - time:21705
00&amp;gt; fail!!! - err_code:19, time:21705
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21719
00&amp;gt; tx log (71, 20-2), time:21719
00&amp;gt; sussess - time:21719
00&amp;gt; fail!!! - err_code:19, time:21719
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21734
00&amp;gt; tx log (70, 21-1), time:21734
00&amp;gt; sussess - time:21734
00&amp;gt; fail!!! - err_code:19, time:21734
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21749
00&amp;gt; tx log (70, 21-2), time:21750
00&amp;gt; sussess - time:21750
00&amp;gt; fail!!! - err_code:19, time:21750
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21764
00&amp;gt; tx log (69, 22),   time:21765
00&amp;gt; sussess - time:21765
00&amp;gt; fail!!! - err_code:19, time:21765
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21779
00&amp;gt; tx log (68, 23-1), time:21780
00&amp;gt; sussess - time:21780
00&amp;gt; fail!!! - err_code:19, time:21780
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21794
00&amp;gt; tx log (68, 23-2), time:21794
00&amp;gt; sussess - time:21794
00&amp;gt; fail!!! - err_code:19, time:21794
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21809
00&amp;gt; tx log (67, 24-1), time:21809
00&amp;gt; sussess - time:21809
00&amp;gt; fail!!! - err_code:19, time:21809
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21824
00&amp;gt; tx log (67, 24-2), time:21825
00&amp;gt; sussess - time:21825
00&amp;gt; fail!!! - err_code:19, time:21825
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21839
00&amp;gt; tx log (66, 25),   time:21839
00&amp;gt; sussess - time:21839
00&amp;gt; fail!!! - err_code:19, time:21839
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21854
00&amp;gt; tx log (65, 26-1), time:21855
00&amp;gt; sussess - time:21855
00&amp;gt; fail!!! - err_code:19, time:21855
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21869
00&amp;gt; tx log (65, 26-2), time:21869
00&amp;gt; sussess - time:21869
00&amp;gt; fail!!! - err_code:19, time:21869
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21884
00&amp;gt; tx log (64, 27),   time:21885
00&amp;gt; sussess - time:21885
00&amp;gt; fail!!! - err_code:19, time:21885
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21899
00&amp;gt; tx log (63, 28-1), time:21899
00&amp;gt; sussess - time:21899
00&amp;gt; fail!!! - err_code:19, time:21899
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21914
00&amp;gt; tx log (63, 28-2), time:21914
00&amp;gt; sussess - time:21914
00&amp;gt; fail!!! - err_code:19, time:21914
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21929
00&amp;gt; tx log (62, 29-1), time:21930
00&amp;gt; sussess - time:21930
00&amp;gt; fail!!! - err_code:19, time:21930
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21944
00&amp;gt; tx log (62, 29-2), time:21945
00&amp;gt; sussess - time:21945
00&amp;gt; fail!!! - err_code:19, time:21945
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21959
00&amp;gt; tx log (61, 30),   time:21959
00&amp;gt; sussess - time:21959
00&amp;gt; fail!!! - err_code:19, time:21959
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21974
00&amp;gt; tx log (60, 31-1), time:21974
00&amp;gt; sussess - time:21974
00&amp;gt; fail!!! - err_code:19, time:21974
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:21990
00&amp;gt; tx log (60, 31-2), time:21990
00&amp;gt; sussess - time:21991
00&amp;gt; fail!!! - err_code:19, time:21991
00&amp;gt; tx log (59, 32-1), time:21991
00&amp;gt; @packet_transmit_handler() busy error !!!
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:22004
00&amp;gt; sussess - time:22004
00&amp;gt; fail!!! - err_code:19, time:22004
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:22019
00&amp;gt; tx log (59, 32-2), time:22019
00&amp;gt; sussess - time:22019
00&amp;gt; fail!!! - err_code:19, time:22019
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:22034
00&amp;gt; tx log (58, 33),   time:22034
00&amp;gt; sussess - time:22034
00&amp;gt; fail!!! - err_code:19, time:22034
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:22049
00&amp;gt; tx log (57, 34-1), time:22049
00&amp;gt; sussess - time:22049
00&amp;gt; fail!!! - err_code:19, time:22049
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:22064
00&amp;gt; tx log (57, 34-2), time:22064
00&amp;gt; sussess - time:22064
00&amp;gt; fail!!! - err_code:19, time:22064
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:22079
00&amp;gt; tx log (56, 35-1), time:22079
00&amp;gt; sussess - time:22079
00&amp;gt; fail!!! - err_code:19, time:22079
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:22094
00&amp;gt; tx log (56, 35-2), time:22094
00&amp;gt; sussess - time:22094
00&amp;gt; fail!!! - err_code:19, time:22094
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:22109
00&amp;gt; tx log (55, 36),   time:22109
00&amp;gt; sussess - time:22109
00&amp;gt; fail!!! - err_code:19, time:22109
00&amp;gt; BLE_GATTS_EVT_HVN_TX_COMPLETE - time:22124
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/353595?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 12:22:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f4250e5-27cb-4086-bb3a-7f90f26dc0f2</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;How did you try? Sending multiple packets per connection event is a common practice, and you do it by configuring a long event and sending multiple packets. Note that they must be consecutive, if there is no more packets to send, the event will be closed and you will have to wait for the next. So you need to ensure that you call&amp;nbsp;sd_ble_gatts_hvx() fast enough.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/353540?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 09:28:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07c204ea-49ca-4910-a84c-648ae1eb8630</guid><dc:creator>air</dc:creator><description>&lt;p&gt;I tried as your suggestion.&lt;/p&gt;
&lt;p&gt;Of course, other phones were also used.&lt;/p&gt;
&lt;p&gt;The results were unchanged.&lt;/p&gt;
&lt;p&gt;Sure, I&amp;rsquo;ll check my code more and retry.&lt;/p&gt;
&lt;p&gt;If same, I wonder if there is no other way than to send multiple packets at once.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;thanks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;#define NRF_SDH_BLE_GAP_EVENT_LENGTH 400&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/353515?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 07:32:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e16c4a12-8c02-4365-bef1-1b18a6b3d9b0</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have not found the minimum connection interval for the LG V35 ThinQ, but it is not unusual for a phone to limit it to minimum 15 ms.&lt;/p&gt;
[quote user="air"]I wonder if multi notification is possible in one connection interval.[/quote]
&lt;p&gt;Yes, that is possible. That depends on the event length. From the nRF side, you should set a long event length (up to as long as the connection interval). You do this by adjusting&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH in sdk_config.h. If the phone and nRF agrees on the long event length, then you can send multiple packet during that event. You simply queue more notifications using&amp;nbsp;sd_ble_gatts_hvx() and if there is more data and still time in the evnet, the next packet is sent, and so on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/353481?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 00:10:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:852cf27a-1be9-4b16-8468-c3ca3bd44661</guid><dc:creator>air</dc:creator><description>&lt;p&gt;My phone condition is as below picture and I use custom APP.&lt;/p&gt;
&lt;pre class="tw-data-text tw-text-large tw-ta" id="tw-target-text" dir="ltr"&gt;&lt;span class="Y2IQFc" lang="en"&gt;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;p&gt;If I cannot adjust the connection interval&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I wonder if multi notification is possible in one connection interval.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If this is possible, which part should I refer to?&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;If 1. is not possible, there seems to be a way to combine several packets into one packet and send them.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please comment on this.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;thanks.&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/6052.phone1.png" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/4478.phone2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to shorten the data transmission cycle using sd_ble_gatts_hvx()?</title><link>https://devzone.nordicsemi.com/thread/353377?ContentTypeID=1</link><pubDate>Wed, 16 Feb 2022 13:35:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20cf05d9-2499-49f0-8cee-a7d7b581dad8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know exactly what the first &amp;nbsp;BLE_GAP_EVT_CONN_PARAM_UPDATE&amp;nbsp;is for and why there is a new shortly after, but the last interval seems to be 12 (15 ms), so that matches what you are seeing.&amp;nbsp;In BLE it is always the central (phone in this case) that decides the connection interval, though the peripheral can make changes. And iOS and Android will normally limit the connection interval unless for some specific services (like HID). Which phone are you testing with (model and OS version), and are you using your custom App?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>