[PATCH BlueZ 4/7] advertising: Use client proxy to release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux