One way to conserve power consumption and save the battery is to put the device in Suspend when it is not being used.   When a device is suspended it typically powers down peripheral chips on the board and puts the CPU in a low power state. Then when the device is needed it wakes up, powers up the peripheral chips and resumes executing code where it left off before suspending.
One way to suspend a device is to call GwesPowerOffSystem(), which is considered by some to be the “old” way to suspend. But, looking through the source code for Explorer shell you will see that the shell still uses this function to suspend.
Example:
GwesPowerOffSystem();
// when the system resumes, it will continue executing at this point
 
The newer way to suspend is to call SetSystemPowerState(). This function is more full featured in that it can be used to request that the system change power states, of which suspend is just one.
Example:
SetSystemPowerState(NULL, POWER_STATE_SUSPEND, POWER_FORCE);
// when the system resumes, it will continue executing at this point
 
When these functions are called, the OS will take over and put the device into suspend. The extent that the system actually powers down, the power state that the CPU enters, and the wake sources that are available to resume the system are up to the OEM.
 
Copyright © 2008 – Bruce Eitman
All Rights Reserved