All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manish Mandlik <mmandlik@google.com>
To: marcel@holtmann.org, luiz.dentz@gmail.com
Cc: chromeos-bluetooth-upstreaming@chromium.org,
	linux-bluetooth@vger.kernel.org,
	Manish Mandlik <mmandlik@google.com>,
	Miao-chen Chou <mcchou@chromium.org>
Subject: [BlueZ PATCH 9/9] test: Display the AdvMonitor Release reason
Date: Sun, 20 Mar 2022 18:37:03 -0700	[thread overview]
Message-ID: <20220320183445.BlueZ.9.I6c034497f366eccbb78925ad107ce957f81d97b1@changeid> (raw)
In-Reply-To: <20220320183445.BlueZ.1.I21d5ed25e9a0a2427bddbd6d4ec04d80d735fc53@changeid>

Bluetoothd returns the release reason when a monitor is released. Read
the release reason received as part of the Release event and print it
using the example python app.

Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
---

 test/example-adv-monitor | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/test/example-adv-monitor b/test/example-adv-monitor
index a405fc7b0..b01114c6b 100644
--- a/test/example-adv-monitor
+++ b/test/example-adv-monitor
@@ -117,10 +117,11 @@ class AdvMonitor(dbus.service.Object):
 
 
     @dbus.service.method(ADV_MONITOR_IFACE,
-                         in_signature='',
+                         in_signature='y',
                          out_signature='')
-    def Release(self):
-        print('{}: Monitor Released'.format(self.path))
+    def Release(self, reason):
+        print('{}: Monitor Released (reason: {})'.format(self.path,
+                                                         format(reason, 'd')))
 
 
     @dbus.service.method(ADV_MONITOR_IFACE,
@@ -352,7 +353,10 @@ def test(bus, mainloop, advmon_mgr, app_id):
     # Run until user hits the 'Enter' key. If any peer device is advertising
     # during this time, DeviceFound() should get triggered for monitors
     # matching the advertisements.
-    raw_input('Press "Enter" key to quit...\n')
+    try:
+        raw_input('Press "Enter" key to quit...\n')  # python2
+    except:
+        input('Press "Enter" key to quit...\n')  # python3
 
     # Remove a monitor. DeviceFound() for this monitor should not get
     # triggered any more.
-- 
2.35.1.894.gb6a874cedc-goog


  parent reply	other threads:[~2022-03-21  1:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21  1:36 [BlueZ PATCH 1/9] adv_monitor: Disable RSSIHighTimeout for SW based filtering Manish Mandlik
2022-03-21  1:36 ` [BlueZ PATCH 2/9] adv_monitor: Don't send DeviceFound for already found devices Manish Mandlik
2022-03-21  1:36 ` [BlueZ PATCH 3/9] adv_monitor: Clear tracked devices on resume Manish Mandlik
2022-03-21  1:36 ` [BlueZ PATCH 4/9] adv_monitor: Do not remove the device while monitoring Manish Mandlik
2022-03-21  1:36 ` [BlueZ PATCH 5/9] monitor: Display AdvMonitor DeviceFound/Lost events Manish Mandlik
2022-03-21  4:31   ` Paul Menzel
2022-03-21  1:37 ` [BlueZ PATCH 6/9] adv_monitor: Do not merge monitors with non-overlapping RSSI Manish Mandlik
2022-03-21  1:37 ` [BlueZ PATCH 7/9] adv_monitor: Add the monitor Release reason Manish Mandlik
2022-03-22  0:48   ` Luiz Augusto von Dentz
     [not found]     ` <CAGPPCLDeQB6vQAHYw22sV8b6UsOjhpz5SJKnZ+MMq-DHFAbXZQ@mail.gmail.com>
2022-04-13 21:37       ` Luiz Augusto von Dentz
2022-03-21  1:37 ` [BlueZ PATCH 8/9] client: Display the AdvMonitor " Manish Mandlik
2022-03-21  1:37 ` Manish Mandlik [this message]
2022-03-21  4:02 ` [BlueZ,1/9] adv_monitor: Disable RSSIHighTimeout for SW based filtering bluez.test.bot
2022-03-29 20:19   ` Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220320183445.BlueZ.9.I6c034497f366eccbb78925ad107ce957f81d97b1@changeid \
    --to=mmandlik@google.com \
    --cc=chromeos-bluetooth-upstreaming@chromium.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=mcchou@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.