Skip to contentSkip to conversation

doc: Label Profile1.Release() method as no reply

PATCH In review Denis Kenzior 2 participants 4 messages Sep 10, 2013 – Sep 11, 2013 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 doc: Label Profile1.Release() method as no reply

The current implementation does not expect a reply, nor would it make sense for BlueZ to wait for one from the agent. So explicitly label this method as noreply.

---
 doc/profile-api.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
doc/profile-api.txt +1 -1
index 03b7d2b..96cfce9 100644
@@ -108,7 +108,7 @@ Service		unique name
 Interface	org.bluez.Profile1
 Object path	freely definable
 
-Methods		void Release()
+Methods		void Release() [noreply]
 
 			This method gets called when the service daemon
 			unregisters the profile. A profile can use it to do
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH 2/3 doc: Remove Profile1.Cancel() method

There does not seem to be any actual need for this method.

The current implementation calls Cancel when a pending NewConnection() or RequestDisconnection() method call fails. Additionally it calls Cancel() when the remote client has disconnected. In either case BlueZ calls shutdown on the file descriptor associated with the agent and issues a Cancel() method call.

The closing of the file descriptor will trigger a HUP on the agent side, which will trigger normal cleanup procedures. The received Cancel() method call is redundant in both cases.

---
 doc/profile-api.txt | 8 --------
 1 file changed, 8 deletions(-)
doc/profile-api.txt +0 -8
index 96cfce9..ec18034 100644
@@ -145,11 +145,3 @@ Methods		void Release() [noreply]
 
 			Possible errors: org.bluez.Error.Rejected
 			                 org.bluez.Error.Canceled
-
-		void Cancel()
-
-			This method gets called to indicate that the profile
-			request failed before a reply was returned.
-
-			All request are queued and there will be only one
-			pending pequest at a time per profile.
Signature · 1 line
1.8.1.5
#2 lore raw

PATCH 3/3 profile: Remove support for Cancel method

In reply to Denis Kenzior
---
 src/profile.c | 18 ------------------
 1 file changed, 18 deletions(-)
src/profile.c +0 -18
index 57aead7..523e119 100644
@@ -678,20 +678,9 @@ static struct ext_profile *find_ext_profile(const char *owner,
 	return NULL;
 }
 
-static void ext_cancel(struct ext_profile *ext)
-{
-	DBusMessage *msg;
-
-	msg = dbus_message_new_method_call(ext->owner, ext->path,
-						"org.bluez.Profile1", "Cancel");
-	if (msg)
-		g_dbus_send_message(btd_get_dbus_connection(), msg);
-}
-
 static void ext_io_destroy(gpointer p)
 {
 	struct ext_io *ext_io = p;
-	struct ext_profile *ext = ext_io->ext;
 
 	if (ext_io->io_id > 0)
 		g_source_remove(ext_io->io_id);
@@ -711,7 +700,6 @@ static void ext_io_destroy(gpointer p)
 	if (ext_io->pending) {
 		dbus_pending_call_cancel(ext_io->pending);
 		dbus_pending_call_unref(ext_io->pending);
-		ext_cancel(ext);
 	}
 
 	if (ext_io->resolving)
@@ -783,9 +771,6 @@ static void new_conn_reply(DBusPendingCall *call, void *user_data)
 
 	btd_service_connecting_complete(conn->service, -ECONNREFUSED);
 
-	if (dbus_error_has_name(&err, DBUS_ERROR_NO_REPLY))
-		ext_cancel(ext);
-
 	dbus_error_free(&err);
 
 	ext->conns = g_slist_remove(ext->conns, conn);
@@ -817,9 +802,6 @@ static void disconn_reply(DBusPendingCall *call, void *user_data)
 
 	btd_service_disconnecting_complete(conn->service, -ECONNREFUSED);
 
-	if (dbus_error_has_name(&err, DBUS_ERROR_NO_REPLY))
-		ext_cancel(ext);
-
 	dbus_error_free(&err);
 
 disconnect:
Signature · 1 line
1.8.1.5
#3 lore raw
In reply to Denis Kenzior

Hi Denis,

Quoted 6 lines · Denis Kenzior

The current implementation does not expect a reply, nor would it make sense for BlueZ to wait for one from the agent. So explicitly label this method as noreply.

---
 doc/profile-api.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

All three patches have been applied. Thanks.

Johan