On Sun, Mar 24, 2013 at 12:21 PM, Mihai Popescu <[email protected]> wrote:
> Reading man pages for tty and cua plus the FAQ let me confused. I
> wasn't born in dial-in/out usage time and I'm not familiar with these
> actions.
> I want to use the serial port for some sensor communication, send and
> receive, not in duplex mode.
> What is the best dev to use: tty or cua ? Does it matter for non
> dial-in/out purposes ?

The tty* devices make your program block until the device signals that
it's ready.  So, who initiates the *hardware* connection?  If the
sensor asserts the DCD line when ready to talk, then the tty device is
the one to use as then your process will block on open until the
device is actually present and ready.  If you need to be able to talk
to it when that's not the case, then use a cua device.


> What are the proper modalities to control the port, using ioctl
> functions or tc* ones (tcsetattr, tcsendbreak, etc)?

No question here: use the tc* functions.  Type checking is a Good Thing.


Philip Guenther

Reply via email to