GNSS

Description

Decodes NMEA frames received from an external GNSS receiver

This library can be used to handle received GNSS data based on NMEA format received from any external GNSS receiver module that is connected to one of the UART/RS232 peripheral interfaces. Decoding of frames with Sentence ID "GGA", "GLL", "GSA", "GSV", "RMC" and "VTG" is supported, providing information about longitude, latitude, speed, course and many other GNSS data tokens. In addition, checksum calculation is implemented as well as predefined structures and debugging functions.

OVERVIEW

gnss_Abstract:
This library can be used to handle received GNSS data based on NMEA format received from any external GNSS receiver module that is connected to one of the UART or RS232 peripheral interfaces. Decoding of frames with Sentence ID "GGA", "GLL", "GSA", "GSV", "RMC" and "VTG" is supported, providing information about longitude, latitude, speed, course and many other GNSS data tokens. In addition, checksum calculation is implemented as well as predefined structures and debugging functions.

Interfaces:
rapidM2M M2xx
  • 1x UART
  • rapidM2M EASY IoT/V3
  • 1x RS232
  • rapidM2M NRF91
  • 1x UART
  • gnss_How_to_use:
    const { PORT = 0, // The first UART/RS232 interface should be used. INTERVAL_RECORD = 10, // Interval of record [s] } static iRecTimer= INTERVAL_RECORD; // Sec. until the next recording /* 1 sec. timer is used for the general program sequence */ #callback MainTimer() { // Issues RMC data via the watch panel (optional) GNSS_PrintData(GNSS_DEBUG_MODE_WATCH,GNSS_DEBUG_PRINT_RMC); // Counting down the sec. until the next read out iRecTimer--; //If there are only 5 seconds left until the data should be read -> // Initialise the UART/RS232 interface for communication with a GNSS module if(iRecTimer == 5)GNSS_Init(PORT); if(iRecTimer <= 0) // When the counter has expired -> { new aRMC[TGNSS_RMC]; // Last received RMC sentence if(OK == GNSS_GetRMC(aRMC)) // If new RMC data are available -> { //Use RMC data stored in aRMC } GNSS_Close(); // Close UART/RS232 interface // Note: In order to save energy, all unnecessary interfaces should always be closed. // If possible, the voltage supply of the GNSS module should also be switched // off here. Note, however, that the GNSS module may take longer to determine // the postion after switching on again. // Resets counter variable to current record interval iRecTimer = INTERVAL_RECORD; } } main() { /* Static byte array that should be used as a buffer to output debug information via the console or watch panel. This size can also be reduced. It depends on how much debug information you want to output */ static aConsole_Buffer[8192]; /* Provides the firmware with a buffer from the RAM area reserved for the device logic that is used to output debug information via the console or watch panel */ setbuf( aConsole_Buffer, 4 * sizeof (aConsole_Buffer)); setInterval(MainTimer, 1000); // Init of a cyclic sec. timer }
    gnss_Config:
    To select the frames which should be processed by the gnss-microtronics library, add the following macro to the main.dde file.
    If the macro is not defined all frames are processed.
    /** * Use this macro to select the frames which should be processed: * * 0: Received NMEA frame is ignored * 1: Received NMEA frame is processed */ #define GNSS_SELECT_GGA 1 // Global positioning system fix data #define GNSS_SELECT_GLL 1 // Geographic Position - Latitude/Longitude #define GNSS_SELECT_GSA 1 // GNSS DOP and Active Satellites #define GNSS_SELECT_GSV 1 // GNSS Satellites in View #define GNSS_SELECT_RMC 1 // Recommended minimum sentence C #define GNSS_SELECT_VTG 1 // Vector track and speed over the ground

    BASIC

    GNSS_SAT_COUNT -

    Maximum number of satellites for which data can be included in the GSV sentences

    GNSS_GSA_MAX_SAT_CNT -

    Maximum number of satellites for which the PRN number can be included in the GSA sentence

    GNSS_Types:

    Types of global navigation satellite systems

    GNSS_GNSS = 0 - Unspecified global navigation satellite system
    GNSS_GPS - Global Positioning System (GPS)
    GNSS_SBAS - Unspecified Satellite Based Augmentation System
    GNSS_GLONASS - GLONASS is operated and financed by the ministry of defence of the russian federation.
    GNSS_GET_xxx:

    Control flags for the GNSS_Getxxx() functions

    GNSS_GET_CLEAR_AVAILABLE = 0b00000001 - Clears "data available" flag of the internal Buffer for the last received data after the readout
    GNSS_GET_DISABLE_NAN = 0b00000010 - Suppresses the return of NaN values (S32_NAN are replaced by 0, U8_NAN are replaced by '0')
    GNSS_Init(Port = -1, Baudrate = 9600, Mode = GNSS_MODE_8_DATABIT | GNSS_MODE_PARITY_NONE | GNSS_MODE_1_STOPBIT)

    Function to initialise UART/RS232 interface


    This function is used to initialise the UART/RS232 peripheral interface for communication with a GNSS module. The serial interface configuration (9600 baud 8N1 unless otherwise specified) is set and the result is printed to the console in the event of an error.

    Port : s32 - Number of the UART/RS232 interface, starting with 0 for the first UART/RS232 of the device
    Baudrate : s32 - Baudrate to be used
    Mode : s32 - Serial interface configuration (e.g 7/8 Data-bit, Stopbit yes/no, Parity yes/no, etc. use GNSS_MODE_xxx)
    GNSS_Close()

    Function to close the UART/RS232 interface

    TGNSS_GGA:

    Information extracted from a GGA sentence (Global Positioning System Fixed Data). The GGA sentence contains time, position and fix type data.

    If a data field in the GGA sentence is empty, the corresponding element of TGNSS_GGA is set to S32_NAN.
    Available : s32 - Validity of the GGA data
    0 - No valid data available
    1 - Valid data available
    UTC : s32 - Current time in UTC [hhmmss] (e.g. 123519 for 12:35:19 UTC)
    Latitude : s32 - geographical latitude in degrees [ 0.000001°]
    -90000000 - South pole 90° south
    0 - Equator
    +90000000 - North pole 90° north
    Longitude : s32 - geographical longitude in degrees [ 0.000001°]
    -180000000 - 180° west
    0 - Zero meridian (Greenwich)
    +180000000 - 180° east
    PosFixInd : s32 - GPS quality indicator (Position Fix Indicator)
    0 - Fix not available or invalid
    1 - non-differential GPS fix
    2 - differential GPS fix
    3 - Precise positioning service (PPS)
    4 - Real time kinematic (RTK)
    5 - Float real time kinematic
    6 - Estimated fix (dead reckoning, coupled navigation)
    7 - Manual input mode
    8 - Simulation mode
    SatUsed : s32 - Number of satellites used for the positioning
    HPrecision : s32 - Horizontal dilution of precision (HDOP) i.e. relative accuracy of horizontal position [0.01]
    Altitude : s32 - Altitude above/below mean sea level (MSL) [0.1 m]
    GeoSep : s32 - Height (i.e. vertical difference) of mean sea level above WGS-84 earth ellipsoid i.e. geoidal separation [0.1 m]
    DGNSSage : s32 - Time in seconds since differential correction i.e. age of differential GPS data [0.1 s]
    DGNSSID : s32 - Differential reference station ID
    TGNSS_GLL:

    Information extracted from a GLL sentence (Geographic Position - Latitude/Longitude). The GSV sentence contains latitude, longitude, UTC time of position fix and status.

    If a data field in the GLL sentence is empty, the corresponding element of TGNSS_GLL is set to xxx_NAN. The used NAN value depends on the data type of the corresponding element. “Status” and “Mode” will be set to U8_NAN. All other elements will be set to S32_NAN.
    Available : s32 - Validity of the GGA data
    0 - No valid data available
    1 - Valid data available
    Latitude : s32 - geographical latitude in degrees [ 0.000001°]
    -90000000 - South pole 90° south
    0 - Equator
    +90000000 - North pole 90° north
    Longitude : s32 - geographical longitude in degrees [ 0.000001°]
    -180000000 - 180° west
    0 - Zero meridian (Greenwich)
    +180000000 - 180° east
    UTC : s32 - Time in UTC at which the position fix was done [hhmmss] (e.g. 123519 for 12:35:19 UTC)
    Status{1} : chr - Position status
    'A' - Data valid
    'V' - Data invalid
    Mode{1} : chr - Signal Integrity
    'A' - Autonomous mode
    'D' - Differential mode
    'E' - Estimated (dead-reckoning) mode
    'N' - Data Not Valid
    TGNSS_GSA:

    Information extracted from a GSA sentence (GNSS DOP and Active Satellites). The GSA sentence contains GPS receiver operating mode, satellites used in the position solution and DOP values.

    If a data field in the GSA sentence is empty, the corresponding element of TGNSS_GSA is set to xxx_NAN. The used NAN value depends on the data type of the corresponding element. “FixMode” will be set to U8_NAN. All other elements will be set to S32_NAN.
    Available : s32 - Validity of the GGA data
    0 - No valid data available
    1 - Valid data available
    FixMode{1} : chr - Fix Mode
    'A' - 2D Automatic, allowed to automatically switch between 2D/3D
    'M' - Manual, forced to operate in 2D or 3D mode
    FixType : s32 - Fix Type
    1 - Fix not available
    2 - 2D (<4 SVs used)
    3 - 3D (>3 SVs used)
    SvPrnNumber[GNSS_GSA_MAX_SAT_CNT] : s32 - PRN numbers of satellites which have been used for the position fix
    PDOP : s32 - Position (3D) dilution of precision (smaller is better) [0.01]
    HDOP : s32 - Horizontal dilution of precision (smaller is better) i.e. relative accuracy of horizontal position [0.01]
    VDOP : s32 - Vertical dilution of precision (smaller is better) i.e. relative accuracy of vertical position [0.01]
    TGNSS_GSV:

    Information extracted from a GSV sentence (GNSS Satellites in View). The GSV sentence contains the number of GPS satellites in view, satellite ID numbers, elevation, azimuth, and SNR values.

    One GSV sentence only can provide data for up to 4 satellites and thus there may need to be 3 sentences for the full information.
    The GSV sentences can contain more satellites as indicated in the GGA sentence as the GSV sentences also contain satellites that were not used for the position fix.
    If a data field in the GSV sentence is empty, the corresponding element of TGNSS_GSV is set to S32_NAN.
    Available : s32 - Validity of the GGA data
    0 - No valid data available
    1 - Valid data available
    SatInView : s32 - Number of satellites in view i.e. number of satellites for which data are available in the up to 4 GSV sentences
    SvPrnNumber : s32 - Satellite PRN number i.e. satellite ID
    Elevation : s32 - Elevation in degrees (Maximum 90) [°]
    Azimuth : s32 - Azimuth in degrees (True north, 000 to 359) [°]
    Snr : s32 - Signal to Noise Ratio (SNR), higher is better (00-99, null when not tracking) [dB]
    TGNSS_RMC:

    Information extracted from a RMC sentence (Recommended Minimum Specific GNSS Data). The GSV sentence contains time, date, position, course and speed data.

    If a data field in the GGA sentence is empty, the corresponding element of TGNSS_GGA is set to xxx_NAN. The used NAN value depends on the data type of the corresponding element. “Status” and “Mode” will be set to U8_NAN. All other elements will be set to S32_NAN.
    Available : s32 - Validity of the RMC data
    0 - No valid data available
    1 - Valid data available
    UTC : s32 - Time in UTC at which the position fix was done [hhmmss] (e.g. 123519 for 12:35:19 UTC)
    Status{1} : chr - Position status
    'A' - Data valid
    'V' - Data invalid
    Latitude : s32 - geographical latitude in degrees [ 0.000001°]
    -90000000 - South pole 90° south
    0 - Equator
    +90000000 - North pole 90° north
    Longitude : s32 - geographical longitude in degrees [ 0.000001°]
    -180000000 - 180° west
    0 - Zero meridian (Greenwich)
    +180000000 - 180° east
    SpeedOverGround : s32 - Speed over ground in knots [ 0.001 kn]
    CourseOverGround : s32 - Course over ground in degrees related to geographic north (Track Made Good, True course) [ 0.1°]
    UTCdate : s32 - Date [ddmmyy]
    MagVar : s32 - Magnetic variation in degrees (from -180.0° west to +180.0° east ) [ 0.1°]
    >0 - East
    <0 - West
    Mode{1} : chr - Signal Integrity
    'A' - Autonomous mode
    'D' - Differential mode
    'E' - Estimated (dead-reckoning) mode
    'M' - Manual input mode
    'S' - Simulated mode
    'N' - Data Not Valid
    TGNSS_VTG:

    Information extracted from a VTG sentence (Course Over Ground and Ground Speed). The VTG sentence contains course and speed information relative to the ground.

    If a data field in the VTG sentence is empty, the corresponding element of TGNSS_VTG is set to xxx_NAN. The used NAN value depends on the data type of the corresponding element. “Mode” will be set to U8_NAN. All other elements will be set to S32_NAN.
    Available : s32 - Validity of the VTG data
    0 - No valid data available
    1 - Valid data available
    CourseOverGroundTrue : s32 - Course over ground in degrees related to geographic north (Track Made Good, True course) [ 0.1°]
    CourseOverGroundMagnetic : s32 - Course over ground in degrees related to magnetic north (Track Made Good, Magnetic course) [ 0.1°]
    SpeedOverGround_kn : s32 - Speed over ground in knots [ 0.001 kn]
    SpeedOverGround_kph : s32 - Speed over ground in kilometres per hour [ 0.001 km/h]
    Mode{1} : chr - Signal Integrity
    'A' - Autonomous mode
    'D' - Differential mode
    'E' - Estimated (dead-reckoning) mode
    'N' - Data Not Valid
    GNSS_GetGGA(aGNSS_GGA_item[TGNSS_GGA],flags=GNSS_GET_CLEAR_AVAILABLE )

    checks whether valid GGA data is available and returns it using the passed TGNSS_GGA structure

    gaGNSS_GGA_item : TGNSS_GGA - Structure for storing the information extracted from a GGA sentence
    flags : s32 - see GNSS_GET_xxx
    returns : s32
    OK - Valid GGA data available
    ERROR - No valid GGA data available
    GNSS_GetGLL(aGNSS_GLL_item[TGNSS_GLL],flags=GNSS_GET_CLEAR_AVAILABLE )

    checks whether valid GLL data is available and returns it using the passed TGNSS_GLL structure

    gaGNSS_GLL_item : TGNSS_GLL - Structure for storing the information extracted from a GLL sentence
    flags : s32 - see GNSS_GET_xxx
    returns : s32
    OK - Valid GLL data available
    ERROR - No valid GLL data available
    GNSS_GetGSA(aGNSS_GSA_item[TGNSS_GSA],type=GNSS_GPS,flags=GNSS_GET_CLEAR_AVAILABLE )

    checks whether valid GSA data for GPS or GLONASS satellites is available and returns it using the passed TGNSS_GSA structure

    gaGNSS_GSA_item : TGNSS_GSA - Structure for storing the information extracted from a GSA sentence
    type : s32 - Selection of the type of global navigation satellite system for which the GSA data should be read
    GNSS_GPS - Global Positioning System (GPS)
    GNSS_GLONASS - GLONASS
    flags : s32 - see GNSS_GET_xxx
    returns : s32
    OK - Valid GSA data available
    ERROR - No valid GSA data available or invalid type of global navigation satellite system requested
    GNSS_GetGSV(idx,aGNSS_GSV_item[TGNSS_GSV]=0,type=GNSS_GPS,flags=GNSS_GET_CLEAR_AVAILABLE )

    returns the number of satellites (GPS or GLONASS) for which valid GSV data is available (idx < 0) or checks whether valid GSV data for a specific satellite ( GPS or GLONASS ) is available and returns it using the passed TGNSS_GSV structure (idx >= 0)

    idx : s32 - Selection of the information returned by the function
    idx < 0 - Returns the number of satellites for which valid GSV data is available
    idx >= 0 - Number of the satellite for which the GSV data should be read
    gaGNSS_GSV_item : TGNSS_GSV
    idx < 0 - Not required
    idx >= 0 - Structure for storing the information extracted from a GSV sentence
    type : s32 - Selection of the type of global navigation satellite system for which the GSV data for a specific satellite should be read
    GNSS_GPS - Global Positioning System (GPS)
    GNSS_GLONASS - GLONASS
    flags : s32 - see GNSS_GET_xxx
    returns : s32
    idx < 0
  • > 0 - Number of satellites for which valid GSV data is available (max. GNSS_SAT_COUNT - 1)
  • ERROR - No valid GSV data available
  • idx >= 0
  • OK - Valid GSV data available
  • ERROR - No valid GSV data available or invalid type of global navigation satellite system requested
  • ERROR - 1 - idx out of the valid range (e.g. >= GNSS_SAT_COUNT)
  • GNSS_GetRMC(aGNSS_RMC_item[TGNSS_RMC],flags=GNSS_GET_CLEAR_AVAILABLE )

    checks whether valid RMC data is available and returns it using the passed TGNSS_RMC structure

    gaGNSS_RMC_item : TGNSS_RMC - Structure for storing the information extracted from a RMC sentence
    flags : s32 - see GNSS_GET_xxx
    returns : s32
    OK - Valid RMC data available
    ERROR - No valid RMC data available
    GNSS_GetVTG(aGNSS_VTG_item[TGNSS_VTG],flags=GNSS_GET_CLEAR_AVAILABLE )

    checks whether valid TVG data is available and returns it using the passed TGNSS_TVG structure

    gaGNSS_TVG_item : TGNSS_TVG - Structure for storing the information extracted from a TVG sentence
    flags : s32 - see GNSS_GET_xxx
    returns : s32
    OK - Valid RMC data available
    ERROR - No valid RMC data available

    EXPERT

    GNSS_NMEAIsChecksumValid(const frame{})

    Function to verify NMEA frame checksum


    The GNSS checksum calculation is performed by considering all characters between '$' and
    '*'. After '*' two characters follow, representing the two hexadecimal digits of the checksum. The calculation simply consists of executing a XOR operation character by character starting with the first one after '$'.
    frame : astr - String that contains NMEA frame to be verified
    returns : s32
    0 - Calculated and received checksum are equal
    -1 - NMEA frame does not start with '$'
    -2 - Character of frame is no letter, digit or punctuation (ASCII range 0x21 to 0x7E)
    -3 - Checksum wrong
    GNSS_GetTalkerID(const sString{}, sTakerID{})

    Function to get the Talker ID of a NMEA frame or a token

    sString : astr - Full NMEA frame or first token of an NMEA frame (including '$')
    sTalkerID : astr - Requested Talker ID
    returns : s32
    0 - Success
    -1 - String is too short to be a token
    -2 - String does not start with '$'
    GNSS_GetSentenceID(const sString{}, sSentenceID{})

    Function to get the Sentence ID of a NMEA frame or a token

    sString : astr - Full NMEA frame or first token of an NMEA frame (including '$')
    sSentenceID : astr - Requested Sentence ID
    returns : s32
    0 - Success
    -1 - String is too short to be a token
    -2 - String does not start with '$'
    GNSS_NMEADecodeGGA(const sFrame{}, gaGNSS_GGA_item[TGNSS_GGA])

    This function decodes NMEA frames with Sentence ID "GGA". The data is stored in the given structure. For conversion/resolution information of the stored data, please refer to the TGNSS_GGA structure.

    NMEA GGA sentence:
    1 - UTC of Position
    2 - Latitude
    3 - N or S
    4 - Longitude
    5 - E or W
    6 - GPS quality indicator (0=invalid; 1=GPS fix; 2=Diff. GPS fix)
    7 - Number of satellites in use [not those in view]
    8 - Horizontal dilution of position
    9 - Antenna altitude above/below mean sea level (geoid)
    10 - Metres (Antenna height unit)
    11 - Geoidal separation (Diff. between WGS-84 earth ellipsoid and mean sea level. "-" = geoid is below WGS-84 ellipsoid)
    12 - Metres (Units of geoidal separation)
    13 - Age in seconds since last update from diff. reference station
    14 - Diff. reference station ID#
    15 - Checksum
    sFrame : astr - String that contains NMEA frame
    gaGNSS_GGA_item : TGNSS_GGA - Structure for storing the information extracted from a GGA sentence
    GNSS_NMEADecodeGLL(const sFrame{}, gaGNSS_GLL_item[TGNSS_GLL])

    This function decodes NMEA frames with Sentence ID "GLL". The data is stored in the given structure. For conversion/resolution information of the stored data, please refer to the TGNSS_GLL structure.

    NMEA GLL sentence:
    1 - Latitude
    2 - N or S
    3 - Longitude
    4 - E or W
    5 - UTC of position fix
    6 - Data status (A=data valid or V=data not valid)
    7 - Mode Indicator () N=No Fix, E=Estimated/Dead Reckoning Fix, A=Autonomous GNSS Fix, D=Differential GNSS Fix)
    8 - Checksum
    sFrame : astr - String that contains NMEA frame
    gaGNSS_GLL_item : TGNSS_GLL - Structure for storing the information extracted from a GLL sentence
    GNSS_NMEADecodeGSA(const sFrame{}, gaGNSS_GSA_item[TGNSS_GSA])

    This function decodes NMEA frames with Sentence ID "GSA". The data is stored in the given structure. For conversion/resolution information of the stored data, please refer to the TGNSS_GSA structure.

    NMEA GSA sentence:
    1 - Mode 1 (M=Manual—forced to operate in 2D or 3D mode, A=2D Automatic—allowed to automatically switch between 2D/3D)
    2 - Mode 2 (1=Fix not available, 2=2D, 3=3D)
    3-14 - SV PRN number of used satellite
    15 - Position Dilution of Precision
    16 - Horizontal Dilution of Precision
    17 - Vertical Dilution of Precision
    sFrame : astr - String that contains NMEA frame
    gaGNSS_GSA_item : TGNSS_GSA - Structure for storing the information extracted from a GSA sentence
    returns : s32
    GNSS_GNSS - The GSA sentence contained PRN numbers of satellites of different global navigation satellite systems.
    GNSS_GPS - The GSA sentence contained only PRN numbers of GPS satellites.
    GNSS_SBAS - The GSA sentence contained only PRN numbers of a Satellite Based Augmentation System.
    GNSS_GLONASS - The GSA sentence contained only PRN numbers of GLONASS satellites.
    GNSS_NMEADecodeGSV(const sFrame{}, aGNSS_GSV_item[GNSS_SAT_COUNT][TGNSS_GSV])

    This function decodes NMEA frames with Sentence ID "GSV".

    One GSV sentence only can provide data for up to 4 satellites and thus there may need to be 3 sentences for the full information.
    Each GSV sentence contains information about SV PRN number, elevation, azimuth and SNR of four SVs. The first token gives information about how many sentences are sent in total (max. 3), the second indicates the number and the third contains the specific SV number (SV PRN number). Consequently, at a maximum information about 12 SVs is provided. The data is stored in the given structure (an array of GNSS_SAT_COUNT structures of the type TGNSS_GSV).
    NMEA GSV sentence :
    1 - Total number of messages of this type in this cycle
    2 - Message number
    3 - Total number of SVs in view
    4 - SV PRN number
    5 - Elevation in degrees, 90 maximum
    6 - Azimuth, degrees from true north, 000 to 359
    7 - SNR, 00-99 dB (null when not tracking)
    8-11 - Information about second SV, same as field 4-7
    12-15 - Information about third SV, same as field 4-7
    16-19 - Information about fourth SV, same as field 4-7
    sFrame : astr - String that contains NMEA frame
    aGNSS_GSV_item : [GNSS_SAT_COUNT][TGNSS_GSV] - Array of Structures for storing satellite data extracted from several GSV sentences
    returns : s32
    0 - Not all GSV sentences have been received yet.
    >0 - Number of satellites in view when all GSV sentences have been received
    GNSS_NMEADecodeRMC(const sFrame{}, gaGNSS_RMC_item[TGNSS_RMC])

    This function decodes NMEA frames with Sentence ID "RMC". The data is stored in the given structure. For conversion/resolution information of the stored data, please refer to the TGNSS_RMC structure.

    NMEA RMC sentence:
    1 - UTC of position fix
    2 - Data status (V=navigation receiver warning)
    3 - Latitude of fix
    4 - N or S
    5 - Longitude of fix
    6 - E or W
    7 - Speed over ground in knots
    8 - Track made good in degrees True
    9 - UTC date
    10 - Magnetic variation degrees (Easterly var. subtracts from true course)
    11 - E or W
    12 - Mode Indicator N=No Fix, E=Estimated/Dead Reckoning Fix, A=Autonomous GNSS Fix, D=Differential GNSS Fix
    13 - Checksum
    sFrame : astr - String that contains NMEA frame
    gaGNSS_RMC_item : TGNSS_RMC - Structure for storing the information extracted from a RMC sentence
    GNSS_NMEADecodeVTG(const sFrame{}, gaGNSS_VTG_item[TGNSS_VTG])

    This function decodes NMEA frames with Sentence ID "VTG". The data is stored in the given structure. For conversion/resolution information of the stored data, please refer to the TGNSS_VTG structure.

    NMEA VTG sentence:
    1 - Course over ground (true north)
    2 - Fixed text 'T' indicates that course over ground is relative to true north
    3 - Course over ground (magnetic)
    4 - Fixed text 'M' indicates that course over ground is relative to magnetic north
    5 - Speed over ground in knots
    6 - Fixed text 'N' indicates that speed over ground is in knots
    7 - Speed over ground in kilometres/hour
    8 - Fixed text 'K' indicates that speed over ground is in kilometres/hour
    9 - Mode indicator N=No Fix, E=Estimated/Dead Reckoning Fix, A=Autonomous GNSS Fix, D=Differential GNSS Fix
    10 - Checksum
    sFrame : astr - String that contains NMEA frame
    gaGNSS_VTG_item : TGNSS_VTG - Structure for storing the information extracted from a VTG sentence
    GNSS_MODE_xxx:

    GNSS serial interface configuration bits (bitmask)

    Bit0-1: Number of stop bits
    GNSS_MODE_1_STOPBIT - 1 stop bit
    GNSS_MODE_2_STOPBIT - 2 stop bits
    Bit2-3: Parity
    GNSS_MODE_PARITY_NONE - no parity
    GNSS_MODE_PARITY_ODD - odd parity
    GNSS_MODE_PARITY_EVEN - even parity
    Bit4-5: Number of data bits
    GNSS_MODE_7_DATABIT - 7 data bits
    GNSS_MODE_8_DATABIT - 8 data bits
    Bit6-7: Flow control
    GNSS_MODE_FLOW_NONE - no flow control
    GNSS_MODE_FLOW_RTSCTS - RTS/CTS hand shake
    Bit8: Duplex mode
    GNSS_MODE_HALF_DUPLEX - half duplex mode
    GNSS_MODE_FULL_DUPLEX - full duplex mode

    DEBUG

    gnss_Debug_Config:
    To configure debug mode add the following macro to the main.dde file.
    /** * Use this macro to configure debug mode: * * 0: No debugging * 1: Received NMEA frames are issued via the console (Even if not decodable by the lib) * 2: Decoded NMEA tokens are printed to the console * 3: Entire to be decoded NMEA frames are printed to the console */ #define GNSS_DEBUG 0
    GNSS_DEBUG_MODE_xxx:

    Output mode for debug functions such as the GNSS_PrintData function

    GNSS_DEBUG_MODE_CONSOLE = 0 - Data is output via the console.
    GNSS_DEBUG_MODE_WATCH - Data is output via the watch panel.
    GNSS_DEBUG_PRINT_xxx:

    Selection of which GNSS data should be output by debug functions such as GNSS_PrintData.

    GNSS_DEBUG_PRINT_GGA = 0b00000001 - GGA data (Global positioning system fix data)
    GNSS_DEBUG_PRINT_GLL = 0b00000010 - GLL data (Geographic Position - Latitude/Longitude)
    GNSS_DEBUG_PRINT_GSA_GPS = 0b00000100 - GSA data (GNSS DOP and Active Satellites) for GPS satellites
    GNSS_DEBUG_PRINT_GSA_GLONASS = 0b00001000 - GSA data (GNSS DOP and Active Satellites) for GLONASS satellites
    GNSS_DEBUG_PRINT_GSV_GPS = 0b00010000 - GSV data (GNSS Satellites in View) for GPS satellites
    GNSS_DEBUG_PRINT_GSV_GLONASS = 0b00100000 - GSV data (GNSS Satellites in View) for GLONASS satellites
    GNSS_DEBUG_PRINT_RMC = 0001000000 - RMC data (Recommended minimum sentence C)
    GNSS_DEBUG_PRINT_VTG = 0b10000000 - VTG data (Vector track and speed over the ground)
    GNSS_PrintNMEAframe(const sFrame{})

    Issues a NMEA data frame via the console

    sFrame : astr - String that contains NMEA frame
    returns : s32
    0 - Success
    -1 - String is too long
    -2 - String does not start with '$'
    GNSS_PrintData(iMode = GNSS_DEBUG_MODE_CONSOLE, iPrint = GNSS_DEBUG_PRINT_GGA)

    Issues the NMEA sentences data storedin the internal buffers of the GNSS library either via the console or the watch panel

    iMode : s32 - Selection of whether the GNSS data should be output via the console or the watch panel (see GNSS_DEBUG_MODE_xxx)
    iPrint : s32 - Selection of which GNSS data should be output (see GNSS_DEBUG_PRINT_xxx)
    If the output of too many GNSS data has been enabled (e.g. GGA data, RMC data and GSV data ), the maximum number of PAWN commands (100,000) per pass may be reached. This is indicated by the message "SCRIPT Forced exit" in the console. The problem can occur especially when outputting the GSV data. To fix the problem, reduce the data to be output and / or use the watch panel instead of the console for outputting the data.

    On this page

    GNSS