nRF Connect SDK Bare Metal API 2.0.99
Loading...
Searching...
No Matches

◆ pm_handler_secure_on_error()

void pm_handler_secure_on_error ( const ble_evt_t * ble_evt)

#include <peer_manager_handler.h>

Secure a connection if a GATT read or write operation lacks security.

This function starts pairing if a GATTC procedure fails with insufficient encryption or insufficient authentication. This is meant to delay performing pairing/bonding until it is actually needed to access resources. This is affected by PM_HANDLER_SEC_DELAY_MS.

Note
When using this handler, the failed GATTC operation must be retried by the user.
This does not work when using Write Without Response (BLE_GATT_OP_WRITE_CMD) because the server does not send any response, even on error. Instead, the write will be silently dropped by the server.
In normal circumstances, this function should be called for every Bluetooth LE event.
Parameters
[in]ble_evtEvent to handle.