devc-ser* devctl info

Hi all,
Is there a “standard” document somewhere that
explains the possible devctl parameters for the
serial port drivers under QNX? Even if it’s
a generic Unix doc that would get me started I’d
find any information useful. Haven’t started
digging around with source files or header files yet,
though I suspect that’s where the actual information
lies; still, thought I’d ask first.
Cheers,
Randy Hyde

Randall Hyde <randall.nospam.hyde@ustraffic.net> wrote:

Hi all,
Is there a “standard” document somewhere that
explains the possible devctl parameters for the
serial port drivers under QNX? Even if it’s
a generic Unix doc that would get me started I’d
find any information useful. Haven’t started
digging around with source files or header files yet,
though I suspect that’s where the actual information
lies; still, thought I’d ask first.

I don’t know of a generic doc on it – but take a look at
/usr/include/sys/dcmd_chr.h – it does seem to be reasonably
heavily commented.

-David


QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Yeah, been there.
I guess I should be more specific :slight_smile:
Is there anyway to set the serial port parameters like
bps, parity, number of bits, stop bits, etc., using devctl?
I see mechanisms for testing/setting DTR/DTS and CTS/RTS,
as well as other line status/modem status values, but I don’t
see how to change the basic serial parameters. Is this possible
using generic devctl calls? Or does the system expect this
to be so device-specific that a generic set of definitions aren’t
provided for these purposes?
Thanks,
Randy Hyde

Randall Hyde <randall.nospam.hyde@ustraffic.net> wrote:

Yeah, been there.
I guess I should be more specific > :slight_smile:
Is there anyway to set the serial port parameters like
bps, parity, number of bits, stop bits, etc., using devctl?
I see mechanisms for testing/setting DTR/DTS and CTS/RTS,
as well as other line status/modem status values, but I don’t
see how to change the basic serial parameters. Is this possible
using generic devctl calls? Or does the system expect this
to be so device-specific that a generic set of definitions aren’t
provided for these purposes?

Does it have to be devctl()s?

The “standard” way to do this would be:

tcgetattr()
cfsetospeed()
cfsetispeed()
tcsetattr()

Or, to put it another way, this is so generic, that there are
POSIX functions to do it.

(And, the cfset* functions are, really, convenience functions for
modifying the termios structure – you could directly modify that
instead of using them.)

If you would like to do these with devctl()s, then the controls
would be DCMD_CHR_TCGETATTR and DCMD_CHR_TCSETATTR – but both
these devctls take a struct termios as their parameter – so you
don’t gain anything by using the devctl instead.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Randall Hyde <randall.nospam.hyde@ustraffic.net> wrote:

Yeah, been there.
I guess I should be more specific > :slight_smile:
Is there anyway to set the serial port parameters like
bps, parity, number of bits, stop bits, etc., using devctl?

And previously you asked for:

Is there a “standard” document somewhere that
explains the possible devctl parameters for the
serial port drivers under QNX?

My favourite document on this is Advanced Programming in the
UNIX Environment
by W. Richard Stevens (ISBN 0-201-56317-7),
Chapter 11, “Terminal I/O”.


But, yes, all of those things – bps, number of bits, stop bits,
parity, how parity errors are marked or if they are, etc are
all controllable through the tcgetattr(), termios structure,
and tcsetattr() functionality.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

see /usr/include/termios.h

“David Gibbs” <dagibbs@qnx.com> wrote in message
news:b4nms6$fbd$6@nntp.qnx.com

Randall Hyde <> randall.nospam.hyde@ustraffic.net> > wrote:
Yeah, been there.
I guess I should be more specific > :slight_smile:
Is there anyway to set the serial port parameters like
bps, parity, number of bits, stop bits, etc., using devctl?

And previously you asked for:

Is there a “standard” document somewhere that
explains the possible devctl parameters for the
serial port drivers under QNX?

My favourite document on this is Advanced Programming in the
UNIX Environment
by W. Richard Stevens (ISBN 0-201-56317-7),
Chapter 11, “Terminal I/O”.


But, yes, all of those things – bps, number of bits, stop bits,
parity, how parity errors are marked or if they are, etc are
all controllable through the tcgetattr(), termios structure,
and tcsetattr() functionality.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.