Danielle,

You need to first open the port with SrmOpen().  Here is a sample:

   err = SrmOpen(0x8001,9600,&portId);

once open, you use the portId variable (or "handle") in subsequent SrmXYZ
functions.

SrmReceiveFlush(portId,32)

...

SrmClose(portId)

the 0x8001 value is only used during the open.

to open the port for IrComm, cooked class, use 'ircm' rather than 0x8001.
For Bluetooth, serial port profile, 'rfcm', etc.


For some samples with the straight api (no POL), try :
http://www.palm-communications.com/tutorials.asp


hope this helps.


Frank




----- Original Message ----- 
From: "Danielle O'Hallisey" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Saturday, August 07, 2004 6:21 PM
Subject: RE: IR and serial ports


> >"Martin Bruner" wrote:
> >Shouldn't there be a SrmOpen(serPortIrPort,1200,&PortID) somewhere?
>  You got me thinking and I realized that I had used POL to initialize the
> object, but standard C to close it.  So I did the following test to check
> (once again) programmatically whether or not this approach will work
(using
> serial manager to communicate via the IR port).
>
>                  Err erRor;
>                  erRor=SrmReceiveFlush(0x8001,32);
>
>                  {switch (erRor)
>                  {
>                                  case serErrNotOpen:
>                                  {
>                                  FrmCustomAlert(SerialErrorAlert, "Ain't
> Open", "!", "");
>                                  return true;
>                                  break;
>                                  }
>                                  case serErrBadPort :
>                                  {
>                                  FrmCustomAlert(SerialErrorAlert, "Ain't
No
> Thing", "!", "");
>                                  return true;
>                                  break;
>                                  }
>                                  case serErrNoDevicesAvail:
>                                  {
>                                  FrmCustomAlert(SerialErrorAlert,
"Couldn't
> Find Nothing", "!", "");
>                                  return true;
>                                  break;
>                                  }
>                                  default: break;
>                                  }
>                                  }
>
> Once again, I receive the alert that there is no such thing as a serial
port
> with the ID 0x8001 (which is supposed to be the IR port when addressed
> through serial manager).
>
> Does anyone see another potential error, or has the serial manager/IR link
> been dropped somewhere along the line?
>
> Thank you,
>
> Danielle O'Hallisey
>
>
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/


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

Reply via email to