Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Reactivate the CF GPS after switching on

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-15-2007, 11:55 PM
Senior Member
 
Join Date: Jun 2007
Location: Netherlands (Arnhem)
Posts: 107
Awards Showcase
Beta Tester 
Total Awards: 1
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
Mobile: Samsung Omnia I900 (WM6.1)
Reply With Quote
  #2 (permalink)  
Old 10-16-2007, 07:27 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,726
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
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, 07:52 PM
Senior Member
 
Join Date: Jun 2007
Location: Netherlands (Arnhem)
Posts: 107
Awards Showcase
Beta Tester 
Total Awards: 1
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
Mobile: Samsung Omnia I900 (WM6.1)
Reply With Quote
  #4 (permalink)  
Old 10-17-2007, 08:27 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,726
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
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, 12:52 AM
Senior Member
 
Join Date: Jun 2007
Location: Netherlands (Arnhem)
Posts: 107
Awards Showcase
Beta Tester 
Total Awards: 1
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
Mobile: Samsung Omnia I900 (WM6.1)
Reply With Quote
  #6 (permalink)  
Old 10-25-2007, 06:24 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,726
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
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, 07:00 PM
Senior Member
 
Join Date: Jun 2007
Location: Netherlands (Arnhem)
Posts: 107
Awards Showcase
Beta Tester 
Total Awards: 1
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
Mobile: Samsung Omnia I900 (WM6.1)
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 Off
Pingbacks are Off
Refbacks are On

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


All times are GMT. The time now is 05:32 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0