Quote:
Originally posted by Brandon Martus
File Descriptor. I can't help with your actual question, though, .. sorry
|
Thanks Brandon

I talked to Rob last night, and now I only need help on the last code section. read() = ReadFile(), write() = WriteFile().
<< Edit >>: The stuff below bolded is what I don't get:
Code:
int openSerial(char *port){
struct termios tios;
fd=open(port, O_NOCTTY | O_RDWR | O_NONBLOCK);
if(fd<0){
sprintf(lastError, "%s: %s\n", port, strerror(errno));
return fd;
}
tios.c_cflag = BAUDRATE | CS8 | CREAD;
tios.c_iflag = IGNPAR;
tios.c_oflag=0;
tios.c_lflag=0;
//satisfy read immediately.
tios.c_cc[VTIME]=0;
tios.c_cc[VMIN]=0;
tcflush(fd, TCIFLUSH);
tcsetattr(fd, TCSANOW, &tios);
return fd;
}