Hi guys,
can someone provide an example or tutorial how to do BLE connection with authentication key?
Regards, Konstantin
Hi guys,
can someone provide an example or tutorial how to do BLE connection with authentication key?
Regards, Konstantin
In bref: Code is part of the example which I pointed to you. This is essential part, but not all (more in the example). It is kind of a starting point for you. I saw your device(on the web, the prototype) does not have screen or keyboard so it will work on your NRFGo board only: //in security parameters init you will need m_sec_params.io_caps = SEC_PARAM_IO_CAPABILITIES; // SEC_PARAM_IO_CAPABILITIES = BLE_GAP_IO_CAPS_DISPLAY_ONLY
//and the code which display the number to be entered: case BLE_GAP_EVT_PASSKEY_DISPLAY: if (m_is_display_available) { p_passkey = (char *)p_ble_evt->evt.gap_evt.params.passkey_display.passkey;
success = nrf6350_lcd_on(); APP_ERROR_CHECK_BOOL(success);
success = nrf6350_lcd_write_string(PASSKEY_TXT, PASSKEY_TXT_LENGTH, LCD_UPPER_LINE, 0); APP_ERROR_CHECK_BOOL(success);
success = nrf6350_lcd_write_string(p_passkey, PASSKEY_LENGTH, LCD_LOWER_LINE, 0); APP_ERROR_CHECK_BOOL(success); } break;
In bref: Code is part of the example which I pointed to you. This is essential part, but not all (more in the example). It is kind of a starting point for you. I saw your device(on the web, the prototype) does not have screen or keyboard so it will work on your NRFGo board only: //in security parameters init you will need m_sec_params.io_caps = SEC_PARAM_IO_CAPABILITIES; // SEC_PARAM_IO_CAPABILITIES = BLE_GAP_IO_CAPS_DISPLAY_ONLY
//and the code which display the number to be entered: case BLE_GAP_EVT_PASSKEY_DISPLAY: if (m_is_display_available) { p_passkey = (char *)p_ble_evt->evt.gap_evt.params.passkey_display.passkey;
success = nrf6350_lcd_on(); APP_ERROR_CHECK_BOOL(success);
success = nrf6350_lcd_write_string(PASSKEY_TXT, PASSKEY_TXT_LENGTH, LCD_UPPER_LINE, 0); APP_ERROR_CHECK_BOOL(success);
success = nrf6350_lcd_write_string(p_passkey, PASSKEY_LENGTH, LCD_LOWER_LINE, 0); APP_ERROR_CHECK_BOOL(success); } break;