why can't stop GPS

yuhong

Member
Licensed User
Longtime User
In the GPS GPSStatus event, I stop GPS, But,GPSStatus is constantly being triggered.

B4X:
Sub GPS_LocationChanged (Location1 As Location)

   lastKnownLocation = Location1
   isGPSFix=True

End Sub

Sub GPS_GpsStatus (Satellites As List)
   Log("进入GPSStatus事件...")

   If isGPSFix=True Then
      WriteLogDB("OK")
      StopGPS
   Else
      'location timeout 
      If (DateTime.Now-startTimeMillis>1000*60) Then
         WriteLogDB("Time out!")
         StopGPS
      End If
   End If
End Sub

Sub StopGPS
   isGPSFix=False
   gps1.Stop
End Sub

with log file!:BangHead:
 

Attachments

  • gpslog.zip
    31.5 KB · Views: 219
Last edited:

yuhong

Member
Licensed User
Longtime User
Are you sure that StopGPS executes? Add a log message in Sub StopGPS.

I sure StopGPS Executes! look gpslog.txt. at 176 record, Generate a log record per second.in fact,A log record for each fifth of the clock generator is correct.
 
Upvote 0

yuhong

Member
Licensed User
Longtime User
This is what I see in record 176:
176 176 460036431403219 0 0 2011-12-09 06:16:55.000 2011-12-09 06:17:56.000 定位超时

176:record no
460036431403219:IMSI
0,0:Longitude,Latitude
2011-12-09 06:16:55.000:Service start time,program begin get GPS position.
2011-12-09 06:17:56.000:End service time.
定位超时:time out

From this record, the system becomes once per second to take the location information. this is error!
 
Upvote 0
Top