hi..folks
wish you happiee new year
i am using nrf52832 whille i tried to pair my device with my android , i am getting an error message " pairing rejected by nordic_uart " why?
hi..folks
wish you happiee new year
i am using nrf52832 whille i tried to pair my device with my android , i am getting an error message " pairing rejected by nordic_uart " why?
I do believe the example you refer to does not support pairing and bonding, refer to:
case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
// Pairing not supported
err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
APP_ERROR_CHECK(err_code);
break;
If you want to support pairing and bonding, then you need to use an example that have peer manager.
I do believe the example you refer to does not support pairing and bonding, refer to:
case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
// Pairing not supported
err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
APP_ERROR_CHECK(err_code);
break;
If you want to support pairing and bonding, then you need to use an example that have peer manager.
While I am going to pair with my android 9 Asus mobile phone with SDK 17 nRF52840. It in my mobile showing "Pairing rejected by Nordic_HRM". After that I have added a some code line to
static void peer_manager_init(bool erase_bonds);
Presuming your change doesn't give any error code, then I suspect it may be related to HRM already have a bond, thereby doesn't want to allow re-bonding with the same peer.
Typically the application can allow re-pairing by adding the following in pm_evt_handler() in main.c:
case PM_EVT_CONN_SEC_CONFIG_REQ:
{
// Allow or reject pairing request from an already bonded peer.
pm_conn_sec_config_t conn_sec_config = {.allow_repairing = true};
pm_conn_sec_config_reply(p_evt->conn_handle, &conn_sec_config);
} break;
Though, be aware that the user should somehow control this (e.g. by the user for instance press a pairing button), because always allowing re-pairing should be considered an security issue.
If this isn't the problem, then I would like a on-air sniffer log (e.g. from nRF sniffer) so I can see the actual on-air error.