|
From: <bo...@us...> - 2008-06-15 08:10:15
|
Revision: 180
http://gearbox.svn.sourceforge.net/gearbox/?rev=180&view=rev
Author: borax00
Date: 2008-06-15 01:10:09 -0700 (Sun, 15 Jun 2008)
Log Message:
-----------
time check moved inside loop, so that if two messages arrive between reads they get non-identical timestamps.
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2008-06-13 01:16:07 UTC (rev 179)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.cpp 2008-06-15 08:10:09 UTC (rev 180)
@@ -102,12 +102,9 @@
try {
if ( getDataFromSerial() )
{
- IceUtil::Time t = IceUtil::Time::now();
- int timeStampSec = (int)t.toSeconds();
- int timeStampUsec = (int)t.toMicroSeconds() - timeStampSec*1000000;
// Process it
try {
- bool statusOK = processBuffer( timeStampSec, timeStampUsec );
+ bool statusOK = processBuffer();
if ( statusOK )
subStatus_.ok();
}
@@ -186,7 +183,7 @@
}
bool
-SerialDeviceHandler::processBuffer( const int &timeStampSec, int &timeStampUsec )
+SerialDeviceHandler::processBuffer()
{
if ( SUPER_DEBUG )
{
@@ -200,6 +197,10 @@
// This loop is in case multiple messages arrived.
while ( true )
{
+ IceUtil::Time t = IceUtil::Time::now();
+ int timeStampSec = (int)t.toSeconds();
+ int timeStampUsec = (int)t.toMicroSeconds() - timeStampSec*1000000;
+
IResponsePtr response;
int numBytesParsed = 0;
bool gotMessage = false;
Modified: gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h 2008-06-13 01:16:07 UTC (rev 179)
+++ gearbox/trunk/src/gbxsickacfr/gbxserialdeviceacfr/serialdevicehandler.h 2008-06-15 08:10:09 UTC (rev 180)
@@ -122,7 +122,7 @@
// Returns: true if got data, false if timed out
bool getDataFromSerial();
// Returns: true if statusOK, false it something bad happened
- bool processBuffer( const int &timeStampSec, int &timeStampUsec );
+ bool processBuffer();
gbxserialacfr::Serial &serial_;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|