move librfid to new location in repository
[librfid] / rfid.c
1
2 #include <stdio.h>
3 #include <string.h>
4
5 #include <rfid/rfid_reader_cm5121.h>
6 #include <rfid/rfid_protocol.h>
7 #include <rfid/rfid_protocol_tcl.h>
8
9 const char *
10 rfid_hexdump(const void *data, unsigned int len)
11 {
12         static char string[1024];
13         unsigned char *d = (unsigned char *) data;
14         unsigned int i, left;
15
16         string[0] = '\0';
17         left = sizeof(string);
18         for (i = 0; len--; i += 3) {
19                 if (i >= sizeof(string) -4)
20                         break;
21                 snprintf(string+i, 4, " %02x", *d++);
22         }
23         return string;
24 }
25
26 int rfid_init()
27 {
28         rfid_reader_register(&rfid_reader_cm5121);
29         rfid_layer2_register(&rfid_layer2_iso14443a);
30         rfid_layer2_register(&rfid_layer2_iso14443b);
31         rfid_protocol_register(&rfid_protocol_tcl);
32
33         return 0;
34 }
35
36 void rfid_fini()
37 {
38         /* FIXME: implementation */
39 }