]>
git.zerfleddert.de Git - proxmark3-svn/blob - linux/proxmark3.c
8 #include <readline/readline.h>
9 #include <readline/history.h>
12 #include "translate.h"
13 #include "../winsrc/prox.h"
14 #include "proxmark3.h"
17 struct usb_receiver_arg
{
21 static void *usb_receiver(void *targ
) {
22 struct usb_receiver_arg
*arg
= (struct usb_receiver_arg
*)targ
;
26 if (ReceiveCommandP(&cmdbuf
) > 0) {
29 for (i
=0; i
<strlen(PROXPROMPT
); i
++)
32 UsbCommandReceived(&cmdbuf
);
41 static void *main_loop(void *targ
)
46 struct usb_receiver_arg rarg
;
47 pthread_t reader_thread
;
50 pthread_create(&reader_thread
, NULL
, &usb_receiver
, &rarg
);
52 cmd
= readline(PROXPROMPT
);
54 pthread_join(reader_thread
, NULL
);
72 int main(int argc
, char **argv
)
74 pthread_t main_loop_t
;
77 if (!(devh
= OpenProxmark(1))) {
78 fprintf(stderr
,"PROXMARK3: NOT FOUND!\n");
82 pthread_create(&main_loop_t
, NULL
, &main_loop
, NULL
);
83 InitGraphics(argc
, argv
);
87 pthread_join(main_loop_t
, NULL
);