SECTION 2
Supporting DOS Applications
PEN*KEY
R
6200/6300 Hand-Held Computer Programmer’s Reference Guide 2-7
Standard APM Event Processing
The standard APM events are those for which NPOWER performs specific
actions. Any APM event not listed is simply broadcast. These are descriptions of
all of the interrupt vectors that NPOWER hooks to achieve its resident
functionality. The event code values are hex.
0002 System Suspend Request Notification
(
APM_SUSPEN_REQ
)
A Get Power Status call is issued to determine if the terminal is on charge. If the terminal is on charge
then the event is simply ignored. If the /SS:1 switch was specified, then a userĆsuspend event is broadcast
instead of a system suspend; otherwise, a systemĆsuspend event is broadcast via Int2Fh.
0003 Normal Resume System Notification
(
APM_NORM_RESUME
)
If the backlight was on when the HHC was suspended and the global backlight timer was enabled, then
the backlight is turned back on using a Set Power State call with the OEM device ID of 0E200h. INT 6Ch
is issued to restore the DOS clock from the RTC. This is the normal resume notification that is broadcast.
0004 Critical Resume System Notification
If the backlight was on when the terminal was suspended, and the global backlight timer was enabled,
then the backlight is turned back on using a Set Power State call with the OEM device ID of 0E200h.
INT 6Ch is issued to restore the DOS clock from the RTC. The critical resume notification is broadcast.
0005 Main Battery Low Notification
The broadcast of low main warnings is maintained by a timer that is updated every timer tick. There are
two variables used for control when a warning is issued, together with a table of values to arm those two
variables. The first variable is a flag that indicates whether or not warnings are to be issued at all. The
second is a counter that indicates whether it is time for another warning to be broadcast.
When warnings are enabled and the counter has counted down to zero, a warning is broadcast. At that
time, a Get Power Status call is issued to determine whether or not to rearm the counter for another
warning. The Get Power Status call returns how much time is left. That value determines which timeout
period (if any) should be used for the next warning. It also determines which warning to broadcast.
The default values for the table are:
Time Remaining
Broadcast Value
New Timeout Period
10 minutes or less
020Dh (OEM)
60 seconds
20 minutes or less
020Eh (OEM)
120 seconds
30 minutes or less
020Fh (OEM)
180 seconds
over 30 minutes
0005h
disable warnings
The first main battery low notification received starts the warning process. If warnings are already enĆ
abled, additional main battery notifications are ignored. The warning process is started by enabling the
flag and then performing the same process described above. A Get Power Status call determines which
value to immediately broadcast as well as when the next broadcast is performed.
0006 Power Status Change Notification
(
APM_PWR_CHANGE
)
A Get Power Status call determines if the terminal was placed on or removed from ac power. If the termiĆ
nal is on battery power then the power status change event is simply broadcast. If the terminal is on ac
power, but was previously suspended, then a resume notification event is broadcast. After the power staĆ
tus change event is broadcast, the return value is checked for an audible signal. If the return value of BH
is nonzero, then a beep is issued via the APM OEM BIOS extension (Int 15h, AX=5380h, BH=11h).
0007 Update Time Notification
Fix the DOS Clock. Broadcast the time update.
0008 Critical System Suspend Notification
(
APM_CRIT_SUSPEND
)
A Get Power Status call determines if the terminal is on charge. If the terminal is on charge then the
event is simply ignored. The critical system suspend event is broadcast via Int. 2Fh. A Set Power State
command is issued to the APM BIOS to suspend all power managed devices.
2. DOS
Applications