RS232 read write ..
file1: with select #include <pthread.h> #include <stdio.h> #include <termios.h> #include <fcntl.h> #include <string.h> #include <sys/select.h> #define BUFFER_SIZE 100 char* Message="Hello1 Hello2 Hello3 Hello4 Hello5 Hello6 Hello7 Hello8 Hello9 Hello10"; char incomingBuffer[BUFFER_SIZE]; int fd1; int fd2; void* ReaderThread(void* object) { int total=0; int expected=strlen(Message); struct timeval timeOut; fd_set fdSet; int maxFdp=0; printf("Waiting for data on serial ports\r\n"); while(total<expected) { timeOut.tv_sec=0; timeOut.tv_usec=1000000; // Every 100 ms FD_ZERO(&fdSet); FD_SET(fd1, &fdSet); ...