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

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

    Time taken is from the time I get BLE_adv_report and if the UUID match request does match to the time I get connection secured event. Basically if UUIDs match I call connect request, from that time till I get connection secured event. I call pm_conn_secure once I receive the BLE_GAP_connected event.

    How do you handle the  BLE_GAP_EVT_DISCONNECTED event for instance?

    Central : start scanning with whitelist.

    Peripheral : directed advertising and then fast advertising with whitelist.

    Thank you for your Help

  • Okay, this seems to take a bit too long then, do you have a debug log with timestamps or maybe you can take a sniffer trace so we can get some details as to what exactly is taking time in this process? If you have an nRF52 DK you can use it as a sniffer with the nRF Sniffer firmware and Wireshark for example.

    Best regards,

    Simon

  • The time it takes to pair with a new device.

    The time it takes to connect with a previously paired device.

    I hope this is what you meant by debug log. 

Reply Children
Related