Serial programming in C?

Duston, Hal hdusto01 at sprintspectrum.com
Thu Sep 7 17:50:15 CDT 2000


Bradley,

Not sure what you mean by "accessing the serial port" 
here.  Under Linux (and Unix for that matter), it is 
just another file.  Once the port has been setup, 
(Baud, stop bits, parity, etc.) via either stty 
before starting the program, or ioctl's in the 
program after you open it, "/dev/ttyS0" or whatever 
depending on which port you are using, you can just 
read from it, and capture whatever data is being sent.  
I don't think it is much more complicated than that.  
If I have missed something or you need more help, let 
me know.  There are a few other developers on the list 
as well...

Hal Duston
hald at sound.net

Bradley Miller [bradmiller at dslonramp.com] wrote:
> 
> Does someone have a good resource for doing some C 
> programming under Linux for accessing the serial port?   
> I'd appreciate it!  I'm wanting to get my laptop 
> datalogger project going again and need a way to build 
> a bootable disk that will store readings from various 
> sensors on my car. 
>   Let me know -- I have the hardware portion already 
> working . . . I just need something besides 
> Windoz . . . !!!
> 
> -- Bradley Miller




More information about the Kclug mailing list