|
From: <war...@us...> - 2010-01-25 07:05:32
|
Revision: 480
http://gearbox.svn.sourceforge.net/gearbox/?rev=480&view=rev
Author: warren89
Date: 2010-01-25 07:05:25 +0000 (Mon, 25 Jan 2010)
Log Message:
-----------
Added additional tracer debugging and improved NMEA device handling to gbxgarminacfr driver
Modified Paths:
--------------
gearbox/trunk/src/gbxgarminacfr/driver.cpp
gearbox/trunk/src/gbxgarminacfr/driver.h
Modified: gearbox/trunk/src/gbxgarminacfr/driver.cpp
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/driver.cpp 2010-01-07 06:26:50 UTC (rev 479)
+++ gearbox/trunk/src/gbxgarminacfr/driver.cpp 2010-01-25 07:05:25 UTC (rev 480)
@@ -339,12 +339,18 @@
void
Driver::enableDevice()
{
- tracer_.info("Configure GPS device");
+ stringstream ss;
+ ss << "Configure GPS device. Protocol: " << config_.protocol;
+ tracer_.info(ss.str());
+ // Non-Garmin devices do not support message enabling and disabling
+ if (config_.protocol != "Garmin") return;
+
//Create the messages that we are going to send and add the checksums
//Note that the checksum field is filled with 'x's before we start
//First disables all output messages then enable selected ones only.
+ tracer_.debug( "Driver::enableDevice(): calling disableAllMsg", 10 );
gbxgpsutilacfr::NmeaMessage disableAllMsg( "$PGRMO,,2*xx\r\n",gbxgpsutilacfr::AddChecksum );
serial_->writeString( disableAllMsg.sentence() );
@@ -352,20 +358,24 @@
sleep(1);
if ( config_.readGga ) {
+ tracer_.debug( "Driver::enableDevice(): calling enableGgaMsg", 10 );
gbxgpsutilacfr::NmeaMessage enableGgaMsg( "$PGRMO,GPGGA,1*xx\r\n",gbxgpsutilacfr::AddChecksum );
serial_->writeString( enableGgaMsg.sentence() );
}
if ( config_.readVtg ) {
+ tracer_.debug( "Driver::enableDevice(): calling enableVtgMsg", 10 );
gbxgpsutilacfr::NmeaMessage enableVtgMsg( "$PGRMO,GPVTG,1*xx\r\n",gbxgpsutilacfr::AddChecksum );
serial_->writeString( enableVtgMsg.sentence() );
}
if ( config_.readRme ) {
+ tracer_.debug( "Driver::enableDevice(): calling enableRmeMsg", 10 );
gbxgpsutilacfr::NmeaMessage enableRmeMsg( "$PGRMO,PGRME,1*xx\r\n",gbxgpsutilacfr::AddChecksum );
serial_->writeString( enableRmeMsg.sentence() );
}
if ( config_.readRmc ) {
+ tracer_.debug( "Driver::enableDevice(): calling enableRmcMsg", 10 );
gbxgpsutilacfr::NmeaMessage enableRmcMsg( "$PGRMO,GPRMC,1*xx\r\n",gbxgpsutilacfr::AddChecksum );
serial_->writeString( enableRmcMsg.sentence() );
}
@@ -524,7 +534,7 @@
if ( config_.readRmc )
tracer_.debug("got GPRMC message",4);
else
- throw gbxutilacfr::Exception( ERROR_INFO, "got unexpected PGRMC message" );
+ throw gbxutilacfr::Exception( ERROR_INFO, "got unexpected GPRMC message" );
genericData.reset( extractRmcData( nmeaMessage, now.tv_sec, now.tv_usec ) );
if ( genericData.get() )
break;
Modified: gearbox/trunk/src/gbxgarminacfr/driver.h
===================================================================
--- gearbox/trunk/src/gbxgarminacfr/driver.h 2010-01-07 06:26:50 UTC (rev 479)
+++ gearbox/trunk/src/gbxgarminacfr/driver.h 2010-01-25 07:05:25 UTC (rev 480)
@@ -39,6 +39,9 @@
//! Serial device. e.g. "/dev/ttyS0"
std::string device;
+ //! Serial Protocol: Garmin or NMEA
+ std::string protocol;
+
//! Read GPGGA sentence
bool readGga;
//! Read GPVTG sentence
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|