site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Hi Duane- -Ethan On Mar 25, 2008, at 11:09 AM, Duane Murphy wrote: 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 (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/ebold%40apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... 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. 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. This email sent to ebold@apple.com This email sent to site_archiver@lists.apple.com