linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 4/7] advertising: Use client proxy to release
Date: Thu,  2 Nov 2017 16:15:16 +0200	[thread overview]
Message-ID: <20171102141519.28446-4-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20171102141519.28446-1-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This uses g_dbus_proxy_method_call instead of build the message
manually.
---
 src/advertising.c  | 13 ++-----------
 src/bluetooth.conf |  1 +
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/advertising.c b/src/advertising.c
index 31a5fff5c..94a8c4050 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -137,20 +137,11 @@ static gboolean client_free_idle_cb(void *data)
 static void client_release(void *data)
 {
 	struct btd_adv_client *client = data;
-	DBusMessage *message;
 
 	DBG("Releasing advertisement %s, %s", client->owner, client->path);
 
-	message = dbus_message_new_method_call(client->owner, client->path,
-							LE_ADVERTISEMENT_IFACE,
-							"Release");
-
-	if (!message) {
-		error("Couldn't allocate D-Bus message");
-		return;
-	}
-
-	g_dbus_send_message(btd_get_dbus_connection(), message);
+	g_dbus_proxy_method_call(client->proxy, "Release", NULL, NULL, NULL,
+									NULL);
 }
 
 static void client_destroy(void *data)
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 10d2d3688..60e75955c 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -20,6 +20,7 @@
     <allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
     <allow send_interface="org.bluez.GattCharacteristic1"/>
     <allow send_interface="org.bluez.GattDescriptor1"/>
+    <allow send_interface="org.bluez.LEAdvertisement1"/>   
     <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
     <allow send_interface="org.freedesktop.DBus.Properties"/>
   </policy>
-- 
2.13.6


  parent reply	other threads:[~2017-11-02 14:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 14:15 [PATCH BlueZ 1/7] doc/advertising-api: Add Duration and Timeout Luiz Augusto von Dentz
2017-11-02 14:15 ` [PATCH BlueZ 2/7] advertising: Add implementation of " Luiz Augusto von Dentz
2017-11-02 14:15 ` [PATCH BlueZ 3/7] client: Add set-advertise-{duration, timeout} Luiz Augusto von Dentz
2017-11-02 14:15 ` Luiz Augusto von Dentz [this message]
2017-11-02 14:15 ` [PATCH BlueZ 5/7] core: Add LEAdvertising1 to bluetooth.conf Luiz Augusto von Dentz
2017-11-02 14:24   ` Szymon Janc
2017-11-02 14:15 ` [PATCH BlueZ 6/7] core: Cleanup bluetooth.conf Luiz Augusto von Dentz
2017-11-02 14:15 ` [PATCH BlueZ 7/7] tests: Remove test-thermometer 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=20171102141519.28446-4-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).