128
2.7.7 Virtual OFF by Application
Virtual OFF
The Virtual OFF is a function and its main object is to save power. Internally, the terminal is
running normally but it seems to be with the power being turned off – unable to display and input
a key. This function is mainly used to provide the terminal user with fast resume from standby
state in WLAN communication.
Virtual OFF State Transition
The state transition diagram of Virtual OFF is below. The system has a mode named Virtual OFF
and the state transits ON State and OFF State in the mode. The transition is triggered by the
message issued by pressing the Power key.
Figure 2-14
How to set Virtual OFF mode in application
In order to set the Virtual OFF mode, call SysSetVirtualOffMode and SysDisablePowerOff
functions of the System Library. In this mode, the Power Management alternately issues the
following messages every time the Power key is pressed.
1. When the Power key is pressed to turn off the power:
WM_POWERBROADCAST (PBT_APMSUSPEND)
2. When the Power key is pressed to turn on the power:
WM_POWERBROADCAST (PBT_APMRESUMESUSPEND)
In the diagram in following figure, the application receives PBT_APMSUSPEND message at the
first press of the Power key and then changes the state to OFF State in the Virtual mode. And then
the application receives PBT_APMRESUMESUSPEND message and returns to ON State.
The application undertakes the transition to OFF State in the Virtual OFF mode. For example, the
application disables display, key input, and etc. and turns off the power to devices in idle.
ON
State
OFF
State
Normal mode
Virtual OFF mode
SysSetVirtualOffMode
SysDisablePowerOff
SysSetVirtualOffMode
SysEnablePowerOff
Press the Power key
(PBT_APMSUSPEND)
Press the Power key
(PBT_APMRESUMESUSPEND)
ON
State
OFF
State
Normal mode
Virtual OFF mode
SysSetVirtualOffMode
SysDisablePowerOff
SysSetVirtualOffMode
SysEnablePowerOff
Press the Power key
(PBT_APMSUSPEND)
Press the Power key
(PBT_APMRESUMESUSPEND)