Re: IOKit Kext and Battery/Power State
Re: IOKit Kext and Battery/Power State
- Subject: Re: IOKit Kext and Battery/Power State
- From: Ethan Bold <email@hidden>
- Date: Wed, 26 Mar 2008 11:38:41 -0700
Hi Duane-
1) Join the power management plane with PMinit()/registerPowerDriver()/
joinPMtree()
1a) implement setPowerState to handle power states
2) Implement virtual method IOService::setAggressiveness
in setAggressiveness:
- check for type kPMPowerSource
Compare against these values:
enum {
kIOPMInternalPower = 1,
kIOPMExternalPower
};
You can poll the power source with a call to getAggressiveness(). You
must be initialized with PM to call getAggressiveness.
-Ethan
On Mar 25, 2008, at 11:09 AM, Duane Murphy wrote:
I am working on an IOKit kext that would like to know the status of
the
power adapter. That is specifically if the computer is running on
battery power or if it is plugged in. The kext has the potential for
running down the battery rapidly so we'd like to throttle the
processing
if the computer is running on battery.
I've noticed a few things in the pwr_mgt folder but the
documentation is
little thin on which functions to use and how it all goes together.
How does a kext get notified (or poll) the state of the power system
as
it changes from battery to charger or charger to battery.
Thanks,
...Duane
--
"I have not failed. I've just found 10,000 ways that won't work."
Thomas A. Edison
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden