- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the answer. What would be the limit for the TX queue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm also receiving wiced_bt_gatt_evt_t event == 0x5 from GATT callback. (SDK 4.0.1)
Is there any update?