diff options
-rw-r--r-- | RELEASE | 4 | ||||
-rw-r--r-- | ambd/core.cpp | 4 | ||||
-rw-r--r-- | ambd/pluginloader.cpp | 3 | ||||
-rw-r--r-- | examples/bluemonkey/bluemonkeyconfig | 6 | ||||
-rw-r--r-- | examples/databaseconfig | 5 | ||||
-rw-r--r-- | lib/abstractroutingengine.h | 4 | ||||
-rw-r--r-- | plugins/bluemonkey/bluemonkey.cpp | 8 | ||||
-rw-r--r-- | plugins/database/databasesink.cpp | 12 | ||||
-rw-r--r-- | plugins/examplesink.cpp | 7 |
9 files changed, 28 insertions, 25 deletions
@@ -1,4 +1,4 @@ -Release notes for release 0.10.0 +Release notes for release 0.10 New features: @@ -9,7 +9,7 @@ New features: - Added error type for get() calls Changes: -- AbstractPropertyType class now contains information for zone and the property name +- AbstractPropertyType class now contains information for zone and the property name (zone is unused in 0.10) - Clean up sink subscription process so that subscription only happens once regardless of whether the property is supported or not at the time Fixes: diff --git a/ambd/core.cpp b/ambd/core.cpp index d1c0ddb2..42d14c37 100644 --- a/ambd/core.cpp +++ b/ambd/core.cpp @@ -233,9 +233,7 @@ AsyncRangePropertyReply *Core::getRangePropertyAsync(AsyncRangePropertyRequest r for(SourceList::iterator itr = mSources.begin(); itr != mSources.end(); itr++) { AbstractSource* src = (*itr); - PropertyList properties = src->supported(); - if(ListPlusPlus<VehicleProperty::Property>(&properties).contains(request.property) - && (src->supportedOperations() & AbstractSource::GetRanged) + if((src->supportedOperations() & AbstractSource::GetRanged) && (request.sourceUuid == "" || request.sourceUuid == src->uuid())) { src->getRangePropertyAsync(reply); diff --git a/ambd/pluginloader.cpp b/ambd/pluginloader.cpp index 7333e07d..be52bbb7 100644 --- a/ambd/pluginloader.cpp +++ b/ambd/pluginloader.cpp @@ -140,8 +140,7 @@ PluginLoader::PluginLoader(string configFile, AbstractRoutingEngine* re, int arg mSources.push_back(plugin); } } - DebugOut() << "Trying to free list" << endl; - //array_list_free(sourceslist); + DebugOut() << "Trying to free obj" << endl; json_object_put(sourcesobject); DebugOut() << "Done first" << endl; diff --git a/examples/bluemonkey/bluemonkeyconfig b/examples/bluemonkey/bluemonkeyconfig index 6176fb0e..d2663d0c 100644 --- a/examples/bluemonkey/bluemonkeyconfig +++ b/examples/bluemonkey/bluemonkeyconfig @@ -8,12 +8,6 @@ "baud" : "115200", "device" : "00:04:3E:1F:16:A3", "bluetoothAdapter" : "00:02:72:24:68:35" - }, - { - "name" : "Database", - "path" : "/usr/lib/automotive-message-broker/databasesinkplugin.so", - "properties" : "{ 'properties' : ['VehicleSpeed','EngineSpeed'] }", - "startOnLoad" : "true" }, { "path" : "/usr/lib/automotive-message-broker/gpsdplugin.so", diff --git a/examples/databaseconfig b/examples/databaseconfig index b7b42356..b83c67f8 100644 --- a/examples/databaseconfig +++ b/examples/databaseconfig @@ -16,11 +16,6 @@ { "name" : "Example Sink", "path" : "/usr/lib/automotive-message-broker/examplesinkplugin.so" - }, - { - "name" : "Websocket sink", - "path" : "/usr/lib/automotive-message-broker/websocketsinkplugin.so", - "interface" : "lo" } ] } diff --git a/lib/abstractroutingengine.h b/lib/abstractroutingengine.h index 3af4e89a..e71e3ba3 100644 --- a/lib/abstractroutingengine.h +++ b/lib/abstractroutingengine.h @@ -138,7 +138,7 @@ public: AsyncRangePropertyRequest(const AsyncRangePropertyRequest &request) { - this->property = request.property; + this->properties = request.properties; this->completed = request.completed; this->timeBegin = request.timeBegin; this->timeEnd = request.timeEnd; @@ -149,7 +149,7 @@ public: virtual ~AsyncRangePropertyRequest() {} - VehicleProperty::Property property; + PropertyList properties; std::string sourceUuid; GetRangedPropertyCompletedSignal completed; double timeBegin; diff --git a/plugins/bluemonkey/bluemonkey.cpp b/plugins/bluemonkey/bluemonkey.cpp index 8c8a9c12..fcbe47f2 100644 --- a/plugins/bluemonkey/bluemonkey.cpp +++ b/plugins/bluemonkey/bluemonkey.cpp @@ -176,7 +176,7 @@ void BluemonkeySink::loadConfigPriv() QFile file(str); if(!file.open(QIODevice::ReadOnly)) { - qDebug()<<"failed to open config file: "<<str; + DebugOut()<<"failed to open config file: "<<str.toStdString()<<endl; return; } @@ -184,9 +184,11 @@ void BluemonkeySink::loadConfigPriv() file.close(); + DebugOut()<<"evaluating script: "<<script.toStdString(); + QScriptValue val = engine->evaluate(script); - qDebug()<<val.toString(); + DebugOut()<<val.toString().toStdString()<<endl; } void BluemonkeySink::reloadEngine() @@ -260,7 +262,7 @@ void Property::setValue(QVariant v) } Property::Property(VehicleProperty::Property prop, AbstractRoutingEngine* re, QObject *parent) - :QObject(parent), AbstractSink(re, std::map<std::string,std::string>()),mValue(nullptr) +:QObject(parent), AbstractSink(re, std::map<std::string,std::string>()),mValue(nullptr) { setType(prop.c_str()); } diff --git a/plugins/database/databasesink.cpp b/plugins/database/databasesink.cpp index 33ce930c..aad404be 100644 --- a/plugins/database/databasesink.cpp +++ b/plugins/database/databasesink.cpp @@ -439,7 +439,17 @@ void DatabaseSink::getRangePropertyAsync(AsyncRangePropertyReply *reply) ostringstream query; query.precision(15); - query<<"SELECT * from "<<tablename<<" WHERE key='"<<reply->property<<"' AND"; + query<<"SELECT * from "<<tablename<<" WHERE ("; + + for(auto itr = reply->properties.begin(); itr != reply->properties.end(); itr++) + { + if(itr != reply->properties.begin()) + query<<" OR "; + + query<<"key='"<<(*itr)<<"'"; + } + + query<<") AND"; if(reply->timeBegin && reply->timeEnd) { diff --git a/plugins/examplesink.cpp b/plugins/examplesink.cpp index 95c87731..1dbeba1d 100644 --- a/plugins/examplesink.cpp +++ b/plugins/examplesink.cpp @@ -167,7 +167,12 @@ void ExampleSink::supportedChanged(PropertyList supportedProperties) vehicleSpeedFromLastWeek.timeBegin = amb::currentTime() - 10; vehicleSpeedFromLastWeek.timeEnd = amb::currentTime(); - vehicleSpeedFromLastWeek.property = VehicleProperty::VehicleSpeed; + + PropertyList requestList; + requestList.push_back(VehicleProperty::VehicleSpeed); + requestList.push_back(VehicleProperty::EngineSpeed); + + vehicleSpeedFromLastWeek.properties = requestList; vehicleSpeedFromLastWeek.completed = [](AsyncRangePropertyReply* reply) { std::list<AbstractPropertyType*> values = reply->values; |