"sinks": [
{
"name" : "DBusSink",
- "path" : "/usr/lib/automotive-message-broker/dbussinkplugin.so"
+ "path" : "/usr/lib/automotive-message-broker/dbussinkplugin.so",
+ "frequency" : "1060"
}
]
GDBusConnection* connection)
: mInterfaceName(interfaceName), mConnection(connection), mPropertyName(objectName), supported(false), zoneFilter(Zone::None), mTime(0), regId(0)
{
- if(!signaller)
- {
- signaller = DBusSignaller::factory(50);
- }
-
startRegistration();
mObjectPath = "/" + objectName;
throw -1;
}
+void AbstractDBusInterface::setTimeout(int timeout)
+{
+ if(signaller)
+ delete signaller;
+
+ signaller = DBusSignaller::factory(timeout);
+}
+
#include <nullptr.h>
#include "abstractpropertytype.h"
#include <abstractroutingengine.h>
+#include "dbussignaller.hpp"
class AbstractProperty;
virtual void setProperty(std::string propertyName, GVariant * value);
virtual GVariant * getProperty(std::string propertyName);
+
+ void setTimeout(int timeout);
std::unordered_map<std::string, AbstractProperty*> properties;
static std::unordered_map<std::string, AbstractDBusInterface*> objectMap;
static std::list<std::string> mimplementedProperties;
guint regId;
+ int mTimeout;
};
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <boost/lexical_cast.hpp>
#include "dbusplugin.h"
#include "abstractroutingengine.h"
AbstractSink(engine, config)
{
AbstractDBusInterface::re = engine;
+
+ int timeout = 50;
+
+ if(config.find("frequency") != config.end())
+ {
+ int t = boost::lexical_cast<int>(config["frequency"]);
+
+ timeout = 1000 / t;
+ }
+
+ setTimeout(timeout);
}
void DBusSink::supportedChanged(PropertyList supportedProperties)
#ifndef _DBUSSIGNALLER_H_
-#define _DBUSSINGALLER_H_
+#define _DBUSSIGNALLER_H_
#include <gio/gio.h>
#include <map>