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.

  • What I may be confused about is that it appears that the BLE_GATTS_EVT_HVN_TX_COMPLETE actually happens before the radio goes active a second time (because NRF_RADIO_NOTIFICATION_DISTANCE_800US) and I was under the assumption no processing occurs when the radio is actually active. If the ack was received during the second radio window it would not have to occur after the second inactive event?

Reply
  • What I may be confused about is that it appears that the BLE_GATTS_EVT_HVN_TX_COMPLETE actually happens before the radio goes active a second time (because NRF_RADIO_NOTIFICATION_DISTANCE_800US) and I was under the assumption no processing occurs when the radio is actually active. If the ack was received during the second radio window it would not have to occur after the second inactive event?

Children
No Data
Related