At 11:00 AM -0400 2000/06/09, [EMAIL PROTECTED] wrote:
>I have the 3.5 SDK and looked high and low for a header with this sort of function, 
>and couldn't see it. Then I looked in the older 3.1 SDK and lo and behold there is 
>Hardware.h which contains (among other things):
>
>typedef enum {
>     DockStatusNotDocked = 0,
>     DockStatusInModem,
>     DockStatusInCharger,
>     DockStatusUnknown = 0xFF
>     } hwrDockStatusState, *hwrDockStatusStateP;

This is an old implementation of the function which returned a single enum rather than 
a bitfield. This was inappropriate for certain [licensee's] devices which have, for 
example, cradle-based charging modems.

The change to return a bitfield occurred in Palm OS 3.2 -- Palm OS 3.1 and prior 
versions returned one of those enums. Both implementations use the same trap number. 
The bitfield constants were carefully selected to map to the enum values as best as 
possible for backward compatibility. However, code which tests equality (e.g. 
HwrDockStatus() == DockStatusInModem) will fail on newer OS versions, while code which 
tests using bit masking (e.g. HwrDockStatus() & hwrDockStatusModemAttached) will 
succeed under both old and new implementations.

Regards,

Jim Schram
Palm Incorporated
Partner Engineering


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

Reply via email to