I use the function "IOPMSchedulePowerEvent" to schedule Sleep or Wake-Events and registered my daemon with "IORegisterForSystemPower" to receive power-state-changes. Everything works fine!
When system going sleep and later waking up at scheduled time, my daemon do some work, and after it system should going sleep again.
Now my questions:
How can i detect, if the system was awaked by user or by the scheduled time?
How can i detect, if a user currently working with the system, so the daemon have not to put it in sleep-mode???
Thanks Nobik