|
From: <rus...@us...> - 2008-06-09 08:10:27
|
Revision: 172
http://gearbox.svn.sourceforge.net/gearbox/?rev=172&view=rev
Author: russo2503v
Date: 2008-06-09 01:10:35 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
removing ctrl char
Modified Paths:
--------------
gearbox/trunk/src/gbxgarminacfr/driver.cpp
Modified: gearbox/trunk/src/gbxgarminacfr/driver.cpp
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/driver.cpp 2008-06-09 07:56:03 UTC (rev 171)
+++ gearbox/trunk/src/gbxgarminacfr/driver.cpp 2008-06-09 08:10:35 UTC (rev 172)
@@ -306,6 +306,16 @@
//
tracer_.debug( serialData, 10 );
+ // dealing with unexplained cntrl characters in the message
+ // don't check the last 2 characters: they're \0 and \n
+ for ( string::iterator it=serialData.begin(); it!=serialData.end()-2; ++it ) {
+ if ( iscntrl( *it ) ) {
+ // debug
+ cout<<now.tv_sec<<" "<<now.tv_usec<<" removing control char="<<std::hex<<(unsigned int)*it<<endl;
+ it = serialData.erase( it );
+ }
+ }
+
//Put it into the message object and checksum the data
try {
// This throws if it cannot find the * to deliminate the checksum field
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|