fixed runtime errors and warnings with dbus plugin
authorKevron Rees <kevron.m.rees@intel.com>
Fri, 28 Mar 2014 21:06:06 +0000 (14:06 -0700)
committerKevron Rees <kevron.m.rees@intel.com>
Fri, 28 Mar 2014 21:42:57 +0000 (14:42 -0700)
plugins/dbus/dbusinterfacemanager.cpp
plugins/dbus/dbusinterfacemanager.h
plugins/exampleplugin.cpp

index 115891d..9f78867 100644 (file)
@@ -210,7 +210,7 @@ on_bus_acquired (GDBusConnection *connection, const gchar *name, gpointer user_d
        exportProperty<SteeringWheelPositionProperty>(iface->re, connection);
        exportProperty<MirrorSettingProperty>(iface->re, connection);
 
-       iface->supportedChanged(iface->re->supported());
+       iface->registerCustomTypes();
 }
 
 static void
@@ -257,10 +257,14 @@ void DBusInterfaceManager::supportedChanged(const PropertyList &supportedPropert
        DebugOut()<<"supported Properties: "<<supportedProperties.size()<<endl;
        if(!connection)
        {
-               DebugOut(DebugOut::Warning)<<"supportedChanged called before we have a dbus connection"<<endl;
                return;
        }
 
+       registerCustomTypes();
+}
+
+void DBusInterfaceManager::registerCustomTypes()
+{
        PropertyList list = VehicleProperty::customProperties();
        PropertyList implemented = AbstractDBusInterface::implementedProperties();
 
index bfef0dc..72a4808 100644 (file)
@@ -41,8 +41,10 @@ public:
     
        GDBusConnection * connection;
 
+       void registerCustomTypes();
+
 private:
-       
+
        unsigned int ownerId;
 
 
index 3b7fa8a..bc62f02 100644 (file)
@@ -151,6 +151,13 @@ void ExampleSourcePlugin::getPropertyAsync(AsyncPropertyReply *reply)
                reply->success = true;
                reply->completed(reply);
        }
+       else if(reply->property == VehicleProperty::TransmissionGearPosition)
+       {
+               VehicleProperty::TransmissionGearPositionType temp(transmissionShiftPostion);
+               reply->value = &temp;
+               reply->success = true;
+               reply->completed(reply);
+       }
        else if(reply->property == VehicleProperty::SteeringWheelAngle)
        {
                VehicleProperty::SteeringWheelAngleType temp(steeringWheelAngle);