UNPKG

extended-nmea

Version:

A TypeScript library for parsing NMEA0183-like sentences with support for custom and proprietary sentences.

35 lines (34 loc) 1.32 kB
import { NmeaSentence } from "./NmeaSentence"; export declare abstract class ChecksumSentence extends NmeaSentence { /** * The optional checksum in a valid "talker sentence" is separated by a "*" character. */ static readonly ChecksumSeparator = "*"; /** * Whether or not this sentence contains a checksum value (a "*" and two hexadecimal characters at the end). */ protected get hasChecksum(): boolean; /** * Returns all characters between "$" and "*" if there is one or between "$" and "<CR><LF>". */ protected get dataNoChecksum(): string; /** * Returns the last two characters at the end of the sentence, excluding "<CR><LF>". */ protected get checksum(): string; /** * If this sentence has a checksum, returns whether it is valid or not. Otherwise returns true. */ protected get checksumValid(): boolean; /** * Returns all fields (including the first field in the sentence) separated by comma. Excludes checksum. */ get fields(): string[]; /** * Whether or not this sentence is a valid NMEA0183 talker sentence. * * This getter also validates the checksum, if there is one. */ get valid(): boolean; get invalidReason(): null | string; }