Added new function codes
[librfid] / include / librfid / rfid.h
1 #ifndef _RFID_H
2 #define _RFID_H
3
4 #include <stdio.h>
5
6 #ifdef __LIBRFID__
7
8 #include <librfid/rfid_system.h>
9
10 //#define DEBUG_LIBRFID
11
12 #ifdef DEBUG_LIBRFID
13
14 #ifdef LIBRFID_FIRMWARE
15 extern void debugp(const char *format, ...);
16 extern const char *hexdump(const void *data, unsigned int len);
17 #define rfid_hexdump(x, y) hexdump(x, y)
18 #define DEBUGP(x, args ...) debugp("%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args)
19 #define DEBUGPC(x, args ...) debugp(x, ## args)
20 #else /* LIBRFID_FIRMWARE */
21 extern const char *rfid_hexdump(const void *data, unsigned int len);
22 #define DEBUGP(x, args ...) fprintf(stderr, "%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args)
23 #define DEBUGPC(x, args ...) fprintf(stderr, x, ## args)
24 #endif /* LIBRFID_FIRMWARE */
25
26 #else /* DEBUG */
27 extern const char *rfid_hexdump(const void *data, unsigned int len);
28
29 #define DEBUGP(x, args ...)
30 #define DEBUGPC(x, args ...)
31
32 #endif /* DEBUG */
33
34
35 #ifndef ARRAY_SIZE
36 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
37 #endif
38
39 #endif /* __LIBRFID__ */
40
41 int rfid_init();
42
43 enum rfid_opt_level {
44         RFID_LEVEL_ASIC,
45         RFID_LEVEL_READER,
46         RFID_LEVEL_LAYER2,
47         RFID_LEVEL_LAYER3,
48 };
49
50 enum rfid_frametype {
51         RFID_14443A_FRAME_REGULAR,
52         RFID_14443B_FRAME_REGULAR,
53         RFID_MIFARE_FRAME,
54 };
55
56 #endif /* _RFID_H */