IOPMLib.h

Includes:
<CoreFoundation/CFArray.h>
<IOKit/IOKitLib.h>
<IOKit/pwr_mgt/IOPMLibDefs.h>
<IOKit/pwr_mgt/IOPMKeys.h>
<Availability.h>

Overview

IOPMLib provides access to common power management facilites, like initiating system sleep, getting current idle timer values, registering for sleep/wake notifications, and preventing system sleep.



Groups

Assertions

Group members:

IOPMAssertionCreate

Dynamically requests a system behavior from the power management system.

IOPMAssertionCreateWithName

Dynamically requests a system behavior from the power management system.

IOPMAssertionRelease

Releases the behavior requested in IOPMAssertionCreate

IOPMCopyAssertionsByProcess

Returns a dictionary mapping processes to the assertions they are holding active.

IOPMCopyAssertionsStatus

Returns a list of available assertions and their system-wide level.

 

ScheduledEvents

Group members:

IOPMCancelScheduledPowerEvent

Cancel a previously scheduled power event.

IOPMCopyScheduledPowerEvents

List all scheduled system power events

IOPMSchedulePowerEvent

Schedule the machine to wake from sleep, power on, go to sleep, or shutdown.

 

Notifications

Group members:

IOAllowPowerChange

The caller acknowledges notification of a power state change on a device it has registered for notifications for via IORegisterForSystemPower or IORegisterApp.

IOCancelPowerChange

The caller denies an idle system sleep power state change.

IODeregisterApp

