Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Reactivate the CF GPS after switching on


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-16-2007, 12:55 AM
Knows the basics
 
Join Date: Jun 2007
Location: Netherlands (Arnhem)
Posts: 71
Default Reactivate the CF GPS after switching on

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:

Code:
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
Code:
Serial.PortOpen = true
(I created a Wakeup GPS button), but I want to do this automatically.

Is there a way to do this?

Scub
__________________
PPC: IPAQ 2210, 2GB, CF GPS, CF Wireless
Reply With Quote
  #2 (permalink)  
Old 10-16-2007, 08:27 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

You could use a timer to check that data is coming from the GPS.
If no data arrives after 5 seconds close the port and open it again.
Reply With Quote
  #3 (permalink)  
Old 10-16-2007, 08:52 PM
Knows the basics
 
Join Date: Jun 2007
Location: Netherlands (Arnhem)
Posts: 71
Default

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
__________________
PPC: IPAQ 2210, 2GB, CF GPS, CF Wireless
Reply With Quote
  #4 (permalink)  
Old 10-17-2007, 09:27 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

You should only check the GPS values inside the GPSDecoded event.
If the GPS stops sending data, the last values will continue to show.
Reply With Quote
  #5 (permalink)  
Old 10-25-2007, 01:52 AM
Knows the basics
 
Join Date: Jun 2007
Location: Netherlands (Arnhem)
Posts: 71
Default

Erel,

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

Code:
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
__________________
PPC: IPAQ 2210, 2GB, CF GPS, CF Wireless
Reply With Quote
  #6 (permalink)  
Old 10-25-2007, 07:24 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

Are you reading the data with a timer?
Maybe the 512 bytes were still not read when you've turned off the device?
Reply With Quote
  #7 (permalink)  
Old 10-25-2007, 08:00 PM
Knows the basics
 
Join Date: Jun 2007
Location: Netherlands (Arnhem)
Posts: 71
Default

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!
__________________
PPC: IPAQ 2210, 2GB, CF GPS, CF Wireless
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fast user switching LineCutter Questions & Help Needed 0 10-27-2008 11:37 PM
PPC is hanging after switching GPS on/off BerndB Questions & Help Needed 8 05-24-2008 03:39 PM
out-of-memory-error based on timer after switching to V6 Frank Questions & Help Needed 2 01-17-2008 04:26 PM


All times are GMT. The time now is 06:26 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0