This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Bluetopia, remaining buffer space for notifications?

Other Parts Discussed in Thread: CC2564, MSP430F5438A

Hello all,

Is there any way with Bluetopia to tell how much buffer space (in either bytes or # of messages, if possible) is left for outgoing GATT messages such as notifications?

I'm using a Bluetooth module from a vendor that, internally, contains an MSP430F5438A and CC2564, running a vendor specific Bluetopia release labeled as version 4.0.1.3. I am currently only using this for BLE even though it is a dual mode module.

My application involves transferring data logs to from the embedded device (containing the above module) to a mobile phone, and to accomplish this with decent rate I am using BLE Notifications (GATT_Handle_Value_Notification) since you can send more than one notification per connection interval.

The first implementation I did basically sends a fixed number of notifications per second. However, if the signal gets spotty and packet loss starts occuring, the notifications start stacking up in some internal buffer and eventually the call to GATT_Handle_Value_Notification fails with error code -65 (  BTPS_ERROR_INSUFFICIENT_BUFFER_SPACE.) When I send 18 byte notifications in a tight loop to test, it looks like it takes between 120 and 130 notifications before I receive this error. That part makes sense.

However, after that, the connection seems wedged. Even if I wait a while to send again, I always get BTPS_ERROR_INSUFFICIENT_BUFFER_SPACE. It seems weird that this state is irrecoverable but perhaps something is going on at a lower level that I don't understand.

I think I can fix the immediate problem by limiting the number of in-flight notifications through various means (such as only sending N notifications in response to a write request & not sending the write response until all notifications are buffered, or doing a pipelining acknowledgement system like how TCP works) but it would be even simpler to just be able to know how much buffer I have left and maintain a certain amount of headroom. If anyone has any suggestions how to accomplish this I would love to know.

Thanks for your help,

Scott