/* Handles an incoming ATT error response for the specified indication proc. A device should never send an error in response to an indication. If this happens, we treat it like a confirmation (indication ack), but report the error status to the application.  */
static void ble_gattc_indicate_err(struct ble_gattc_proc *proc, int status, uint16_t att_handle)
/* Handles an incoming ATT error response for the specified indication proc. A device should never send an error in response to an indication. If this happens, we treat it like a confirmation (indication ack), but report the error status to the application.  */
static void ble_gattc_indicate_err(struct ble_gattc_proc *proc, int status, uint16_t att_handle)
{
    int rc;
    ble_gattc_dbg_assert_proc_not_inserted(proc);
    if (status != BLE_HS_ENOTCONN) {
        rc = ble_gatts_rx_indicate_ack(proc->conn_handle,
                                       proc->indicate.chr_val_handle);
        if (rc != 0) {
            return;
        }
    }
    ble_gap_notify_tx_event(status, proc->conn_handle,
                            proc->indicate.chr_val_handle, 1);
    ble_gatts_send_next_indicate(proc->conn_handle);
}