diff options
author | Mikel Astiz <mikel.astiz@bmw-carit.de> | 2012-12-06 14:34:43 +0100 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-12-06 17:41:39 +0200 |
commit | 419f00496cb793ff25d3dba1048e668f12d9662d (patch) | |
tree | 561e5c625863c69c99b23264ce68b69b27917168 /test/test-device | |
parent | 8f0d6c96c4409979646e81b60cfdba517ed1e48b (diff) | |
download | bluez-419f00496cb793ff25d3dba1048e668f12d9662d.tar.gz |
test: Fix test-device using wrong interface
The property getter and setter belong to org.freedesktop.DBus.Properties
and therefore fix this code using the wrong interface since commit
67dab2d2aeec9ab895da6afd528ec0c63e657ff4.
Diffstat (limited to 'test/test-device')
-rwxr-xr-x | test/test-device | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/test-device b/test/test-device index 655eeae3c..2be5394cd 100755 --- a/test/test-device +++ b/test/test-device @@ -140,9 +140,10 @@ if (args[0] == "class"): print("Need address parameter") else: device = bluezutils.find_device(args[1], options.dev_id) - device = dbus.Interface(bus.get_object("org.bluez", path), + path = device.object_path + props = dbus.Interface(bus.get_object("org.bluez", path), "org.freedesktop.DBus.Properties") - cls = device.Get("org.bluez.Device1", "Class") + cls = props.Get("org.bluez.Device1", "Class") print("0x%06x" % cls) sys.exit(0) @@ -167,10 +168,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.Device1", "Alias") + alias = props.Get("org.bluez.Device1", "Alias") print(alias) else: - device.Set("org.bluez.Device1", "Alias", args[2]) + props.Set("org.bluez.Device1", "Alias", args[2]) sys.exit(0) if (args[0] == "trusted"): @@ -182,7 +183,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.Device1", "Trusted") + trusted = props.Get("org.bluez.Device1", "Trusted") print(trusted) else: if (args[2] == "yes"): @@ -191,7 +192,7 @@ if (args[0] == "trusted"): value = dbus.Boolean(0) else: value = dbus.Boolean(args[2]) - device.Set("org.bluez.Device1", "Trusted", value) + props.Set("org.bluez.Device1", "Trusted", value) sys.exit(0) if (args[0] == "blocked"): @@ -203,7 +204,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.Device1", "Blocked") + blocked = props.Get("org.bluez.Device1", "Blocked") print(blocked) else: if (args[2] == "yes"): @@ -212,7 +213,7 @@ if (args[0] == "blocked"): value = dbus.Boolean(0) else: value = dbus.Boolean(args[2]) - device.Set("org.bluez.Device1", "Blocked", value) + props.Set("org.bluez.Device1", "Blocked", value) sys.exit(0) if (args[0] == "services"): @@ -223,7 +224,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.Device1", "Services") + services = props.Get("org.bluez.Device1", "Services") for path in services: print(path) sys.exit(0) |