Diff between 0009f141a723c8bcca78aaf69843bf5e0b9ff3c2 and 886e78ab4c90bf2cea9887c264d8569fa30808c9

Changed Files

File Additions Deletions Status
android/gatt.c +11 -2 modified
android/hal-msg.h +4 -0 modified

Full Patch

diff --git a/android/gatt.c b/android/gatt.c
index b224c28..c2cad94 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -3047,10 +3047,19 @@ failed:
 
 static void handle_client_get_device_type(const void *buf, uint16_t len)
 {
+	const struct hal_cmd_gatt_client_get_device_type *cmd = buf;
+	struct hal_rsp_gatt_client_get_device_type rsp;
+	bdaddr_t bdaddr;
+
 	DBG("");
 
-	ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT,
-			HAL_OP_GATT_CLIENT_GET_DEVICE_TYPE, HAL_STATUS_FAILED);
+	android2bdaddr(cmd->bdaddr, &bdaddr);
+
+	rsp.type = bt_get_device_android_type(&bdaddr);
+
+	ipc_send_rsp_full(hal_ipc, HAL_SERVICE_ID_GATT,
+					HAL_OP_GATT_CLIENT_GET_DEVICE_TYPE,
+					sizeof(rsp), &rsp, -1);
 }
 
 static void handle_client_set_adv_data(const void *buf, uint16_t len)
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 52ecafb..9d28866 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -730,6 +730,10 @@ struct hal_cmd_gatt_client_get_device_type {
 	uint8_t bdaddr[6];
 } __attribute__((packed));
 
+struct hal_rsp_gatt_client_get_device_type {
+	uint8_t type;
+} __attribute__((packed));
+
 #define HAL_OP_GATT_CLIENT_SET_ADV_DATA		0x015
 struct hal_cmd_gatt_client_set_adv_data {
 	int32_t  server_if;