RE: Help:Serial / Parallel Port Control Under Linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Grant, 

I have written a simple program based on the POXIS programming guide,
however, it seems that ioctl() function doesn't have a command of
'TIOCMGET'and 'TIOCMSET'.

I am currently using Centos system.

Do you know any other function which could control the serial port pin
status?


Error:

serialIO.c:195: error: `TIOCMGET' undeclared (first use in this function)
serialIO.c:195: error: (Each undeclared identifier is reported only once
serialIO.c:195: error: for each function it appears in.)
serialIO.c:207: error: `TIOCM_CD' undeclared (first use in this function)
serialIO.c:208: error: `TIOCM_CTS' undeclared (first use in this function)
serialIO.c:209: error: `TIOCM_DSR' undeclared (first use in this function)
serialIO.c:210: error: `TIOCM_RI' undeclared (first use in this function)
serialIO.c:212: error: `TIOCM_DTR' undeclared (first use in this function)
serialIO.c:215: error: `TIOCM_RTS' undeclared (first use in this function)
serialIO.c:223: error: `TIOCMSET' undeclared (first use in this function)

-----Original Message-----
From: linux-serial-owner@xxxxxxxxxxxxxxx
[mailto:linux-serial-owner@xxxxxxxxxxxxxxx] On Behalf Of Grant Edwards
Sent: 2008年10月3日 22:27
To: linux-serial@xxxxxxxxxxxxxxx
Subject: Re: Help:Serial / Parallel Port Control Under Linux

On 2008-10-03, johnny <johnny@xxxxxxxxxxxxxxx> wrote:

> Right Now I need to write a simple C code to control the
> serial / parallel port under linux working like this: Detect
> there is an input signal / voltage change and send some output
> signal / voltage accordingly, eg: if DSR is detected to be
> high, I want to set RTS to be high as well; if RI is detected
> to be high, I want DTR set to be low etc.
>
> I have read the Serial-How to and Serial programming-How to,
> however I am still not so clear regarding to this simple
> programming.

Ignore the serial programming howto.  It's out-of-date,
incomplete, unmaintained and just plain wrong in many areas. I
needs to be gotten rid of, but that doesn't seem to be
possible.

A far better source of information is the Serial Programming
Guide for Posix Operating Systems:

http://www.easysw.com/~mike/serial/serial.html

Specifically, the information about modem control and status
lines is in chapter 5.1:

http://www.easysw.com/~mike/serial/serial.html#5_1

-- 
Grant Edwards                   grante             Yow! Inside, I'm already
                                  at               SOBBING!
                               visi.com            

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux