From: Kevron Rees Date: Mon, 17 Dec 2012 21:09:48 +0000 (-0800) Subject: added DatabaseLogging property. still needs more completion. X-Git-Tag: submit/tizen/20130618.181635~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=666f4953e2797e9b3b89ac552c03ffcff92584fa;p=profile%2Fivi%2Fautomotive-message-broker.git added DatabaseLogging property. still needs more completion. --- diff --git a/plugins/database/databasesink.cpp b/plugins/database/databasesink.cpp index 5b20173..85c751d 100644 --- a/plugins/database/databasesink.cpp +++ b/plugins/database/databasesink.cpp @@ -27,6 +27,7 @@ DatabaseSink::DatabaseSink(AbstractRoutingEngine *engine, mapquit ) { + delete obj; break; } @@ -87,6 +88,7 @@ PropertyList DatabaseSink::supported() props.push_back(VehicleProperty::EngineSpeed); props.push_back(VehicleProperty::VehicleSpeed); + props.push_back(DatabaseLoggingProperty); return props; } @@ -217,6 +219,15 @@ AsyncPropertyReply *DatabaseSink::setProperty(AsyncSetPropertyRequest request) { AsyncPropertyReply* reply = new AsyncPropertyReply(request); reply->success = false; + + if(request.property == DatabaseLoggingProperty) + { + if(request.value->value()) + { + ///TODO: start or stop logging thread + } + } + return reply; } diff --git a/plugins/database/databasesink.h b/plugins/database/databasesink.h index 8311773..c41017c 100644 --- a/plugins/database/databasesink.h +++ b/plugins/database/databasesink.h @@ -26,6 +26,8 @@ #include +#define DatabaseLoggingProperty "DatabaseLogging" + template class Queue { @@ -148,6 +150,7 @@ public: :AbstractSinkManager(engine, config) { new DatabaseSink(routingEngine, config); + VehicleProperty::registerProperty(DatabaseLoggingProperty, [](){return new BasicPropertyType(false);}); } }; diff --git a/plugins/obd2plugin/obd2source.cpp b/plugins/obd2plugin/obd2source.cpp index 6d98953..53442a9 100644 --- a/plugins/obd2plugin/obd2source.cpp +++ b/plugins/obd2plugin/obd2source.cpp @@ -586,6 +586,8 @@ OBD2Source::OBD2Source(AbstractRoutingEngine *re, map config) m_supportedProperties.push_back((*itr)->property); } + m_supportedProperties.push_back(Obd2Connect); + re->setSupported(supported(), this); /*if (openPort(std::string("/dev/pts/7"),115200)) {