Keypop Reader C++ API - 2.1.0
Component of the Keypop C++ API
ChannelControl.hpp
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
3 * *
4 * See the NOTICE file(s) distributed with this work for additional *
5 * information regarding copyright ownership. *
6 * *
7 * This program and the accompanying materials are made available under the *
8 * terms of the MIT License which is available at *
9 * https://opensource.org/licenses/MIT *
10 * *
11 * SPDX-License-Identifier: MIT *
12 ******************************************************************************/
13
14#pragma once
15
16#include <stdexcept>
17
18namespace keypop {
19namespace reader {
20
26enum class ChannelControl {
33
42};
43
53inline ChannelControl
54valueOf(const int value)
55{
56 switch (value) {
57 case static_cast<int>(ChannelControl::KEEP_OPEN):
59 case static_cast<int>(ChannelControl::CLOSE_AFTER):
61 default:
62 throw std::invalid_argument("invalid ChannelControl value");
63 }
64}
65
66} /* namespace reader */
67} /* namespace keypop */
ChannelControl
Policy for managing the physical channel after a card request is executed.
@ CLOSE_AFTER
Terminates communication with the card.
@ KEEP_OPEN
Leaves the physical channel open.
ChannelControl valueOf(const int value)
Returns the enum constant of this type with the specified value.