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
  • 2. Okay, I didn't realize this was about the re-connection taking too long. Thank you for explaining. Can you confirm whether it is the time from the DISCONNECTED to CONNNECTED events or from the CONNECTED event until the devices are paired again that takes ~5 seconds by debugging? How do you handle the  BLE_GAP_EVT_DISCONNECTED event for instance?

    3. Well, if you don't ask for a return code (ret_code) then you won't get any, the error will still occur, but won't be printed for you to see, which will make it hard for you to see what (or if something) is wrong.

    Best regards,

    Simon

Reply
  • 2. Okay, I didn't realize this was about the re-connection taking too long. Thank you for explaining. Can you confirm whether it is the time from the DISCONNECTED to CONNNECTED events or from the CONNECTED event until the devices are paired again that takes ~5 seconds by debugging? How do you handle the  BLE_GAP_EVT_DISCONNECTED event for instance?

    3. Well, if you don't ask for a return code (ret_code) then you won't get any, the error will still occur, but won't be printed for you to see, which will make it hard for you to see what (or if something) is wrong.

    Best regards,

    Simon

Children
Related