From 1d93307e27efa6f09a23ff81424316f005de907b Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Tue, 4 Jun 2013 17:46:48 -0700 Subject: [PATCH] fixed up obd2 source code from merge --- plugins/obd2plugin/obd2source.cpp | 33 --------------------------------- plugins/obd2plugin/obd2source.h | 3 --- plugins/obd2plugin/obdpid.h | 22 ---------------------- 3 files changed, 58 deletions(-) diff --git a/plugins/obd2plugin/obd2source.cpp b/plugins/obd2plugin/obd2source.cpp index ad9db62..ba7e537 100644 --- a/plugins/obd2plugin/obd2source.cpp +++ b/plugins/obd2plugin/obd2source.cpp @@ -328,10 +328,7 @@ void threadLoop(gpointer data) } StatusMessage *statusreq = new StatusMessage(); statusreq->statusStr = "error:nodata"; -<<<<<<< HEAD -======= statusreq->property = (*i)->property; ->>>>>>> 46f67f8d33d8eccc26d9326ce1c6b9745dc6bb97 g_async_queue_push(privStatusQueue,statusreq); continue; } @@ -340,11 +337,7 @@ void threadLoop(gpointer data) timeoutCount++; if (timeoutCount < 2) { -<<<<<<< HEAD - DebugOut() << __SMALLFILE__ << ":" << __LINE__ << "OBDLib::TIMEOUT for pid" << (*i)->pid << "\n"; -======= DebugOut() << __SMALLFILE__ << ":" << __LINE__ << "OBDLib::TIMEOUT for pid" << (*i)->pid << endl; ->>>>>>> 46f67f8d33d8eccc26d9326ce1c6b9745dc6bb97 StatusMessage *statusreq = new StatusMessage(); statusreq->statusStr = "error:timeout"; g_async_queue_push(privStatusQueue,statusreq); @@ -407,38 +400,12 @@ void threadLoop(gpointer data) obd->closePort(); } } -<<<<<<< HEAD -static int updateProperties(/*gpointer retval,*/ gpointer data) -======= static int updateProperties( gpointer data) ->>>>>>> 46f67f8d33d8eccc26d9326ce1c6b9745dc6bb97 { OBD2Source* src = (OBD2Source*)data; -<<<<<<< HEAD - - StatusMessage *statusreq = new StatusMessage(); - statusreq->statusStr = "connected"; - g_async_queue_push(src->statusQueue,statusreq); - - while (gpointer retval = g_async_queue_try_pop(src->statusQueue)) - { - StatusMessage *reply = (StatusMessage*)retval; - if (reply->statusStr == "disconnected") - { - //TODO: This is where we update Obd2Connected property - //src->updateProperty("Obd2Connected",true); - } - else if (reply->statusStr == "connected") - { - //TODO: This is where we update Obd2Connected property - } - } - while(gpointer retval = g_async_queue_try_pop(src->responseQueue)) -======= while (gpointer retval = g_async_queue_try_pop(src->statusQueue)) ->>>>>>> 46f67f8d33d8eccc26d9326ce1c6b9745dc6bb97 { StatusMessage *reply = (StatusMessage*)retval; if (reply->statusStr == "disconnected") diff --git a/plugins/obd2plugin/obd2source.h b/plugins/obd2plugin/obd2source.h index 7399c97..296ebd5 100644 --- a/plugins/obd2plugin/obd2source.h +++ b/plugins/obd2plugin/obd2source.h @@ -54,10 +54,7 @@ class StatusMessage { public: std::string statusStr; -<<<<<<< HEAD -======= VehicleProperty::Property property; ->>>>>>> 46f67f8d33d8eccc26d9326ce1c6b9745dc6bb97 }; class ObdReply { diff --git a/plugins/obd2plugin/obdpid.h b/plugins/obd2plugin/obdpid.h index da59e49..0731063 100644 --- a/plugins/obd2plugin/obdpid.h +++ b/plugins/obd2plugin/obdpid.h @@ -313,41 +313,19 @@ public: property = VehicleProperty::WMI; } bool isValid(ByteArray replyVector) -<<<<<<< HEAD -======= { return isValidVal = VinPid::isValid(replyVector); } void parse(ByteArray replyVector) ->>>>>>> 46f67f8d33d8eccc26d9326ce1c6b9745dc6bb97 { if (!isValidVal) { -<<<<<<< HEAD - isValidVal = false; - return false; - } - isValidVal = true; - return true; - } - void parse(ByteArray replyVector) - { - if (!isValidVal) - { - //TODO: Determine if we should throw an exception here, rather than just returning without a value? - return; - } - VinPid::parse(replyVector); - value = value.substr(0,3); - } -======= //TODO: Determine if we should throw an exception here, rather than just returning without a value? return; } VinPid::parse(replyVector); value = value.substr(0,3); } ->>>>>>> 46f67f8d33d8eccc26d9326ce1c6b9745dc6bb97 }; class AirIntakeTemperaturePid: public CopyMe -- 2.7.4