2 Replies Latest reply on Jan 24, 2017 7:28 PM by DaveStude

    wiced_bt_gatt_send_notification - controlling rate (4343W BLE)

    DaveStude

      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[i],

                              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

        • 1. Re: wiced_bt_gatt_send_notification - controlling rate (4343W BLE)
          DaveStude

          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.

          • 2. Re: wiced_bt_gatt_send_notification - controlling rate (4343W BLE)
            DaveStude

            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.