OSDN Git Service

dbus: Rename to org.bluez.Device1
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Wed, 5 Dec 2012 12:51:41 +0000 (13:51 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Wed, 5 Dec 2012 14:41:30 +0000 (16:41 +0200)
Trivially add the numbering suffix to org.bluez.Device according to
the proposal for BlueZ 5.

doc/adapter-api.txt
doc/device-api.txt
profiles/cups/main.c
src/device.h
test/bluezutils.py
test/list-devices
test/monitor-bluetooth
test/simple-agent
test/test-attrib
test/test-device

index 983a20d..cf8374d 100644 (file)
@@ -107,7 +107,7 @@ Signals             DevicesFound(array{object path, dict values})
                        device discovery.
 
                        The dictionary contains the properties from the
-                       org.bluez.Device interface.
+                       org.bluez.Device1 interface.
 
 Properties     string Address [readonly]
 
index c1f2361..36ea1d9 100644 (file)
@@ -11,7 +11,7 @@ Device hierarchy
 ================
 
 Service                org.bluez
-Interface      org.bluez.Device
+Interface      org.bluez.Device1
 Object path    [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
 
 Methods                dict DiscoverServices(string pattern)
index 977c057..ae0cc6a 100644 (file)
@@ -133,7 +133,7 @@ static char *device_get_ieee1284_id(const char *adapter, const char *device)
 
        /* Look for the service handle of the HCRP service */
        message = dbus_message_new_method_call("org.bluez", device,
-                                               "org.bluez.Device",
+                                               "org.bluez.Device1",
                                                "DiscoverServices");
        dbus_message_iter_init_append(message, &iter);
        dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &hcr_print);
@@ -309,7 +309,7 @@ static gboolean device_is_printer(const char *adapter, const char *device_path,
        gboolean retval;
 
        message = dbus_message_new_method_call("org.bluez", device_path,
-                                                       "org.bluez.Device",
+                                                       "org.bluez.Device1",
                                                        "GetProperties");
 
        reply = dbus_connection_send_with_reply_and_block(conn,
index 1d7f54f..cb0bb50 100644 (file)
@@ -22,7 +22,7 @@
  *
  */
 
-#define DEVICE_INTERFACE       "org.bluez.Device"
+#define DEVICE_INTERFACE       "org.bluez.Device1"
 
 struct btd_device;
 
index 70fe01b..803805b 100644 (file)
@@ -2,7 +2,7 @@ import dbus
 
 SERVICE_NAME = "org.bluez"
 ADAPTER_INTERFACE = SERVICE_NAME + ".Adapter"
-DEVICE_INTERFACE = SERVICE_NAME + ".Device"
+DEVICE_INTERFACE = SERVICE_NAME + ".Device1"
 
 def get_managed_objects():
        bus = dbus.SystemBus()
index e8f3f24..7e56239 100755 (executable)
@@ -32,7 +32,7 @@ def extract_uuids(uuid_list):
 objects = manager.GetManagedObjects()
 
 all_devices = (str(path) for path, interfaces in objects.iteritems() if
-                                       "org.bluez.Device" in interfaces.keys())
+                                       "org.bluez.Device1" in interfaces.keys())
 
 for path, interfaces in objects.iteritems():
        if "org.bluez.Adapter" not in interfaces.keys():
@@ -55,7 +55,7 @@ for path, interfaces in objects.iteritems():
                print("    [ " + dev_path + " ]")
 
                dev = objects[dev_path]
-               properties = dev["org.bluez.Device"]
+               properties = dev["org.bluez.Device1"]
 
                for key in properties.keys():
                        value = properties[key]
index 45cc910..cfda322 100755 (executable)
@@ -7,7 +7,7 @@ import gobject
 import dbus
 import dbus.mainloop.glib
 
-relevant_ifaces = [ "org.bluez.Adapter", "org.bluez.Device" ]
+relevant_ifaces = [ "org.bluez.Adapter", "org.bluez.Device1" ]
 
 def property_changed(interface, changed, invalidated, path):
        iface = interface[interface.rfind(".") + 1:]
index 3c51530..15f2a32 100755 (executable)
@@ -24,11 +24,11 @@ def ask(prompt):
 def set_trusted(path):
        props = dbus.Interface(bus.get_object("org.bluez", path),
                                        "org.freedesktop.DBus.Properties")
-       props.Set("org.bluez.Device", "Trusted", True)
+       props.Set("org.bluez.Device1", "Trusted", True)
 
 def dev_connect(path):
        dev = dbus.Interface(bus.get_object("org.bluez", path),
-                                                       "org.bluez.Device")
+                                                       "org.bluez.Device1")
        dev.Connect()
 
 class Rejected(dbus.DBusException):
index 2b0b010..aadffaa 100755 (executable)
@@ -40,7 +40,7 @@ if (args[0] == "list"):
        adapter = bluezutils.find_adapter(options.dev_id)
        for path in adapter.GetProperties()["Devices"]:
                device = dbus.Interface(bus.get_object("org.bluez", path),
-                                                       "org.bluez.Device")
+                                                       "org.bluez.Device1")
                devprop = device.GetProperties()
                print("[ %s ]" % devprop["Address"])
                for path in devprop["Services"]:
