serial access in linux
Posted on 2002-07-17
I've looked over previous quesitons regarding serial port access through linux, but didn't totally understand what was the best/easiest way to program on the ports. I want to read in through COM1 and read/write through COM2. I see open("/dev/ttyS0", O_RDWR). I understand the first arguement, but I don't understand what the declared constansts are and through which library I'm supposed to include to access them. Also, when I do have the read only port open, it will have to wait for data 24/7. I don't know the best way to do that (is there a boolean that is changed on the event of buffer status change?) or even how to do that with the read() write() functions.