This commit is contained in:
2025-04-03 07:41:30 +02:00
parent cca97e4a0c
commit 248af2bc4d
4 changed files with 7 additions and 8 deletions
+1 -1
View File
@@ -8,6 +8,6 @@
#define MIN_X_TERMINAL_SIZE 80
#define MIN_Y_TERMINAL_SIZE 30
char * uartDialog(int terminal_x, int terminal_y);
void uartDialog(char *uart_adress, int terminal_x, int terminal_y);
#endif
BIN
View File
Binary file not shown.
+2 -4
View File
@@ -10,8 +10,6 @@
#include "users.h"
#include "tui.h"
void *uartListener(void *arg)
{
@@ -21,7 +19,7 @@ void *uartListener(void *arg)
int main(int argc, char const *argv[])
{
int y_max, x_max;
char * uart_address;
char uart_address[51];
pthread_t uart_thread;
initscr();
@@ -42,7 +40,7 @@ int main(int argc, char const *argv[])
erase();
refresh();
uartDialog(x_max, y_max);
uartDialog(uart_address, x_max, y_max);
pthread_create(&uart_thread, NULL, uartListener, NULL);
+3 -2
View File
@@ -3,7 +3,7 @@
#include <string.h>
#include <stdlib.h>
char *uartDialog(int terminal_x, int terminal_y)
void uartDialog(char *uart_adress, int terminal_x, int terminal_y)
{
char *prompt = "Please enter UART device address for RFID reader (probably /dev/ttyUSB0): ";
char *header = "Enter UART Address";
@@ -85,7 +85,8 @@ char *uartDialog(int terminal_x, int terminal_y)
refresh();
delwin(uartwin);
refresh();
return input;
strcpy(uart_adress, input);
break;
}
}
}