Keypop Card C++ API - 2.0.1
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 * This program and the accompanying materials are made available under the *
5 * terms of the MIT License which is available at *
6 * https://opensource.org/licenses/MIT. *
7 * *
8 * SPDX-License-Identifier: MIT *
9 ******************************************************************************/
10
11#pragma once
12
13#include <stdexcept>
14
15namespace keypop {
16namespace card {
17
23enum class ChannelControl {
30
39};
40
50inline ChannelControl
51valueOf(const int value) {
52 switch (value) {
53 case static_cast<int>(ChannelControl::KEEP_OPEN):
55 case static_cast<int>(ChannelControl::CLOSE_AFTER):
57 default:
58 throw std::invalid_argument("invalid ChannelControl value");
59 }
60}
61
62} /* namespace card */
63} /* 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.