Aria  2.7.5.2
ArNMEAParser Class Reference

NMEA Parser. More...

#include <ArNMEAParser.h>

Classes

struct  Message
 

Public Types

enum  { ParseFinished = 1, ParseError = 2, ParseData = 4, ParseUpdated = 8 }
 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). More...
 
typedef ArFunctor1
< ArNMEAParser::Message
Handler
 
typedef std::map< std::string,
ArNMEAParser::Handler * > 
HandlerMap
 
typedef std::vector< std::string > MessageVector
 

Public Member Functions

void addHandler (const char *message, ArNMEAParser::Handler *handler)
 
 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. 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).
 

Detailed Description

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.

Member Typedef Documentation

NMEA message handler type.

typedef std::vector<std::string> ArNMEAParser::MessageVector

NMEA message, divided into parts.

Member Enumeration Documentation

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).

Enumerator
ParseFinished 

There was no data to parse.

ParseError 

There was an error.

ParseData 

Input was recieved and stored, but no complete messages were parsed.

ParseUpdated 

At least one complete message was parsed.

Constructor & Destructor Documentation

ArNMEAParser::ArNMEAParser ( const char *  name = "NMEA Parser")
Parameters
nameUsed in log messages

Member Function Documentation

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.


The documentation for this class was generated from the following files: