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

SC field in AuthReq pairing response

Hi, I noticed that I can't bond successfully with my device using iOs 9.1 with Nrf Master control panel iOs app. When I insert the PINCODE, the device immediatly disconnects, and debugging it seems that iOs sends a diconnection command (BLE_GAP_EVT_DISCONNECTED). I read that this problem is due to the fact that iOS 9 is now using the new LE Secure Connections pairing model, and the SC bit is set to 1 in the pairing request. (stackoverflow.com/.../ios-9-1-ble-connects-and-immediately-disconnects)

I checked in the bluetooth core V 4.2 specs that in bonding procedure there is that bitfield in the octect 3 of pairing response called AuthReq, but I couldn't find any way to set it with softdevice 8.0.0.0. I guess the problem could be that one, but I couldn't find a way to test it. So is it possible to change that bit or do you have any information about that problem? I know S110 8.0.0.0 is compliant to V4.1 bluetooth specs, but I have this problem and I don't know how to fix it.

Thank you

  • @RK: I don't have the HW to test this at the moment, but looking at the 8.0.0 code, the whole preq is copied verbatim from the radio. And in the pairing confirm generation, it is again used without modification. There are also conformance tests to verify that we correctly ignore these fields, so I believe this is not the problem. But the tests and the current stack have changed a lot since 8.0.0, so my memory can be fuzzy.

    @Lorens: The disconnection reason was not provided still, and this could quickly solve this. If it's "MIC Failure", then something is up with the key generation. But if it's just "Remote peer disconnected", then it's likely that iOS just killed the connection because nothing interesting was happening. I think they operate with a few seconds of timeout before they tear it down. Are you also able to pair without mitm?

  • Thanks Ulrich - I thought it was a bit premature for the engineer to leap to that conclusion, and more so for the guy to mark it as the 'right answer'. It seemed somewhat unlikely that you'd change the request before using it, more likely you would just ignore the bits you didn't care about, as you do.

  • @Lorens, have you been able to resolve this? I've tried passkey pairing on multiple occasions with ios 9.2.1 and have not experienced that iOS has terminated the link unless the bonding flag was set to false (pairing not supported apparently).

  • @Ulrich: the disconnection reason is 0x13 REMOTE_USER_TERMINATED_CONNECTION. @Vidar: I made several tries using LightBlue app or even Master Control Panel. The problem seems to be solved, I mean now iOs is not disconnecting. I changed the parameter in the function: sd_ble_gap_sec_params_reply; the last one parameter I used to use NULL, now I gave a pointer to the structure ble_gap_sec_keyset_t. Probably before there was not the need to store the key. With this pointer I suppose the softdevice is storing the key, that wasn't storing in case of NULL. But Maybe someone could PROVIDE a more precise answer.

  • do you error-check the result of sd_ble_gap_sec_params_reply()? If you do then it's probably returning an error telling you that NULL isn't a valid parameter and you're going to the error handler and resetting, hence breaking the connection.

Related