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 v2 8/9] client: Display the AdvMonitor Release reason
Date: Wed, 13 Apr 2022 13:54:48 -0700	[thread overview]
Message-ID: <20220413135223.BlueZ.v2.8.Ia97a9544495c94781c0391c0ec5a01273a278d18@changeid> (raw)
In-Reply-To: <20220413135223.BlueZ.v2.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 bluetoothctl.

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

(no changes since v1)

 client/adv_monitor.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/client/adv_monitor.c b/client/adv_monitor.c
index 792379fc4..6ee9d2b42 100644
--- a/client/adv_monitor.c
+++ b/client/adv_monitor.c
@@ -72,9 +72,13 @@ static DBusMessage *release_adv_monitor(DBusConnection *conn,
 					DBusMessage *msg, void *user_data)
 {
 	struct adv_monitor *adv_monitor = user_data;
+	int8_t release_reason;
 
-	bt_shell_printf("Advertisement monitor %d released\n",
-							adv_monitor->idx);
+	dbus_message_get_args(msg, NULL, DBUS_TYPE_BYTE, &release_reason,
+							DBUS_TYPE_INVALID);
+	bt_shell_printf("Advertisement monitor %d released (reason: %d)\n",
+							adv_monitor->idx,
+							release_reason);
 	remove_adv_monitor(adv_monitor, conn);
 
 	return dbus_message_new_method_return(msg);
@@ -117,7 +121,8 @@ static DBusMessage *device_lost_adv_monitor(DBusConnection *conn,
 }
 
 static const GDBusMethodTable adv_monitor_methods[] = {
-	{ GDBUS_ASYNC_METHOD("Release", NULL, NULL, release_adv_monitor) },
+	{ GDBUS_ASYNC_METHOD("Release", GDBUS_ARGS({"reason", "y"}),
+			NULL, release_adv_monitor) },
 	{ GDBUS_ASYNC_METHOD("Activate", NULL, NULL, activate_adv_monitor) },
 	{ GDBUS_ASYNC_METHOD("DeviceFound", GDBUS_ARGS({ "device", "o" }),
 			NULL, device_found_adv_monitor) },
-- 
2.36.0.rc0.470.gd361397f0d-goog


  parent reply	other threads:[~2022-04-13 20:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13 20:54 [BlueZ PATCH v2 1/9] adv_monitor: Disable RSSIHighTimeout for SW based filtering Manish Mandlik
2022-04-13 20:54 ` [BlueZ PATCH v2 2/9] adv_monitor: Don't send DeviceFound for already found devices Manish Mandlik
2022-04-13 20:54 ` [BlueZ PATCH v2 3/9] adv_monitor: Clear tracked devices on resume Manish Mandlik
2022-04-13 20:54 ` [BlueZ PATCH v2 4/9] adv_monitor: Do not remove the device while monitoring Manish Mandlik
2022-04-13 20:54 ` [BlueZ PATCH v2 5/9] monitor: Display AdvMonitor DeviceFound/Lost events Manish Mandlik
2022-04-13 20:54 ` [BlueZ PATCH v2 6/9] adv_monitor: Do not merge monitors with non-overlapping RSSI Manish Mandlik
2022-04-13 20:54 ` [BlueZ PATCH v2 7/9] adv_monitor: Add the monitor Release reason Manish Mandlik
2022-04-13 21:48   ` Luiz Augusto von Dentz
     [not found]     ` <CAGPPCLB1j+KV_ZCY7xQe9sHheWWAQPxaRF9pH9R53mAVdmQfHg@mail.gmail.com>
2022-04-13 22:42       ` Luiz Augusto von Dentz
     [not found]         ` <CAGPPCLBaoP=dXKp53F7Q3Pg4pnSELdkt_ns9Aw-A-yYk6Vs0yw@mail.gmail.com>
2022-04-20 20:02           ` Luiz Augusto von Dentz
2022-04-13 20:54 ` Manish Mandlik [this message]
2022-04-13 20:54 ` [BlueZ PATCH v2 9/9] test: Display the AdvMonitor " Manish Mandlik
2022-04-15  9:34 ` [BlueZ,v2,1/9] adv_monitor: Disable RSSIHighTimeout for SW based filtering bluez.test.bot

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=20220413135223.BlueZ.v2.8.Ia97a9544495c94781c0391c0ec5a01273a278d18@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.