-
Notifications
You must be signed in to change notification settings - Fork 5
/
message_and_id.h
121 lines (110 loc) · 3.24 KB
/
message_and_id.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/* message_and_id.h - EVM inter-process communication definition
* Copyright 2019 Daniel Hu <[email protected]>
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, and the entire permission notice in its entirety,
* including the disclaimer of warranties.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
* WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*
*/
#ifndef MESSAGE_AND_ID_H
#define MESSAGE_AND_ID_H
#include <cstdint>
namespace emv {
enum class ui_message_id : uint8_t {
APPROVED = 0x03,
NOT_AUTHORIZED = 0x07,
ENTER_PIN = 0x09,
PROCESSING_ERR = 0xF,
REMOVE_CARD = 0x10,
WELCOME = 0x14,
PRESENT_CARD = 0x15,
PROCESSING = 0x16,
READ_OK = 0x17,
INSERT_OR_SWIPE = 0x18,
PRESENT_ONE_ONLY = 0x19,
APPROVED_PLEASE_SIGN = 0x1A,
AUTHORISING = 0x1B,
INSERT_SWIPE_TRY_ANOTHER = 0x1C,
INSERT_CARD = 0x1D,
NO_MESSAGE = 0x1E,
CHECK_PHONE = 0x20,
TRY_AGAIN = 0x21,
NA = 0xFF
};
enum class ui_status_id : uint8_t {
NOT_READY = 0x00,
IDLE = 0x01,
PRESENT_CARD = 0x02,
PROCESSING = 0x03,
CARD_READ_OK = 0x04,
PROCESSING_ERR = 0x05,
CONTACTLESS_NOT_SATISFIED = 0x06,
COLLISION_ERR = 0x07,
CARD_NOT_REMOVED = 0x08,
NA = 0xFF,
};
enum class ui_value_id : uint8_t {
NONE = 0,
AMOUNT = 0x01,
BALANCE = 0x02,
NA = 0,
};
enum class EMV_MODULE : uint8_t {
TERMINAL = 0,
L1 = 1,
L2 = 2,
ROUTER = 3
};
enum class MESSAGE_ID : uint8_t {
L1_POWER_UP = 0,
L1_POWER_DOWN = 1,
L1_RESET = 2,
L1_TX_DATA = 3,
L1_DATA_RECEIVED = 4,
L1RSP = 5,
L2_START_TRANSACTION = 6,
ROUTER_INIT = 7,
L1_CARD_DETECTED = 8,
L1_COLLISION_DETECTED = 9,
TERMINAL_UI_REQ = 10,
TERMINAL_PIN_CAPTURE = 11,
TERMINAL_ONLINE_REQ = 12,
TERMINAL_TRANSACTION_COMPLETE = 13,
L2_CONTINUE_TRANSACT_WITH_ONLINE_RESP = 14,
DEK = 15,
DET = 16,
};
enum class OUTCOME_CVM : uint8_t {
NO_CVM = 0,
SIGNATURE = 1,
ONLINE_PIN = 2,
CONF_CODE_VERIFIED = 3,
NA = 0x0F
};
}; // namespace emv
#endif