]>
git.zerfleddert.de Git - proxmark3-svn/blob - client/proxmark3.c
77c37715893b94a928f12bc0965b65a4c9eb0223
5 #include <readline/readline.h>
6 #include <readline/history.h>
12 struct usb_receiver_arg
22 static void *usb_receiver(void *targ
)
24 struct usb_receiver_arg
*arg
= (struct usb_receiver_arg
*)targ
;
28 if (ReceiveCommandPoll(&cmdbuf
)) {
29 for (int i
= 0; i
< strlen(PROXPROMPT
); i
++)
31 UsbCommandReceived(&cmdbuf
);
40 static void *main_loop(void *targ
)
42 struct main_loop_arg
*arg
= (struct main_loop_arg
*)targ
;
43 struct usb_receiver_arg rarg
;
45 pthread_t reader_thread
;
47 if (arg
->usb_present
== 1) {
49 pthread_create(&reader_thread
, NULL
, &usb_receiver
, &rarg
);
53 cmd
= readline(PROXPROMPT
);
66 if (arg
->usb_present
== 1) {
68 pthread_join(reader_thread
, NULL
);
75 int main(int argc
, char **argv
)
77 struct main_loop_arg marg
;
78 pthread_t main_loop_t
;
81 if (!OpenProxmark(1)) {
82 fprintf(stderr
,"PROXMARK3: NOT FOUND!\n");
90 pthread_create(&main_loop_t
, NULL
, &main_loop
, &marg
);
91 InitGraphics(argc
, argv
);
95 pthread_join(main_loop_t
, NULL
);
97 if (marg
.usb_present
== 1) {