Disconnects the caller from an IOService after receiving power state change notifications from the IOService. (Caller must also release IORegisterApp's return io_connect_t and returned IONotificationPortRef for complete clean-up).

IODeregisterForSystemPower

Disconnects the caller from the Root Power Domain IOService after receiving system power state change notifications. (Caller must also destroy the IONotificationPortRef returned from IORegisterForSystemPower.)

IORegisterApp

Connects the caller to an IOService for the purpose of receiving power state change notifications for the device controlled by the IOService.

IORegisterForSystemPower

Connects the caller to the Root Power Domain IOService for the purpose of receiving sleep & wake notifications for the system. Does not provide system shutdown and restart notifications.

 

IOSystemLoadAdvisory

Group members:

IOCopySystemLoadAdvisoryDetailed

Indicates how user activity, battery level, and thermal level each contribute to the overall "SystemLoadAdvisory" level. In the future, this combined level may represent new levels as well.

IOGetSystemLoadAdvisory

Returns a hint about whether now would be a good time to perform time-insensitive work.


Functions

IOAllowPowerChange

The caller acknowledges notification of a power state change on a device it has registered for notifications for via IORegisterForSystemPower or IORegisterApp.

IOCancelPowerChange

The caller denies an idle system sleep power state change.

IOCopySystemLoadAdvisoryDetailed

Indicates how user activity, battery level, and thermal level each contribute to the overall "SystemLoadAdvisory" level. In the future, this combined level may represent new levels as well.

IODeregisterApp

Disconnects the caller from an IOService after receiving power state change notifications from the IOService. (Caller must also release IORegisterApp's return io_connect_t and returned IONotificationPortRef for complete clean-up).

IODeregisterForSystemPower

Disconnects the caller from the Root Power Domain IOService after receiving system power state change notifications. (Caller must also destroy the IONotificationPortRef returned from IORegisterForSystemPower.)

IOGetSystemLoadAdvisory

Returns a hint about whether now would be a good time to perform time-insensitive work.

IOPMAssertionCreate

Dynamically requests a system behavior from the power management system.

IOPMAssertionCreateWithName

Dynamically requests a system behavior from the power management system.

IOPMAssertionRelease

Releases the behavior requested in IOPMAssertionCreate

IOPMCancelScheduledPowerEvent

Cancel a previously scheduled power event.

IOPMCopyAssertionsByProcess

Returns a dictionary mapping processes to the assertions they are holding active.

IOPMCopyAssertionsStatus

Returns a list of available assertions and their system-wide level.

IOPMCopyBatteryInfo

Request raw battery data from the system.

IOPMCopyScheduledPowerEvents

List all scheduled system power events

IOPMFindPowerManagement

Finds the Root Power Domain IOService.

IOPMGetAggressiveness

Retrieves the current value of one of the aggressiveness factors in IOKit Power Management.

IOPMSchedulePowerEvent

Schedule the machine to wake from sleep, power on, go to sleep, or shutdown.

IOPMSetAggressiveness

Sets one of the aggressiveness factors in IOKit Power Management.

IOPMSleepEnabled

Tells whether the system supports full sleep, or just doze

IOPMSleepSystem

Request that the system initiate sleep.

IORegisterApp

Connects the caller to an IOService for the purpose of receiving power state change notifications for the device controlled by the IOService.

IORegisterForSystemPower

Connects the caller to the Root Power Domain IOService for the purpose of receiving sleep & wake notifications for the system. Does not provide system shutdown and restart notifications.


IOAllowPowerChange


The caller acknowledges notification of a power state change on a device it has registered for notifications for via IORegisterForSystemPower or IORegisterApp.

IOReturn IOAllowPowerChange (
    io_connect_t kernelPort,
    long notificationID ) ;  
Parameters
kernelPort

Port used to communicate to the kernel, from IORegisterApp or IORegisterForSystemPower.

notificationID

A copy of the notification ID which came as part of the power state change notification being acknowledged.

Return Value

Returns kIOReturnSuccess or an error condition if request failed.

Discussion

Must be used when handling kIOMessageCanSystemSleep and kIOMessageSystemWillSleep messages from IOPMrootDomain system power. The caller should not call IOAllowPowerChange in response to any messages except for these two.

Availability
Introduced in Mac OS X v10.0.

IOCancelPowerChange


The caller denies an idle system sleep power state change.

IOReturn IOCancelPowerChange (
    io_connect_t kernelPort,
    long notificationID ) ;  
Parameters
kernelPort

Port used to communicate to the kernel, from IORegisterApp or IORegisterForSystemPower.

notificationID

A copy of the notification ID which came as part of the power state change notification being acknowledged.

Return Value

Returns kIOReturnSuccess or an error condition if request failed.

Discussion

Should only called in response to kIOMessageCanSystemSleep messages from IOPMrootDomain. IOCancelPowerChange has no meaning for responding to kIOMessageSystemWillSleep (which is non-abortable) or any other messages.

When an app responds to a kIOMessageCanSystemSleep message by calling IOCancelPowerChange, the app vetos the idle sleep request. The system will stay awake. The idle timer will elapse again after a period of inactivity, and the system will send out the same kIOMessageCanSystemSleep message, and interested applications will respond gain.

Availability
Introduced in Mac OS X v10.0.

IOCopySystemLoadAdvisoryDetailed


Indicates how user activity, battery level, and thermal level each contribute to the overall "SystemLoadAdvisory" level. In the future, this combined level may represent new levels as well.

Return Value

Returns a CFDictionaryRef, or NULL on error. Caller must release the returned dictionary.

Discussion

See dictionary keys defined above.


IODeregisterApp


Disconnects the caller from an IOService after receiving power state change notifications from the IOService. (Caller must also release IORegisterApp's return io_connect_t and returned IONotificationPortRef for complete clean-up).

IOReturn IODeregisterApp (
    io_object_t *notifier );  
Parameters
notifier

An object from IORegisterApp.

Return Value

Returns kIOReturnSuccess or an error condition if request failed.

Availability
Introduced in Mac OS X v10.0.

IODeregisterForSystemPower


Disconnects the caller from the Root Power Domain IOService after receiving system power state change notifications. (Caller must also destroy the IONotificationPortRef returned from IORegisterForSystemPower.)

IOReturn IODeregisterForSystemPower (
    io_object_t *notifier ) ;  
Parameters
notifier

The object returned from IORegisterForSystemPower.

Return Value

Returns kIOReturnSuccess or an error condition if request failed.

Availability
Introduced in Mac OS X v10.0.

IOGetSystemLoadAdvisory


Returns a hint about whether now would be a good time to perform time-insensitive work.

Return Value

IOSystemLoadAdvisoryLevel - one of: kIOSystemLoadAdvisoryLevelGreat - A Good time to perform time-insensitive work. kIOSystemLoadAdvisoryLevelOK - An OK time to perform time-insensitive work. kIOSystemLoadAdvisoryLevelBad - A Bad time to perform time-insensitive work.

Discussion

Based on user and system load, IOGetSystemLoadAdvisory determines "better" and "worse" times to run optional or time-insensitive CPU or disk work.

Applications may use this result to avoid degrading the user experience. If it is a "Bad" or "OK" time to perform work, applications should slow down and perform work less aggressively.

There is no guarantee that the system will ever be in "Great" condition to perform work - all essential work must still be performed even in "Bad", or "OK" times. Completely optional work, such as updating caches, may be postponed indefinitely.

Note: You may more efficiently read the SystemLoadAdvisory level using notify_get_state() instead of IOGetSystemLoadAdvisory. The results are identical. notify_get_state() requires that you pass the token argument received by registering for SystemLoadAdvisory notifications.


IOPMAssertionCreate


Dynamically requests a system behavior from the power management system.

IOReturn IOPMAssertionCreate(
    CFStringRef AssertionType, 
    IOPMAssertionLevel AssertionLevel, 
    IOPMAssertionID *AssertionID)  ;  
Parameters
AssertionType

The CFString assertion type to request from the PM system.

AssertionLevel

Pass kIOPMAssertionLevelOn or kIOPMAssertionLevelOff.

AssertionID

On success, a unique id will be returned in this parameter.

Return Value

Returns kIOReturnSuccess on success, any other return indicates PM could not successfully activate the specified assertion.

Discussion

IOPMAssertionCreate is deprecated in favor of IOPMAssertionCreateWithName. Please use the named portion of this API instead for greater accountability. No special privileges necessary to make this call - any process may activate a power assertion.

Availability
Introduced in Mac OS X v10.5, but later deprecated in Mac OS X v10.6. Introduced in iPhone OS v2.0, but later deprecated in iPhone OS v2.1.

IOPMAssertionCreateWithName


Dynamically requests a system behavior from the power management system.

IOReturn IOPMAssertionCreateWithName( 
    CFStringRef AssertionType, 
    IOPMAssertionLevel AssertionLevel, 
    CFStringRef AssertionName, 
    IOPMAssertionID *AssertionID) ;  
Parameters
AssertionType

The CFString assertion type to request from the PM system.

AssertionLevel

Pass kIOPMAssertionLevelOn or kIOPMAssertionLevelOff.

AssertionName

A string that describes the name of the caller and the activity being handled by this assertion (e.g. "Mail Compacting Mailboxes"). Name may be no longer than 128 characters.

AssertionID

On success, a unique id will be returned in this parameter.

Return Value

Returns kIOReturnSuccess on success, any other return indicates PM could not successfully activate the specified assertion.

Discussion

No special privileges necessary to make this call - any process may activate a power assertion. Caller must specify an AssertionName - NULL is not a valid input.

Availability
Introduced in Mac OS X v10.6.

IOPMAssertionRelease


Releases the behavior requested in IOPMAssertionCreate

IOReturn IOPMAssertionRelease(
    IOPMAssertionID AssertionID) ;  
Parameters
AssertionID

The assertion_id, returned from IOPMAssertionCreate, to cancel.

Return Value

Returns kIOReturnSuccess on success

Discussion

All calls to IOPMAssertionCreate must be paired with calls to IOPMAssertionRelease.

Availability
Introduced in Mac OS X v10.5.

IOPMCancelScheduledPowerEvent


Cancel a previously scheduled power event.

IOReturn IOPMCancelScheduledPowerEvent(
    CFDateRef time_to_wake,
    CFStringRef my_id,
    CFStringRef type);  
Parameters
time_to_wake

Cancel entry with this date and time.

my_id

Cancel entry with this name.

type

Type to cancel

Return Value

kIOReturnSuccess on success, otherwise on failure

Discussion

Arguments mirror those to IOPMSchedulePowerEvent. All arguments must match the original arguments from when the power on was scheduled. Must be called as root.


IOPMCopyAssertionsByProcess


Returns a dictionary mapping processes to the assertions they are holding active.

IOReturn IOPMCopyAssertionsByProcess(
    CFDictionaryRef *AssertionsByPID) ;  
Parameters
AssertionsByPID

On success, this returns a dictionary of assertions per process. At the top level, keys to the CFDictionary are pids stored as CFNumbers (kCFNumberIntType). The value associated with each CFNumber pid is a CFArray of active assertions. Each entry in the CFArray is an assertion represented as a CFDictionary. See the keys kIOPMAssertionTypeKey and kIOPMAssertionLevelKey. Caller must CFRelease() this dictionary when done.

Return Value

Returns kIOReturnSuccess on success.

Discussion

Notes: One process may have multiple assertions. Several processes may have asserted the same assertion to different levels.

Availability
Introduced in Mac OS X v10.5.

IOPMCopyAssertionsStatus


Returns a list of available assertions and their system-wide level.

IOReturn IOPMCopyAssertionsStatus(
    CFDictionaryRef *AssertionsStatus) ;  
Parameters
AssertionsStatus

On success, this returns a CFDictionary of all assertions currently available. The keys in the dictionary are the assertion types, and the value of each is a CFNumber that represents the aggregate level for that assertion. Caller must CFRelease() this dictionary when done.

Return Value

Returns kIOReturnSuccess on success.

Discussion

Notes: One process may have multiple assertions. Several processes may have asserted the same assertion to different levels. The system-wide level is the maximum of these assertions' levels.

Availability
Introduced in Mac OS X v10.5.

IOPMCopyBatteryInfo


Request raw battery data from the system.

IOReturn IOPMCopyBatteryInfo(
    mach_port_t masterPort,
    CFArrayRef *info ) ;  
Parameters
masterPort

The master port obtained from IOMasterPort(). Just pass MACH_PORT_NULL.

info

A CFArray of CFDictionaries containing raw battery data.

Return Value

Returns kIOReturnSuccess or an error condition if request failed.

Discussion

WARNING! IOPMCoyBatteryInfo is unsupported on ALL Intel CPU based systems. For PPC CPU based systems, it remains not recommended. For almost all purposes, developers should use the richer IOPowerSources API (with change notifications) instead of using IOPMCopyBatteryInfo. Keys to decipher IOPMCopyBatteryInfo's return CFArray exist in IOPM.h.

Availability
Introduced in Mac OS X v10.0.

IOPMCopyScheduledPowerEvents


List all scheduled system power events

Return Value

A CFArray of CFDictionaries of power events. The CFArray must be released by the caller. NULL if there are no scheduled events.

Discussion

Returns a CFArray of CFDictionaries of power events. Each CFDictionary contains keys for CFSTR(kIOPMPowerEventTimeKey), CFSTR(kIOPMPowerEventAppNameKey), and CFSTR(kIOPMPowerEventTypeKey).


IOPMFindPowerManagement


Finds the Root Power Domain IOService.

io_connect_t IOPMFindPowerManagement(
    mach_port_t master_device_port ) ;  
Parameters
master_device_port

Just pass in MACH_PORT_NULL for master device port.

Return Value

Returns a io_connect_t handle on the root domain. Must be released with IOServiceClose() when done.

Availability
Introduced in Mac OS X v10.0.

IOPMGetAggressiveness


Retrieves the current value of one of the aggressiveness factors in IOKit Power Management.

IOReturn IOPMGetAggressiveness (
    io_connect_t fb,
    unsigned long type,
    unsigned long *aggressiveness ) ;  
Parameters
fb

Representation of the Root Power Domain from IOPMFindPowerManagement.

type

Specifies which aggressiveness factor is being retrieved.

aggressiveness

Points to where to store the retrieved value of the aggressiveness factor.

Return Value

Returns kIOReturnSuccess or an error condition if request failed.

Availability
Introduced in Mac OS X v10.0.

IOPMSchedulePowerEvent


Schedule the machine to wake from sleep, power on, go to sleep, or shutdown.

IOReturn IOPMSchedulePowerEvent(
    CFDateRef time_to_wake,
    CFStringRef my_id,
    CFStringRef type);  
Parameters
time_to_wake

Date and time that the system will power on/off.

my_id

A CFStringRef identifying the calling app by CFBundleIdentifier. May be NULL.

type

The type of power on you desire, either wake from sleep or power on. Choose from: CFSTR(kIOPMAutoWake) == wake machine, CFSTR(kIOPMAutoPowerOn) == power on machine, CFSTR(kIOPMAutoWakeOrPowerOn) == wake or power on, CFSTR(kIOPMAutoSleep) == sleep machine, CFSTR(kIOPMAutoShutdown) == power off machine, CFSTR(kIOPMAutoRestart) == restart the machine.

Return Value

kIOReturnSuccess on success, otherwise on failure

Discussion

This event will be added to the system's queue of power events and stored persistently on disk. The sleep and shutdown events present a graphical warning and allow a console user to cancel the event. Must be called as root.


IOPMSetAggressiveness


Sets one of the aggressiveness factors in IOKit Power Management.

IOReturn IOPMSetAggressiveness (
    io_connect_t fb,
    unsigned long type,
    unsigned long aggressiveness ) ;  
Parameters
fb

Representation of the Root Power Domain from IOPMFindPowerManagement.

type

Specifies which aggressiveness factor is being set.

aggressiveness

New value of the aggressiveness factor.

Return Value

Returns kIOReturnSuccess or an error condition if request failed.

Availability
Introduced in Mac OS X v10.0.

IOPMSleepEnabled


Tells whether the system supports full sleep, or just doze

boolean_t IOPMSleepEnabled (
    void );  
Return Value

Returns true if the system supports sleep, false if some hardware prevents full sleep.

Availability
Introduced in Mac OS X v10.0.

IOPMSleepSystem


Request that the system initiate sleep.

IOReturn IOPMSleepSystem (
    io_connect_t fb );  
Parameters
fb

Port used to communicate to the kernel, from IOPMFindPowerManagement.

Return Value

Returns kIOReturnSuccess or an error condition if request failed.

Discussion

For security purposes, caller must be root or the console user.

Availability
Introduced in Mac OS X v10.0.

IORegisterApp


Connects the caller to an IOService for the purpose of receiving power state change notifications for the device controlled by the IOService.

io_connect_t IORegisterApp(
    void *refcon, 
    io_service_t theDriver, 
    IONotificationPortRef *thePortRef, 
    IOServiceInterestCallback callback, 
    io_object_t *notifier ) ;  
Parameters
refcon

Data returned on power state change notifications and not used by the kernel.

theDriver

Representation of the IOService, probably from IOServiceGetMatchingService.

thePortRef

Pointer to a port on which the caller will receive power state change notifications. The port is allocated by the calling application.

callback

A c-function which is called during the notification.

notifier

Pointer to a notifier which caller must keep and pass to subsequent call to IODeregisterApp.

Return Value

Returns a io_connect_t session for the IOService or MACH_PORT_NULL if request failed. Caller must close return value via IOServiceClose() after calling IODeregisterApp on the notifier argument.

Discussion

IORegisterApp requires that the IOService of interest implement an IOUserClient. In addition, that IOUserClient must implement the allowPowerChange and cancelPowerChange methods defined in IOPMLibDefs.h. If you're interested in receiving power state notifications from a device without an IOUserClient, try using IOServiceAddInterestNotification with interest type gIOGeneralInterest instead.

Availability
Introduced in Mac OS X v10.0.

IORegisterForSystemPower


Connects the caller to the Root Power Domain IOService for the purpose of receiving sleep & wake notifications for the system. Does not provide system shutdown and restart notifications.

io_connect_t IORegisterForSystemPower (
    void *refcon, 
    IONotificationPortRef *thePortRef, 
    IOServiceInterestCallback callback, 
    io_object_t *notifier ) ;  
Parameters
refcon

Caller may provide data to receive s an argument to 'callback' on power state changes.

thePortRef

On return, thePortRef is a pointer to a port on which the caller will receive power state change notifications. The port is allocated by this function and must be later released by the caller (after IODeregisterForSystemPower).

callback

A c-function which is called during the notification.

notifier

On success, returns a pointer to a unique notifier which caller must keep and pass to a subsequent call to IODeregisterForSystemPower.

Return Value

Returns a io_connect_t session for the IOPMrootDomain or MACH_PORT_NULL if request failed. Caller must close return value via IOServiceClose() after calling IODeregisterForSystemPower on the notifier argument.

Discussion

Provides sleep/wake notifications to applications. Requires that applications acknowledge some, but not all notifications. Register for sleep/wake notifications will deliver these messages over the sleep/wake lifecycle:

- kIOMessageSystemWillSleep is delivered at the point the system is initiating a non-abortable sleep. Callers MUST acknowledge this event by calling IOAllowPowerChange. If a caller does not acknowledge the sleep notification, the sleep will continue anyway after a 30 second timeout (resulting in bad user experience). Delivered before any hardware is powered off. - kIOMessageSystemWillPowerOn is delivered at early wakeup time, before most hardware has been powered on. Be aware that any attempts to access disk, network, the display, etc. may result in errors or blocking your process until those resources become avaiable. Caller must NOT acknowledge kIOMessageSystemWillPowerOn; the caller must simply return from its handler. - kIOMessageSystemHasPoweredOn is delivered at wakeup completion time, after all device drivers and hardware have handled the wakeup event. Expect this event 1-5 or more seconds after initiating system awkeup. Caller must NOT acknowledge kIOMessageSystemHasPoweredOn; the caller must simply return from its handler. - kIOMessageCanSystemSleep indicates the system is pondering an idle sleep, but gives apps the chance to veto that sleep attempt. Caller must acknowledge kIOMessageCanSystemSleep by calling IOAllowPowerChange or IOCancelPowerChange. Calling IOAllowPowerChange will not veto the sleep; any app that calls IOCancelPowerChange will veto the idle sleep. A kIOMessageCanSystemSleep notification will be followed up to 30 seconds later by a kIOMessageSystemWillSleep message. or a kIOMessageSystemWillNotPowerOn message. - kIOMessageSystemWillNotPowerOn is delivered when some app client has vetoed an idle sleep request. kIOMessageSystemWillNotPowerOn may follow a kIOMessageCanSystemSleep notification, but will not otherwise be sent. Caller must NOT acknowledge kIOMessageSystemWiillNotPowerOn; the caller must simply return from its handler.

To deregister for sleep/wake notifications, the caller must make two calls, in this order: - Call IODeregisterForSystemPower with the 'notifier' argument returned here. - Then call IONotificationPortDestroy passing the 'thePortRef' argument returned here.

Availability
Introduced in Mac OS X v10.0.

Typedefs

IOPMAssertionID

Type for AssertionID arguments to IOPMAssertionCreate and IOPMAssertionRelease

IOPMAssertionLevel

Type for AssertionLevel argument to IOPMAssertionCreate

IOSystemLoadAdvisoryLevel

Return type for IOGetSystemLoadAdvisory


IOPMAssertionID


Type for AssertionID arguments to IOPMAssertionCreate and IOPMAssertionRelease

typedef uint32_t IOPMAssertionID;  


IOPMAssertionLevel


Type for AssertionLevel argument to IOPMAssertionCreate

typedef uint32_t IOPMAssertionLevel;  


IOSystemLoadAdvisoryLevel


Return type for IOGetSystemLoadAdvisory

typedef int IOSystemLoadAdvisoryLevel;  
Discussion

Value is one of kIOSystemLoadAdvisoryLevelGreat, kIOSystemLoadAdvisoryLevelOK, or kIOSystemLoadAdvisoryLevelBad.

Enumerated Types

Assertion

Level for an enabled assertion, passed as an argument to IOPMAssertionCreate

kIOPMNullAssertionID

This value represents a non-initialized assertion ID


Assertion


Level for an enabled assertion, passed as an argument to IOPMAssertionCreate

enum {  
    kIOPMAssertionLevelOff = 0,   
    kIOPMAssertionLevelOn = 255 
};  
Constants
Discussion

Levels


kIOPMNullAssertionID


This value represents a non-initialized assertion ID

enum { 
    kIOPMNullAssertionID = 0 
};  

Macro Definitions

kIOPMAssertionLevelKey

The CFDictionary key for assertion level in dictionaries returned by IOPMCopyAssertionsByProcess.

kIOPMAssertionNameKey

The CFDictionary key for assertion name in dictionaries returned by IOPMCopyAssertionsByProcess.

kIOPMAssertionTypeKey

The CFDictionary key for assertion type in dictionaries returned by IOPMCopyAssertionsByProcess.

kIOPMAssertionTypeNoDisplaySleep

Use as AssertionType argument to IOPMAssertionCreate. The display will not sleep when enabled (consequently the system will not sleep).

kIOPMAssertionTypeNoIdleSleep

Use as AssertionType argument to IOPMAssertionCreate. The system will not sleep when enabled (display may sleep).

kIOSystemLoadAdvisoryBatteryLevelKey

Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed

kIOSystemLoadAdvisoryCombinedLevelKey

Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed

kIOSystemLoadAdvisoryNotifyName

The notifcation by this name fires when system "SystemLoadAdvisory" status changes.

kIOSystemLoadAdvisoryThermalLevelKey

Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed

kIOSystemLoadAdvisoryUserLevelKey

Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed


kIOPMAssertionLevelKey


The CFDictionary key for assertion level in dictionaries returned by IOPMCopyAssertionsByProcess.

#define kIOPMAssertionLevelKey CFSTR("AssertLevel") 


kIOPMAssertionNameKey


The CFDictionary key for assertion name in dictionaries returned by IOPMCopyAssertionsByProcess.

#define kIOPMAssertionNameKey CFSTR("AssertName") 
Discussion

Name is specified by the assertion creator, and reflects the calling process and the activity being handled by the assertion.


kIOPMAssertionTypeKey


The CFDictionary key for assertion type in dictionaries returned by IOPMCopyAssertionsByProcess.

#define kIOPMAssertionTypeKey CFSTR("AssertType") 


kIOPMAssertionTypeNoDisplaySleep


Use as AssertionType argument to IOPMAssertionCreate. The display will not sleep when enabled (consequently the system will not sleep).

#define kIOPMAssertionTypeNoDisplaySleep CFSTR("NoDisplaySleepAssertion") 


kIOPMAssertionTypeNoIdleSleep


Use as AssertionType argument to IOPMAssertionCreate. The system will not sleep when enabled (display may sleep).

#define kIOPMAssertionTypeNoIdleSleep CFSTR("NoIdleSleepAssertion") 


kIOSystemLoadAdvisoryBatteryLevelKey


Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed

Discussion

Indicates battery constraints on the current SystemLoadAdvisory level.


kIOSystemLoadAdvisoryCombinedLevelKey


Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed

#define kIOSystemLoadAdvisoryCombinedLevelKey CFSTR("CombinedLevel") 
Discussion

Provides a combined level based on UserLevel, BatteryLevel, and ThermalLevels; the combined level is the minimum of these levels. In the future, this combined level may represent new levels as well. The combined level is identical to the value returned by IOGetSystemLoadAdvisory().


kIOSystemLoadAdvisoryNotifyName


The notifcation by this name fires when system "SystemLoadAdvisory" status changes.

#define kIOSystemLoadAdvisoryNotifyName "com.apple.system.powermanagement.SystemLoadAdvisory" 
Discussion

Pass this string as an argument to register via notify(3). You can query SystemLoadAdvisory state via notify_get_state() when this notification fires - this is more efficient than calling IOGetSystemLoadAdvisory(), and returns an identical combined SystemLoadAdvisory value.


kIOSystemLoadAdvisoryThermalLevelKey


Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed

Discussion

Indicates thermal constraints on the current SystemLoadAdvisory level.


kIOSystemLoadAdvisoryUserLevelKey


Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed

Discussion

Indicates user activity constraints on the current SystemLoadAdvisory level.

 

Did this document help you? Yes It's good, but... Not helpful...

 

Last Updated: 2009-10-15