I'm writing an application that uses the IR library. I'm wondering how to verify that 
the device I'm running on supports IR communication so I can put up a dialog and abort 
when necessary. Scanning old messages on this list, I found:

On 1/29/1999, Steve Lemke wrote:
<snip>
>In other words, the following should ONLY be used on Palm OS version 
>3.0.  It *WILL* change in the future (in particular, the "IrSerial 
>Library" will NOT exist in future upgrades once it is replaced with 
>the NewSerialMgr, which will make ALL of this stuff a bit easier).
<snip>
>    // Are we running on version 3.0?
>    FtrGet(sysFtrCreator, sysFtrNumROMVersion, &romVersion);
>    if ( (sysGetROMVerMajor(romVersion) == 3) &&
>         (sysGetROMVerMinor(romVersion) == 0) ) {
>
>        // check for Palm III Upgrade Card (w/IR)
>        if ( GHwrMiscFlags & hwrMiscFlagHasCardIrDA ) {
>
>            // found it; locate the Upgrade Card's special serial library
>            SysLibFind("IrSerial Library", &serRefNum);
>
>        } else {
>
>            // check for IR support on motherboard
>            if ( GHwrMiscFlags & hwrMiscFlagHasMbdIrDA ) {
>
>                // locate the default serial library
>                SysLibFind("Serial Library", &serRefNum);
>
>            }
>        }
>    }

My current approach is based on the above code. I first check the ROM version. If it's 
older than 3.0 then I complain right away. If it's 3.0, I check if either the 
hwrMiscFlagHasMbdIrDA bit or the hwrMiscFlagHasCardIrDA bit is set in GHwrMiscFlags. 
If it's newer than 3.0, I assume the device has IR support. Does this make sense? 
Should I be checking the hardware flags on 3.1 and 3.2? Are there any 3.0, 3.1 or 3.2 
devices without IR hardware?

What's the best strategy for future compatibility? Would it be better to go ahead and 
try to open the IR library? What will happen if I try to use the IR library on a 
device running 3.0 or later but without IR hardware?

Thanks in advance.
-
Danny Epstein     *     mailto:[EMAIL PROTECTED]
Applied Thought Corporation     *     http://www.appliedthought.com
Flytrap for PalmOS     *     http://www.appliedthought.com/flytrap

Reply via email to