- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am working on a project which is involving sending a large (right now on the order of 20-200KB, but eventually it could get up to a couple hundred MB) file from a NAND flash, which is hooked up to a CYW20719B1 chip, to an android app. In the interest of speed, I am sending the file from the board by using notifications, which the android app then subscribes to and uses to reconstruct the file on the phone. However, after sending a certain number of notifications, I get a GATT Congestion Event. I've tried handling the event the following ways:
1. When a congestion event is registered, the board stops reading from the flash and sending notifications, waiting for a decongestion event to occur. When I do this, I never get a decongestion event, and so the application never proceeds any further.
2. Increasing the buffer sizes: This changed the number of notifications I can send before getting the congestion event from 8 to 12, but there is not enough RAM to cover the entire file we need to send, so increasing the buffer size any more will not be a viable long term solution
3. Ignoring it: If I ignore the congestion event and keep sending data, I get errors from all the send notification calls until the last one, after which I immediately get a decongestion event. This is the only way I've found to register a decongestion event, but any data past the first 12 notifications doesn't make it to the android app.
The first two solutions are the only ones I have found recommended for solving this congestion error, and neither has worked for me, so I was wondering if there are any other ways I should be handling the congestion problem.
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We can get congestion state from wiced_bt_gatt_congestion_event_t which can be get from GATT_CONGESTION_EVT event. I think, based on it we get build the logic. One reference you can use is below example. Please check it.
Thanks,
-Dheeraj.P.K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We can get congestion state from wiced_bt_gatt_congestion_event_t which can be get from GATT_CONGESTION_EVT event. I think, based on it we get build the logic. One reference you can use is below example. Please check it.
Thanks,
-Dheeraj.P.K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the reply. The example does give me a bit of an idea of the structure that can be used around congestion issues. However, this project is built for the B2 chip, and we are using the B1 (we are trying to upgrade to the B2, but that won't happen for some time). I also did try a structure similar to this, using an if statement to check congestion before sending a notification, and when I did that the program never received an event saying it was decongested.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please share the working code. We can check it together.
I would recommend to create another query in the community.