extra bytes on sending serial

Postby Eli on Thu Mar 25, 2004 7:14 pm

I am trying to send a simple command of the IRDA port. For starters i was just trying to send single byte "0x77" command. On the receive end i am getting 3 bytes. I get a FD, FF and then the 77 hex.

Where are the extra bytes coming from? And how can i get rid of them? They are confusing the receiver.

retVal = seropenx(0x8001,9600);
if (retVal == 0)
alert("Transmission Complete");
I have confirmed this by two different methods.


Posts: 42
Joined: Fri Oct 11, 2002 10:57 pm
Location: USA

Postby Eli on Wed Mar 31, 2004 8:11 pm

I may have discovered an answer though not the reason to my problem. I got a new Sony Clie TJ27 (OS 5.3.1) and tried executing the same commands and I did not see any of these extra characters.

I do see the problem when sending from my Handspring Visor (OS 3.5.2) and a Sony Clie SJ22 (OS 4.1).

I also noticed that with the Sony i get the real ASCII equivalents of what i send but not with the older ones. ??????

Posts: 42
Joined: Fri Oct 11, 2002 10:57 pm
Location: USA

Postby otakribut1 on Tue Apr 19, 2005 2:02 am

some infrared work on different protocols and transmission error-checking procedure may differ on units. you may need to write a monitor app. to check incoming data, and organise it to validate which is error-checking, which is redundant data and the real data.
this is a sample explaiantion extracted from bert van dam codes for lego cybermaster serial control via pda--
'This subroutine extracts reply values from a reply string. The reply
'will look like this 255 237 18 54 201 0 255 35 220
'Where the answer is 54 + 0 * 256
'so find the 4th (First) and 6th (Second) number and perform this
'calculation. This routine will give an error if you try to extract the
'very first number of the string, which is ok since that's never needed.
'If the reply consists of only 1 number make Second=0.
Posts: 12
Joined: Tue Feb 22, 2005 2:26 am

Return to PocketC for Palm OS KB

Who is online

Users browsing this forum: No registered users and 3 guests