pub unsafe extern "C-unwind" fn IOPMDeclareNetworkClientActivity(
assertion_name: Option<&CFString>,
assertion_id: *mut IOPMAssertionID,
) -> IOReturnpwr_mgt only.Expand description
A convenience function for handling remote network clients; this is a wrapper for
holding
kIOPMAssertNetworkClientActiveCall this whenever you detect activity from your remote network clients. This call generates an IPC call, and may block.
On the first invocation, this will populate parameter
AssertionID
with a new assertion ID.
You should pass in this returned assertion ID on every access.
When system is on AC power, every call to
IOPMDeclareNetworkClientActivity
prevents system from idle sleeping and from demand sleeping for the duration of
system sleep timer. When system is on Battery power, every call to
IOPMDeclareNetworkClientActivity
prevents system from idle sleeping for the
duration of system sleep timer.
Assertion created by this interface is valid only for the duration of system sleep timer
from the last call. IOKit will disable
AssertionID
after that duration.
If you detect that your remote client is no longer active, please immediately call
IOPMAssertionReleaseIf your process can detect when remote clients are active and idle, you can skip
this API and directly create
kIOPMAssertNetworkClientActiveIf your remote clients require access to the framebuffer or the GPU, then this
isn’t the appropriate call for you. Please see
IOPMAssertionDeclareUserActivity
kIOPMUserActiveRemote
.
Parameter AssertionName: A string that describes the name of the caller and the activity being
handled by this assertion (e.g. “Serving a podcast”). The name must be less than
128 characters.
*
Parameter AssertionID: On Success, unique id will be returned in this parameter. Caller
may call this function again with the unique id retured previously to report additional
user activity. The unique id returned by this function may change on each call depending
on how frequently this function call is repeated and the current system sleep timer value.
If you make this call more than once, track the returned value for
assertionID, and pass it in as an argument on each call.
Returns: Returns kIOReturnSuccess on success, any other return indicates PM could not successfully activate the specified assertion.
§Safety
assertion_namemight not allowNone.assertion_idmust be a valid pointer.