]>
git.zerfleddert.de Git - proxmark3-svn/blob - client/proxmark3.c
830a12456873e1e01e529d0b18ea6e22db2bfdaa
4 #include <readline/readline.h>
5 #include <readline/history.h>
11 struct usb_receiver_arg
21 static void *usb_receiver(void *targ
)
23 struct usb_receiver_arg
*arg
= (struct usb_receiver_arg
*)targ
;
27 if (ReceiveCommandPoll(&cmdbuf
)) {
28 for (int i
= 0; i
< strlen(PROXPROMPT
); i
++)
30 UsbCommandReceived(&cmdbuf
);
39 static void *main_loop(void *targ
)
41 struct main_loop_arg
*arg
= (struct main_loop_arg
*)targ
;
42 struct usb_receiver_arg rarg
;
44 pthread_t reader_thread
;
46 if (arg
->usb_present
== 1) {
48 pthread_create(&reader_thread
, NULL
, &usb_receiver
, &rarg
);
52 cmd
= readline(PROXPROMPT
);
65 if (arg
->usb_present
== 1) {
67 pthread_join(reader_thread
, NULL
);
74 int main(int argc
, char **argv
)
76 struct main_loop_arg marg
;
77 pthread_t main_loop_t
;
80 if (!OpenProxmark(1)) {
81 fprintf(stderr
,"PROXMARK3: NOT FOUND!\n");
89 pthread_create(&main_loop_t
, NULL
, &main_loop
, &marg
);
90 InitGraphics(argc
, argv
);
94 pthread_join(main_loop_t
, NULL
);
96 if (marg
.usb_present
== 1) {