Hi!
My BLE peripheral needs to change its "static" passkey under certain circumstance.
However, when I attempt to connect after setting it, I get a PM_CONN_SEC_ERROR_PIN_OR_KEY_MISSING failure.
Here is the code fragment from update_advertising (start_advertising does this also.)
ble_opt_t m_static_pin_option;
NRF_LOG_INFO("update_advertising");
if(Current_Mode_Pairing_Passkey != 0)
{
sprintf(passkey,"%06d",Current_Mode_Pairing_Passkey);
}
m_static_pin_option.gap_opt.passkey.p_passkey = &passkey[0];
NRF_LOG_INFO("Passkey in use at update_advertising: %s ",m_static_pin_option.gap_opt.passkey.p_passkey);
err_code = sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &m_static_pin_option);
APP_ERROR_CHECK(err_code);
The key in the log message matches what I expect, and there is nowhere else that I call sd_ble_opt_set with the BLE_GAP_OPT_PASSKEY parameter.
Very baffled.
I know you guys are on holiday, and I am grateful for any attention you can give this.
-Ben Burch
BTR Controls, Inc.