I recently updated an app that used the OS 2.0 SysBatteryInfo after
a PalmV user reported that voltages were being displayed as 0.  But
after testing the updated code the user reported a steep dropoff after
100%.  His results are:
   4.00, 4.02, 4.04, & 4.05 volts - gauge shows 100%
   3.98 volts - gauge show 88%
   3.96 volts - gauge show 86%

   Has SysBatteryInfo been updated in OS 3.1 to handle the PalmV's
LiIon battery?  The code I'm using seems fairly straightforward:

void GetVoltage(UIntPtr voltage, BytePtr percent) {
   UInt warning;
   DWord romVersion;

   // we have to correctly calculate the current voltage on a PalmPilot,
   // PalmIII, PalmIIIx and PalmV...and in the future, PalmVII.
   FtrGet(sysFtrCreator, sysFtrNumROMVersion, &romVersion);
   if (sysGetROMVerMajor(romVersion) < 3) {
      *voltage = SysBatteryInfoV20(false, /*set*/
      ...
   } else
      *voltage = SysBatteryInfo(false, /*set*/
         NULL, /*warnThresholdP*/
         NULL, /*criticalThresholdP*/
         NULL, /*maxTicksP*/
         NULL, /*kindP*/
         NULL, /*pluggedIn*/
         percent);

Thanks,
Daniel.
-- 
(AP) This morning a 3Com engineer in product development was fired after
officials discovered he had chosen the name "Palm V." 3Com noted that he
had said on his resume he could count to 10 but it was revealed to be a 
big lie. The employee had previously worked for Microsoft, where he had
upgraded Windows 3.1 to Windows 95 and Visual J++ 1.1 to Visual J++ 6.0.
                                                  -- John Doe on My PGHQ




Reply via email to