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

SD7 send one packet per interval

I am using SD7 and I want to send exactly one 23-byte notification per connection interval.  If I wait for the BLE_GATTS_EVT_HVN_TX_COMPLETE event and call sd_ble_gatts_hvx() then it is sending one notification every other interval.  How do I send one per interval?

Parents
  • Hi,

    If I wait for the BLE_GATTS_EVT_HVN_TX_COMPLETE event and call sd_ble_gatts_hvx() then it is sending one notification every other interval.

     This makes sense, BLE_GATTS_EVT_HVN_TX_COMPLETE occurs when a notification is acked on the 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. 

    How do I send one per interval?

    You could use sd_ble_gap_conn_evt_trigger_start , and make it trigger a software interrupt every connection event start. (use the EGU), and in the SW interrupt call sd_ble_gatts_hvx().

Reply
  • Hi,

    If I wait for the BLE_GATTS_EVT_HVN_TX_COMPLETE event and call sd_ble_gatts_hvx() then it is sending one notification every other interval.

     This makes sense, BLE_GATTS_EVT_HVN_TX_COMPLETE occurs when a notification is acked on the 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. 

    How do I send one per interval?

    You could use sd_ble_gap_conn_evt_trigger_start , and make it trigger a software interrupt every connection event start. (use the EGU), and in the SW interrupt call sd_ble_gatts_hvx().

Children
Related