Diff between e07c4e5765e65b21d3a9ce16bb28dd9c384b10f4 and ef2d3dd3d2b2878a09d0fdabb65bf144aa1a5a3f

Changed Files

File Additions Deletions Status
Makefile.android +1 -0 modified
android/Android.mk +1 -0 modified
android/hid.c +48 -0 added
android/hid.h +24 -0 added
android/main.c +5 -0 modified

Full Patch

diff --git a/Makefile.android b/Makefile.android
index 052d755..90d5973 100644
--- a/Makefile.android
+++ b/Makefile.android
@@ -9,6 +9,7 @@ android_bluetoothd_SOURCES =	android/main.c \
 				src/shared/util.h src/shared/util.c \
 				src/shared/mgmt.h src/shared/mgmt.c \
 				android/adapter.h android/adapter.c \
+				android/hid.h android/hid.c \
 				android/ipc.h android/ipc.c
 
 android_bluetoothd_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@
diff --git a/android/Android.mk b/android/Android.mk
index c4b0621..bad5ebc 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -16,6 +16,7 @@ LOCAL_SRC_FILES := \
 	main.c \
 	log.c \
 	adapter.c \
+	hid.c \
 	ipc.c ipc.h \
 	../src/shared/mgmt.c \
 	../src/shared/util.c \
diff --git a/android/hid.c b/android/hid.c
new file mode 100644
index 0000000..72eef0d
--- /dev/null
+++ b/android/hid.c
@@ -0,0 +1,48 @@
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2013  Intel Corporation. All rights reserved.
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include <stdint.h>
+
+#include <glib.h>
+
+#include "log.h"
+#include "hal-msg.h"
+#include "ipc.h"
+#include "hid.h"
+
+void bt_hid_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, uint16_t len)
+{
+	uint8_t status = HAL_ERROR_FAILED;
+
+	switch (opcode) {
+	case HAL_MSG_OP_BT_HID_CONNECT:
+		break;
+	case HAL_MSG_OP_BT_HID_DISCONNECT:
+		break;
+	default:
+		DBG("Unhandled command, opcode 0x%x", opcode);
+		break;
+	}
+
+	ipc_send_error(io, HAL_SERVICE_ID_BLUETOOTH, status);
+}
diff --git a/android/hid.h b/android/hid.h
new file mode 100644
index 0000000..1247488
--- /dev/null
+++ b/android/hid.h
@@ -0,0 +1,24 @@
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2013  Intel Corporation. All rights reserved.
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+void bt_hid_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, uint16_t len);
diff --git a/android/main.c b/android/main.c
index 988d08b..5e297f7 100644
--- a/android/main.c
+++ b/android/main.c
@@ -49,6 +49,7 @@
 #include "src/shared/mgmt.h"
 
 #include "adapter.h"
+#include "hid.h"
 #include "hal-msg.h"
 #include "ipc.h"
 
@@ -162,6 +163,10 @@ static gboolean cmd_watch_cb(GIOChannel *io, GIOCondition cond,
 		bt_adapter_handle_cmd(hal_cmd_io, msg->opcode, msg->payload,
 								msg->len);
 		break;
+	case HAL_SERVICE_ID_HIDHOST:
+		bt_hid_handle_cmd(hal_cmd_io, msg->opcode, msg->payload,
+								msg->len);
+		break;
 	default:
 		ipc_send_error(hal_cmd_io, msg->service_id, HAL_ERROR_FAILED);
 		break;