|
| static gnss_coordinate_t | parseCoordinate (nmea_span_t coordinate, nmea_span_t hemisphere) |
| | Decode a latitude or longitude field and its hemisphere. More...
|
| |
| static size_t | formatCoordinate (char *output, size_t capacity, const gnss_coordinate_t &coordinate) |
| | Format exact coordinate components as signed decimal degrees. More...
|
| |
| static gnss_position_t | parsePosition (nmea_span_t type, nmea_span_t fields) |
| | Decode a GGA, RMC, or GLL position without retaining receiver state. More...
|
| |
| static gnss_position_t | parsePosition (const nmea_sentence_t &sentence) |
| | Route a validated standard NMEA sentence to the position decoder. More...
|
| |
| static gnss_time_t | parseTime (nmea_span_t field) |
| | Decode a complete UTC hhmmss[.fraction] field. More...
|
| |
| static gnss_date_t | parseDate (nmea_span_t field) |
| | Decode a complete ddmmyy date field. More...
|
| |
| static gnss_validation_t | validateNavigation (nmea_span_t type, nmea_span_t fields) |
| | Validate standard fields before updating navigation data. More...
|
| |
| static nmea_sentence_t | validate (const char *data, size_t length) |
| | Validate a complete, length-bounded NMEA sentence without copying it. More...
|
| |
| static nmea_span_t | nextField (nmea_span_t &remaining) |
| | Return the next field and advance a bounded field cursor. More...
|
| |
| static nmea_decimal_t | parseDecimal (nmea_span_t field) |
| | Convert a complete field to an exact signed decimal value. More...
|
| |
| static nmea_number_status_t | validateDecimal (nmea_span_t field, bool allowNegative=true) |
| | Check an exact decimal without constructing its numeric value. More...
|
| |
| static size_t | buildCommand (char *output, size_t capacity, const char *body, size_t bodyLength) |
| | Build a checksummed command in caller-provided storage. More...
|
| |
Standard GNSS receiver and decoding shared by receiver implementations. Inherits bounded framing with caller-owned buffers and per-instance times. Position decoding is stateless: no fix is cached or merged across lines. Static decoding does not require receive storage. No heap or transport I/O.
Decode a latitude or longitude field and its hemisphere.
- Parameters
-
| coordinate | DDMM[.fraction] latitude or DDDMM[.fraction] longitude. |
| hemisphere | Exactly one N/S for latitude or E/W for longitude. |
- Returns
- Validated components and signed decimal degrees times 10000000.
Missing spans take precedence over empty spans, then malformed syntax, then range errors. Signs, spaces, exponents, and a bare decimal point are invalid. Minutes must be below 60; latitude is limited to 90 degrees and longitude to 180, with zero minutes at either boundary. Fractional minutes retain the first nine digits, padded with zeros; further digits are validated and truncated. degreesE7 is exact at its stated resolution, without rounding or intermediate floating-point arithmetic.
| size_t Adafruit_GNSS::formatCoordinate |
( |
char * |
output, |
|
|
size_t |
capacity, |
|
|
const gnss_coordinate_t & |
coordinate |
|
) |
| |
|
static |
Format exact coordinate components as signed decimal degrees.
- Parameters
-
| output | Writable text buffer; must not overlap coordinate. |
| capacity | Buffer size including the NUL terminator. Use GNSS_COORDINATE_TEXT_SIZE to fit every valid coordinate. |
| coordinate | Validated components from parseCoordinate(). |
- Returns
- Characters written, excluding NUL, or zero for invalid components or insufficient storage. On failure output[0] is cleared when possible; no other output bytes are changed.
Writes exactly 11 fractional degree digits, truncated toward zero. This distinguishes every retained fractional-minute increment and introduces less than 0.00000000001 degree of formatting error (about 1.2 micrometers of latitude). Southern/western zero retains its minus sign. The components, not the lower-resolution degreesE7 member, supply the result.
Integer long division uses at most 32-bit arithmetic, with no heap or floating-point conversion. AVR output retains the same precision as other targets, regardless of NMEA_FLOAT_T or the platform's double size.
Decode a GGA, RMC, or GLL position without retaining receiver state.
- Parameters
-
| type | Three-character sentence type without its talker prefix. |
| fields | Borrowed fields after the address comma and before '*'. |
- Returns
- Independent values and validation diagnostics. Invalid or unsupported input returns no partially decoded measurements.
Call after validating the enclosing frame with Adafruit_NMEA::validate(). Input storage must remain readable and unchanged throughout the call. Validate all consumed navigation fields before returning measurements, including fields this result does not expose (such as altitude). Optional tails retain validateNavigation()'s existing behavior.
Populated coordinates retain all nine fractional-minute digits and can be passed directly to formatCoordinate(). Empty fields have EMPTY status; fields absent from this sentence type have MISSING status. The fix boolean is meaningful only with VALID fixStatus and does not imply populated coordinates. GGA quality is independent of RMC/GLL fix validity.
Time/date and exact position components belong only to this sentence. No timestamps, previous-fix merging, allocation, or floating-point conversion occur here. GSA and other sentence types are UNSUPPORTED by this decoder.
Validate standard fields before updating navigation data.
- Parameters
-
| type | Three-character sentence type, without its talker prefix. |
| fields | Fields after the address comma and before the checksum. |
- Returns
- Status and the first invalid or missing one-based field position.
Call after validating the enclosing NMEA frame. Checks the fields consumed by the existing GPS decoders: GGA through geoid separation, RMC through date, GLL through status, and GSA fix type and dilution values. Optional tails and the satellite IDs skipped by the GPS parser are left to their decoders. Empty fields are permitted, but a coordinate and its hemisphere must either both be empty or both be valid for the appropriate axis. Numeric fields must be complete representable decimals; speed, course, and dilution values cannot be negative. Fix quality and satellite count must fit uint8_t. Valid does not imply a position fix or populated fields. No receiver state changes, field arrays, or heap allocation are involved.