]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/proxmark3.c
PCF7931: Print found single/consecutive block(s), fixes to block 1 check
[proxmark3-svn] / client / proxmark3.c
index 88cb5fa76db22a705172e9318fa566f9205b9a15..fda9f313b3f6876f5c2fe19a8ccbbcf73af651ce 100644 (file)
@@ -9,6 +9,8 @@
 // Main binary
 //-----------------------------------------------------------------------------
 
 // Main binary
 //-----------------------------------------------------------------------------
 
+#include "proxmark3.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -17,7 +19,6 @@
 #include <readline/readline.h>
 #include <readline/history.h>
 
 #include <readline/readline.h>
 #include <readline/history.h>
 
-#include "proxmark3.h"
 #include "util_posix.h"
 #include "proxgui.h"
 #include "cmdmain.h"
 #include "util_posix.h"
 #include "proxgui.h"
 #include "cmdmain.h"
@@ -26,6 +27,7 @@
 #include "cmdparser.h"
 #include "cmdhw.h"
 #include "whereami.h"
 #include "cmdparser.h"
 #include "cmdhw.h"
 #include "whereami.h"
+#include "comms.h"
 
 
 void
 
 
 void
@@ -35,24 +37,19 @@ __attribute__((force_align_arg_pointer))
 #endif
 #endif
 main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) {
 #endif
 #endif
 main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) {
-       receiver_arg conn;
        char *cmd = NULL;
        char *cmd = NULL;
-       pthread_t reader_thread;
        bool execCommand = (script_cmd != NULL);
        bool stdinOnPipe = !isatty(STDIN_FILENO);
 
        bool execCommand = (script_cmd != NULL);
        bool stdinOnPipe = !isatty(STDIN_FILENO);
 
-       memset(&conn, 0, sizeof(receiver_arg));
-
        if (usb_present) {
        if (usb_present) {
-               conn.run = true;
                SetOffline(false);
                SetOffline(false);
-               pthread_create(&reader_thread, NULL, &uart_receiver, &conn);
                // cache Version information now:
                CmdVersion(NULL);
        } else {
                SetOffline(true);
        }
 
                // cache Version information now:
                CmdVersion(NULL);
        } else {
                SetOffline(true);
        }
 
+
        // file with script
        FILE *script_file = NULL;
        char script_cmd_buf[256] = {0};  // iceman, needs lua script the same file_path_buffer as the rest
        // file with script
        FILE *script_file = NULL;
        char script_cmd_buf[256] = {0};  // iceman, needs lua script the same file_path_buffer as the rest
@@ -136,11 +133,6 @@ main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) {
        }
 
        write_history(".history");
        }
 
        write_history(".history");
-
-       if (usb_present) {
-               conn.run = false;
-               pthread_join(reader_thread, NULL);
-       }
        
        if (script_file) {
                fclose(script_file);
        
        if (script_file) {
                fclose(script_file);
@@ -294,7 +286,7 @@ int main(int argc, char* argv[]) {
        set_my_executable_path();
 
        // try to open USB connection to Proxmark
        set_my_executable_path();
 
        // try to open USB connection to Proxmark
-       usb_present = OpenProxmark(argv[1], waitCOMPort, 20);
+       usb_present = OpenProxmark(argv[1], waitCOMPort, 20, false);
 
 #ifdef HAVE_GUI
 #ifdef _WIN32
 
 #ifdef HAVE_GUI
 #ifdef _WIN32
Impressum, Datenschutz