Hi,
 
I'm having trouble trying to send a packet over an IR connection using IrLib.
 
I have successfully estabilished LAP and LMP connections (passing the remote LSap selector in the XID information string, during Discovery). I'm not using the IAS yet. When I try to send a packet using my send() function (source code in the end) I get a callback event LEVENT_PACKET_HANDLED meaning it was successfully sent. However when the remote side receives the LEVENT_DATA_IND event (meaning data has been received) try to print the receive buffer and am surprised by an empty buffer!
 
I don't know if the problem is sending, receiving or both. Could someone please help me find out what's wrong?

Thanks,
Gercel Silva

--- source code snippet ---

// This function sends the string "Animals" over IR
Boolean IRLib :: send()
{
   UInt8 animals[] = { 'A', 'n', 'i' , 'm', 'a', 'l', 's', '\0' };
   packet.buff = (UInt8*) animals;
   packet.len = len;
   status = IrDataReq(refNum, &connect, &packet);
   FrmCustomAlert(DebugAlert, "Data sent", (Char*) packet.buff, "" );

   if (status != IR_STATUS_PENDING)
      return false ;

   return true;
}

 

// This function is called when I get a callback event LEVEN_DATA_IND.
void IRLib :: callback(IrConnect *con, IrCallBackParms *parms)
{
   switch (parms->event)
   {
      case LEVENT_DATA_IND:
         FrmCustomAlert(DebugAlert, "Data received" , (Char*) parms->rxBuff,   (Char*) parms->packet->buff);
         break;
   }
}

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

Reply via email to