[gnome-bluetooth/wip/hadess/power-state-bluez: 3/3] lib: Add test application for BluetoothClient properties
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/wip/hadess/power-state-bluez: 3/3] lib: Add test application for BluetoothClient properties
- Date: Thu, 25 Aug 2022 14:29:38 +0000 (UTC)
commit 36c74fa43984b697ce3c38df91d9179fb954f520
Author: Bastien Nocera <hadess hadess net>
Date: Thu Aug 25 16:11:37 2022 +0200
lib: Add test application for BluetoothClient properties
lib/test-client.py | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
---
diff --git a/lib/test-client.py b/lib/test-client.py
new file mode 100644
index 00000000..ab3866b8
--- /dev/null
+++ b/lib/test-client.py
@@ -0,0 +1,21 @@
+#!/usr/bin/python3
+#
+# Copyright (C) 2022 Bastien Nocera <hadess hadess net>
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+import gi
+from gi.repository import GLib
+from gi.repository import Gio
+gi.require_version('GnomeBluetooth', '3.0')
+from gi.repository import GnomeBluetooth
+
+def notify_cb(client, pspec):
+ value = client.get_property(pspec.name)
+ print(f'{pspec.name} changed to {value}')
+
+client = GnomeBluetooth.Client.new()
+client.connect('notify', notify_cb)
+
+ml = GLib.MainLoop()
+ml.run()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]