nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

nrf52832 sdk17.0 connect failed

Hi, I have the following questions. Please help me answer them:

Using the protocol stack of the above version, one master and two slaves are disconnected when reconnecting after the exchange of MTU,

I put logs in some key positions of the code and found the following:

Normally, this function will be called to connect when connecting, and then log output: connect status: 0, and then continue to enter one of the cases of the next function, as shown in the following figure:

Then the connection will be successful.

Under abnormal circumstances, the function in the first figure will still enter, and still print connect status: 0 to prove SD_ ble_ gap_ The return value of connect is success, but it will not enter the function shown in the second figure. Why is this happen? thanks

  • Hi Liny, 

    When you receive "connect status: 0" it doesn't meant that the connection has been established successfully. It only means that the scanner now starting to scan for advertising packet from the intended peripheral to connect to the peripheral. 
    So if it couldn't connect for some reason, you will never receive BLE_GAP_EVT_CONNECTED event. 

    Could you elaborate more on what you described here: "Using the protocol stack of the above version, one master and two slaves are disconnected when reconnecting after the exchange of MTU" ? 

    What exact issue do you have ? 

    Please try to capture a sniffer trace so we have more insight of what happening. 

Related