[PATCHv8 12/15] android/socket: Support listen() with supplied chan number

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

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

No profile is assigned in this case. There is a possibility to use
Serial Port Profile.
---
 android/socket.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/android/socket.c b/android/socket.c
index ca5ea2f..5f89f2c 100644
--- a/android/socket.c
+++ b/android/socket.c
@@ -644,10 +644,13 @@ static int handle_listen(void *buf)
 	DBG("");
 
 	profile = get_profile_by_uuid(cmd->uuid);
-	if (!profile)
-		return -1;
-
-	chan = profile->channel;
+	if (!profile) {
+		if (!cmd->channel)
+			return -1;
+		else
+			chan = cmd->channel;
+	} else
+		chan = profile->channel;
 
 	DBG("rfcomm channel %d svc_name %s", chan, cmd->name);
 
@@ -682,7 +685,9 @@ static int handle_listen(void *buf)
 		return -1;
 	}
 
-	rfsock->service_handle = sdp_service_register(profile, cmd->name);
+	if (profile)
+		rfsock->service_handle = sdp_service_register(profile,
+								cmd->name);
 
 	return hal_fd;
 }
-- 
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