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

Softdevice, pairing and connecting to bonded device

Hello,

While I was testing the codes, I just got a few errors and I am confused as to why it's happening. The questions are:

1) Sometimes, I get pm_conn_secure error code 17 and I found out it's NRF_ERROR_BUSY. Is there some way to avoid it. I am calling it only after I receive the connected event so the devices are not disconnected.

2) Pairing happens very fast but connected to those paired devices takes time. Is there any reason why it is that way?

3) Suppose I am calling any softdevice function or any of the SDK libraries without any error code. Where are those error codes stored or are they destroyed. This isn't as much a doubt, more like curiosity on how things work in the GCC compiler.

Thanks and Regards

Parents
  • so you could add a check to make sure that the devices are "ready

    Thats cool. I can try that.

    I'm not sure I understand what you mean with this question.

    Ok, i will try to explain it even further. I am trying to connect two nrf52832 chips and pair them. First, i scan without whitelist and the two devices connect and pair in like 500 ms.

    Then, I disconnect the device and start advertising in the peripheral and scanning in central, both using whitelist (which contains the information of previously bonded device). The pairing of this takes around 5sec. Why is it that this is slower than the first one is my question?

    In other words once I call sd_ble_gap_connect(), it takes more time while connecting to a device with whitelist enabled than a device without whitelist enabled.

    So it shouldn't be stored or "destroyed" at all if that's what you mean.

    Ok, basically consider two scenarios

    Scenario 1 : ret_code_t ret = sd_ble_gap_advertising_start();

    In this case, if my parameters are correct I get ret as success which is zero.

    Suppose I call only call

    s_ble_gap_advertising_start();

    Where does the error code which returns from the softdevice go?

Reply
  • so you could add a check to make sure that the devices are "ready

    Thats cool. I can try that.

    I'm not sure I understand what you mean with this question.

    Ok, i will try to explain it even further. I am trying to connect two nrf52832 chips and pair them. First, i scan without whitelist and the two devices connect and pair in like 500 ms.

    Then, I disconnect the device and start advertising in the peripheral and scanning in central, both using whitelist (which contains the information of previously bonded device). The pairing of this takes around 5sec. Why is it that this is slower than the first one is my question?

    In other words once I call sd_ble_gap_connect(), it takes more time while connecting to a device with whitelist enabled than a device without whitelist enabled.

    So it shouldn't be stored or "destroyed" at all if that's what you mean.

    Ok, basically consider two scenarios

    Scenario 1 : ret_code_t ret = sd_ble_gap_advertising_start();

    In this case, if my parameters are correct I get ret as success which is zero.

    Suppose I call only call

    s_ble_gap_advertising_start();

    Where does the error code which returns from the softdevice go?

Children
No Data
Related