Reactivate the CF GPS after switching on

Scubaticus

Active Member
Licensed User
After I loaded my app, the GPS is actived and data is coming in.
Now I leave the program open and switch my Ipaq off.

When switching the Ipaq on again, with the app in memory, the CF GPS card is not activated.

I tried to switch it back on by a timer event which does:

B4X:
If Serial.PortOpen <> true Then Serial.PortOpen = true
But after switching the device on, the Serial.PortOpen returns true, but the CF GPS is not.

The only way to get the CF card back online is by issuing a
B4X:
Serial.PortOpen = true
(I created a Wakeup GPS button), but I want to do this automatically.

Is there a way to do this?

Scub
 

Scubaticus

Active Member
Licensed User
But isn't it strage the GPS library status returns "A" when the CF card is not sending any data after switching the device on again?

Scub
 

Scubaticus

Active Member
Licensed User
Erel,

To figure out if data is coming from serial after switching on the PPC with the application loaded in memory I use

B4X:
If Serial.InBufferCount=0 Then WakeUpGPS_Click(false)
After I switch off my PCC, the GPS CF light goes off (not initialized). After switching it on again, the GPS light stays off. The Serial.InBufferCount report 512 bytes over and over again, but how is that possible even when the GPS is still off.

I only got it activated again after disposing serial, gps & converter and adding these objects again but as you will understand this is not wanted automatically.

To me it looks like the serial object has a strange behaviour after switching power off and on again.

Do you have any hints or clues?

Scub
 

Scubaticus

Active Member
Licensed User
The Sub which disposed and created the new objects was starting with disableing the timers responseble for readed the serial. This was needed to prevent reading bytes from a disposed serial.

So when switching the device off there was a big chance it was between disabling and enabling the timers, causing not read the serial ......

Now I do an extra check: If there are bytes in the buffer AND if the timers are diabled, run the re-init GPS again.

Now it works the way I had in mind.

Thanks Erel!
 
Top