linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/5] Fix not being able to register pdu handlers
@ 2011-10-03 22:01 Luiz Augusto von Dentz
  2011-10-03 22:01 ` [PATCH BlueZ 2/5] AVRCP: move MediaPlayer to adapter object Luiz Augusto von Dentz
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2011-10-03 22:01 UTC (permalink / raw)
  To: linux-bluetooth

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

This happens when removing and adding again an adapter
---
 audio/avctp.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/audio/avctp.c b/audio/avctp.c
index b8cb36e..89ef70c 100644
--- a/audio/avctp.c
+++ b/audio/avctp.c
@@ -463,6 +463,7 @@ static gboolean session_cb(GIOChannel *chan, GIOCondition cond,
 
 	handler = find_handler(handlers, avc->opcode);
 	if (!handler) {
+		DBG("handler not found for 0x%02x", avc->opcode);
 		avc->code = AVC_CTYPE_REJECTED;
 		goto done;
 	}
@@ -824,14 +825,20 @@ void avctp_unregister(const bdaddr_t *src)
 	if (servers)
 		return;
 
-	if (passthrough_id)
+	if (passthrough_id) {
 		avctp_unregister_pdu_handler(passthrough_id);
+		passthrough_id = 0;
+	}
 
-	if (unit_id)
+	if (unit_id) {
 		avctp_unregister_pdu_handler(unit_id);
+		passthrough_id = 0;
+	}
 
-	if (subunit_id)
-		avctp_unregister_pdu_handler(unit_id);
+	if (subunit_id) {
+		avctp_unregister_pdu_handler(subunit_id);
+		subunit_id = 0;
+	}
 }
 
 int avctp_send_passthrough(struct avctp *session, uint8_t op)
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-10-04  0:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-03 22:01 [PATCH BlueZ 1/5] Fix not being able to register pdu handlers Luiz Augusto von Dentz
2011-10-03 22:01 ` [PATCH BlueZ 2/5] AVRCP: move MediaPlayer to adapter object Luiz Augusto von Dentz
2011-10-04  0:32   ` Lucas De Marchi
2011-10-03 22:01 ` [PATCH BlueZ 3/5] Add simple-player test script Luiz Augusto von Dentz
2011-10-03 22:01 ` [PATCH BlueZ 4/5] Remove MediaPlayer interface from control-api.txt Luiz Augusto von Dentz
2011-10-03 22:01 ` [PATCH BlueZ 5/5] Remove test-media-player Luiz Augusto von Dentz

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).