Hi Gentlemen,
i want to pair my mobile(central) with peripheral device by entering passkey note: No input or display on peripheral device
suggest the method with sample codes if possible am using sdk 8.0.0 and nrf51dk
Hi Gentlemen,
i want to pair my mobile(central) with peripheral device by entering passkey note: No input or display on peripheral device
suggest the method with sample codes if possible am using sdk 8.0.0 and nrf51dk
*/ static void sec_params_init(void) {
m_sec_params.bond = SEC_PARAM_BOND;
m_sec_params.mitm = SEC_PARAM_MITM;
m_sec_params.io_caps = SEC_PARAM_IO_CAPABILITIES;
m_sec_params.oob = SEC_PARAM_OOB;
m_sec_params.min_key_size = SEC_PARAM_MIN_KEY_SIZE;
m_sec_params.max_key_size = SEC_PARAM_MAX_KEY_SIZE;
}
#define SEC_PARAM_TIMEOUT 30 /< Timeout for Pairing Request or Security Request (in seconds). */ #define SEC_PARAM_BOND 1 /< Perform bonding. */ #define SEC_PARAM_MITM 1 /< Man In The Middle protection not required. */ #define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /< No I/O capabilities. */ #define SEC_PARAM_OOB 0 /< Out Of Band data not available. */ #define SEC_PARAM_MIN_KEY_SIZE 7 /< Minimum encryption key size. */ #define SEC_PARAM_MAX_KEY_SIZE 16
gap_params_init(); { uint8_t passkey[] = "123456"; ble_opt_t ble_opt; ble_opt.gap_opt.passkey.p_passkey = &passkey[0]; (void) sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &ble_opt); }
services_init();
Set the SEC_PARAM_IO_CAPABILITIES to BLE_GAP_IO_CAPS_DISPLAY_ONLY. It should work.
Good to hear. You can mark my answer as correct so others can also find this.
Can you test using MCP? I have tested using MCP and android phone.
The password had to be from 0 - 99999 ascii digits.