Aria
2.8.0
|
NMEA Parser. More...
#include <ArNMEAParser.h>
Classes | |
struct | Message |
Message data passed to handlers. More... | |
Public Types | |
enum | { ParseFinished = 1, ParseError = 2, ParseData = 4, ParseUpdated = 8 } |
Flags to indicates what the parse() method did. More... | |
typedef ArFunctor1< ArNMEAParser::Message > | Handler |
NMEA message handler type. More... | |
typedef std::map< std::string, ArNMEAParser::Handler * > | HandlerMap |
typedef std::vector< std::string > | MessageVector |
NMEA message, divided into parts. More... | |
Public Member Functions | |
void | addHandler (const char *message, ArNMEAParser::Handler *handler) |
Set a handler for an NMEA message. More... | |
ArNMEAParser (const char *name="NMEA Parser") | |
const ArNMEAParser::HandlerMap & | getHandlersRef () const |
int | parse (ArDeviceConnection *dev) |
int | parse (const char *buf, int n) |
void | removeHandler (const char *message) |
void | setIgnoreChecksum (bool ignore) |
Set whether checksum is ignored (default behavior is not to ignore it, and skip messages with incorrect checksums, and log a warning mesage) | |
Public Attributes | |
enum ArNMEAParser:: { ... } | ParseFlags |
Flags to indicates what the parse() method did. More... | |
NMEA Parser.
Parses NMEA input data and calls callbacks for certain messages with message parts. NMEA is a standard output data protocol used by GPS devices and others (e.g. compass, altimiter, etc.) This class is used internally by ArNMEAParser and subclasses, and by ArTCMCompassDirect.
NMEA message handler type.
typedef std::vector<std::string> ArNMEAParser::MessageVector |
NMEA message, divided into parts.
anonymous enum |
Flags to indicates what the parse() method did.
i.e. If nothing was done, then the result will be 0. To check a parse() return result result to see if data was updated, use (result & ParseUpdated). To check if there was an error, use (result & ParseError).
ArNMEAParser::ArNMEAParser | ( | const char * | name = "NMEA Parser" | ) |
name | Used in log messages |
void ArNMEAParser::addHandler | ( | const char * | message, |
ArNMEAParser::Handler * | handler | ||
) |
Set a handler for an NMEA message.
Mostly for internal use or to be used by related classes, but you could use for ususual or custom messages emitted by a device that you wish to be handled outside of the ArNMEAParser class.
enum { ... } ArNMEAParser::ParseFlags |
Flags to indicates what the parse() method did.
i.e. If nothing was done, then the result will be 0. To check a parse() return result result to see if data was updated, use (result & ParseUpdated). To check if there was an error, use (result & ParseError).