Read the io programming howto on LDP (If you want POSIX interphase, go
for the linked doc, in the serial chapter it is quite good)
But very simply put:
you open the serial device:
FILE *fd;
fopen(fd, "/dev/ttyS0", wr) (Or something like that)
you write to the device:
write(fd,"hello world",11)
you read from the device:
read(fd, &input)
(If there is no data in the input buffer, your program will freze
until some input comes...)
and you close the device
fclose(fd)
- Mazzachre
http://www.linuxdoc.org/HOWTO/Serial-Programming-HOWTO.html
Enjoy.
Ajay
Mark Lebowski wrote:
> Has anybody a little source example for open-read-write-close serial port
> device under linux ?
> Thnx