fixed regression in cangen plugin
authorKevron Rees <kevron.m.rees@intel.com>
Tue, 21 Oct 2014 21:41:45 +0000 (14:41 -0700)
committerKevron Rees <kevron.m.rees@intel.com>
Tue, 21 Oct 2014 22:20:44 +0000 (15:20 -0700)
examples/CMakeLists.txt
examples/cangenconfig.in [moved from examples/cangenconfig with 52% similarity]
plugins/bluemonkey/bluemonkey.h
plugins/cangenplugin/cangenplugin.cpp
plugins/common/ambplugin.h

index 4d68156..28ff5a3 100644 (file)
@@ -16,6 +16,7 @@ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/qtmainloopconfig.in ${CMAKE_CURRENT_
 configure_file (${CMAKE_CURRENT_SOURCE_DIR}/websocketsink2.in ${CMAKE_CURRENT_SOURCE_DIR}/websocketsink2 @ONLY)
 configure_file (${CMAKE_CURRENT_SOURCE_DIR}/websocketsource2.in ${CMAKE_CURRENT_SOURCE_DIR}/websocketsource2 @ONLY)
 configure_file (${CMAKE_CURRENT_SOURCE_DIR}/testsourceconfig.in ${CMAKE_CURRENT_SOURCE_DIR}/testsourceconfig @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cangenconfig.in ${CMAKE_CURRENT_SOURCE_DIR}/cangenconfig @ONLY)
 configure_file (${CMAKE_CURRENT_SOURCE_DIR}/bluemonkey/bluemonkeyconfig.in ${CMAKE_CURRENT_SOURCE_DIR}/bluemonkey/bluemonkeyconfig @ONLY)
 
 install (FILES ${amb_examples} DESTINATION /etc/ambd/examples)
similarity index 52%
rename from examples/cangenconfig
rename to examples/cangenconfig.in
index 816c74e..81add2c 100644 (file)
@@ -2,18 +2,18 @@
        "sources" : [ 
                {
                        "name" : "CANSimPlugin",
-                       "path":"/usr/lib/automotive-message-broker/cansimplugin.so",
+                       "path":"@PLUGIN_INSTALL_PATH@/cansimplugin.so",
                        "interfaces" : ["vcan0", "vcan1"]
                },
                { 
                        "name" : "CANGenPlugin",
-                       "path":"/usr/lib/automotive-message-broker/cangenplugin.so"
+                       "path":"@PLUGIN_INSTALL_PATH@/cangenplugin.so"
                }
        ],
        "sinks": [
                {
                        "name" : "DBusSink",
-                       "path" : "/usr/lib/automotive-message-broker/dbussinkplugin.so",
+                       "path" : "@PLUGIN_INSTALL_PATH@/dbussinkplugin.so",
                        "frequency" : "60"
                }
 
index 7f1a1a2..2a08856 100644 (file)
@@ -88,7 +88,11 @@ private:
 class BluemonkeySink : public QObject, public AmbPluginImpl
 {
 Q_OBJECT
+
 public:
+       using AmbPluginImpl::setProperty;
+       using QObject::setProperty;
+
        BluemonkeySink(AbstractRoutingEngine* e, map<string, string> config,  AbstractSource& parent);
        virtual PropertyList subscriptions();
        virtual void supportedChanged(const PropertyList & supportedProperties);
index 5ed91b9..c5ccdd6 100644 (file)
@@ -88,7 +88,7 @@ AsyncPropertyReply *CANGenPlugin::setProperty(const AsyncSetPropertyRequest &req
        {
                std::string v = request.value->toString();
 
-               dataReceived(nullptr,v.c_str(),v.length());
+               dataReceived(nullptr, v.c_str(), v.length());
        }
 
        return AmbPluginImpl::setProperty(request);
@@ -408,13 +408,13 @@ void CANGenPlugin::dataReceived(libwebsocket* socket, const char* data, size_t l
                        }
                        else if (name == "set")
                        {
+                               LOG_MESSAGE("set called");
                                if (!propertyNames.empty())
                                {
                                        //Should not happen
                                }
                                else if (!propertyData.empty())
                                {
-                                       auto prop = propertyData.begin();
                                        for (auto prop = propertyData.begin(); prop != propertyData.end(); ++prop)
                                        {
                                                LOG_MESSAGE("websocketsinkmanager setting " << std::get<1>(*prop) << " to " << std::get<2>(*prop) << " in zone " << std::get<3>(*prop));
index 4719128..47fc94e 100644 (file)
@@ -207,7 +207,9 @@ void AmbPlugin<T>::getRangePropertyAsync(AsyncRangePropertyReply *reply)
 template<typename T>
 AsyncPropertyReply* AmbPlugin<T>::setProperty(AsyncSetPropertyRequest request)
 {
-       return d ? d->AmbPluginImpl::setProperty(request) : nullptr;
+       if(d)
+               return d->setProperty(request);
+       return nullptr;
 }
 
 template<typename T>