Hi,
Are there any known Android bugs where Android should not bond, but does? I have tried searching the web without too much success.
My central device is an older Android phone, Nexus 6, running Android 7.1.1. Using nRF Connect. With that said, I was able to replicate this issue on other Android phones. The peripheral is an nRF52840.
Security parameters are being set in the peer manager handler:
static void ble_thr_pm_handler(pm_evt_t const *p_evt) { /* ...stuff here... */ switch(p_evt->evt_id) { case PM_EVT_CONN_SEC_PARAMS_REQ: { ble_gap_sec_params_t sec_param = {0}; ret_code_t err_code; sec_param.bond = 0; sec_param.mitm = 1; sec_param.lesc = 1; sec_param.keypress = 0; sec_param.io_caps = BLE_GAP_IO_CAPS_DISPLAY_YESNO; sec_param.oob = 0; sec_param.min_key_size = 7; sec_param.max_key_size = 16; err_code = pm_conn_sec_params_reply( conn_handle, &sec_param, p_evt->params.conn_sec_params_req.p_context ); APP_ERROR_CHECK(err_code); } break; /* ...other cases here... */ } }
I am attaching two BLE HCI snoop logs. One, connect.log, shows the initial pairing process. Pairing is triggered by reading a characteristic (frame 26). Second file, connect-previously-paired.log, shows how Android tries to start encryption after connection is established, even though it should not (frames 30-32). nRF correctly responds with PIN or Key Missing. iOS devices seem to work okay, and do not store any bond information.
Am I doing something wrong, or is this just Android bug?
btsnoop � �ܢ��{� �ܢ���x u�M� �ܢ����T���.u�P �ܢ���T� �ܢ��X�T� �ܢ��g/T� �ܢ��ns �ܢ���� ����(2� �ܢ���-T�o���t �ܢ���T� �ܢ���vT��� o���t � �ܢ����T� �ܢ����T� �ܢ����T� &