Thursday, August 16, 2007

Checking for New Features in Palm OS 5

Checking for OS Version ==================================================================
err = FtrGet(sysFtrCreator, sysFtrNumROMVersion, &romVersion);
if (romVersion >= sysMakeROMVersion(5,0,0,sysROMStageRelease,0)) //OS 5 or above


Pace Version
================================================================= You can check to see if you are running under the Palm Application Environment (PACE) and and at the same time get the version of PACE with:
FtrGet('pace', 0, &version);


Processor Type
================================================================
FtrGet(sysFtrCreator, sysFtrNumProcessorID, &procType);procType &= sysFtrNumProcessorMask;
You can then compare procType against the processor types defined in SysMgr.h
#define sysFtrNumProcessor328 0x00010000 // Motorola 68328 (Dragonball)

#define sysFtrNumProcessorEZ 0x00020000 // Motorola 68EZ328 (Dragonball EZ)
#define sysFtrNumProcessorVZ 0x00030000 // Motorola 68VZ328 (Dragonball VZ)
#define sysFtrNumProcessorSuperVZ 0x00040000 // Motorola 68SZ328 (Dragonball SuperVZ)
#define sysFtrNumProcessorARM720T 0x00100000 // ARM 720T
#define sysFtrNumProcessorARM7TDMI 0x00110000 // ARM7TDMI
#define sysFtrNumProcessorARM920T 0x00120000 // ARM920T
#define sysFtrNumProcessorARM922T 0x00130000 // ARM922T
#define sysFtrNumProcessorARM925 0x00140000 // ARM925
#define sysFtrNumProcessorStrongARM 0x00150000 // StrongARM
#define sysFtrNumProcessorXscale 0x00160000 // Xscale
#define sysFtrNumProcessorARM710A 0x00170000 // ARM710A
#define sysFtrNumProcessorx86 0x01000000 // Intel CPU (Palm Simulator)

High Density Display
===========================================================
To see if the High Density Feature Set is present, check the version of the Window Manager and confirm that it is 4 or greater:
err = FtrGet(sysFtrCreator, sysFtrNumWinVersion, &version);
Once you have confirmed that the High Density Feature Set is present, you can check the density of the screen with:
WinScreenGetAttribute(winScreenDensity, &attr);if (attr == kDensityDouble)//the screen is high density


Sampled Sound ==================================================================
err = FtrGet(sysFileCSoundMgr, sndFtrIDVersion, &version);
if(err)
{
// Sampled Sound Feature Set not present
}
else
{
// The Sampled Sound Feature Set is present.
// Check version number of Sound Manager, if necessary

if(version == expectedSndMgrVersionNum)
// everything is OK
}

SSL Library
=====================================================================
theError = SysLibFind("SslLib", &refNum);
if (theError)

theError = SysLibLoad(sysFileTLibrary, 'ssl0', &refNum);
if (theError)

//no SSL library
else
//SSL library is present

Crypto Library
================================================================
theError = SysLibFind("CPMlib", &refNum);
if (theError)

theError = SysLibLoad(sysFileTLibrary, 'cpml', &refNum);
if (theError)

//no crypto library
else
//crypto library is present

1 comment: