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.
Thanks for your answer, but it doesn't work in my application....
I added those code after ble_statck_init() in main, but my mobile phone still can pair nRF52832 without passkey.
What's wrong did I do?
Thanks for your answer, but it doesn't work in my application....
I added those code after ble_statck_init() in main, but my mobile phone still can pair nRF52832 without passkey.
What's wrong did I do?