Function

IOPMAssertionSetProperty

Sets a property in the assertion.

Declaration

IOReturn IOPMAssertionSetProperty(IOPMAssertionID theAssertion, CFStringRef theProperty, CFTypeRef theValue);

Parameters

theAssertion

The IOPMAssertionID of the assertion to modify.

theProperty

The CFString key, from IOPMAssertionDictionaryKeys to modify.

theValue

The property to set. It must be a CFNumber or CFString, as specified by the property key named in whichProperty.

Return Value

Returns kIOReturnNotPriviliged if the caller doesn't have permission to modify this assertion. Returns kIOReturnNotFound if PM can't locate this assertion. Returns kIOReturnError upon an unidentified error. Returns kIOReturnSuccess otherwise.

Discussion

Only the process that created an assertion may change its properties.

See Also

Assertions

IOPMAssertionCopyProperties

Copies details about an IOPMAssertion

IOPMAssertionCreate

Dynamically requests a system behavior from the power management system.

Deprecated
IOPMAssertionCreateWithName

Dynamically requests a system behavior from the power management system.

IOPMAssertionCreateWithProperties

Creates an IOPMAssertion with more flexibility than IOPMAssertionCreateWithDescription.

IOPMAssertionDeclareUserActivity

Declares that the user is active on the system. This causes the display to power on and postpone display sleep up to the user's display sleep Energy Saver settings. If you prefer to hold the display awake for a longer period and you know how long you'd like to hold it, consider taking assertion kIOPMAssertionTypePreventUserIdleDisplaySleep using IOPMAssertionCreateWithDescription API instead.

IOPMAssertionRelease

Decrements the assertion's retain count.

IOPMAssertionRetain

Increments the assertion's retain count.

IOPMCopyAssertionsByProcess

Returns a dictionary listing all assertions, grouped by their owning process.

IOPMCopyAssertionsStatus

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software