// Main binary
//-----------------------------------------------------------------------------
+#include "proxmark3.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <readline/readline.h>
#include <readline/history.h>
-#include "proxmark3.h"
#include "util_posix.h"
#include "proxgui.h"
#include "cmdmain.h"
#include "cmdparser.h"
#include "cmdhw.h"
#include "whereami.h"
-
+#include "comms.h"
+#include "uart.h"
void
#ifdef __has_attribute
#endif
#endif
main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) {
- receiver_arg conn;
char *cmd = NULL;
- pthread_t reader_thread;
bool execCommand = (script_cmd != NULL);
bool stdinOnPipe = !isatty(STDIN_FILENO);
- memset(&conn, 0, sizeof(receiver_arg));
-
if (usb_present) {
- conn.run = true;
SetOffline(false);
- pthread_create(&reader_thread, NULL, &uart_receiver, &conn);
// 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
}
write_history(".history");
-
- if (usb_present) {
- conn.run = false;
- pthread_join(reader_thread, NULL);
- }
if (script_file) {
fclose(script_file);
main_loop(script_cmds_file, script_cmd, usb_present);
#endif
- // Clean up the port
+ // Switch off field and clean up the port
if (usb_present) {
+ UsbCommand c = {CMD_FPGA_MAJOR_MODE_OFF};
+ SendCommand(&c);
CloseProxmark();
}