Re: IOPMScheduleEvent...
Re: IOPMScheduleEvent...
- Subject: Re: IOPMScheduleEvent...
- From: Ethan Bold <email@hidden>
- Date: Thu, 18 Mar 2004 12:35:56 -0800
Yep, you're using this correctly, but one limitation of this API is
that it won't accept wakeup times less than 90 seconds from "right
now." Try doing now+90 seconds, and you should see it work. We may
relax this cutoff in the future...
-ethan
On Mar 18, 2004, at 5:51 AM, Jerry LeVan wrote:
Hello,
This is a bit off-topic but I can't locate any info on using the
IOPMSccheduleEvent call.
I basically want to try to wake a sleeping mac a bit before cron is
supposed to fire.
Here is a program that does *not* work.
********************************************************************
#import <Foundation/Foundation.h>
#import <IOKit/pwr_mgt/IOPMLib.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int res;
NSDate *now = [NSDate date];
NSDate *plus30Sec = [NSDate dateWithTimeIntervalSinceNow:30];
NSLog(@"\nnow: %@ \nlater: %@", now, plus30Sec);
res = IOPMSchedulePowerEvent ((CFDateRef)plus30Sec,NULL,
CFSTR(kIOPMAutoWake));
NSLog(@"res=%x",res);
[pool release];
return 0;
}
*******************************************************************
Here is the output
2004-03-18 08:48:22.828 DateStuff[2507]
now: <CFDate 0x300da0 [0xa01900e0]>{time = 101310503}
later: <CFDate 0x302ef0 [0xa01900e0]>{time = 101310533}
2004-03-18 08:48:22.829 DateStuff[2507] res=e00002d8
DateStuff has exited with status 0.
The error code is "not ready" ( Program was run as root ).
The error code is the same for all choices of the operation.
Is the IOPMScheduleEvent usable from outside the kernel?
Thanks for any insight...
Jerry
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.