diff options
author | Kevron Rees <tripzero.kev@gmail.com> | 2014-12-30 17:47:22 -0800 |
---|---|---|
committer | Kevron Rees <tripzero.kev@gmail.com> | 2014-12-30 17:53:04 -0800 |
commit | 08a201cd5e80a664a3e9594d01f07a22f9300adc (patch) | |
tree | f8d4349593c1a5918b153c486c90ec44a25bcd0b | |
parent | 139864e794bab1c2cf8d75ad90d2d813a5c5a9b5 (diff) | |
download | automotive-message-broker-08a201cd5e80a664a3e9594d01f07a22f9300adc.tar.gz |
[gpsnmea] fix to pass test forward port
-rw-r--r-- | plugins/gpsnmea/gpsnmea.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/gpsnmea/gpsnmea.cpp b/plugins/gpsnmea/gpsnmea.cpp index 695e15df..494535eb 100644 --- a/plugins/gpsnmea/gpsnmea.cpp +++ b/plugins/gpsnmea/gpsnmea.cpp @@ -577,6 +577,7 @@ void GpsNmeaSource::test() location.parse("GPRMC,061211,A,2351.9605,S,15112.5239,E,000.0,053.4,170303,009.9,E*6E"); DebugOut(0)<<"lat: "<<location.latitude()->toString()<<endl; + DebugOut(0)<<"time: "<<location.gpsTime()->toString()<<endl; g_assert(location.latitude()->toString() == "-23.86600833"); g_assert(location.gpsTime()->toString() == "1050585131"); @@ -641,6 +642,7 @@ bool GpsNmeaSource::tryParse(string data) { if(checksum(line)) { + DebugOut(7) << "checksome checks out for: " << line << endl; buffer = line; } else @@ -652,7 +654,7 @@ bool GpsNmeaSource::tryParse(string data) if(pos != std::string::npos && pos != 0) { - ///Throw the incomplete stuff away. if it doesn't begin with "G" it'll never be complete + DebugOut(7) << "Throwing the incomplete stuff away. if it doesn't begin with 'G'' it'll never be complete: " << buffer << endl; buffer = buffer.substr(pos); } @@ -668,10 +670,10 @@ bool GpsNmeaSource::tryParse(string data) { if(pos == 0 ) { - uint cs = buffer.find('*'); + std::string::size_type cs = buffer.find('*'); if (cs != std::string::npos && cs != buffer.length()-1) { - ///This means we have a false flag somewhere. + DebugOut(7) << "false flag somewhere: "<< cs << " " << buffer << endl; buffer = buffer.substr(cs+(buffer.length() - cs)); } } |