Contents

SetPowerState

Updates the service in response to power-related changes for a provider.

Declaration

virtual kern_return_t SetPowerState(uint32_t powerFlags);

Parameters

  • powerFlags:

    The new power state for the service’s provider object. Configure your driver appropriately for the new state. For a list of possible values, see 3325571 Service_power_capabilities.

Return Value

kIOReturnSuccess on success, or another value if an error occurs. For a list of error codes, see Error Codes.

Discussion

DriverKit calls this method to notify your service when the power state of its provider changes. Implement this method in your service object and use it to put your driver in a safe state for the new power setting. Call super as the last step in your implementation.

See Also

Responding to Power-Level Changes