This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Empty the indication queue

I am putting data in a queue whenever I get indication, something like this:

on_indication(..,.., received_data)
  self.qure_received.put(received_data)
Is there a way to forcefully empty the queue?
Thanks
Parents
  • Hello,

    When you use indications, please remember that you need to ACK these in the application layer. That means that you need to call sd_ble_gattc_hv_confirm() on each indication. If not, the peripheral will not be able to send the next indication.

    What do you mean by forcefully empty the queue? What queue? Did you create this queue and handler yourself?

    If you are not interrested in all the data, but only the latest message, perhaps you should use notifications instead of indications, as these doesn't require application layer acks, but only link layer acks (which is done by the softdevice).

    Best regards,

    Edvin

Reply
  • Hello,

    When you use indications, please remember that you need to ACK these in the application layer. That means that you need to call sd_ble_gattc_hv_confirm() on each indication. If not, the peripheral will not be able to send the next indication.

    What do you mean by forcefully empty the queue? What queue? Did you create this queue and handler yourself?

    If you are not interrested in all the data, but only the latest message, perhaps you should use notifications instead of indications, as these doesn't require application layer acks, but only link layer acks (which is done by the softdevice).

    Best regards,

    Edvin

Children
No Data
Related