uestion
uestion

Reputation:

What are TIOCM_OUT1 and TIOCM_OUT2 good for?

termios.h defines:

#define TIOCM_OUT1      0x2000
#define TIOCM_OUT2      0x4000

But what are the flags good for?

Upvotes: 5

Views: 808

Answers (2)

PersistenceOfVision
PersistenceOfVision

Reputation: 1295

TIOCM_OUT1 = Unassigned Programmable Output #1
TIOCM_OUT2 = Unassigned Programmable Output #2

It looks like they can be used to set the OUT1 and OUT2 bits in the MCR.
But what are the Unassigned Programmable Outputs good for?
My best understanding is they are used during loopback mode for interrupts and are best NOT used for anything (since they are intended to be used internally).

Upvotes: 3

dwc
dwc

Reputation: 24940

They are used as signal lines similar to DTR, et al. They are "unassigned" and therefore open for use. So theoretically you could use them to signal some special condition out of band, which could come in very handy.

However, I would not use them for anything unless you are building your own hardware solution: commodity serial hardware often supports only the minimum requirements for the most common uses. I.e., it's often not full RS-232 (or RS-XXX) compliant.

Upvotes: 3

Related Questions