Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

Wi-Fi Combo

user_2112781
Level 4
10 likes received 10 likes given 5 likes given
Level 4

After using the BLE stack for a while, I get a GATT event callback with the code 0x5. This is not documented.

When looking at the header wiced_bt_gatt.h, I see a structure related to the GATT_CONGESTION_EVT, this event is not in the enumeration wiced_bt_gatt_evt_t ​but I guess this is the 0x5 event ?

0 Likes
5 Replies
JacobT_81
Employee
250 likes received 100 likes received 50 likes received
Employee

This event means that you're running low in tx buffers. BLE transmissions wait for connection events which occur every 7.5ms to 4000ms. Standard BLE can only send 20 bytes per connection event. If you transmit data in between connection events, it goes into a buffer until the next connection event can push it out. If you try to push too much in between connection events, you'll overflow this buffer.

Jacob

user_2112781
Level 4
10 likes received 10 likes given 5 likes given
Level 4

Thank you for the answer.  What would be the limit for the TX queue?

0 Likes
JacobT_81
Employee
250 likes received 100 likes received 50 likes received
Employee

There are a couple variables associated with the tx queue size. Your MTU size, defined buffer count, size, etc. I'll have to get back to you once I find an exact number.

For now, the best solution is timing your data pushes to synchronize with connection events i.e. start a timer on the same interval as (or a multiple of) the connection events and push data once per loop into the queue. That should avoid this error.

Jacob

user_2112781
Level 4
10 likes received 10 likes given 5 likes given
Level 4

This sounds more like a workaround, I guess that could work but my question is: how could I change the TX buffer size to be sure never to exceed it ? I always send BLE commands one after another, e.g. I will only send a Request after a Response has been received, so it should not be congested. Of course I am connected to multiple devices (8) but the TX queue cannot be so small. Waiting for your findings 🙂

JeGu_2199941
Level 5
25 likes received 10 likes received 10 likes given
Level 5

I'm also receiving wiced_bt_gatt_evt_t event == 0x5 from GATT callback. (SDK 4.0.1)
Is there any update?

0 Likes