[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
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)


last edited (December 21, 2004) by jperson, Number of views: 3727, Current Rev: 5 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.