updated idl to match api 93/6093/1
authorKevron Rees <kevron_m_rees@linux.intel.com>
Mon, 29 Jul 2013 22:29:26 +0000 (15:29 -0700)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Mon, 29 Jul 2013 23:03:00 +0000 (16:03 -0700)
src/Vehicle/Vehicle.cpp
src/Vehicle/Vehicle.idl

index be10960..8109e50 100644 (file)
@@ -209,7 +209,7 @@ GDBusProxy* VehicleMaster::automotiveManager()
 std::string VehicleMaster::findProperty(std::string objectName)
 {
        GDBusProxy* managerProxy = automotiveManager();
-       
+
        GError *error = nullptr;
        
        GVariant* objectPath = g_dbus_proxy_call_sync(managerProxy, "findProperty", g_variant_new("(s)", objectName.c_str()), G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
@@ -219,24 +219,24 @@ std::string VehicleMaster::findProperty(std::string objectName)
                LoggerE("Could not find property");
                return ""; 
        }
-       
+
        if(error)
        {
                LoggerD("error calling findProperty "<< error->message);
                g_error_free(error);
                return "";
        }
-       
+
        LoggerD("returned object path: " << g_variant_get_type_string(objectPath));
-       
+
        gchar * objP;
        g_variant_get(objectPath,"(o)", &objP);
-       
+
        LoggerD("findProperty() returned object path: " <<objP);
-       
+
        g_object_unref(managerProxy);
        g_variant_unref(objectPath);    
-       
+
        return objP;
        
 }
@@ -244,9 +244,9 @@ std::string VehicleMaster::findProperty(std::string objectName)
 void VehicleMaster::onSignalReceived(std::string objectName, std::map<std::string, GVariant*> propertyMap)
 {
        LoggerD("Entered");
-       
+
        std::stringstream json;
-               
+
        json<<"{";
 
        for(auto itr = propertyMap.begin(); itr != propertyMap.end(); itr++)
@@ -270,15 +270,15 @@ void VehicleMaster::onSignalReceived(std::string objectName, std::map<std::strin
        LoggerD("get json: " << json.str().c_str());
 
        JSStringRef jsonString = JSStringCreateWithUTF8CString(json.str().c_str());
-               
+
        std::list<VehicleSubscribeCB> cbs = objectToFunctionListMap[objectName];
-       
+
        if(!cbs.size())
        {
                LoggerD("No callbacks for this signal.  aborting");
                return;
        }
-       
+
        auto cbitr = cbs.begin();
        
        JSValueRef value =  JSValueMakeFromJSONString((*cbitr).context, jsonString);
@@ -290,7 +290,7 @@ void VehicleMaster::onSignalReceived(std::string objectName, std::map<std::strin
        }
 
        const JSValueRef arguments[1] = { value };
-       
+
        try{
        for(auto itr = cbs.begin(); itr != cbs.end(); itr++)
        {
@@ -309,9 +309,7 @@ void VehicleMaster::onSignalReceived(std::string objectName, std::map<std::strin
 GVariant* VehicleMaster::listObjects()
 {
        LoggerD("Entered");
-       
-       //std::list<std::string> supportedObjects;
-       
+
        GDBusProxy* managerProxy = automotiveManager();
        
        GError *error = nullptr;
@@ -325,19 +323,7 @@ GVariant* VehicleMaster::listObjects()
                g_object_unref(managerProxy);
                return NULL;
        }
-       
-       
-       /*GVariant *value;
-       GVariantIter iter;
-
-       g_variant_get(supportedList,"(as)",&iter);
 
-       while(g_variant_iter_next(iter,"(s)", &key, &value))
-       {
-               supportedObjects.push_back(g_variant_get_string(value);
-               g_variant_unref(value);
-       }
-*/
        g_object_unref(managerProxy);
        return supportedList;
 }
index 42c4b99..8430e2c 100644 (file)
@@ -54,18 +54,16 @@ callback SupportedPropertiesCallback = void (sequence<DOMString> properties);
 interface Vehicle  { 
 
        /**  
-        *  \brief returns supported properties  
-        *  \arg VehiclePropertyCallback successCallback function to be called when method has completed successfully  
-        *  \arg VehiclePropertyErrorCallback errorCallback this function is called when an error has occured.
+        *  \brief returns supported object types
         **/
-       getSupported(SupportedPropertiesCallback successCallback, optional VehiclePropertyErrorCallback errorCallback);
+       sequence<DOMString> supported();
 
        /**  
-        *  \brief fetch the current value for 'property'.  
-        *  \arg DOMString property is the requested property to be retrieved.
-        *  \returns object representing the requested 'property'
+        *  \brief fetch the current value for 'objectType'.  
+        *  \arg DOMString objectType is the requested property to be retrieved.
+        *  \returns object representing the requested 'objectType'
         **/
-       any get(DOMString property);  
+       any get(DOMString objectType);  
 
        /** \brief subscribe to the given property and get callbacks when it changes
         *  \arg DOMString property property to set