I've got an application that's communicating with a peripheral using 
low-level IR (not IrDA, but just sending 19,200 baud info through the IR
port).

On an SPT 1740 (running Palm OS 3.2), the following control call returns an
error 768, serErrNotSupported:

 err = SerControl(gSerialRefNum, serCtlIrScanningOff, NULL, 0);

(the intention is to turn off beam receive).

On an SPT 1500 (running Palm OS 3.01), and a Palm VII (running Palm OS 3.2),
the control call works just fine.


Note that I've opened the port with:
 Err err;
 char *serialLibrary = NULL;
    // check for Palm III Upgrade Card (w/IR)
    if ( GHwrMiscFlags & hwrMiscFlagHasCardIrDA ) {
        // found it; locate the Upgrade Card's special serial library
        serialLibrary = "IrSerial Library";
    } else {
        // check for IR support on motherboard
        if ( GHwrMiscFlags & hwrMiscFlagHasMbdIrDA ) {
            // locate the default serial library
   serialLibrary = "Serial Library";
        }
    }
 ErrNonFatalDisplayIf(!serialLibrary, "No IR on this device!");
 err = SysLibFind(serialLibrary, &gSerialRefNum);
 ErrNonFatalDisplayIf(err != 0, "Can't find serial library");
 if (err != 0)
  return err;
 err = SerOpen(gSerialRefNum, 0, 19200);
 if (err != 0) {
  if (err == serErrAlreadyOpen) {
   ErrNonFatalDisplay("Serial is in use");
   SerClose(gSerialRefNum);
  } else {
   StatusNum("Can't open serial: %d", err);
  }
 }

And, prior to the control call, I've set the baud rate, stop bits, and bits
per char:
 settings.baudRate = kTecIRBaudRate;
 settings.flags = serSettingsFlagStopBits1 | serSettingsFlagBitsPerChar8;
 err = SerSetSettings(gSerialRefNum, &settings);


My code seems to run fine on a 1740 without the call to turn IR scanning
off, but I'd like to know why it fails.

Thanks,


Neil

Reply via email to