summaryrefslogtreecommitdiff
path: root/rfid_asic_rc632_mifare.c
blob: 9bfb0ae1d584023e3d46a99d9706fc062c10a5c7 (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

int
rc632_mifare_read16()
{
	unsigned char sndbuf[2];
	unsigned char recvbuf[0x40];
	unsigned char recvlen = sizeof(recvbuf);
	
	int ret;

	sndbuf[0] = 0x30;
	sndbuf[1] = arg_4;

	memset(recvbuf, 0, sizeof(recvbuf));

	ret = rc632_transcieve(handle, sndbuf, sizeof(sndbuf), 
				recvbuf, &recvlen, 0x32, 0);
	if (ret < 0)
		return ret;

	if (recvlen != 0x10)
		return -1;

	return 0;
}
personal git repositories of Harald Welte. Your mileage may vary