Re: Safely SHUTDOWN Device from Application
- From: "Chris Tacke, eMVP" <ctacke.at.opennetcf.dot.com>
- Date: Fri, 19 Sep 2008 12:26:35 -0500
That's going to be very device-specific. The handler for device suspend
needs to be modified to send out the notification. An example of how this
could be done is the way Eurotech does it (not sdaying it's the best way,
just *a* way). You can set a registry option to have the power button
interrupt just set a system event. It's then up to the app to take whatever
actions it needs and then call the API to actually suspend.
The problem in your case is the arbitrary desire for "any" app to be
notified and given time. How will they be notified (an even is simple
enough)? More important is how will the OS/kernel know when all of those
apps are "done" and are in a safe state? Would they send an event back?
How would the OS know who all should reply back? What if the app is hung
and not responding? There are a *lot* of variables to this - and I can't
see any general solution.
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
"Neo" <prideray@xxxxxxxxx> wrote in message
news:af5092a1-16f1-4c93-b4d8-54ee83b65cb0@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Sep 18, 7:48 pm, "Chris Tacke, eMVP" <ctacke.at.opennetcf.dot.com>
wrote:
Well the first thing you have to define is "shut down". What does that
mean
in your context? CE devices don't generally have a shut down state, but
rather a suspend state. In that case sending a VK_POWEROFF usually is all
you need (no clue if the emulator supports this though - IIRC Bruce Eitman
blogged about doing this recently). If you mean "shut all power off" then
that's going to be device dependent and the OEM would be the only one who
could tell you how. If you mean a hard reset then a call to
KernelIoControl
is a common way to achieve it, but again the device must have support for
it.
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded communityhttp://community.OpenNETCF.com
"Neo" <pride...@xxxxxxxxx> wrote in message
news:132d7334-f76b-4d71-b9bd-054b3cb82efd@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi!
I am working with WinCE 5.0 and x86 Emulator. I wish to write an
application to safely shutdown the device. After a few searches I
could note that I need to use IOCTLs (if I'm not wrong!) and there
are existing implementations of Suspend, Reboot but nothing for safely
shutting down the device.I have identified some of the functions that
might be useful like:
void OEMPowerOff(void)
void OALCPUPowerOff(void)
IOCTL_POWER_SET
IOCTL_POWER_GET
IOCTL_REGISTER_POWER_RELATIONSHIP
KernelIOControl()
I wish to know what all things I need to know, apart from these and
how do I put all these things together!
Regards,
-- Neo
By 'Safe Shutdown', I meant that any application writing/reading to/
from the Flash should be notified about the system going down for a
shut down (instead of aborting it) so that the application gets a fair
chance for it's graceful exit and then a regular shutdown (power off)
of the platform should be carried. I think, second part of the issue
(shutting down the platform) might be specific to the Device but, I
think we should be able to perform the 1st step (notifying all the
applications interacting with the Flash resulting in their graceful
exit). How can we achieve this? Please guide me on this.
Thanks,
Neo
.
- Follow-Ups:
- References:
- Safely SHUTDOWN Device from Application
- From: Neo
- Re: Safely SHUTDOWN Device from Application
- From: Chris Tacke, eMVP
- Re: Safely SHUTDOWN Device from Application
- From: Neo
- Safely SHUTDOWN Device from Application
- Prev by Date: WindowsCE 6.0 + OTG support
- Next by Date: Re: ce6.0 register active problem!
- Previous by thread: Re: Safely SHUTDOWN Device from Application
- Next by thread: Re: Safely SHUTDOWN Device from Application
- Index(es):
Loading