]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/proxmark3.c
remove some straggling files and fix paths in cockpit batch files
[proxmark3-svn] / client / proxmark3.c
index 3c3b7927a7b11b9c608027baa63074e91c6c3643..05c2fe2d5681ac8359f0030e496a74a99a47e1fe 100644 (file)
@@ -9,7 +9,6 @@
 #include <readline/history.h>
 #include <pthread.h>
 
-#include "translate.h"
 #include "prox.h"
 #include "proxmark3.h"
 #include "proxgui.h"
@@ -27,7 +26,7 @@ static void *usb_receiver(void *targ) {
        UsbCommand cmdbuf;
 
        while(arg->run) {
-               if (ReceiveCommandP(&cmdbuf) > 0) {
+               if (ReceiveCommandPoll(&cmdbuf)) {
                        int i;
 
                        for (i=0; i<strlen(PROXPROMPT); i++)
@@ -46,21 +45,17 @@ static void *main_loop(void *targ)
 {
        struct main_loop_arg *arg = (struct main_loop_arg*)targ;
        char *cmd = NULL;
+       pthread_t reader_thread;
 
-       while(1) {
+       if (arg->usb_present == 1) {
                struct usb_receiver_arg rarg;
-               pthread_t reader_thread;
-
                rarg.run=1;
-               if (arg->usb_present == 1) {
-                       pthread_create(&reader_thread, NULL, &usb_receiver, &rarg);
-               }
-               cmd = readline(PROXPROMPT);
-               rarg.run=0;
-               if (arg->usb_present == 1) {
-                       pthread_join(reader_thread, NULL);
-               }
+               pthread_create(&reader_thread, NULL, &usb_receiver, &rarg);
+       }
+
+       while(1) {
 
+               cmd = readline(PROXPROMPT);
                if (cmd) {
                        if (cmd[0] != 0x00) {
                                CommandReceived(cmd);
Impressum, Datenschutz