/* Dispatches an incoming ATT error-response to the appropriate active GATT procedure.  */
void ble_gattc_rx_err(uint16_t conn_handle, uint16_t handle, uint16_t status)
/* Dispatches an incoming ATT error-response to the appropriate active GATT procedure.  */
void ble_gattc_rx_err(uint16_t conn_handle, uint16_t handle, uint16_t status)
{
    struct ble_gattc_proc *proc;
    ble_gattc_err_fn *err_cb;
    proc = ble_gattc_extract_first_by_conn_op(conn_handle, BLE_GATT_OP_NONE);
    if (proc != NULL) {
        err_cb = ble_gattc_err_dispatch_get(proc->op);
        if (err_cb != NULL) {
            err_cb(proc, BLE_HS_ERR_ATT_BASE + status, handle);
        }
        ble_gattc_proc_free(proc);
    }
}