serial madness?

bridged with qdn.public.ddk.input
Post Reply
Kevin Weisser

serial madness?

Post by Kevin Weisser » Tue Jun 11, 2002 8:51 pm

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

David Gibbs

Re: serial madness?

Post by David Gibbs » Wed Jun 12, 2002 2:23 pm

Kevin Weisser <kweisser@udel.edu> wrote:

Answered in more detail elsewhere.

This newsgroup is primarily about modifying/coding new drivers, rather
than using the existing one.

-David
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

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

john eddy

Re: serial madness?

Post by john eddy » Sat Jun 29, 2002 3:37 pm

I had similar problems dubugging some code, and found it was a quirk in how
printf was handled.

It doesn't update the screen until it sees an end of line.

I was printing out characters with printf("%02X,"ch); in a loop that
received data, but I didn't see any of it until an en of line character was
sent.

Just a thought

Jeddy

"David Gibbs" <dagibbs@qnx.com> wrote in message
news:ae7lgm$631$6@nntp.qnx.com...
Kevin Weisser <kweisser@udel.edu> wrote:

Answered in more detail elsewhere.

This newsgroup is primarily about modifying/coding new drivers, rather
than using the existing one.

-David

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



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

David Bacon

Re: serial madness?

Post by David Bacon » Thu Jul 04, 2002 9:01 pm

This isn't a "quirk" - it's called line buffering, and it's standard Unix
behavior for stdout when attached to a terminal. See the doc page for
setvbuf() for more information on how to change this default.

dB

"john eddy" <johnheddy@adelphia.net> wrote in message
news:afkjps$5eb$1@inn.qnx.com...
I had similar problems dubugging some code, and found it was a quirk in
how
printf was handled.

It doesn't update the screen until it sees an end of line.

I was printing out characters with printf("%02X,"ch); in a loop that
received data, but I didn't see any of it until an en of line character
was
sent.

Just a thought

Jeddy

"David Gibbs" <dagibbs@qnx.com> wrote in message
news:ae7lgm$631$6@nntp.qnx.com...
Kevin Weisser <kweisser@udel.edu> wrote:

Answered in more detail elsewhere.

This newsgroup is primarily about modifying/coding new drivers, rather
than using the existing one.

-David

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



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

Post Reply

Return to “qdn.public.ddk.input”