From: Kevron Rees Date: Fri, 10 Jan 2014 00:19:16 +0000 (-0800) Subject: apply dynamic path to other Find methods. add dbus plugin documents. change default... X-Git-Tag: 0.11.800~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7abf3608cc7ae4c1e327a46d77649f9ceb65164;p=profile%2Fivi%2Fautomotive-message-broker.git apply dynamic path to other Find methods. add dbus plugin documents. change default frequency to 60 --- diff --git a/examples/websocketsink2 b/examples/websocketsink2 index 2f95e47..2ecebd4 100644 --- a/examples/websocketsink2 +++ b/examples/websocketsink2 @@ -13,7 +13,7 @@ "interface" : "lo", "ssl" : "false", "port" : "23000", - "binaryProtocol" : "true" + "binaryProtocol" : "false" } ] } diff --git a/examples/websocketsource2 b/examples/websocketsource2 index 25a8088..0c45aaa 100644 --- a/examples/websocketsource2 +++ b/examples/websocketsource2 @@ -2,11 +2,11 @@ "sources" : [ { "name" : "WebsocketSource", - "path" : "/usr/lib/automotive-message-broker/websocketsourceplugin.so", + "path" : "/usr/lib/automotive-message-broker/websocketsource.so", "port" : "23000", "ssl" : "false", "ip" : "127.0.0.1", - "binaryProtocol" : "true" + "binaryProtocol" : "false" } ], "sinks": [ diff --git a/plugins/dbus/README b/plugins/dbus/README new file mode 100644 index 0000000..b8d3b03 --- /dev/null +++ b/plugins/dbus/README @@ -0,0 +1,25 @@ +DBus plugin + +This plugin provides a nice DBus API to application who want access to AMB data. + +To use the DBus plugin, add the following to the "sinks" array in /etc/ambd/config: + +{ + "name" : "dbussink", + "path" : "/usr/lib/automotive-message-broker/dbussinkplugin.so", + "frequency" : "60" +} + +Configuration Key Definitions: + +"name" +name of plugin. This key is not used by the plugin at this moment. + +"path" +path to plugin on the filesystem. + +"frequency" +Frequency in Hz which AMB will fire dbus signals. AMB will fire the most recent values at this rate. + +Default: 60 + diff --git a/plugins/dbus/automotivemanager.cpp b/plugins/dbus/automotivemanager.cpp index a435d70..b5fb149 100644 --- a/plugins/dbus/automotivemanager.cpp +++ b/plugins/dbus/automotivemanager.cpp @@ -141,8 +141,20 @@ static void handleMethodCall(GDBusConnection *connection, for(auto itr = interfaces.begin(); itr != interfaces.end(); itr++) { AbstractDBusInterface* t = *itr; + if(t->zone() == (Zone::Type)zone) { + if(!t->isRegistered()) + t->registerObject(); + + std::list processes = manager->subscribedProcesses[t]; + + if(!contains(processes,sender)) + { + DebugOut()<<"Referencing "<objectPath()<<" with sender: "<subscribedProcesses[t].push_back(sender); + } + g_dbus_method_invocation_return_value(invocation,g_variant_new("(o)", t->objectPath().c_str())); return; } @@ -283,6 +295,17 @@ static void handleMethodCall(GDBusConnection *connection, boost::algorithm::erase_all(targetSource, "-"); if(t->zone() == (Zone::Type)zone && source == targetSource) { + if(!t->isRegistered()) + t->registerObject(); + + std::list processes = manager->subscribedProcesses[t]; + + if(!contains(processes,sender)) + { + DebugOut()<<"Referencing "<objectPath()<<" with sender: "<subscribedProcesses[t].push_back(sender); + } + g_dbus_method_invocation_return_value(invocation,g_variant_new("(o)", t->objectPath().c_str())); return; } diff --git a/plugins/dbus/dbusplugin.cpp b/plugins/dbus/dbusplugin.cpp index 9547072..7fa31c1 100644 --- a/plugins/dbus/dbusplugin.cpp +++ b/plugins/dbus/dbusplugin.cpp @@ -35,7 +35,7 @@ DBusSink::DBusSink(string propertyName, AbstractRoutingEngine* engine, GDBusConn { AbstractDBusInterface::re = engine; - int timeout = 50; + int timeout = 60; if(config.find("frequency") != config.end()) {