First I want to thank you for the code, it works. But I learned a lesson
about my terminal program.
Let me first describe my system.
CW Ver 6.0 (without update 1)
POSE Ver 3.0a6 using palmos35-dr4-en-nonez.rom
LapTop Compaq, with a Handspring Visor connected to the serial port acting
as a monitor running OnLine from Mark/Space. (Great program). This setup
works great, I can simulate my responses to commands and monitor what is
coming out.
Tonights session was hell. I reviewed your example and adapted to my code.
I did not copy it verbatum. I wrote my code and tested and I did not see
any control characters on the Handspring.
I stepped through the programs and watched the variables and saw the data
in all the right places. I saw the return value from SerSend indicate that
something was sent.
Then I figured that maybe Online does not allow printing of these values.
Therefore I turned on logging which sends the Hex values to a note pad
file. Great feature!
I saw some strange values for what I thought would be 2 Hex, I saw "/" or
C5. In looking at how control chars are stored in variables I saw /2 in the
variable in Codewarrior. At this point
I checked that I was sending the correct amount of charaters, and I was.
I then put your code in and ran it with Online logging on and got the
following.
s 0A , where lower case s was the last thing my code did and 0A was your
line feed code.
In addition on the Online screen I saw the CR take effect.
In Summary
The terminal program did not display any of these hex values with the
exception of 0A on the main display or in the Hex log file. Therefore I
thought they were not being sent. They are being sent but not displayed or
logged in the file.
const char som1 = 0x02; //control-B
const char eom1 = 0x03; //control-C
const char eom2 = 0x0D; //#13 carriage return
const char eom3 = 0x0A; //#10 linefeed
const char control_d = 0x04; //control-D
Solution
I will get another terminal program set up running my favorite terminal
program Procomm Plus and then I will see the data.
Thank you
Robert Cohen
_________________________________________________________________
Aloha Robert:
I'm a scoreboard programmer so I have to write non-printable characters via
the serial port all the time. It's no big deal. Like everything else about
the PalmOS, it's easy when you know how, but finding out how can be a real
Easter-egg hunt.
Here's a snippet of code from my software that's used to drive the
scoreboards at the US Open tennis tournament. This should be
self-explanatory. I actually use the "new" serial manager at the US Open,
but I have translated it here into the old serial manager for you.
const char som1 = 0x02; //control-B
const char eom1 = 0x03; //control-C
const char eom2 = 0x0D; //#13 carriage return
const char eom3 = 0x0A; //#10 linefeed
const char control_d = 0x04; //control-D
typedef char c_string[255]; //define c_string
c_string mydata = "";
mydata[0]=eom1;//control-C
mydata[1]=eom2;//CR
mydata[2]=eom3;//LF
mydata[3]=eom3;//send an extra character, which gets eaten when the port
gets shut off
SerSend10(refNumP,&mydata,4);
SerSendWait(refNumP,-1);
Just be careful to specify the number of characters to send, do NOT use
StrLen(mydata), because StrLen returns some funky results when using
non-printable characters.
Best of luck.
James
> 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/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/