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

radio notifications and relationship with BLE_GATTS_EVT_WRITE and BLE_GATTS_EVT_HVN_TX_COMPLETE

I have enabled radio notifications (through sd_nvic_ functions). When sd_ble_gatts_hvx() (notification) is called once, I've noticed two radio active-nactive windows occur before BLE_GATTS_EVT_HVN_TX_COMPLETE occurs. It seems like it takes 2 windows to notify, why? Is the packet sent during the active-nactive window occurring directly before BLE_GATTS_EVT_HVN_TX_COMPLETE?

When a BLE_GATTS_EVT_WRITE event occurs, was the new data presented by the BLE event handler (assigned with NRF_SDH_BLE_OBSERVER) received during the active-nactive window occurring directly before BLE_GATTS_EVT_WRITE?

The sd is configured as a peripheral.

Parents
  • Hi Archangel,

    BLE_GATTS_EVT_HVN_TX_COMPLETE occurs when a notification is Acked on link layer. So this usually requires 2 connection event. First one is for the peripheral to send the packet and the next one is when the packet ACKed by the central. This is why you see 2 windows before you receive the event.

    In most cases (when you have only one connection, peripheral only, no timeslot activity) the BLE_GATTS_EVT_WRITE occurs right after the data arrives (the radio active window).

    Please have a look at chapter 11 in the S132 softdevice specification for more information regarding radio notification.

  • Just for clarification, regardless of if you are using notifications or indications, at some level there is an acknowledgement? It seems that I am getting BLE_GATTS_EVT_HVN_TX_COMPLETE right as the second radio window is about to start now (nactive) which doesn't seem to jive with your explanation but it could be the result of some race condition.

    Sending code

    tx enqueue

    active: 54141

    inactive: 54798

    active: 84342

    BLE_GATTS_EVT_HVN_TX_COMPLETE

    inactive: 85071

Reply
  • Just for clarification, regardless of if you are using notifications or indications, at some level there is an acknowledgement? It seems that I am getting BLE_GATTS_EVT_HVN_TX_COMPLETE right as the second radio window is about to start now (nactive) which doesn't seem to jive with your explanation but it could be the result of some race condition.

    Sending code

    tx enqueue

    active: 54141

    inactive: 54798

    active: 84342

    BLE_GATTS_EVT_HVN_TX_COMPLETE

    inactive: 85071

Children
No Data
Related