Robert,

When posting questions, you should include information on what's going wrong.
You don't say, and so I can't only assume that the other end of the connection
is receiving something other than you think you're sending. In this case, I will
further assume that the receiving end is seeing zeros.

That's because you're not setting up your "send" buffer correctly. Take a look
at the first SerSend. You are assigning 255 to a 16-bit (2-byte) value. In
memory, this appears as the following (using hexadecimal notation):

0x00 0xFF

You are then pointing to the beginning of this sequence, and sending just one
byte. Therefore, the 0x00 gets sent out the serial port, but not the 0xFF.
Changing DecValue and ControlC to UInt8's should fix this.

Also, Control-C is 0x03, not 0x02. And neither is necessarily a printable smiley
face.

-- Keith Rollin
-- Palm OS Emulator engineer






Robert Cohen <[EMAIL PROTECTED]> on 09/08/2000 11:10:13 PM

Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>

Sent by:  Robert Cohen <[EMAIL PROTECTED]>


To:   "Palm Developer Forum" <[EMAIL PROTECTED]>
cc:    (Keith Rollin/US/PALM)
Subject:  Sending Serial Data Challenge



I need to send ASCII 255 character.

I can send strings, but how do you send Ctrl C for example? Which is 2 in
ASCII.Printable smile face.

What is wrong with this code?

Int16 DecValue=255;
byte_sent=SerSend(Refnum,&DecValue,1, &error);

Int16 ControlC=2;
byte_sent=SerSend(Refnum,&ControlC,1, &error);

I looked at the SDK Reference and I think I am doing this correctly.

Thank you
Rob





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to