Diff between 3e5e6c76183f3710d9d416bfbbd00c4e8fcbe0c3 and e99c1dbd3318517f62a569779bd990f89a60fae7

Changed Files

File Additions Deletions Status
android/hal-msg.h +10 -10 modified
android/socket.c +1 -1 modified

Full Patch

diff --git a/android/hal-msg.h b/android/hal-msg.h
index c351501..bbbb99c 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -233,20 +233,20 @@ struct hal_cmd_le_test_mode {
 
 #define HAL_OP_SOCK_LISTEN		0x01
 struct hal_cmd_sock_listen {
-	uint8_t  type;
-	uint8_t  name[256];
-	uint8_t  uuid[16];
-	uint16_t channel;
-	uint8_t  flags;
+	uint8_t type;
+	uint8_t name[256];
+	uint8_t uuid[16];
+	int32_t channel;
+	uint8_t flags;
 } __attribute__((packed));
 
 #define HAL_OP_SOCK_CONNECT		0x02
 struct hal_cmd_sock_connect {
-	uint8_t  bdaddr[6];
-	uint8_t  type;
-	uint8_t  uuid[16];
-	uint16_t channel;
-	uint8_t  flags;
+	uint8_t bdaddr[6];
+	uint8_t type;
+	uint8_t uuid[16];
+	int32_t channel;
+	uint8_t flags;
 } __attribute__((packed));
 
 /* Bluetooth HID Host HAL API */
diff --git a/android/socket.c b/android/socket.c
index 11d64f8..f68fbf0 100644
--- a/android/socket.c
+++ b/android/socket.c
@@ -804,7 +804,7 @@ static void handle_listen(const void *buf, uint16_t len)
 
 	profile = get_profile_by_uuid(cmd->uuid);
 	if (!profile) {
-		if (!cmd->channel)
+		if (cmd->channel <= 0)
 			goto failed;
 
 		chan = cmd->channel;