As Juergen Heinzl pointed out, much of my original fwi calculations evaluated
[librfid] / rfid.c
1 /*
2  *  This program is free software; you can redistribute it and/or modify
3  *  it under the terms of the GNU General Public License version 2 
4  *  as published by the Free Software Foundation
5  *
6  *  This program is distributed in the hope that it will be useful,
7  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
8  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9  *  GNU General Public License for more details.
10  *
11  *  You should have received a copy of the GNU General Public License
12  *  along with this program; if not, write to the Free Software
13  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
14  */
15 #include <stdio.h>
16 #include <string.h>
17
18 #include <rfid/rfid_reader_cm5121.h>
19 #include <rfid/rfid_protocol.h>
20 #include <rfid/rfid_protocol_tcl.h>
21
22 const char *
23 rfid_hexdump(const void *data, unsigned int len)
24 {
25         static char string[1024];
26         unsigned char *d = (unsigned char *) data;
27         unsigned int i, left;
28
29         string[0] = '\0';
30         left = sizeof(string);
31         for (i = 0; len--; i += 3) {
32                 if (i >= sizeof(string) -4)
33                         break;
34                 snprintf(string+i, 4, " %02x", *d++);
35         }
36         return string;
37 }
38
39 int rfid_init()
40 {
41         rfid_reader_register(&rfid_reader_cm5121);
42         rfid_layer2_register(&rfid_layer2_iso14443a);
43         rfid_layer2_register(&rfid_layer2_iso14443b);
44         rfid_protocol_register(&rfid_protocol_tcl);
45
46         return 0;
47 }
48
49 void rfid_fini()
50 {
51         /* FIXME: implementation */
52 }