]>
cvs.zerfleddert.de Git - proxmark3-svn/blob - client/proxmark3.c
280d07f91fbc3b51d04e1221a61bc05f0d4deb11
8 #include <readline/readline.h>
9 #include <readline/history.h>
13 #include "proxmark3.h"
16 struct usb_receiver_arg
{
20 struct main_loop_arg
{
24 static void *usb_receiver(void *targ
) {
25 struct usb_receiver_arg
*arg
= (struct usb_receiver_arg
*)targ
;
29 if (ReceiveCommandPoll(&cmdbuf
)) {
32 for (i
=0; i
<strlen(PROXPROMPT
); i
++)
35 UsbCommandReceived(&cmdbuf
);
44 static void *main_loop(void *targ
)
46 struct main_loop_arg
*arg
= (struct main_loop_arg
*)targ
;
50 struct usb_receiver_arg rarg
;
51 pthread_t reader_thread
;
54 if (arg
->usb_present
== 1) {
55 pthread_create(&reader_thread
, NULL
, &usb_receiver
, &rarg
);
57 cmd
= readline(PROXPROMPT
);
59 if (arg
->usb_present
== 1) {
60 pthread_join(reader_thread
, NULL
);
79 int main(int argc
, char **argv
)
81 struct main_loop_arg marg
;
82 pthread_t main_loop_t
;
85 if (!(devh
= OpenProxmark(1))) {
86 fprintf(stderr
,"PROXMARK3: NOT FOUND!\n");
94 pthread_create(&main_loop_t
, NULL
, &main_loop
, &marg
);
95 InitGraphics(argc
, argv
);
99 pthread_join(main_loop_t
, NULL
);
101 if (marg
.usb_present
== 1) {