You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

34 lines
611 B

#include <error.h>
#include <fcntl.h>
#include <malloc.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <termios.h>
#include <unistd.h>
#include "uart.hpp"
using namespace iflytop;
class Uart g_uart;
int main(int argc, char *argv[]) {
pthread_t pid1, pid2;
pthread_attr_t *pthread_arr1, *pthread_arr2;
pthread_arr1 = NULL;
pthread_arr2 = NULL;
g_uart.open(argv[1]);
char buffer[128];
while (1) {
g_uart.receive(buffer, sizeof(buffer));
usleep(1000);
}
return 0;
}