serial frustration

I am trying to write a serial program which simply takes in characters and
then writes them out on a port the whole time is sitting and waiting for
characters from the other computer to be read in. My problem lies in here
the code I have written will send out the characters to the other computer
running DOS that part works fine. But my computer doesn’t display the
characters it recieves until I go and press a key. I have even gone as far
as to insert threads and that has not worked. I am using the raw() and
unraw() functions posted in the applications newsgroup. Does anyone have a
solution so that keys pressed on the DOS computer appear on my QNX computer
even if I don’t press anything. I am thinking it may be a blocking a
write(). Please any solutions, pointers, sites you can point me to are much
appreciated.

kweisser@udel.edu
Kevin Weisser

Kevin Weisser <kweisser@udel.edu> wrote:

I am trying to write a serial program which simply takes in characters and
then writes them out on a port the whole time is sitting and waiting for
characters from the other computer to be read in. My problem lies in here
the code I have written will send out the characters to the other computer
running DOS that part works fine. But my computer doesn’t display the
characters it recieves until I go and press a key. I have even gone as far
as to insert threads and that has not worked. I am using the raw() and
unraw() functions posted in the applications newsgroup. Does anyone have a
solution so that keys pressed on the DOS computer appear on my QNX computer
even if I don’t press anything. I am thinking it may be a blocking a
write(). Please any solutions, pointers, sites you can point me to are much
appreciated.

Instead of keeps on saying “it is not working”, don’t you like
post your code so we all don’t need to wild guessing?

The only “wild guessing” I could have, is you are blocking on
waiting keyboard input…

-xtang

Kevin Weisser <kweisser@udel.edu> wrote:

I am trying to write a serial program which simply takes in characters and
then writes them out on a port the whole time is sitting and waiting for
characters from the other computer to be read in. My problem lies in here
the code I have written will send out the characters to the other computer
running DOS that part works fine. But my computer doesn’t display the
characters it recieves until I go and press a key. I have even gone as far
as to insert threads and that has not worked. I am using the raw() and
unraw() functions posted in the applications newsgroup. Does anyone have a
solution so that keys pressed on the DOS computer appear on my QNX computer
even if I don’t press anything. I am thinking it may be a blocking a
write(). Please any solutions, pointers, sites you can point me to are much
appreciated.

I keep feeling like I’m getting little bits and pieces of your problem,
and making a guess at the answer to that little bit or piece, then getting
a “it doesn’t work” without enought to know exactly which bit or piece…

Can you post the code you’ve written, and a detailed description of the
system configuration. Also, the output of “pidin”, and “stty -a” on all
the QNX devices when you’re in the “waiting” state.

The “nothing until I press a key” sure sounds like you’re blocking on
something… just not clear what.

If I understand what you’re trying to do:
– you have a QNX box with a console (or virtual console) and a serial
port
– the serial port is connected by a null modem cable to a DOS machine
– you have a terminal program on the DOS machine talking to the serial
port
– you want to put a program on the QNX machine that sits between the
console and the serial port such that:
– everything typed at the console goes to the serial port
– everything that comes in the serial port goes to the console

At some point, you’ve generated data, but don’t see it until you hit a
key? By this, do you mean that you’ve typed stuff into the DOS side,
but it doesn’t get displayed on the QNX side until you hit a key on
the QNX console? If so, this definitely sounds like you are blocking
on the QNX read of the console. The source code for how you setup your
QNX program would be very helpful.

Side note: this is what the qtalk utility does. If you just need a
program that does this, qtalk might solve your problems. If this
is just the first step to a larger solution, it probably won’t.

-David

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