Sodaq/sodaq-one-ttnmapper/Sodaq_UBlox_GPS.cpp
/*!
 * Read the coordinates using $GPGGA
 * See also section 24.3 of u-blox 7, Receiver Description. Document number: GPS.G7-SW-12001-B
 *
 * See section "Decode of selected position sentences" at
 *   http://www.gpsinformation.org/dale/nmea.htm
 * The most important NMEA sentences include the GGA which provides the
 * current Fix data, the RMC which provides the minimum gps sentences
 * information, and the GSA which provides the Satellite status data.
 *
 * 0    $GPGGA
 * 1    time            hhmmss.ss       UTC time
 * 2    lat             ddmm.mmmmm      Latitude (degrees & minutes)
 * 3    NS              char            North/South indicator
 * 4    long            dddmm.mmmmm     Longitude (degrees & minutes)
 * 5    EW              char            East/West indicator
 * 6    quality         digit           Quality indicator for position fix: 0 No Fix, 6 Estimated, 1 Auto GNSS, 2 Diff GNSS
 * 7    numSV           num             Number of satellites used
 * 8    HDOP            num             Horizontal Dilution of Precision
 * 9    alt             num             Altitude above mean sea level
 * 10   uAlt            char            Altitude units: meters
 * 11   sep             num             Geoid separation: difference between geoid and mean sea level
 * 12   uSep            char            Separation units: meters
 * 13   diffAge         num             Age of differential corrections
 * 14   diffStation     num             ID of station providing differential corrections
 * 15   checksum        2 hex digits
 */
Read the coordinates using $GPGGA
See also section 24.3 of u-blox 7, Receiver Description.



0    $GPGGA
1    time            hhmmss.ss       UTC time
2    lat             ddmm.mmmmm      Latitude (degrees & minutes)
3    NS              char            North/South indicator
4    long            dddmm.mmmmm     Longitude (degrees & minutes)
5    EW              char            East/West indicator
6    quality         digit           Quality indicator for position fix: 0 No Fix, 6 Estimated, 1 Auto GNSS, 2 Diff GNSS
7    numSV           num             Number of satellites used
8    HDOP            num             Horizontal Dilution of Precision
9    alt             num             Altitude above mean sea level
10   uAlt            char            Altitude units: meters
11   sep             num             Geoid separation: difference between geoid and mean sea level
12   uSep            char            Separation units: meters
13   diffAge         num             Age of differential corrections
14   diffStation     num             ID of station providing differential corrections
15   checksum        2 hex digits
Read the coordinates using $GPGGA See also section 24 . 3 of u - blox 7 Receiver Description . 0 $GPGGA 1 time hhmmss . ss UTC time 2 lat ddmm . mmmmm Latitude ( degrees & minutes ) 3 NS char North / South indicator 4 long dddmm . mmmmm Longitude ( degrees & minutes ) 5 EW char East / West indicator 6 quality digit Quality indicator for position fix : 0 No Fix 6 Estimated 1 Auto GNSS 2 Diff GNSS 7 numSV num Number of satellites used 8 HDOP num Horizontal Dilution of Precision 9 alt num Altitude above mean sea level 10 uAlt char Altitude units : meters 11 sep num Geoid separation : difference between geoid and mean sea level 12 uSep char Separation units : meters 13 diffAge num Age of differential corrections 14 diffStation num ID of station providing differential corrections 15 checksum 2 hex digits
bool Sodaq_UBlox_GPS::parseGPGGA(const String & line)
{
    debugPrintLn("parseGPGGA");
    debugPrintLn(String(">> ") + line);
    if (getField(line, 6) != "0") {
        _lat = convertDegMinToDecDeg(getField(line, 2));
        if (getField(line, 3) == "S") {
            _lat = -_lat;
        }
        _lon = convertDegMinToDecDeg(getField(line, 4));
        if (getField(line, 5) == "W") {
            _lon = -_lon;
        }
        _seenLatLon = true;
        _hdop = getField(line, 8).toFloat();
        if(getField(line, 10) == "M") {
          _alt = getField(line, 9).toFloat();
          _seenAlt = true;
        }
    }
    _numSatellites = getField(line, 7).toInt();
    return true;
}
bool Sodaq_UBlox_GPS :: parseGPGGA ( const String & line ) { debugPrintLn ( " " ) ; debugPrintLn ( String ( " " ) + line ) ; if ( getField ( line , 6 ) != " " ) { _lat = convertDegMinToDecDeg ( getField ( line , 2 ) ) ; if ( getField ( line , 3 ) == " " ) { _lat = - _lat ; } _lon = convertDegMinToDecDeg ( getField ( line , 4 ) ) ; if ( getField ( line , 5 ) == " " ) { _lon = - _lon ; } _seenLatLon = true ; _hdop = getField ( line , 8 ) . toFloat ( ) ; if ( getField ( line , 10 ) == " " ) { _alt = getField ( line , 9 ) . toFloat ( ) ; _seenAlt = true ; } } _numSatellites = getField ( line , 7 ) . toInt ( ) ; return true ; }
Read the coordinates using $GPGGA
 See also section 24.3 of u-blox 7, Receiver Description.
Read the coordinates using $GPGGA See also section 24 . 3 of u - blox 7 Receiver Description .