g_variant_builder_add(&builder, "{sv}", property->name().c_str(), val);
g_variant_builder_add(&builder, "{sv}", std::string(property->name() + "Sequence").c_str(), g_variant_new("i", property->sequence()));
g_variant_builder_add(&builder, "{sv}", "Time", g_variant_new("d", property->timestamp()) );
+ g_variant_builder_add(&builder, "{sv}", "Zone", g_variant_new("i", property->value()->zone) );
g_dbus_connection_emit_signal(signal.connection, NULL, signal.objectPath.c_str(), "org.freedesktop.DBus.Properties", signal.signalName.c_str(), g_variant_new("(sa{sv}as)",
signal.interface.c_str(),
-set(amb_tests amb-get amb-set amb-get-history)
+set(amb_tests amb-get amb-set amb-get-history amb-listen)
install (PROGRAMS ${amb_tests} DESTINATION bin)
import dbus
import sys
import argparse
+import gobject
+import json
+from dbus.mainloop.glib import DBusGMainLoop
+
+
+def print_data(interface, properties, invalidated):
+ print json.dumps(properties, indent=2)
parser = argparse.ArgumentParser()
parser.add_argument("get", help="get {objectName}")
objectName = args.get
+dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
managerObject = bus.get_object("org.automotive.message.broker", "/");
managerInterface = dbus.Interface(managerObject, "org.automotive.Manager")
for o in objects:
propertiesInterface = dbus.Interface(bus.get_object("org.automotive.message.broker", o),"org.freedesktop.DBus.Properties")
- print propertiesInterface.GetAll("org.automotive."+objectName)
+ bus.add_signal_receiver(print_data,
+ dbus_interface="org.freedesktop.DBus.Properties",
+ signal_name="PropertiesChanged")
+
+loop = gobject.MainLoop()
+loop.run()