change MFPR version to 2.4.2 to fix install script fail
[proxmark3.git] / client / snooper.c
blobe6d4c364599586462f51055402c72e4fc5f80e3b
1 #include <usb.h>
2 #include <stdio.h>
3 #include <unistd.h>
4 #include <stdlib.h>
5 #include <strings.h>
6 #include <string.h>
7 #include <errno.h>
9 #include "prox.h"
10 #include "proxmark3.h"
12 #define HANDLE_ERROR if (error_occured) { \
13 error_occured = 0;\
14 break;\
17 int main()
19 usb_init();
20 setlogfilename("snooper.log");
22 return_on_error = 1;
24 while(1) {
25 while(!(devh=OpenProxmark(0))) { sleep(1); }
27 while(1) {
28 UsbCommand cmdbuf;
29 int i;
31 CommandReceived("hi14asnoop");
32 HANDLE_ERROR
34 ReceiveCommand(&cmdbuf);
35 HANDLE_ERROR
36 for (i=0; i<5; i++) {
37 ReceiveCommandPoll(&cmdbuf);
39 HANDLE_ERROR
41 CommandReceived("hi14alist");
42 HANDLE_ERROR
46 CloseProxmark();
47 return 0;