I found a project named "nRF51-ble-app-uart-static-passkey" on Github, but I want to set a static passkey on nRF52832(PCA10040). How can I do that?
Thanks!
I found a project named "nRF51-ble-app-uart-static-passkey" on Github, but I want to set a static passkey on nRF52832(PCA10040). How can I do that?
Thanks!
You can try the ble_app_gls example in SDK 11.
Just add
uint8_t passkey[] = "123456";
ble_opt_t ble_opt;
ble_opt.gap_opt.passkey.p_passkey = &passkey[0];
err_code = sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &ble_opt);
APP_ERROR_CHECK(err_code);
somewhere after you have enabled the SoftDevice (ble_stack_init()). And it should work.
Have you set that you want to bond, and that you require MITM protection?
#define SEC_PARAM_BOND 1 /**< Perform bonding. */
#define SEC_PARAM_MITM 1 /**< Man In The Middle protection required. */
Have you set the IO capabilites to display only?
#define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_DISPLAY_ONLY /**< Display I/O capabilities. */
Hi How can i implement for random passkey please help me
Hi GK, you can take a look at ble_app_gls example. it generate and pop out a random passkey everytime a mobile try to bond with device. no extra steps need.
Hi GK, you can take a look at ble_app_gls example. it generate and pop out a random passkey everytime a mobile try to bond with device. no extra steps need.