S
sean_in_raleigh
There are various nonstandard packages that allow you to create
C++ streams from stdio streams or file descriptors:
http://wwwcdf.pd.infn.it/MLO/fd.tar.gz
http://www.google.com/search?q=__gnu_cxx::stdio_filebuf
http://www.boost.org/libs/iostreams/doc/classes/file_descriptor.html#file_descriptor
They let you do something along the lines of:
#include "fdstream.hh"
int fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY);
fdostream modem(fd)
modem << "8675309";
For the gory details on how talking to serial ports is different
to regular files, this would be a good start:
http://www.kohala.com/start/apue.html
Sean
C++ streams from stdio streams or file descriptors:
http://wwwcdf.pd.infn.it/MLO/fd.tar.gz
http://www.google.com/search?q=__gnu_cxx::stdio_filebuf
http://www.boost.org/libs/iostreams/doc/classes/file_descriptor.html#file_descriptor
They let you do something along the lines of:
#include "fdstream.hh"
int fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY);
fdostream modem(fd)
modem << "8675309";
For the gory details on how talking to serial ports is different
to regular files, this would be a good start:
http://www.kohala.com/start/apue.html
Sean