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