Add files via upload

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
This commit is contained in:
Niel Nielsen
2026-08-26 16:07:37 +02:00
committed by Philippe Teuwen
parent 5560b2dbbe
commit ec6f468f36
2 changed files with 11 additions and 13 deletions
+6 -12
View File
@@ -20,9 +20,9 @@
#define COMMS_H_
#include "common.h"
#include "pm3_cmd.h" // Packet structs
#include "util.h" // FILE_PATH_SIZE
#include "iso7816/iso7816core.h" // SetISODEPState
#include "pm3_cmd.h"
#include "util.h"
#include "iso7816/iso7816core.h"
#ifdef __cplusplus
extern "C" {
@@ -40,7 +40,6 @@ extern "C" {
}
#endif
//For storing command that are received from the device
#ifndef CMD_BUFFER_SIZE
#define CMD_BUFFER_SIZE 100
#endif
@@ -67,20 +66,16 @@ typedef enum {
} CommunicationProtocol_t;
typedef struct {
bool run; // If TRUE, continue running the uart_communication thread
bool block_after_ACK; // if true, block after receiving an ACK package
// Flags to tell where to add CRC on sent replies
bool run;
bool block_after_ACK;
bool send_with_crc_on_usb;
bool send_with_crc_on_fpc;
// "Session" flag, to tell via which interface next msgs are sent: USB or FPC USART
bool send_via_fpc_usart;
// to tell if we are using TCP/UDP/TCP(IPv6)/UDP(IPv6)
CommunicationProtocol_t send_via_ip;
// to tell if the target address is local address(127.0.0.1/localhost/::1)
bool send_via_local_ip;
// To memorise baudrate
uint32_t uart_speed;
uint16_t last_command;
bool listen_for_incoming;
char serial_port_name[FILE_PATH_SIZE];
} communication_arg_t;
@@ -122,7 +117,6 @@ bool WaitForResponse(uint32_t cmd, PacketResponseNG *response);
int SetHfFieldTimeout(uint32_t timeout_sec, bool quiet);
//bool GetFromDevice(DeviceMemType_t memtype, uint8_t *dest, uint32_t bytes, uint32_t start_index, PacketResponseNG *response, size_t ms_timeout, bool show_warning);
bool GetFromDevice(DeviceMemType_t memtype, uint8_t *dest, uint32_t bytes, uint32_t start_index, uint8_t *data, uint32_t datalen, PacketResponseNG *response, size_t ms_timeout, bool show_warning);
#ifdef __cplusplus
+5 -1
View File
@@ -829,7 +829,8 @@ static void show_help(bool showFullHelp, char *exec_name) {
PrintAndLogEx(NORMAL, " -h/--help this help");
PrintAndLogEx(NORMAL, " -v/--version print client version");
PrintAndLogEx(NORMAL, " -p/--port serial port to connect to");
PrintAndLogEx(NORMAL, " -w/--wait 20sec waiting the serial port to appear in the OS");
PrintAndLogEx(NORMAL, " -w/--wait 20sec waiting the serial port to appear in the OS\n"
" with a tcp: port, listen and wait for an incoming connection instead");
PrintAndLogEx(NORMAL, " -f/--flush output will be flushed after every print");
PrintAndLogEx(NORMAL, " -d/--debug <0|1|2> set debugmode");
PrintAndLogEx(NORMAL, "\nOptions in client mode:");
@@ -1530,6 +1531,9 @@ int main(int argc, char *argv[]) {
// try to open USB connection to Proxmark
if (port != NULL) {
// --wait on a tcp: port means "listen and accept an incoming connection"
// rather than the usual "retry connecting until the endpoint appears".
g_conn.listen_for_incoming = waitCOMPort && (strncmp(port, "tcp:", 4) == 0);
OpenProxmark(&g_session.current_device, port, waitCOMPort, 20, false, speed);
}