source: trunk/reader-common.h@ 4149

Last change on this file since 4149 was 3353, checked in by _network, 13 years ago

fix compile error

File size: 868 bytes
Line 
1#define ADDRLEN 4 // Address length in EMM commands
2#define MAX_PROV 16
3#define SCT_LEN(sct) (3+((sct[1]&0x0f)<<8)+sct[2])
4#define MAX_LEN 256
5
6//Warning: OK = 0 and ERROR = 1 in csctapi !!!
7#define SKIPPED 2
8#define OK 1
9#define ERROR 0
10
11#include "atr.h"
12
13int check_emm_cardsystem(struct s_reader * rdr, EMM_PACKET *ep);
14void reader_device_close(struct s_reader * reader);
15
16#define write_cmd(cmd, data) \
17{ \
18 if (card_write(reader, cmd, data, cta_res, &cta_lr)) return ERROR; \
19}
20
21#define get_atr \
22 unsigned char atr[64]; \
23 unsigned int atr_size; \
24 memset(atr, 0, sizeof(atr)); \
25 ATR_GetRaw(&newatr, atr, &atr_size);
26
27#define get_hist \
28 unsigned char hist[64]; \
29 unsigned int hist_size; \
30 ATR_GetHistoricalBytes(&newatr, hist, &hist_size);
31
32#define def_resp \
33 unsigned char cta_res[CTA_RES_LEN]; \
34 unsigned short cta_lr;
Note: See TracBrowser for help on using the repository browser.