test
This commit is contained in:
+1
-1
@@ -8,6 +8,6 @@
|
|||||||
#define MIN_X_TERMINAL_SIZE 80
|
#define MIN_X_TERMINAL_SIZE 80
|
||||||
#define MIN_Y_TERMINAL_SIZE 30
|
#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
|
#endif
|
||||||
BIN
Binary file not shown.
+2
-4
@@ -10,8 +10,6 @@
|
|||||||
#include "users.h"
|
#include "users.h"
|
||||||
#include "tui.h"
|
#include "tui.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void *uartListener(void *arg)
|
void *uartListener(void *arg)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -21,7 +19,7 @@ void *uartListener(void *arg)
|
|||||||
int main(int argc, char const *argv[])
|
int main(int argc, char const *argv[])
|
||||||
{
|
{
|
||||||
int y_max, x_max;
|
int y_max, x_max;
|
||||||
char * uart_address;
|
char uart_address[51];
|
||||||
pthread_t uart_thread;
|
pthread_t uart_thread;
|
||||||
|
|
||||||
initscr();
|
initscr();
|
||||||
@@ -42,7 +40,7 @@ int main(int argc, char const *argv[])
|
|||||||
erase();
|
erase();
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
uartDialog(x_max, y_max);
|
uartDialog(uart_address, x_max, y_max);
|
||||||
|
|
||||||
pthread_create(&uart_thread, NULL, uartListener, NULL);
|
pthread_create(&uart_thread, NULL, uartListener, NULL);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.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 *prompt = "Please enter UART device address for RFID reader (probably /dev/ttyUSB0): ";
|
||||||
char *header = "Enter UART Address";
|
char *header = "Enter UART Address";
|
||||||
@@ -85,7 +85,8 @@ char *uartDialog(int terminal_x, int terminal_y)
|
|||||||
refresh();
|
refresh();
|
||||||
delwin(uartwin);
|
delwin(uartwin);
|
||||||
refresh();
|
refresh();
|
||||||
return input;
|
strcpy(uart_adress, input);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user