Detecting +ohpaged on a serial port

I am using Qnx4.25. I have software running on a serial port.
Occassionally, the serial port stops sending data. Using the stty
command +ohpaged is on executing stty -ohpaged </dev/tta1 clears the
problem. Is there any method of checking and clearing ohpaged from
software without using the stty command?

Padraig Furlong

Padraig Furlong <Padraig.Furlong@rte.ie> wrote:

I am using Qnx4.25. I have software running on a serial port.
Occassionally, the serial port stops sending data. Using the stty
command +ohpaged is on executing stty -ohpaged </dev/tta1 clears the
problem. Is there any method of checking and clearing ohpaged from
software without using the stty command?

tcflow() for clearing

To query it, stty seems to use

tcgetattr(fd, &tios)
then looks at the tios.c_status field, which has a set of bits defined
for this in the <termios.h> header:

#define TC_ISFLOW 0x0001
#define TC_OSFLOW 0x0002
#define TC_IHFLOW 0x0004
#define TC_OHFLOW 0x0008

I’d assume if the bit is set, then the corresponding flow-control
state is in effect.

-David

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

David,
Many thanks for the suggestion.

Padraig

David Gibbs wrote:

Padraig Furlong <> Padraig.Furlong@rte.ie> > wrote:

I am using Qnx4.25. I have software running on a serial port.
Occassionally, the serial port stops sending data. Using the stty
command +ohpaged is on executing stty -ohpaged </dev/tta1 clears the
problem. Is there any method of checking and clearing ohpaged from
software without using the stty command?


tcflow() for clearing

To query it, stty seems to use

tcgetattr(fd, &tios)
then looks at the tios.c_status field, which has a set of bits defined
for this in the <termios.h> header:

#define TC_ISFLOW 0x0001
#define TC_OSFLOW 0x0002
#define TC_IHFLOW 0x0004
#define TC_OHFLOW 0x0008

I’d assume if the bit is set, then the corresponding flow-control
state is in effect.

-David

David,
That worked perfectly. Many thanks again

Padraig

Padraig Furlong wrote:

David,
Many thanks for the suggestion.

Padraig

David Gibbs wrote:

Padraig Furlong <> Padraig.Furlong@rte.ie> > wrote:

I am using Qnx4.25. I have software running on a serial port.
Occassionally, the serial port stops sending data. Using the stty
command +ohpaged is on executing stty -ohpaged </dev/tta1 clears the
problem. Is there any method of checking and clearing ohpaged from
software without using the stty command?


tcflow() for clearing

To query it, stty seems to use

tcgetattr(fd, &tios)
then looks at the tios.c_status field, which has a set of bits defined
for this in the <termios.h> header:

#define TC_ISFLOW 0x0001
#define TC_OSFLOW 0x0002
#define TC_IHFLOW 0x0004
#define TC_OHFLOW 0x0008

I’d assume if the bit is set, then the corresponding flow-control
state is in effect.

-David

Padraig Furlong <Padraig.Furlong@rte.ie> wrote:

David,
That worked perfectly. Many thanks again

Great. Thanks for letting me know that it worked.

-David

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

David Gibbs <dagibbs@qnx.com> wrote:

Padraig Furlong <> Padraig.Furlong@rte.ie> > wrote:
I am using Qnx4.25. I have software running on a serial port.
Occassionally, the serial port stops sending data. Using the stty
command +ohpaged is on executing stty -ohpaged </dev/tta1 clears the
problem. Is there any method of checking and clearing ohpaged from
software without using the stty command?

tcflow() for clearing

To query it, stty seems to use

tcgetattr(fd, &tios)
then looks at the tios.c_status field, which has a set of bits defined
for this in the <termios.h> header:

#define TC_ISFLOW 0x0001
#define TC_OSFLOW 0x0002
#define TC_IHFLOW 0x0004
#define TC_OHFLOW 0x0008

I’d assume if the bit is set, then the corresponding flow-control
state is in effect.

Are you sure you don’t need the hardware flow control?

Then probably a better approach is, to avoid the ‘+ohpaged’ by
disabling the hardware flow control before starting communication
by either starting Dev.ser with the -F option (work for all ports)
or by switching it of individually for each port by the
‘tcsetattr()’-function.

You can avoid unnecessary polling, then.

HTH as well,

:Karsten.


| / | __ ) | Karsten.Hoffmann@mbs-software.de MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld