From 554d63bfb7c729954b2bee311e426edea25dfb9f Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Mon, 29 Jul 2013 15:29:26 -0700 Subject: [PATCH] updated idl to match api --- src/Vehicle/Vehicle.cpp | 42 ++++++++++++++---------------------------- src/Vehicle/Vehicle.idl | 14 ++++++-------- 2 files changed, 20 insertions(+), 36 deletions(-) diff --git a/src/Vehicle/Vehicle.cpp b/src/Vehicle/Vehicle.cpp index be10960..8109e50 100644 --- a/src/Vehicle/Vehicle.cpp +++ b/src/Vehicle/Vehicle.cpp @@ -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: " < 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 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 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; } diff --git a/src/Vehicle/Vehicle.idl b/src/Vehicle/Vehicle.idl index 42c4b99..8430e2c 100644 --- a/src/Vehicle/Vehicle.idl +++ b/src/Vehicle/Vehicle.idl @@ -54,18 +54,16 @@ callback SupportedPropertiesCallback = void (sequence 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 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 -- 2.7.4