Added two functions:
dio_modemget(resource fd) - returns the control line status of a serial port
dio_read_waiting(resource fd) - returns the number of bytes waiting in
the input buffer
(note: i have submitted a patch for dio_modemget before, but since
current CVS doesn't have it, I'm sending it again)
Modified dio_tcsetattr() so the array accepts two more parameters:
'hwflow' - set to zero to turn hardware flow control (CRTSCTS) off
(defaults to on)
'swflow' - set to non-zero to turn software flow control (XON/XOFF) on
(defaults to off)
Note that the defaults maintain the old behaviour. This change to
dio_tcsetattr() is also attached seperately as dio_tcsetattr.patch.txt,
but it is also included in dio_changes.patch.txt.
dio_modemget() was written to get the status of a UPS. Flow control
changes were made to be able to communicate with a serial device that
required flow control off (and that was a fun problem to track down..).
dio_read_waiting() was also written to communicate with the serial
device, as I was having problems using non-blocking, and with blocking
read() would sometimes wait forever.
fyi, the device is a "weatherduck"
http://www.itwatchdogs.com/duckdetails.shtml
ttyl, greg
--
Greg MacLellan