[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
Are We Fixed Yet
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
Are We Fixed Yet
Are We Fixed Yet?
The $GPRMC sentence includes a value which indicates whether or not a “fix” has been obtained. A fix is possible when the signal strength of at least three satellites is strong enough to be involved in calculating your location. If at least four satellites are involved, altitude also becomes known. The third word of the $GPRMC sentence is one of two letters: “A” for “active,” where a fix is obtained, or “V” for “invalid” where no fix is present.
'*******************************************************
'** Extracting satellite fix status
'*******************************************************
Public Class NmeaInterpreter
' Raised when the current location has changed
Public Event FixObtained()
Public Event FixLost()
' Divides a sentence into individual words
Public Function GetWords(ByVal sentence As String) As String()
Return sentence.Split(","c)
End Function
' Interprets a $GPRMC message
Public Function ParseGPRMC(ByVal sentence As String) As Boolean
' Divide the sentence into words
Dim Words() As String = GetWords(sentence)
' Does the device currently have a satellite fix?
If Words(2) <> "" Then
Select Case Words(2)
Case "A"
RaiseEvent FixObtained()
Case "V"
RaiseEvent FixLost()
End Select
End If
' Indicate that the sentence was recognized
Return True
End Function
End Class
Written By Jon Person (http://www.gpsdotnet.com)
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
