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.

  • You are correct, any BLE packet will be retransmitted until it's ACKed on link layer. You can read more about the flow control here.

    I don't see anything contradict with my explantion, after the radio is active, it receives the next packet from central , and that packet ACKs the last notification packet, and then you have the BLE_GATTS_EVT_HVN_TX_COMPLETE event of how many packets sent in the last connection event.

    This BLE_GATTS_EVT_HVN_TX_COMPLETE event can come before the connection event finish.

Reply
  • You are correct, any BLE packet will be retransmitted until it's ACKed on link layer. You can read more about the flow control here.

    I don't see anything contradict with my explantion, after the radio is active, it receives the next packet from central , and that packet ACKs the last notification packet, and then you have the BLE_GATTS_EVT_HVN_TX_COMPLETE event of how many packets sent in the last connection event.

    This BLE_GATTS_EVT_HVN_TX_COMPLETE event can come before the connection event finish.

Children
No Data
Related