G
Graham McKechnie
Hi All,
I'm developing a GPS app and I'm having problems when the device Auto powers
off. Up until that point it works well. When I switch the device on again
I'm getting an Exception (I'm throwing it ) when I call ReadFile. I then
have to reboot the device and it then works again until it auto powers off
again. Of course if its in the cradle it works all day because it never
powers down.
My first thoughts were to trap the activated and deactive events - this is
where I open/close the port and start/stop the reading of the GPS data. This
appears to work well enough when swapping between programs. When I come back
to my app after bringing another to the foreground, it just continues
reading away as normal. But it doesn't work when the device powers off. I
don't even know if those events get called when the device powers off as I
have no way of debugging it ( I can't get my 5450 to auto power off when its
in the cradle, even though I have that option checked )
I'm presuming they don't and therefore the port is left stuck open or
whatever when the device powers down. It shouldn't be though, because
ReadFile wouldn't be called unless the port is open, so its probably
something else I'm overlooking.
For the moment I'm getting around the problem by preventing the auto power
down with constant calls to SystemIdleTimerReset as per the SDK example.
This is essential for when I'm collecting GPS data for I don't want it to
power down when I'm in the middle of mapping a hole on a golf course.
However that is not what I want for the end user when he comes to use my
program. For the end user I do want the device to automatically power down
during his round of golf as I doubt the battery would last 5 hours
continuous running, especially with the GPS CF card also draining the power.
But obviously I want the program to resume from where it was when the device
was shut down or auto pwered off. The GPS only needs a couple of secs to
start transmitting again on a warm start.
Anyone have any ideas?
Graham
I'm developing a GPS app and I'm having problems when the device Auto powers
off. Up until that point it works well. When I switch the device on again
I'm getting an Exception (I'm throwing it ) when I call ReadFile. I then
have to reboot the device and it then works again until it auto powers off
again. Of course if its in the cradle it works all day because it never
powers down.
My first thoughts were to trap the activated and deactive events - this is
where I open/close the port and start/stop the reading of the GPS data. This
appears to work well enough when swapping between programs. When I come back
to my app after bringing another to the foreground, it just continues
reading away as normal. But it doesn't work when the device powers off. I
don't even know if those events get called when the device powers off as I
have no way of debugging it ( I can't get my 5450 to auto power off when its
in the cradle, even though I have that option checked )
I'm presuming they don't and therefore the port is left stuck open or
whatever when the device powers down. It shouldn't be though, because
ReadFile wouldn't be called unless the port is open, so its probably
something else I'm overlooking.
For the moment I'm getting around the problem by preventing the auto power
down with constant calls to SystemIdleTimerReset as per the SDK example.
This is essential for when I'm collecting GPS data for I don't want it to
power down when I'm in the middle of mapping a hole on a golf course.
However that is not what I want for the end user when he comes to use my
program. For the end user I do want the device to automatically power down
during his round of golf as I doubt the battery would last 5 hours
continuous running, especially with the GPS CF card also draining the power.
But obviously I want the program to resume from where it was when the device
was shut down or auto pwered off. The GPS only needs a couple of secs to
start transmitting again on a warm start.
Anyone have any ideas?
Graham