wiced_bt_gatt_send_notification - controlling rate (4343W BLE)

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

cross mob
dast_1961951
Level 4
Level 4
10 likes received First like received

Hi -

Trying to establish some serial data flow using BLE notifications.   I'm having trouble finding a BLE API function to control message flow to prevent running out of BLE buffers.  Is anyone aware of a method to control the notification flow to prevent this?

When sending often (using following retry mechanism), we appear to send any notifications at all.

--code--

while (wiced_bt_gatt_send_notification(conn_id,

                        HDLC_DEVICE_RX, (uint16_t) trans, &c) != WICED_BT_GATT_SUCCESS)

                        ;

--

00:00:14.056104 GKI_exception(): Task State Table

00:00:14.057104 GKI_exception 65524 getbuf: out of buffers

00:00:14.057104 GKI_exception(): Task State Table

00:00:14.057104 GKI_exception 65524 getbuf: out of buffers

00:00:14.057104 GKI_exception(): Task State Table

00:00:14.058104 GKI_exception 65524 getbuf: out of buffers

00:00:14.058104 GKI_exception(): Task State Table

00:00:14.058104 GKI_exception 65524 getbuf: out of buffers

0 Likes
2 Replies
dast_1961951
Level 4
Level 4
10 likes received First like received

found that, when wiced_bt_gatt_send_notification() is called and congestion is about to occur, the function returns with a congestion notice, but also there is a GATT callback that indicates congestion.  this can be used to accomplish flow control.

the wiced_bt_gatt_evt_t member of the callback is a 5, which isn't defined, but when this occurs, we check p_event_data->congestion.congested to find out if congestion is occurring.

when congestion lets up, the same event is called and p_event_data->congestion.congested is false.

0 Likes
dast_1961951
Level 4
Level 4
10 likes received First like received

Update:  unfortunately I find that if I attempt to use "congestion" as a flow control, the BLE ends up congested most of the time and unable to perform functions like listing out characteristics which gives major problems when clients try to connect.

My temporary solution is to use indications, which require an ACK from the central.  This requires more radio comm & power consumption than I'd like so still hoping some ability might be there to check buffer pool/queue status to make sure we're not congesting.

0 Likes