Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages | Examples

ArNMEAParser Class Reference

#include <ArNMEAParser.h>

List of all members.


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.


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::MessageHandler
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 (const char *buf, int n)
int parse (ArDeviceConnection *dev)
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).

Classes

struct  Message


Member Typedef Documentation

typedef ArFunctor1<ArNMEAParser::Message> ArNMEAParser::Handler
 

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

Enumeration values:
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:
name Used 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:
Generated on Thu Jan 7 10:34:42 2010 for Aria by  doxygen 1.4.2