test
This commit is contained in:
+3
-5
@@ -5,13 +5,11 @@
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <termios.h>
|
||||
#include <termios.h>
|
||||
|
||||
#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,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user