[PATCH 6/7] android/mcaptest: Support MDL reconnection if MCL reconnected

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

 



This is needed in some PTS test cases.
---
 android/mcaptest.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/android/mcaptest.c b/android/mcaptest.c
index f1f28d9..6277b40 100644
--- a/android/mcaptest.c
+++ b/android/mcaptest.c
@@ -118,10 +118,22 @@ static uint8_t mdl_reconn_req_cb(struct mcap_mdl *mdl, void *data)
 	return MCAP_SUCCESS;
 }
 
+static void create_mdl_cb(struct mcap_mdl *mcap_mdl, uint8_t type, GError *gerr,
+								gpointer data);
+
 static void mcl_reconnected(struct mcap_mcl *mcl, gpointer data)
 {
-	/* TODO */
-	printf("MCL reconnected unsupported\n");
+	GError *gerr = NULL;
+
+	printf("%s\n", __func__);
+
+	if (data_mode == MODE_CONNECT) {
+		mcap_create_mdl(mcl, 1, 0, create_mdl_cb, NULL, NULL, &gerr);
+		if (gerr) {
+			printf("Could not connect MDL: %s\n", gerr->message);
+			g_error_free(gerr);
+		}
+	}
 }
 
 static void mcl_disconnected(struct mcap_mcl *mcl, gpointer data)
-- 
2.0.0

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