• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Correct use of IOPMAssertionCreateWithName(...)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Correct use of IOPMAssertionCreateWithName(...)


  • Subject: Correct use of IOPMAssertionCreateWithName(...)
  • From: James Bucanek <email@hidden>
  • Date: Mon, 8 Mar 2010 22:39:06 -0700

Greetings,

I'm not sure that Darwin-Dev is the right place to post this, but since this is essentially an IOKit question, it's the closest I could find to the topic.

I'm upgrading my app and would like to use IOPMAssertionCreate()/IOPMAssertionCreateWithName() to prohibit the computer from going to sleep while performing a backup. However, the documentation seems a little vague, which has left me wondering exactly how these functions should be used.

Do I:

(a) Call IOPMAssertionCreateWithName() when starting an action that should not be interrupted by sleep mode and then call IOPMAssertionRelease() when that's over.

Or (b) do I call IOPMAssertionCreateWithName() with kIOPMAssertionLevelOn when the action starts, immediately call IOPMAssertionRelease() to release the assertion_id, and then later call IOPMAssertionCreateWithName() with kIOPMAssertionLevelOff when the task is complete.

Or (c) ?

I guess my question is really "what sequence of calls establish and rescind the sleep mode prohibition?" I skimmed the IOKit documentation and didn't find anything illuminating. I couldn't find any example code that employed these calls.

TIA,

James
--
James Bucanek

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Correct use of IOPMAssertionCreateWithName(...)
      • From: Jean-Daniel Dupas <email@hidden>
  • Prev by Date: How to link against an older dylib in a framework?
  • Next by Date: Re: Correct use of IOPMAssertionCreateWithName(...)
  • Previous by thread: How to link against an older dylib in a framework?
  • Next by thread: Re: Correct use of IOPMAssertionCreateWithName(...)
  • Index(es):
    • Date
    • Thread