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.

  • I don't have the timing for BLE_GATTS_EVT_HVN_TX_COMPLETE from your log so I don't know if it's before or after the radio is active.

    But be aware that the notification can be ACKed in one connection event if there are more than one packet is transmitted from the central, for example the second packet from central can ACK the first packet from the slave, in one connection event.

Reply
  • I don't have the timing for BLE_GATTS_EVT_HVN_TX_COMPLETE from your log so I don't know if it's before or after the radio is active.

    But be aware that the notification can be ACKed in one connection event if there are more than one packet is transmitted from the central, for example the second packet from central can ACK the first packet from the slave, in one connection event.

Children
No Data
Related