Refactor UART handling and enhance user data structures

This commit is contained in:
2025-04-22 20:34:19 +02:00
parent 4ff9a7f03d
commit d642cc92ab
6 changed files with 48 additions and 17 deletions
+1 -14
View File
@@ -10,20 +10,7 @@
#include "users.h"
#include "tui.h"
void *uartListener(void *arg)
{
char *uart_address = (char *)arg;
int uart = open(uart_address, O_RDWR | O_NOCTTY | O_NDELAY);
if (uart == -1)
{
perror("Failed to open UART");
return NULL;
}
close(uart);
return NULL;
}
#include "rfid_handler.h"
int main(int argc, char const **argv)
{
+25
View File
@@ -0,0 +1,25 @@
#include "rfid_handler.h"
#include "users.h"
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <termios.h>
#include <string.h>
void *uartListener(void *arg)
{
char *uart_address = (char *)arg;
int uart = open(uart_address, O_RDWR | O_NOCTTY | O_NDELAY);
if (uart == -1)
{
perror("Failed to open UART");
return NULL;
}
close(uart);
return NULL;
}