<?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>Central stalling with two peripherals when one is disconnecting</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127614/central-stalling-with-two-peripherals-when-one-is-disconnecting</link><description>Hi everyone, I have a central firmware application connected to 2 peripheral devices: A and B. 
 I use the method bt_gatt_write_without_response_cb (from zephyr&amp;gt;subsys&amp;gt;bluetooth&amp;gt;host&amp;gt;gatt.c ) to send my data to the different peripherals. In order not</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Apr 2026 13:19:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127614/central-stalling-with-two-peripherals-when-one-is-disconnecting" /><item><title>RE: Central stalling with two peripherals when one is disconnecting</title><link>https://devzone.nordicsemi.com/thread/564532?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2026 13:19:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b719885f-e361-47fd-80eb-1c6436ced3d5</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Alberto,&lt;/p&gt;
&lt;p&gt;Yes. That sounds about right!&lt;/p&gt;
&lt;p&gt;In have not seen your application, but you can do a check every time you try to send a message, to see if you are still connected (set some flag in the disconnected event).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you say, waiting for the TX complete callback will cause a drop in the throughput. One option is to keep some internal counter on how many packets you have queued and how many that have been acked, making sure you only have N queued messages at the time. Even better, if you keep track of what device each of these messages are meant for, you can clear that counter when one device disconnects, as these packets are discarded. This way, you can always have enough messages in the queue to maximize your throughput, without overloading the Bluetooth stack when you receive a disconnect.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central stalling with two peripherals when one is disconnecting</title><link>https://devzone.nordicsemi.com/thread/564348?ContentTypeID=1</link><pubDate>Wed, 01 Apr 2026 07:02:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd35a01e-8966-438c-8c1e-88489397fc43</guid><dc:creator>Alberto Calatroni</dc:creator><description>&lt;p&gt;Hi again Edvin and Nordic team,&lt;br /&gt;&lt;br /&gt;We have some updates and we think we now understand what is happening.&lt;br /&gt;&lt;br /&gt;Our hypothesis is that the &amp;quot;write without response&amp;quot; triggers the callback when the message could be successfully passed&amp;nbsp;&lt;strong&gt;to the host&lt;/strong&gt;, which does not mean that the host / controller were yet able to send this out. The consequence was that the internal buffers would get filled up if one of the connections was bad.&lt;br /&gt;&lt;br /&gt;What we did is now to revert to the API which triggers a &amp;quot;write with response&amp;quot;, and wait for the corresponding callback before unlocking the semaphore again. Like this, we only proceed when we are sure that the message was effectively sent (and acknowledged). This reduces somewhat the throughput, since we need to skip at least one connection interval, but is acceptable for our application.&lt;/p&gt;
&lt;p&gt;Could you maybe confirm that our understanding is correct? Maybe it would be helpful to improve the include files / documentation regarding these behaviors.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Alberto&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central stalling with two peripherals when one is disconnecting</title><link>https://devzone.nordicsemi.com/thread/564204?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2026 14:33:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9696e70e-e1e0-45a3-83ab-e0912a7bbcd3</guid><dc:creator>Alberto Calatroni</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;br /&gt;&lt;br /&gt;Thanks for your quick answer. From the documentation I understand that the function is blocking if called from another thread, but from the same thread it should just return -ENOMEM. This is the assumption under which we based our architecture. Do we misunderstand something?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Alberto&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central stalling with two peripherals when one is disconnecting</title><link>https://devzone.nordicsemi.com/thread/564200?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2026 14:08:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92a198f2-9221-4afc-9442-0237ba6a0c7a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am not sure how fast you are trying to push these messages. Could it be that you have filled the&amp;nbsp;CONFIG_BT_ATT_TX_COUNT? The bt_gatt_write_without_response_cb() is a blocking call, meaning if it can&amp;#39;t place the message in the buffer, it will block until it can fit the message.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Try increasing the&amp;nbsp;CONFIG_BT_ATT_TX_COUNT and see if that helps. However, if you fill it up, it will still be blocking.&lt;/p&gt;
&lt;p&gt;You could try to keep the transmission of the two different peripherals to different threads, and monitor how many messages are in each queue (to make sure you don&amp;#39;t fill up the CONFIG_BT_ATT_TX_COUNT).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>