How I can detect when my PDA is going to the waking state ?

G

Guest

Hi,

I have a problem with my gprs connection on a PDA HHP.
When the pda go to the waking state I lost the gprs connection and after I
need to restart my application to retreive the gprs connection.

I'd like to know whether somebody knows how I can detect the waking state ?
If I can detect it, I can stop cleanly the gprs connection.

Or do you have a solution for me ?

Thanks

Best Regards
 
G

Guest

This article shows how you can detect the power states of the handheld,
beware thought that things you do as a result of a power off signal don't
necessarily take place until after the power has come back on (a really
really annoying occurrance for what I wanted to do with it since I had to do
my work BEFORE the power went out).

http://blogs.msdn.com/anthonywong/archive/2005/06/07/426392.aspx

It does detect power states fine though.

Robert Brown
 
G

Graham McKechnie

Robert,

I'm working with a PowerNotifcations class based on Anthony's example. Can I
ask were you successful in doing any useful before the power went off? If so
what sort of stuff did you achieve.

Graham
 
G

Guest

You'll have no success. When the device starts going down, the Power
Manager puts the notification into the queue. If your app is waiting on it,
it's possible (not even definite) that your waiting app may unblock on the
event, but it's highly unlikely you'd get to execute more than 1 or 2 lines
of code before the processor went to sleep.

Only a driver can hold up the sleep process, and when they are at that
point, they can't call any APIs anyway. It's simply an opportunity for them
to power down peripherals, save register staes, etc.

-Chris
 
G

Guest

Yep that's about what I found, once in a while it would run my code (which
was a power down notification to the wifi card to prevent the 20 second start
time when you turn the handheld on), but most of the time it just powered off
before it got the chance to run the code.

(very frustrating because it seemed to be working the first couple of tests,
but when it got into the wild, it didn't work and there's nothing more
frustrating than hitting the power button and having nothing happen for 20
sec, when you're used to instant on and you're trying to sell tickets)

Robert Brown
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top