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

Testing LE Ping between two nrf52s

Hi

I am trying to test the LE Ping feature between two nrf52s. I am enabling the LE Ping feature from one device via:

ble_opt_t opt = {0};

opt.gap_opt.auth_payload_timeout.conn_handle = VaidHandle;
opt.gap_opt.auth_payload_timeout.auth_payload_timeout = 20;


retVal = sd_ble_opt_set(BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT, &opt)

This function is working properly and retVal is returning NRF_SUCCESS. However, I want to test the functionality against a remote device but I don't know how. On the remote device I am printing a message when getting BLE_GAP_EVT_TIMEOUT and the source is BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD, but nothing is printed out (all other events are printed without an issue). I tried enabling the pings on invalid connection handles and the function failed. I tried enabled the pings then abruptly breaking the connection from the remote end, but I got no event either.

Any recommendations/ideas on how to test this?

We are using softdevice S132 v3.0.0 on nrf52.

Thanks

Parents
  • So we found that one way to test this is by configuring the connection interval. Having auth_payload_timeout set to be lower than (2 x connection interval) on an encrypted connection will trigger BLE_GAP_EVT_TIMEOUT. The reason for this is that two connection intervals are required for LE Ping, one for request and one for response.

    For example if auth_payload_timeout is set to 20ms, having the connection interval set to 15ms will ensure that at least 30ms will be needed for ping request and ping response, therefore the device will time out before the response is returned, triggering the BLE_GAP_EVT_TIMEOUT.

Reply
  • So we found that one way to test this is by configuring the connection interval. Having auth_payload_timeout set to be lower than (2 x connection interval) on an encrypted connection will trigger BLE_GAP_EVT_TIMEOUT. The reason for this is that two connection intervals are required for LE Ping, one for request and one for response.

    For example if auth_payload_timeout is set to 20ms, having the connection interval set to 15ms will ensure that at least 30ms will be needed for ping request and ping response, therefore the device will time out before the response is returned, triggering the BLE_GAP_EVT_TIMEOUT.

Children
No Data
Related