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
  • Hi

    1. An NRF_ERROR_BUSY from pm_conn_secure() will return if a security procedure is already in progress on the link, or if the link is disconnecting /disconnected. So if the devices aren't disconnected it's likely due to the devices being in a security procedure already, so you could add a check to make sure that the devices are "ready" or add a delay before calling pm_conn_secure().

    2. I'm not sure I understand what you mean with this question. The devices will pair after they have connected, not the other way around. Also, are you using two nRF52832 devices in this connection, or are you using a phone for one of the roles for instance?

    3. If you don't get an error code, that should mean you "passed" the function, and it won't be called at all. So it shouldn't be stored or "destroyed" at all if that's what you mean. If you're wondering where the error codes are described, this is usually in the comments on header files. Like for pm_conn_secure(), you can find the various error messages described in \SDK_FOLDER\nRF5_SDK_17.0.2_d674dde\components\ble\peer_manager\peer_manager.h

    Best regards,

    Simon

Reply
  • Hi

    1. An NRF_ERROR_BUSY from pm_conn_secure() will return if a security procedure is already in progress on the link, or if the link is disconnecting /disconnected. So if the devices aren't disconnected it's likely due to the devices being in a security procedure already, so you could add a check to make sure that the devices are "ready" or add a delay before calling pm_conn_secure().

    2. I'm not sure I understand what you mean with this question. The devices will pair after they have connected, not the other way around. Also, are you using two nRF52832 devices in this connection, or are you using a phone for one of the roles for instance?

    3. If you don't get an error code, that should mean you "passed" the function, and it won't be called at all. So it shouldn't be stored or "destroyed" at all if that's what you mean. If you're wondering where the error codes are described, this is usually in the comments on header files. Like for pm_conn_secure(), you can find the various error messages described in \SDK_FOLDER\nRF5_SDK_17.0.2_d674dde\components\ble\peer_manager\peer_manager.h

    Best regards,

    Simon

Children
No Data
Related