Sodaq/sodaq-one-ttnmapper/Sodaq_UBlox_GPS.cpp
/*!
 * Read the coordinates using $GPRMC
 * See also section 24.13 of u-blox 7, Receiver Description. Document number: GPS.G7-SW-12001-B
 *
 * 0    $GPRMC
 * 1    time            hhmmss.ss       UTC time
 * 2    status          char            Status, V = Navigation receiver warning, A = Data valid
 * 3    lat             ddmm.mmmmm      Latitude (degrees & minutes)
 * 4    NS              char            North/South
 * 5    long            dddmm.mmmmm     Longitude (degrees & minutes)
 * 6    EW              char            East/West
 * 7    spd             num             Speed over ground
 * 8    cog             num             Course over ground
 * 9    date            ddmmyy          Date in day, month, year format
 * 10   mv              num             Magnetic variation value
 * 11   mvEW            char            Magnetic variation E/W indicator
 * 12   posMode         char            Mode Indicator: 'N' No Fix, 'E' Estimate, 'A' Auto GNSS, 'D' Diff GNSS
 * 13   checksum        2 hex digits    Checksum
 */
Read the coordinates using $GPRMC
See also section 24.13 of u-blox 7, Receiver Description.


Read the coordinates using $GPRMC See also section 24 . 13 of u - blox 7 Receiver Description .
bool Sodaq_UBlox_GPS::parseGPRMC(const String & line)
{
    debugPrintLn("parseGPRMC");
    debugPrintLn(String(">> ") + line);
    if (getField(line, 2) == "A" && getField(line, 12) != "N") {
        _lat = convertDegMinToDecDeg(getField(line, 3));
        if (getField(line, 4) == "S") {
            _lat = -_lat;
        }
        _lon = convertDegMinToDecDeg(getField(line, 5));
        if (getField(line, 6) == "W") {
            _lon = -_lon;
        }
        _seenLatLon = true;
    }
    String time = getField(line, 1);
    String date = getField(line, 9);
    setDateTime(date, time);
    return true;
}
bool Sodaq_UBlox_GPS :: parseGPRMC ( const String & line ) { debugPrintLn ( " " ) ; debugPrintLn ( String ( " " ) + line ) ; if ( getField ( line , 2 ) == " " && getField ( line , 12 ) != " " ) { _lat = convertDegMinToDecDeg ( getField ( line , 3 ) ) ; if ( getField ( line , 4 ) == " " ) { _lat = - _lat ; } _lon = convertDegMinToDecDeg ( getField ( line , 5 ) ) ; if ( getField ( line , 6 ) == " " ) { _lon = - _lon ; } _seenLatLon = true ; } String time = getField ( line , 1 ) ; String date = getField ( line , 9 ) ; setDateTime ( date , time ) ; return true ; }
Read the coordinates using $GPRMC
 See also section 24.13 of u-blox 7, Receiver Description.
Read the coordinates using $GPRMC See also section 24 . 13 of u - blox 7 Receiver Description .