index d40d656..655eeae 100755 (executable)
@@ -49,9 +49,9 @@ if (args[0] == "list"):
        objects = om.GetManagedObjects()
 
        for path, interfaces in objects.iteritems():
-               if "org.bluez.Device" not in interfaces:
+               if "org.bluez.Device1" not in interfaces:
                        continue
-               properties = interfaces["org.bluez.Device"]
+               properties = interfaces["org.bluez.Device1"]
                if properties["Adapter"] != adapter_path:
                        continue;
                print("%s %s" % (properties["Address"], properties["Alias"]))
@@ -142,7 +142,7 @@ if (args[0] == "class"):
                device = bluezutils.find_device(args[1], options.dev_id)
                device = dbus.Interface(bus.get_object("org.bluez", path),
                                        "org.freedesktop.DBus.Properties")
-               cls = device.Get("org.bluez.Device", "Class")
+               cls = device.Get("org.bluez.Device1", "Class")
                print("0x%06x" % cls)
        sys.exit(0)
 
@@ -154,7 +154,7 @@ if (args[0] == "name"):
                path = device.object_path
                props = dbus.Interface(bus.get_object("org.bluez", path),
                                        "org.freedesktop.DBus.Properties")
-               name = props.Get("org.bluez.Device", "Name")
+               name = props.Get("org.bluez.Device1", "Name")
                print(name)
        sys.exit(0)
 
@@ -167,10 +167,10 @@ if (args[0] == "alias"):
                props = dbus.Interface(bus.get_object("org.bluez", path),
                                        "org.freedesktop.DBus.Properties")
                if (len(args) < 3):
-                       alias = device.Get("org.bluez.Device", "Alias")
+                       alias = device.Get("org.bluez.Device1", "Alias")
                        print(alias)
                else:
-                       device.Set("org.bluez.Device", "Alias", args[2])
+                       device.Set("org.bluez.Device1", "Alias", args[2])
        sys.exit(0)
 
 if (args[0] == "trusted"):
@@ -182,7 +182,7 @@ if (args[0] == "trusted"):
                props = dbus.Interface(bus.get_object("org.bluez", path),
                                        "org.freedesktop.DBus.Properties")
                if (len(args) < 3):
-                       trusted = device.Get("org.bluez.Device", "Trusted")
+                       trusted = device.Get("org.bluez.Device1", "Trusted")
                        print(trusted)
                else:
                        if (args[2] == "yes"):
@@ -191,7 +191,7 @@ if (args[0] == "trusted"):
                                value = dbus.Boolean(0)
                        else:
                                value = dbus.Boolean(args[2])
-                       device.Set("org.bluez.Device", "Trusted", value)
+                       device.Set("org.bluez.Device1", "Trusted", value)
        sys.exit(0)
 
 if (args[0] == "blocked"):
@@ -203,7 +203,7 @@ if (args[0] == "blocked"):
                props = dbus.Interface(bus.get_object("org.bluez", path),
                                        "org.freedesktop.DBus.Properties")
                if (len(args) < 3):
-                       blocked = device.Get("org.bluez.Device", "Blocked")
+                       blocked = device.Get("org.bluez.Device1", "Blocked")
                        print(blocked)
                else:
                        if (args[2] == "yes"):
@@ -212,7 +212,7 @@ if (args[0] == "blocked"):
                                value = dbus.Boolean(0)
                        else:
                                value = dbus.Boolean(args[2])
-                       device.Set("org.bluez.Device", "Blocked", value)
+                       device.Set("org.bluez.Device1", "Blocked", value)
        sys.exit(0)
 
 if (args[0] == "services"):
@@ -223,7 +223,7 @@ if (args[0] == "services"):
                path = device.object_path
                props = dbus.Interface(bus.get_object("org.bluez", path),
                                        "org.freedesktop.DBus.Properties")
-               services = device.Get("org.bluez.Device", "Services")
+               services = device.Get("org.bluez.Device1", "Services")
                for path in services:
                        print(path)
        sys.exit(0)