fixed some previous merge bugs that may have broken building a few plugins. also...
authorKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 6 Jun 2013 20:43:28 +0000 (13:43 -0700)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 6 Jun 2013 20:43:28 +0000 (13:43 -0700)
ambd/core.cpp
lib/abstractroutingengine.h
plugins/dbus/abstractdbusinterface.cpp
plugins/websocketsourceplugin/websocketsource.cpp

index d369ea9..e771561 100644 (file)
@@ -194,7 +194,7 @@ AsyncPropertyReply *Core::getPropertyAsync(AsyncPropertyRequest request)
 
                bool supportsGet = supportedOps & AbstractSource::Get;
 
-               if(ListPlusPlus<VehicleProperty::Property>(&properties).contains(request.property) && supportsGet)
+               if(ListPlusPlus<VehicleProperty::Property>(&properties).contains(request.property) && supportsGet && (request.sourceUuid == "" || request.sourceUuid == src->uuid()))
                {
                        src->getPropertyAsync(reply);
 
@@ -215,7 +215,9 @@ AsyncRangePropertyReply *Core::getRangePropertyAsync(AsyncRangePropertyRequest r
        {
                AbstractSource* src = (*itr);
                PropertyList properties = src->supported();
-               if(ListPlusPlus<VehicleProperty::Property>(&properties).contains(request.property) && src->supportedOperations() & AbstractSource::GetRanged)
+               if(ListPlusPlus<VehicleProperty::Property>(&properties).contains(request.property)
+                               && (src->supportedOperations() & AbstractSource::GetRanged)
+                               && (request.sourceUuid == "" || request.sourceUuid == src->uuid()))
                {
                        src->getRangePropertyAsync(reply);
                }
index c3bf267..1c3ae98 100644 (file)
 #ifndef ABSTRACTROUTINGENGINE_H
 #define ABSTRACTROUTINGENGINE_H
 
-#include "sys/types.h"
+#include <sys/types.h>
 #include <stdlib.h>
-
 #include <boost/any.hpp>
 #include <functional>
+#include <string>
 #include <time.h>
+
 #include "vehicleproperty.h"
 #include "abstractpropertytype.h"
 
@@ -51,17 +52,20 @@ public:
        {
                this->property = request.property;
                this->completed = request.completed;
+               this->sourceUuid = request.sourceUuid;
        }
 
        AsyncPropertyRequest & operator = (const AsyncPropertyRequest & other)
        {
                this->property = other.property;
                this->completed = other.completed;
+               this->sourceUuid = other.sourceUuid;
 
                return *this;
        }
 
        VehicleProperty::Property property;
+       std::string sourceUuid;
        GetPropertyCompletedSignal completed;
 };
 
@@ -115,9 +119,11 @@ public:
                this->timeEnd = request.timeEnd;
                this->sequenceBegin = request.sequenceBegin;
                this->sequenceEnd = request.sequenceEnd;
+               this->sourceUuid = request.sourceUuid;
        }
 
        VehicleProperty::Property property;
+       std::string sourceUuid;
        GetRangedPropertyCompletedSignal completed;
        double timeBegin;
        double timeEnd;
index 8f41567..c626b46 100644 (file)
@@ -27,6 +27,23 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 unordered_map<string, AbstractDBusInterface*> AbstractDBusInterface::interfaceMap;
 list<string> AbstractDBusInterface::mimplementedProperties;
 
+
+static void handleMethodCall(GDBusConnection       *connection,
+                                                        const gchar           *sender,
+                                                        const gchar           *object_path,
+                                                        const gchar           *interface_name,
+                                                        const gchar           *method_name,
+                                                        GVariant              *parameters,
+                                                        GDBusMethodInvocation *invocation,
+                                                        gpointer               user_data)
+{
+
+       std::string method = method_name;
+
+
+
+}
+
 AbstractDBusInterface::AbstractDBusInterface(string interfaceName, string op,
                                                                                         GDBusConnection* connection)
        : mInterfaceName(interfaceName), mObjectPath(op), mConnection(connection)
@@ -52,10 +69,15 @@ void AbstractDBusInterface::addProperty(AbstractProperty* property)
 
        ///see which properties are supported:
        introspectionXml +=     "<property type='"+ property->signature() + "' name='"+ property->name()+"' access='"+access+"' />"
-       "<signal name='" + property->name() + "Changed' >"
-       "       <arg type='v' name='" + nameToLower + "' direction='out' />"
-       "       <arg type='d' name='timestamp' direction='out' />"
-       "</signal>";
+                       "<method name='get" + property->name() + "Extended'>"
+                       "       <arg type='v' direction='out' name='value' />"
+                       "       <arg type='d' direction='out' name='timestamp' />"
+                       "       <arg type='d' direction='out' name='sequence' />"
+                       "</method>"
+                       "<signal name='" + property->name() + "Changed' >"
+                       "       <arg type='v' name='" + nameToLower + "' direction='out' />"
+                       "       <arg type='d' name='timestamp' direction='out' />"
+                       "</signal>";
        
        properties[property->name()] = property;
 
@@ -100,18 +122,10 @@ void AbstractDBusInterface::registerObject()
 
        GDBusInterfaceInfo* mInterfaceInfo = g_dbus_node_info_lookup_interface(introspection, mInterfaceName.c_str());
 
-       auto fakeMethodCb = [](GDBusConnection *connection,
-                       const gchar *sender,
-                       const gchar *object_path,
-                       const gchar *interface_name,
-                       const gchar *method_name,
-                       GVariant *parameters,
-                       GDBusMethodInvocation *invocation,
-                       gpointer user_data) { };
 
-       const GDBusInterfaceVTable vtable = { fakeMethodCb, AbstractDBusInterface::getProperty, AbstractDBusInterface::setProperty };
+       const GDBusInterfaceVTable vtable = { handleMethodCall, AbstractDBusInterface::getProperty, AbstractDBusInterface::setProperty };
 
-       regId = g_dbus_connection_register_object(mConnection, mObjectPath.c_str(), mInterfaceInfo, &vtable, NULL, NULL, &error);
+       regId = g_dbus_connection_register_object(mConnection, mObjectPath.c_str(), mInterfaceInfo, &vtable, this, NULL, &error);
        
        if(error) throw -1;
        
index 21a7e43..290a73f 100644 (file)
@@ -170,13 +170,12 @@ static int checkTimeouts(gpointer data)
                                src->uuidRangedReplyMap.erase((*i).first);
                                src->uuidTimeoutMap.erase((*i).first);
                                i--;
-<<<<<<< HEAD
-=======
+
                                if (src->uuidTimeoutMap.size() == 0)
                                {
                                        return 0;
                                }
->>>>>>> 46f67f8d33d8eccc26d9326ce1c6b9745dc6bb97
+
                        }
                        else
                        {
@@ -188,11 +187,7 @@ static int checkTimeouts(gpointer data)
                        //Reply has already come back, ignore and erase from list.
                        src->uuidTimeoutMap.erase((*i).first);
                        i--;
-<<<<<<< HEAD
-               }
 
