marcel Active Member Licensed User Longtime User Mar 11, 2013 #1 Hi, I am looking for a way to check if the GPS is fixed. Code: Sub GPS1_NMEA (timestamp As Long, Sentence As String) If Sentence.StartsWith("$GPGSA") Then If Sentence.CharAt(9)=3 Then gpsFix=True Else gpsFix=False End If End If End Sub I tried this using the NMEA syntax. But this seems not working all the time... Is this incorrect or are their better ways to do this?
Hi, I am looking for a way to check if the GPS is fixed. Code: Sub GPS1_NMEA (timestamp As Long, Sentence As String) If Sentence.StartsWith("$GPGSA") Then If Sentence.CharAt(9)=3 Then gpsFix=True Else gpsFix=False End If End If End Sub I tried this using the NMEA syntax. But this seems not working all the time... Is this incorrect or are their better ways to do this?
derez Expert Licensed User Longtime User Mar 11, 2013 #2 How about this: Code: Sub GPS_LocationChanged (Location1 As Location) If Location1.AccuracyValid Then GPSFix = true else GPSFix = false Upvote 0
How about this: Code: Sub GPS_LocationChanged (Location1 As Location) If Location1.AccuracyValid Then GPSFix = true else GPSFix = false
Erel B4X founder Staff member Licensed User Longtime User Mar 11, 2013 #3 It will be simpler to handle the LocationChanged event. If it was raised then there was a fixed location. Upvote 0
It will be simpler to handle the LocationChanged event. If it was raised then there was a fixed location.
marcel Active Member Licensed User Longtime User Mar 11, 2013 #4 Erel said: It will be simpler to handle the LocationChanged event. If it was raised then there was a fixed location. Click to expand... Ok. Thanks! Upvote 0
Erel said: It will be simpler to handle the LocationChanged event. If it was raised then there was a fixed location. Click to expand... Ok. Thanks!
D Dario126 Member Licensed User Longtime User Jan 21, 2014 #5 LocationChanged method is easier, nut what about when device have GPS fix and loose it (like in tunnel)? Then LocationChanged event is not raised? How do I know that there is no more GPS signal? Implementing some timeout variable since last fix might be some solution, but not like it too much. What if I have GPS setup not to fire up on interval, but on distance since last move then LocationChanged event will not be trigered while user is in same place. He could be there for days, but it thus not mean that there is no signal .. Last edited: Jan 21, 2014 Upvote 0
LocationChanged method is easier, nut what about when device have GPS fix and loose it (like in tunnel)? Then LocationChanged event is not raised? How do I know that there is no more GPS signal? Implementing some timeout variable since last fix might be some solution, but not like it too much. What if I have GPS setup not to fire up on interval, but on distance since last move then LocationChanged event will not be trigered while user is in same place. He could be there for days, but it thus not mean that there is no signal ..
Erel B4X founder Staff member Licensed User Longtime User Jan 22, 2014 #6 You can handle the GpsStatus event it fires in short intervals. You can find the current status based on the number of satellites and status of satellites. Upvote 0
You can handle the GpsStatus event it fires in short intervals. You can find the current status based on the number of satellites and status of satellites.
D Dario126 Member Licensed User Longtime User Jan 22, 2014 #7 To optimize my code execution I had only GPS events when GPS position moved for 100 m. So I should add another GPS object with some fixed time interval to get access for regular check of status inside locationchanged event? Will this be additional battery consumer (significant)? Upvote 0
To optimize my code execution I had only GPS events when GPS position moved for 100 m. So I should add another GPS object with some fixed time interval to get access for regular check of status inside locationchanged event? Will this be additional battery consumer (significant)?
Erel B4X founder Staff member Licensed User Longtime User Jan 22, 2014 #8 Will this be additional battery consumer (significant)? Click to expand... No. It is the GPS hardware itself that consumes the battery, not the listeners. Upvote 0
Will this be additional battery consumer (significant)? Click to expand... No. It is the GPS hardware itself that consumes the battery, not the listeners.