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

Queued message count at start of Connection Interval

If we want to make certain that a particular message goes first on a connection interval. Is there a way to check that there is none already internally queued?

Is this possible? Pseudo code below

app_ble_radio_notification_handler (active)

    if active

         if 0 == queued_tx_messages()

             queue_message(handle)

The reason I'm asking is because we can control the messages that we synchronously send to Central but messages that are generated by Central, example read request of a particular characteristic, will generate an internal response that will be transparent to peripheral.

  • Hi

    I agree with most of that. What about a read characteristic from Central, would not that generate a transmission in the Peripheral? 

    Assume that Application has queued a single notification, and Central happens to also want to read a particular READABLE characteristic from the Peripheral. On the next connection interval, wouldn't that  generate possibly two transmissions?

    #1 for the Notification we have queued

    #2 to read the characteristic that Central was interested in reading

  • Hi,

    Yes, the peripheral will have to send a read response, but not neccessarly in the same connection event as the request. Below you can see a picture of a sniffer trace that shows the scenario where a GATT server receives a read request while having a notification packet in the queue.

Related