|
From: <rus...@us...> - 2008-06-04 14:16:12
|
Revision: 156
http://gearbox.svn.sourceforge.net/gearbox/?rev=156&view=rev
Author: russo2503v
Date: 2008-06-04 07:15:46 -0700 (Wed, 04 Jun 2008)
Log Message:
-----------
cosmetic
Modified Paths:
--------------
gearbox/trunk/submitted/gbxgarminacfr/driver.cpp
gearbox/trunk/submitted/gbxgarminacfr/nmea.h
Modified: gearbox/trunk/submitted/gbxgarminacfr/driver.cpp
===================================================================
--- gearbox/trunk/submitted/gbxgarminacfr/driver.cpp 2008-06-04 13:26:14 UTC (rev 155)
+++ gearbox/trunk/submitted/gbxgarminacfr/driver.cpp 2008-06-04 14:15:46 UTC (rev 156)
@@ -53,7 +53,6 @@
data->altitude = 0.0;
data->satellites = 0;
data->geoidalSeparation = 0.0;
-cout<<"DEBUG: invalid fix, lat="<<data->latitude<<endl;
return data;
case '1':
data->fixType = Autonomous;
Modified: gearbox/trunk/submitted/gbxgarminacfr/nmea.h
===================================================================
--- gearbox/trunk/submitted/gbxgarminacfr/nmea.h 2008-06-04 13:26:14 UTC (rev 155)
+++ gearbox/trunk/submitted/gbxgarminacfr/nmea.h 2008-06-04 14:15:46 UTC (rev 156)
@@ -8,16 +8,12 @@
*
*/
-#include <vector>
-#include <string>
-
-// #include <hydroportability/sharedlib.h>
-
#ifndef GBXGPSUTILACFR_NMEA_H
#define GBXGPSUTILACFR_NMEA_H
+#include <vector>
+#include <string>
-
/*
for further info:
@@ -51,12 +47,14 @@
class NmeaException : public std::exception
{
public:
-
NmeaException(const char *message)
: message_(message) {}
+
NmeaException(const std::string &message)
: message_(message) {}
+
virtual ~NmeaException() throw() {}
+
virtual const char* what() const throw() { return message_.c_str(); }
protected:
@@ -68,36 +66,48 @@
// When using class to send data, need to add checksum, when reciving data need to test checksum
// Checksums are usually optional
-enum{TestChecksum, AddChecksum, DontTestOrAddChecksum};
+enum NmeaMessageOptions
+{
+ TestChecksum,
+ AddChecksum,
+ DontTestOrAddChecksum
+};
// class SOEXPORT NmeaMessage{
class NmeaMessage
{
public:
NmeaMessage();
- NmeaMessage(const char *sentence, int testCheckSum = DontTestOrAddChecksum);
+ NmeaMessage(const char *sentence, int testCheckSum=DontTestOrAddChecksum );
// Set up the internal data for a sentence
- void setSentence(const char *data, int testCheckSum = DontTestOrAddChecksum);
+ void setSentence(const char *data, int testCheckSum=DontTestOrAddChecksum );
// Do we only have the raw string ?
bool haveSentence() const { return haveSentence_; };
+
// Have we parsed fields ?
bool haveTokens() const { return haveTokens_; };
+
// have we a valid checksum ?
- bool haveValidChecksum() const { return checkSumOK_; };
+ bool haveValidChecksum() const { return checkSumOK_; };
+
// have we checked the checksum?
- bool haveTestedChecksum()const { return haveCheckSum_; };
+ bool haveTestedChecksum()const { return haveCheckSum_; };
+
// calculate the checksum from sentence
// Note that this function may throw NMEA_Exception...
bool testChecksumOk();
+
// Return the raw sentence string
const char * sentence() { return sentence_; };
+
// Return a single data token as a string
std::string& getDataToken(int i) { return dataTokens_[i]; };
// Return the number of fields
int numDataTokens() const { return dataTokens_.size(); };
+
//Tokenise the string that we received
void parseTokens();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|