Hi all,
        I'm trying to use some IrDA functions, and I'm seeing some strange results.  Perhaps one of you can puzzle out what I'm doing wrong.  I'm trying to send simple character messages back and forth, but sometimes the recipient seems to receive the wrong message.  For example:
 
When I do this section of code, it works and the recipient receives a message of a "1":
   IR_Send("1");
And if I do this section of code below, the recipient gets some other character.  It almost seems like it's reading the wrong string.  Sometimes it's a "2" or a "0" or a "*" or something else:
 
   char newmessage[30];
   StrPrintF(newmessage,"1");
   IR_Send(newmessage);
Where the IR_Send uses IRDataReq() function to send the message as shown below
 
IR_Send (CharPtr sendbuf)
{
// error checking
  irPack.len = StrLen(sendbuf);
  irPack.buff = (BytePtr) sendbuf;
  IrDataReq ( refNum, &IrCon, &irPack );
// error checking
}
 
Can anyone see what I'm doing wrong?  I'm just trying to send a simple integer back and forth and somehow I'm getting some kind of pointer problem.  Any ideas?  Thanks for the help. 
 
Note:  I am trying to use code from Palm Programming by Glen Bachmann as a reference
 
David Korus

Reply via email to