summaryrefslogtreecommitdiff
path: root/test/test-adapter
diff options
context:
space:
mode:
authorMikel Astiz <mikel.astiz@bmw-carit.de>2012-12-05 13:51:30 +0100
committerJohan Hedberg <johan.hedberg@intel.com>2012-12-05 16:39:34 +0200
commit90e7850d95b36c6c2e7a0fffe848b8b48557b6f3 (patch)
treeedc18cdc6bc0af6ce721d4fe2ec19cb3963504e1 /test/test-adapter
parent6e5459128be74eed55307da4a8af99d7192100ad (diff)
downloadbluez-90e7850d95b36c6c2e7a0fffe848b8b48557b6f3.tar.gz
test: Avoid using DefaultAdapter()
Call the utility library -which uses ObjectManager API- to avoid using Manager.FindAdapter() and Manager.DefaultAdapter().
Diffstat (limited to 'test/test-adapter')
-rwxr-xr-xtest/test-adapter9
1 files changed, 2 insertions, 7 deletions
diff --git a/test/test-adapter b/test/test-adapter
index a37dd30d5..dc66aa6dd 100755
--- a/test/test-adapter
+++ b/test/test-adapter
@@ -6,11 +6,10 @@ import sys
import dbus
import time
from optparse import OptionParser, make_option
+import bluezutils
bus = dbus.SystemBus()
-manager = dbus.Interface(bus.get_object("org.bluez", "/"), "org.bluez.Manager")
-
option_list = [
make_option("-i", "--device", action="store",
type="string", dest="dev_id"),
@@ -19,11 +18,7 @@ parser = OptionParser(option_list=option_list)
(options, args) = parser.parse_args()
-if options.dev_id:
- adapter_path = manager.FindAdapter(options.dev_id)
-else:
- adapter_path = manager.DefaultAdapter()
-
+adapter_path = bluezutils.find_adapter(options.dev_id).object_path
adapter = dbus.Interface(bus.get_object("org.bluez", adapter_path),
"org.freedesktop.DBus.Properties")