Re: Open a tty for write without raising RTS

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

 



> On Aug 2, 2015, at 6:37 AM, Peter Hurley <peter@xxxxxxxxxxxxxxxxxx> wrote:
> 
> On Sat, Aug 1, 2015 at 11:26 AM, Joe Nall <joe@xxxxxxxx> wrote:
> Is there a mechanism to open a serial port for writing without impacting the control lines?
> 
> Sorry, no.

Why would RTS be asserted when there is no reader? Does O_WRONLY have no meaning for a tty?

> open("/dev/ttyS0", O_WRONLY|O_NONBLOCK|O_NOCTTY)
> 
> asserts RTS when there is no listener and I would like to avoid that.
> 
> It is possible to open, set baud to B0, and close; subsequent open()'s would not
> raise RTS. However, RTS would be raised when restoring the baud rate prior to writing.
> 
> What's the purpose of not raising RTS?

We have a couple of use cases.

The first is an application that receives and transmits messages on a serial port. The user interface allows transmit and receive to be enabled separately. Right now, the application starts in a disabled receive state by explicitly opening the device and then deasserting DTR/RTS. When the user want to enable reception, we raise DTR/RTS. This has a brief window where RTS is asserted incorrectly that I would like to be able to remove. There has also been some concern that manually raising RTS might impact subsequent automatic flow control. I had hoped I could rewrite the code to use separate read only and write only fds and get rid of the application fiddling with DTR/RTS.

The second is an application that statuses the control lines on software. The code is raising DTR/RTS as a side effect of opening the device. Setting the baud rate to B0 won't work in this case either.

thanks,
joe
 

--
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