Re: Service to handle power down
- From: "Chris Tacke, eMVP" <ctacke.at.opennetcf.dot.com>
- Date: Thu, 25 Jun 2009 20:04:41 -0500
Not going to happen. You can get a notification of the power state change,
but in reality your code likely won't get a chance to run until after power
comes back up. If it does run, you'd probably only get about 2 lines of
code, if that, and it would't be reliable in the number of instructions to
execute before suspending. Only drivers get serialized "notifications"
during power up or down (via XXX_PowerDown/Up) and they can't make API calls
during those methods anyway, so you can't call another driver to shut down.
The only options are to use some handler hooked into the power control
driver (if the OEM implemented anything for it) or to have the actual bug
fixed.
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
"Craig" <Craig@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3856CE7F-7E96-4ABC-B218-2753FBFC05B5@xxxxxxxxxxxxxxxx
Hello Bruce,
I didn't want to get into it too much because I didn't think it was
necessary, but since you asked ...
My service is a special debug service that, among other things, outputs
special app level debug messages over COM2. The vendor for our BSP
appears
to have a bug which will (very rarely) cause the system to crash (or
freeze)
when resuming from suspend. My service keeps the COM2 port open during
sleep
and we feel that if it is closed during sleep we won't see this issue (we
saw
another issue with RAS server over COM1). So changing state for me means -
closing the COM2 port on a suspend and re-opening it on resume.
Thank you for your feedback,
Craig
"Bruce Eitman [eMVP]" wrote:
Why don't you explain more why this service needs to "change state" and
what
that really means.
--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman
EuroTech Inc.
www.EuroTech.com
"Craig" <Craig@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4F28DFAF-9574-4167-A682-212F5E748AB1@xxxxxxxxxxxxxxxx
Hello,
I have written a service in WinCE 5.0. I now need this service to
change
its state when the system is suspended and when it resumes.
I have read that the xxx_PowerDown and xxx_PowerUp messages are not
handled
in a service (running in services.exe).
Is there a way that I can get messages that the system is about to
power
down within my service? Can a service respond to the IOCTL_POWER_SET
messages?
Thank you for any assistance you can provide,
Craig
.
- References:
- Service to handle power down
- From: Craig
- Re: Service to handle power down
- From: Bruce Eitman [eMVP]
- Re: Service to handle power down
- From: Craig
- Service to handle power down
- Prev by Date: Re: Service to handle power down
- Next by Date: Re: Service to handle power down
- Previous by thread: Re: Service to handle power down
- Next by thread: Re: Service to handle power down
- Index(es):
Relevant Pages
|