/* Causes all GATT procedures matching the specified criteria to fail with the specified status code.  */
static void ble_gattc_fail_procs(uint16_t conn_handle, uint8_t op, int status)
/* Causes all GATT procedures matching the specified criteria to fail with the specified status code.  */
static void ble_gattc_fail_procs(uint16_t conn_handle, uint8_t op, int status)
{
    struct ble_gattc_proc_list temp_list;
    struct ble_gattc_proc *proc;
    ble_gattc_err_fn *err_cb;
    ble_gattc_extract_by_conn_op(conn_handle, op, 0, &temp_list);
    while ((proc = STAILQ_FIRST(&temp_list)) != NULL) {
        err_cb = ble_gattc_err_dispatch_get(proc->op);
        err_cb(proc, status, 0);
        STAILQ_REMOVE_HEAD(&temp_list, next);
        ble_gattc_proc_free(proc);
    }
}