I am having trouble using the SysBatteryInfo function on the Tungsten C (OS
5.2.1).

The value returned for the pluggedIn variable does not always appear to be
correct.

If I call SysBatteryInfo in a polling manner to determine when the device
and cradle is unplugged from the wall, the value does not appear to always
be updated when the device is unplugged. Sometimes it is only updated when
the device is removed from the cradle, though sometime it behaves correctly
and changes when the cradle is unplugged from the wall.

I am polling in the event loop by handling the nilEvent and calling
EvtGetEvent with a one second delay.

Does anyone know if there is a workaround to make the Palm OS properly
detect the correct values?

I am also having trouble reliably getting correct results retrieving the
"percent" variable of SysBatteryInfo from within an alarm handler. When the
handler is called and wakes up the device, I call SysBatteryInfo; but the
percent value is from when the device went to sleep, rather than the current
value of the battery (though I know it is different). It's as though these
values were internally cached and not properly updated.

I had read there were problems with this function but they were supposedly
solved in OS 5.2
Source: http://www.palmos.com/dev/support/docs/palmos50/os52overview.html

The company I worked for is updating our product for the new Palm devices,
and what worked perfectly on old palms and handsprings, no longer seems to
work. This function is now behaving differently, and is not behaving as
documented.

Cyril MacDonald

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

Reply via email to