generate unique reader.host.ccid files
[librfid] / include / librfid / rfid.h
1 #ifndef _RFID_H
2 #define _RFID_H
3
4 #include <stddef.h>
5 #include <sys/types.h>
6 #include <stdio.h>
7
8 #define ECOLLISION              1000
9
10 #ifdef  __MINGW32__
11 #define ENOTSUP         100
12 /* 110 under linux */
13 #define ETIMEDOUT       101
14
15 typedef unsigned char u_int8_t;
16 typedef unsigned short u_int16_t;
17 typedef unsigned long u_int32_t;
18 typedef unsigned long long u_int64_t;
19 #endif/*__MINGW32__*/
20
21 #ifdef  __LIBRFID__
22
23 #include <librfid/rfid_system.h>
24
25 #ifdef DEBUG_LIBRFID
26
27 #ifdef LIBRFID_FIRMWARE
28 extern void debugp(const char *format, ...);
29 extern const char *hexdump(const void *data, unsigned int len);
30 #define rfid_hexdump(x, y) hexdump(x, y)
31 #define DEBUGP(x, args ...) debugp("%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args)
32 #define DEBUGPC(x, args ...) debugp(x, ## args)
33 #else /* LIBRFID_FIRMWARE */
34 extern const char *rfid_hexdump(const void *data, unsigned int len);
35 #define DEBUGP(x, args ...) fprintf(stderr, "%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args)
36 #define DEBUGPC(x, args ...) fprintf(stderr, x, ## args)
37 #endif /* LIBRFID_FIRMWARE */
38
39 #include <stdio.h>
40
41 #else /* DEBUG */
42 extern const char *rfid_hexdump(const void *data, unsigned int len);
43
44 #define DEBUGP(x, args ...)
45 #define DEBUGPC(x, args ...)
46
47 #endif /* DEBUG */
48
49
50 #ifndef ARRAY_SIZE
51 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
52 #endif
53
54 #endif /* __LIBRFID__ */
55
56 int rfid_init();
57
58 enum rfid_opt_level {
59         RFID_LEVEL_ASIC,
60         RFID_LEVEL_READER,
61         RFID_LEVEL_LAYER2,
62         RFID_LEVEL_LAYER3,
63 };
64
65 enum rfid_frametype {
66         RFID_14443A_FRAME_REGULAR,
67         RFID_14443B_FRAME_REGULAR,
68         RFID_MIFARE_FRAME,
69         RFID_15693_FRAME,
70         RFID_15693_FRAME_ICODE1,
71 };
72
73 #endif /* _RFID_H */