I have a simple application that I want to send text between two palms.  I
already have a working version that uses the IrLibrary.  However, I now
want to do the same thing but not using the IrLibrary.  Seems like this
should be easier.  However, I'm stuck here.
The app has a simple form, with a Send and Receive field and a Send and
Recv button.  The way I am trying to use it is to enter something in the
Send field on the 1st palm.  I then tap the Recv on the 2nd palm, followed
by Send on the first.  But nothing happens.  I get "no error" reported by
the sending palm.  Nothing is displayed on the 2nd palm.
Baud, flags and timeout are set prior  the code below.

I must be leaving something out.  Here is the simple code for the two
buttons.  This is within the form handler.  I have also tried this without
the SrmControl (using default values) and that didn't work either so I'mfairly sure it 
doesn't have anything to do with the SrmControl() functions.

Anyone have a tip on how to send and receive RAW IR via a serial channel
without using the IrLibrary and only the Serial Manager?
Thanks

case ctlSelectEvent:
  if(eventP->data.ctlEnter.controlID == MainSendButton) {
     sError = SrmOpen(serPortIrPort, 9600, &portID);
     SrmControl(serPortIrPort, srmCtlSetBaudRate, &baud, &sizeBaud);
     SrmControl(serPortIrPort, srmCtlSetFlags, &flags, &sizeFlags);
     SrmControl(serPortIrPort, srmCtlSetCtsTimeout, &timeout, &sizeTimeout);
     GetFieldText(sBuffer, MainSDataField);  // send data field
     SrmSend(portID, sBuffer, 80, &sError);
     SetFieldText(MainRDataField, error);
     SrmClose(serPortIrPort);
     handled = 1;
     break;
  }

  if(eventP->data.ctlEnter.controlID == MainRecvButton) {
     sError = SrmOpen(serPortIrPort, 9600, &portID);
     SrmControl(serPortIrPort, srmCtlSetBaudRate, &baud, &sizeBaud);
     SrmControl(serPortIrPort, srmCtlSetFlags, &flags, &sizeFlags);
     SrmControl(serPortIrPort, srmCtlSetCtsTimeout, &timeout, &sizeTimeout);
     SrmReceive(portID, rBuffer, 80, 500, &rError);
     SrmClose(serPortIrPort);
     SetFieldText(MainRDataField, rBuffer);
     handled = 1;
     break;
   }




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

Reply via email to