[NTLUG:Discuss] Help with serial I/O.
Bug Hunter
bughuntr at one.ctelcom.net
Mon Oct 4 10:49:07 CDT 1999
go get the source for minicom from ftp.redhat.com, or some other site.
briefly:
SerialFD = open( "/dev/cua2", O_RDWR);
then fprintf(SerialFD,""...);
Look for Richard W. Stevens, he has several books on Unix
Programming.
bug
On Sun, 3 Oct 1999, Kipton Moravec wrote:
> Programming in Linux.
>
> I have been programming a long time, but have programmed for DOS,
> Vax/Vms, Windows 3.1, but never UNIX.
>
> I have a very simple question. How do I open a serial port, and read
> and write binary information to it?
>
> What is the C command to open say COM3:
>
> Then does printf work?
>
> The program is very simple to talk to an external device, and dump the
> formatted results to a file, but I am not sure where to start.
>
> Is there a good general book on programming Linux in C that would
> explain this?
>
> Also I want to poll this device every 120 Seconds. Is there a sleep
> command that lets my program become inactive for a while? Or is it
> better to have it rescheduled to execute two minutes later?
>
> Kip
>
> _______________________________________________
> http://ntlug.org/mailman/listinfo/discuss
>
More information about the Discuss
mailing list