I've been working on a peripheral wich accepts Just Works pairing requests and I'm completed at all points but the pairing itself. The device advertisises and connects successfully but when pairing or bonding are requested it responds with opcode 0x05(Pairing not supported) and then central terminates connection, the pairing in initilialized using pm_init() and pairing params are set and registered but it still resoponds rejecting pairing. I've debugged with the phone bugreport and wireshark to examine the pkts. Nevertheless the hardware is correct as with the nrf connect for desktop it paires and bonds correctly. I'm using the hrs_pca10059 template for my project ( For the dongle ) and here is the pairing initilitzation, which should be correct as with other premades pronjects like the hrs mouse it gets exactly the same rejection with pairing:
static void pm_evt_handler(pm_evt_t const * p_evt){ // Function for handling peer manager evts like pairing and bonding switch(p_evt->evt_id){ case PM_EVT_CONN_SEC_SUCCEEDED: bsp_board_led_on(BSP_LED_2); break; case PM_EVT_CONN_SEC_FAILED: bsp_board_led_on(BSP_LED_1); break; }; } static void pm_initialize(void){ pm_init(); ble_gap_sec_params_t sec_params; memset(&sec_params,0,sizeof(sec_params)); sec_params.bond = 1; sec_params.mitm = 0; sec_params.lesc =0; sec_params.keypress = 0; sec_params.io_caps = BLE_GAP_IO_CAPS_NONE; sec_params.oob = 0; sec_params.min_key_size = 7; sec_params.max_key_size = 16; sec_params.kdist_own.enc = 1; // Distribute encryption key sec_params.kdist_own.id = 1; // Distribute identity key sec_params.kdist_peer.enc = 1; // Request encryption key sec_params.kdist_peer.id = 1; // Request identity key pm_sec_params_set(&sec_params); // Set security parameters for bonding pm_register(pm_evt_handler); // Set evt handler for pm }
I don't know if there's a misconfig in the sdk config but I don't thing so as pm is enabled and I've searched around and seems I'm the only one with the problem.