Last change
on this file since 7101 was 7101, checked in by gf, 12 years ago |
build: Compile reader-common.c only when WITH_CARDREADER is enabled.
|
File size:
728 bytes
|
Line | |
---|
1 | #define ADDRLEN 4 // Address length in EMM commands
|
---|
2 | #define MAX_PROV 16
|
---|
3 |
|
---|
4 | //Warning: OK = 0 and ERROR = 1 in csctapi !!!
|
---|
5 | #define SKIPPED 2
|
---|
6 | #define OK 1
|
---|
7 | #define ERROR 0
|
---|
8 | #include "csctapi/atr.h"
|
---|
9 | #define write_cmd(cmd, data) \
|
---|
10 | { \
|
---|
11 | if (card_write(reader, cmd, data, cta_res, &cta_lr)) return ERROR; \
|
---|
12 | }
|
---|
13 |
|
---|
14 | #define get_atr \
|
---|
15 | unsigned char atr[ATR_MAX_SIZE]; \
|
---|
16 | uint32_t atr_size; \
|
---|
17 | memset(atr, 0, sizeof(atr)); \
|
---|
18 | ATR_GetRaw(newatr, atr, &atr_size);
|
---|
19 |
|
---|
20 | #define get_hist \
|
---|
21 | unsigned char hist[ATR_MAX_HISTORICAL]; \
|
---|
22 | uint32_t hist_size; \
|
---|
23 | ATR_GetHistoricalBytes(newatr, hist, &hist_size);
|
---|
24 |
|
---|
25 | #define def_resp \
|
---|
26 | unsigned char cta_res[CTA_RES_LEN]; \
|
---|
27 | memset(cta_res, 0, CTA_RES_LEN); \
|
---|
28 | uint16_t cta_lr;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.