mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-07 16:48:15 +08:00
chg: write serial port in window title (plot/slider)
This commit is contained in:
parent
60b444d5d8
commit
996b41dce7
5 changed files with 28 additions and 2 deletions
|
@ -24,6 +24,8 @@
|
|||
//#define COMMS_DEBUG
|
||||
//#define COMMS_DEBUG_RAW
|
||||
|
||||
uint8_t gui_serial_port_name[FILE_PATH_SIZE];
|
||||
|
||||
// Serial port that we are communicating with the PM3 on.
|
||||
static serial_port sp = NULL;
|
||||
|
||||
|
@ -568,6 +570,9 @@ bool OpenProxmark(void *port, bool wait_for_port, int timeout, bool flash_mode,
|
|||
uint16_t len = MIN(strlen(portname), FILE_PATH_SIZE - 1);
|
||||
memset(conn.serial_port_name, 0, FILE_PATH_SIZE);
|
||||
memcpy(conn.serial_port_name, portname, len);
|
||||
|
||||
memset(gui_serial_port_name, 0, FILE_PATH_SIZE);
|
||||
memcpy(gui_serial_port_name, portname, len);
|
||||
}
|
||||
conn.run = true;
|
||||
conn.block_after_ACK = flash_mode;
|
||||
|
|
|
@ -44,6 +44,7 @@ typedef enum {
|
|||
FPGA_MEM,
|
||||
} DeviceMemType_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
|
||||
|
@ -60,6 +61,8 @@ typedef struct {
|
|||
|
||||
extern communication_arg_t conn;
|
||||
|
||||
extern uint8_t gui_serial_port_name[FILE_PATH_SIZE];
|
||||
|
||||
void *uart_receiver(void *targ);
|
||||
void SendCommandBL(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *data, size_t len);
|
||||
void SendCommandOLD(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *data, size_t len);
|
||||
|
|
|
@ -18,6 +18,7 @@ extern "C" {
|
|||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
//#include "comms.h"
|
||||
|
||||
void ShowGraphWindow(void);
|
||||
void HideGraphWindow(void);
|
||||
|
@ -55,6 +56,12 @@ extern size_t g_DemodStartIdx;
|
|||
extern bool showDemod;
|
||||
extern uint8_t g_debugMode;
|
||||
|
||||
|
||||
#ifndef FILE_PATH_SIZE
|
||||
#define FILE_PATH_SIZE 1000
|
||||
#endif
|
||||
extern uint8_t gui_serial_port_name[FILE_PATH_SIZE];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -197,11 +197,22 @@ ProxWidget::ProxWidget(QWidget *parent, ProxGuiQT *master) : QWidget(parent) {
|
|||
QVBoxLayout *layout = new QVBoxLayout;
|
||||
layout->addWidget(plot);
|
||||
setLayout(layout);
|
||||
show(); // places the window on the screen.
|
||||
|
||||
// plot window title
|
||||
QString pt = QString("[*]Plot [ %1 ]").arg((char*)gui_serial_port_name);
|
||||
setWindowTitle(pt);
|
||||
|
||||
// shows plot window on the screen.
|
||||
show();
|
||||
|
||||
// Move controller widget below plot
|
||||
controlWidget->move(x(), y() + frameSize().height());
|
||||
controlWidget->resize(size().width(), 200);
|
||||
|
||||
// Olverlays / slider window title
|
||||
QString ct = QString("[*]Slider [ %1 ]").arg((char*)gui_serial_port_name);
|
||||
controlWidget->setWindowTitle(ct);
|
||||
|
||||
controlWidget->show();
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Overlays</string>
|
||||
<string>Sliders</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
|
|
Loading…
Reference in a new issue