beautypg.com

Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 642

background image

C H A P T E R 1 7

Additional System Services

17-26

Using Additional System Services

communications endpoint, it can return the

'holdYourHorses

symbol to delay

shutdown. After completing the task for which you delayed shutdown, you must
call the

PowerOffResume

function as soon as possible to resume the power-

off sequence.

Returning

nil

in response to the

'powerOff

symbol allows the power-off

sequence to continue. Your callback function must return the value

nil

in response

to any symbols other than those described here.

The

UnRegPowerOff

function unregisters functions added with

RegPowerOff

.

IMPORTANT

The callback function registered with

RegPowerOff

must not

itself call

RegPowerOff

nor

UnRegPowerOff

.

Using the Battery Information Functions

17

Two functions return battery-related information. The

BatteryCount

function

returns the count of installed battery packs. The

BatteryStatus

function returns

a frame with information about the status of a battery pack. This frame contains
information about the battery type and charge status, whether the Newton device is
plugged in, and other power-related data. Note that the contents of this frame differ
depending on the hardware responsible for the battery’s operation.