IoT::GNSS::NMEA

class SentenceDecoder

File Information

Library: IoT/GNSS/NMEA
Package: Decoder
Header: IoT/GNSS/NMEA/SentenceDecoder.h

Description

This class decodes NMEA-0183 wire-format sentences into Sentence objects for further processing.

For a complete description of the NMEA 0183 message format see the NMEA 0183 document available from the National Marine Electronics Association.

An informal description of the NMEA 0183 message format can be found at <http://www.catb.org/gpsd/NMEA.html>.

Member Summary

Member Functions: checksum, field, init, invalid, processBuffer, processChar, reset, sentenceComplete, start, talkerType, updateChecksum

Enumerations

Limits protected

NMEA_MAX_FIELD_COUNT = 32

NMEA_MAX_FIELD_SIZE = 64

State protected

ST_INIT

initial state, beginning of message, skipping CR/LF

ST_START

'$' message start delimiter was found

ST_TALKER_TYPE

reading talker and sentence type

ST_FIELD

reading fields

ST_CHECKSUM

reading checksum

ST_INVALID

invalid characters found

Constructors

SentenceDecoder

SentenceDecoder();

Creates the SentenceDecoder.

Destructor

~SentenceDecoder

~SentenceDecoder();

Destroys the SentenceDecoder.

Member Functions

processBuffer

void processBuffer(
    const char * buffer,
    std::size_t size
);

Processes all characters in the given buffer.

processChar

void processChar(
    char ch
);

Processes the given character.

reset

void reset();

Resets the decoder to initial state.

checksum protected

void checksum(
    char ch
);

field protected

void field(
    char ch
);

init protected

void init(
    char ch
);

invalid protected

void invalid(
    char ch
);

sentenceComplete protected

void sentenceComplete();

start protected

void start(
    char ch
);

talkerType protected

void talkerType(
    char ch
);

updateChecksum protected inline

void updateChecksum(
    char ch
);

Variables

sentenceReceived

Poco::BasicEvent < const Sentence > sentenceReceived;

Fired when a valid sentence has been received.

Securely control IoT edge devices from anywhere   Connect a Device