-       }
-=======
                        if (src->uuidTimeoutMap.size() == 0)
                        {
                                return 0;
@@ -201,7 +196,6 @@ static int checkTimeouts(gpointer data)
 
        }
        return 0;
->>>>>>> 46f67f8d33d8eccc26d9326ce1c6b9745dc6bb97
 }
 
 static int callback_http_only(libwebsocket_context *context,struct libwebsocket *wsi,enum libwebsocket_callback_reasons reason,void *user, void *in, size_t len)
@@ -431,19 +425,12 @@ static int callback_http_only(libwebsocket_context *context,struct libwebsocket
                                                        source->uuidReplyMap[id]->success = true;
                                                        source->uuidReplyMap[id]->completed(source->uuidReplyMap[id]);
                                                        source->uuidReplyMap.erase(id);
-<<<<<<< HEAD
-                                                               delete v;
-=======
->>>>>>> 46f67f8d33d8eccc26d9326ce1c6b9745dc6bb97
+
                                                }
                                                else
                                                {
                                                        DebugOut() << "get methodReply has been recieved, without a request being in!. This is likely due to a request coming in after the timeout has elapsed.\n";
                                                }
-<<<<<<< HEAD
-=======
-                                                       delete v;
->>>>>>> 46f67f8d33d8eccc26d9326ce1c6b9745dc6bb97
                                        }
                                        else
                                        {
@@ -484,7 +471,7 @@ static int callback_http_only(libwebsocket_context *context,struct libwebsocket
 }
 void WebSocketSource::setSupported(PropertyList list)
 {
-  DebugOut() << "SET SUPPORTED";
+       DebugOut() <<__SMALLFILE__ << ":" << __LINE__ <<"SET SUPPORTED"<<endl;
        m_supportedProperties = list;
        m_re->updateSupported(list,PropertyList());
 }