I'm using an Nrf52 with S132v3.0 I'm using Peer Manager to manage pairing and bonding. I'm running as a central connecting to a peripheral (iOS/Android peripheral).
I'm using "out of the box" peer management code using the following link from the SDK as an example. infocenter.nordicsemi.com/index.jsp
Most of the time the connection/pairing/bonding works just fine. On occasion I've experienced PM_EVT_CONN_SEC_FAILED.
Below is my switch statement broken up for debug purposes.
switch (p_evt->params.conn_sec_failed.error)
{
case PM_CONN_SEC_ERROR_PIN_OR_KEY_MISSING:
// Rebond if one party has lost its keys.
err_code = pm_conn_secure(p_evt->conn_handle, true);
if (err_code != NRF_ERROR_INVALID_STATE)
{
APP_ERROR_CHECK(err_code);
}
break;//PM_CONN_SEC_ERROR_PIN_OR_KEY_MISSING
case PM_CONN_SEC_ERROR_MIC_FAILURE:
NRF_LOG_DEBUG("error: PM_CONN_SEC_ERROR_MIC_FAILURE");
sd_ble_gap_disconnect(p_evt->conn_handle, BLE_HCI_AUTHENTICATION_FAILURE);
break;//PM_CONN_SEC_ERROR_MIC_FAILURE
case PM_CONN_SEC_ERROR_DISCONNECT :
NRF_LOG_DEBUG("error: PM_CONN_SEC_ERROR_DISCONNECT ");
sd_ble_gap_disconnect(p_evt->conn_handle, BLE_HCI_AUTHENTICATION_FAILURE);
break;//PM_CONN_SEC_ERROR_DISCONNECT
case PM_CONN_SEC_ERROR_SMP_TIMEOUT:
NRF_LOG_DEBUG("error: PM_CONN_SEC_ERROR_SMP_TIMEOUT");
sd_ble_gap_disconnect(p_evt->conn_handle, BLE_HCI_AUTHENTICATION_FAILURE);
break;//PM_CONN_SEC_ERROR_SMP_TIMEOUT
default:
/* Close the connection and move on */
sd_ble_gap_disconnect(p_evt->conn_handle, BLE_HCI_AUTHENTICATION_FAILURE);
break;
}
The error I'm getting is "Unknown" with an error ID of 0x0001.
Looking at the documentation: infocenter.nordicsemi.com/index.jsp
The only valid error IDs are 0x6, 0x3D, 0x100 ,0x101. Has anyone seen 0x0001? Any idea what it means?