From: Kevron Rees Date: Sun, 27 Apr 2014 19:32:41 +0000 (-0700) Subject: change to example and dbus plugins X-Git-Tag: submit/tizen_ivi/20140619.111013~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bae50d4134d7e077db1abf828131c87c6385408c;p=profile%2Fivi%2Fautomotive-message-broker.git change to example and dbus plugins Example plugin was change to reflect best-practices. Allocating properties for every change should be avoided. Dbus plugin caching when not registered is now disabled. This improved performance by about 40%. --- diff --git a/plugins/dbus/dbusplugin.cpp b/plugins/dbus/dbusplugin.cpp index 5835cef..0dcf8bd 100644 --- a/plugins/dbus/dbusplugin.cpp +++ b/plugins/dbus/dbusplugin.cpp @@ -69,6 +69,9 @@ void DBusSink::supportedChanged(const PropertyList &supportedProperties) void DBusSink::propertyChanged(AbstractPropertyType *value) { + if(!isRegistered()) + return; + VehicleProperty::Property property = value->name; if(propertyDBusMap.find(property) == propertyDBusMap.end() || value->zone != zoneFilter) diff --git a/plugins/exampleplugin.cpp b/plugins/exampleplugin.cpp index 6ad6622..737605e 100644 --- a/plugins/exampleplugin.cpp +++ b/plugins/exampleplugin.cpp @@ -33,9 +33,11 @@ uint16_t accelerationX = 0; Transmission::TransmissionPositions transmissionShiftPostion = Transmission::Neutral; uint16_t steeringWheelAngle=0; uint16_t throttlePos = 0; -uint16_t engineCoolant = 40; +int engineCoolant = 40; bool machineGun = false; +const char* id = "6dd4268a-c605-4a06-9034-59c1e8344c8e"; + static gboolean timeoutCallback(gpointer data) { ExampleSourcePlugin* src = (ExampleSourcePlugin*)data; @@ -113,7 +115,7 @@ extern "C" AbstractSource * create(AbstractRoutingEngine* routingengine, map