Batterystatus = getbatteryinfo ( ), Status = getpowerstate ( devicename ), Resetidletimer ( ) – Casio Naurtech CETerm Ver.5.5 Scripting Guide User Manual

Page 31

Advertising
background image

N

AURTECH

W

EB

B

ROWSER AND

T

ERMINAL

E

MULATION FOR

W

INDOWS

CE

AND

W

INDOWS

M

OBILE




CETerm Scripting Guide

Page 31


batteryStatus = GetBatteryInfo ( )

Get the battery charge information. Returns a JavaScript object literal with the
information in the form:


{ACLineStatus:0x1,
main:{flags:0x1, lifePercent:100, lifeTime:4294967295,
fullLifeTime:4294967295, voltage:4178, current:0,
averageCurrent:0, averageInterval:0,
mAHourConsumed:0, temperature:3.8, chemistry:0x4},
backup:{flags:0x1, lifePercent:100, lifeTime:4294967295,
fullLifeTime:4294967295, voltage:2797}}




See Section 2.8 for details about handling JavaScript literals. See Appendix 4 for
status and flag definitions. Times are in seconds, voltages are in millivolts, and
currents are in milliamperes. Depending on the device, some values may be
invalid. When a battery is under charge (ACLineStatus:0x1) some values may
be invalid. Return null if battery information is not available. Search
msdn.microsoft.com with keyword “SYSTEM_POWER_STATUS_EX2” for more
details.

status = GetPowerState ( deviceName )

Get the power state of the specified device component. The valid device names
depend on the hardware. Common devices are serial ports (“COMx:”) and the
backlight (“BKL1:”). Return values are 0 – full on, 1 – low on, 2 – standby, 3 –
sleep, 4

– off, or -1 if unknown. Check the Device property LastError for more

error information.

status = PowerStateRequest ( deviceName, powerState )

Request the OS to set the power state of a device component. The state is one
of the 5 values listed under GetPowerState. See Appendix 4 for state constants.
Return 0 for success, non-zero for failure. Check the Device property LastError
for more error information.

ResetIdleTimer ( )

Resets the system idle timer. The idle timer is used to determine when to enter a
suspended state. Resetting the timer will typically prevent the device from
suspending.

Advertising
This manual is related to the following products: