[PATCH 11/11] android/health: Add setting mcl callbacks for incoming connection

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

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

For incoming connection NULL is passed as argument since application is
not known yet.
---
 android/health.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/android/health.c b/android/health.c
index df97848..7281dd5 100644
--- a/android/health.c
+++ b/android/health.c
@@ -1020,6 +1020,9 @@ static void mcap_mdl_deleted_cb(struct mcap_mdl *mdl, void *data)
 
 	DBG("");
 
+	if (!channel)
+		return;
+
 	dev = channel->dev;
 	/* mdl == NULL means, delete all mdls */
 	if (!mdl) {
@@ -1540,12 +1543,30 @@ static const struct ipc_handler cmd_handlers[] = {
 
 static void mcl_connected(struct mcap_mcl *mcl, gpointer data)
 {
-	DBG("Not implemented");
+	GError *gerr = NULL;
+	bool ret;
+
+	DBG("");
+
+	ret = set_mcl_cb(mcl, NULL, &gerr);
+	if (!ret) {
+		error("health: error setting mcl callbacks: %s", gerr->message);
+		g_error_free(gerr);
+	}
 }
 
 static void mcl_reconnected(struct mcap_mcl *mcl, gpointer data)
 {
-	DBG("Not implemented");
+	GError *gerr = NULL;
+	bool ret;
+
+	DBG("");
+
+	ret = set_mcl_cb(mcl, NULL, &gerr);
+	if (!ret) {
+		error("health: error setting mcl callbacks: %s", gerr->message);
+		g_error_free(gerr);
+	}
 }
 
 static void mcl_disconnected(struct mcap_mcl *mcl, gpointer data)
-- 
1.8.3.2

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