Hi guys,
I'm studying Power Manager now,and want to make sure that I don't get
confused with it.
So I try to explain what I know and hope someone could make a comment if there
is anything wrong.

==============================================================================
There are 5 level in device power status,D0~D4,Power Manager will switch
device power status according to the system status.

SetPowerRequirement tell PM minimum power level of specific device could be.
That means if we tell PM set backlight power requirement to D2,then PM will
switch power status of backlight from D0 to D1 and then stop at D2.
If we set backlight power requirement to D0,backlight will stay at D0 ,and
that's how media player preserve backlight on while playing .

SetDevicePower just ask PM to change power state of given device immediately.
But it is used by some system applications.

If we want to change power state of a device ,we can use DevicePowerNotify
to inform PM.
==============================================================================

That's my understanding about Power Manager,if there is anything wrong,please
tell me and I'll appreciate your kindness.

Thanks very much .

Regards.

Will

Re: about Power Manager by Geoff

Geoff
Wed Jan 14 13:50:02 CST 2004

Power manager - it is a bunch of timers and events. Some timers trigger
events, some events trigger timers. I think you have it but the sample is
only an example.

Think of a state machine that can leap between power modes - I like to use
the example of a mobile phone so that people (other than extreme luddites)
are familiar with it.

Your phone has state like this:

- (1) Fully on during in a call
- (2) No active call, user in a menu
- (3) No active call, user inactive, system active (such a during a cell
handoff of checking the battery)
- (4) No active call, user inactive, system inactive
- (5) Off

So you have these 5 states in my example. The drivers in the phone get told
to go to various states whenever a stae transition occurs. The way the PM
tracks who to tell what is via GUIDs in the registry.

- So your call ends, your mother was pleased to speak to you. The PM gets
an event to say the call ended and starts the user inactivity timer. The
power state changes (1) -> (2).
- A user presses a key, the PM resets the user inactive timer. (2) -> (2)
- The user puts the phone back in her pocket. The inactive timer triggers
and the phone switches to state (2) -> (3)
- The system is idle and times out, system goes to sleep (3) -> (4)
- Time to check the signal strength (4) -> (3)
- Strength checked, back to sleep (3) -> (4)
- Battery low!!! shutdown (4) -> (5)
etc....

You get the idea right?

The trick is mapping your system states and the events that change them
before going anywhere near the code.

Hope this helps,
Geoff
==

--
Geoff Smith
eMVP
http://www.BSQUARE.com
==

"Diadia" <jhchang@csie.nctu.edu.tw> wrote in message
news:bu2vq8$1m0p$1@netnews2.csie.nctu.edu.tw...
> Hi guys,
> I'm studying Power Manager now,and want to make sure that I don't get
> confused with it.
> So I try to explain what I know and hope someone could make a comment if
there
> is anything wrong.
>
>
============================================================================
==
> There are 5 level in device power status,D0~D4,Power Manager will switch
> device power status according to the system status.
>
> SetPowerRequirement tell PM minimum power level of specific device could
be.
> That means if we tell PM set backlight power requirement to D2,then PM
will
> switch power status of backlight from D0 to D1 and then stop at D2.
> If we set backlight power requirement to D0,backlight will stay at D0 ,and
> that's how media player preserve backlight on while playing .
>
> SetDevicePower just ask PM to change power state of given device
immediately.
> But it is used by some system applications.
>
> If we want to change power state of a device ,we can use DevicePowerNotify
> to inform PM.
>
============================================================================
==
>
> That's my understanding about Power Manager,if there is anything
wrong,please
> tell me and I'll appreciate your kindness.
>
> Thanks very much .
>
> Regards.
>
> Will
>



Re: about Power Manager by Diadia

Diadia
Thu Jan 15 00:07:43 CST 2004

Geoff Smith <smith.geoffrey@fixme.comcast.net> wrote:

Hi Geoff,
Thanks for your reply,I got it ,and it helps a lot.

There is one more thing I want to make sure,
SetPowerRequirement API can set Min power consumption level for a device,
that means the device can still switch to higher power level when system
power state changes,and never go lower untill we call ReleasePowerRequirement.

Is that ture??

Thanks for help,
Regards.

Will


Re: about Power Manager by Steve

Steve
Fri Jan 16 17:30:11 CST 2004

SetPowerRequirement isn't generally for the device as a whole (e.g. the
phone in Geoff's example) but for a specific driver (the display backlight
for instance) applications use that to make sure that the system can do its
state transitions for everything else but the driver for the backlight or
whatever keeps the power state at the specified level until the application
code releases it. Once released the power manager can tell the driver to go
to the power state specified for the current system state.

--
Steve Maillet (eMVP)
Entelechy Consulting
smaillet_AT_EntelechyConsulting_DOT_com