Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Does Nordic provide an API to get connection event counter

Hey Nordic team,

We have ECG/EGM alignment problem over BLE, the peer ble chip use RSL15, they came up with the below algorithm, which do need an API to get connection event counter:

Before any BLE activity, ble_coex_rx_tx interrupt (if enabled) is generated. In parallel ble_coex_in_process interrupt can be enabled where at rising edge it shows that ble event has started and at falling edge it shows that ble event has been finished.

 

Application can wait for ble_coex_in_process rising edge, and then set a flag, and wait for ble_coex_rx_tx (Rx rising edge). If at ble_coex_rx_tx Rx rising edge, the flag is set, then it knows it is the first Rx of the event, and can clear the flag and read BB timer and connection interval counter (we need to provide you an API so that connection event counter can be read from BLE stack if you confirm that this method works for you.

 

Now that BB timer is known exactly for connection event counter, (assume BB timer is T1 and event counter is  N1), these numbers can be communicated to peer device. Peer device also needs to find numbers at their side but at any time (T2, a free running timer value and N2).

The time offset between RSL15 and its peer device will be:

 

Timeoffset = (T1 – T2 – ((N1 - N2) * connection_interval))

 

Rx timing is valid, if right after Rx coex interrupt, Tx coex interrupt happens before falling edge of ble_in_process event. If Tx doesn’t happen in the same event, the timing should be ignored and wait for next event. It is because not in all intervals, a packets is received because of RF quality of the link.

 

In this way only one time at the beginning of connection is enough to extract time offset and synchronize devices in time. However, if connection time is long for example 5 minutes, it is suggested to re-sync frequently.

Parents Reply Children
No Data
Related