summaryrefslogtreecommitdiff
path: root/bin
diff options
authorPMR <pmr@pmr-lander>2019-01-09 22:15:59 +0000
committerPMR <pmr@pmr-lander>2019-01-09 22:15:59 +0000
commita9ca90808e0313bf2bb906ccd67a85116780b48b (patch)
tree311ebe28995f001b8059c0e6875e915b262c718d /bin
parent75b1e3702bee6bcb3782d833f35edf1c6a899075 (diff)
parentb8d8c2a9418eb75fa4362c743881502e5b252fd5 (diff)
Merge #361576 from ~jocave/plainbox-provider-checkbox:bluez-controller-detect
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bluez_list_adapters.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/bin/bluez_list_adapters.py b/bin/bluez_list_adapters.py
new file mode 100755
index 0000000..87c68c2
--- /dev/null
+++ b/bin/bluez_list_adapters.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python3
+#
+# This file is part of Checkbox.
+#
+# Copyright 2018 Canonical Ltd.
+#
+# Authors:
+# Jonathan Cave <jonathan.cave@canonical.com>
+#
+# Checkbox is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 3,
+# as published by the Free Software Foundation.
+#
+# Checkbox is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
+
+import checkbox_support.bt_helper as bt_helper
+
+import sys
+
+
+def main():
+ manager = bt_helper.BtManager()
+ bt_adapter_not_found = True
+ for dev in manager.get_bt_adapters():
+ bt_adapter_not_found = False
+ print(dev._if.object_path.split('/')[-1])
+ return bt_adapter_not_found
+
+
+if __name__ == "__main__":
+ sys.exit(main())