Skip to contentSkip to conversation

android/hog: Add copy to HoG implementation from input plugin

RFC New Luiz Augusto von Dentz 1 participant 2 messages May 27, 2014 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

RFC 1/2 android/hog: Add copy to HoG implementation from input plugin

From: Luiz Augusto von Dentz <[email protected]>

---
This is sent as RFC to agree on the API level, the idea is then to move to shared folder once bt_gatt is complete and then rewrite the internals to use it.

 {profiles/input => android}/hog.c | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 copy {profiles/input => android}/hog.c (100%)
android/hog.c renamed from profiles/input/hog.c +0 -0
similarity index 100%
copy from profiles/input/hog.c
copy to android/hog.c
Signature · 1 line
1.9.0
author maintainer
#1 lore raw

PATCH 2/2 android/hog: Strip dependencies from input plugin

From: Luiz Augusto von Dentz <[email protected]>

This strip any dependecy from input plugin so the code can be used by hidhost interface.

---
 android/Android.mk  |   2 +
 android/Makefile.am |   2 +
 android/hog.c       | 465 +++++++++++++++++++---------------------------------
 android/hog.h       |  35 ++++
 4 files changed, 208 insertions(+), 296 deletions(-)
 create mode 100644 android/hog.h
android/Android.mk +2 -0
index f59352a..6cc44a9 100644
@@ -32,6 +32,7 @@ include $(CLEAR_VARS)
 LOCAL_SRC_FILES := \
 	bluez/android/main.c \
 	bluez/android/bluetooth.c \
+	bluez/android/hog.c \
 	bluez/android/hidhost.c \
 	bluez/android/socket.c \
 	bluez/android/ipc.c \
@@ -53,6 +54,7 @@ LOCAL_SRC_FILES := \
 	bluez/src/shared/hfp.c \
 	bluez/src/shared/gatt-db.c \
 	bluez/src/shared/io-glib.c \
+	bluez/src/share/uhid.c \
 	bluez/src/sdpd-database.c \
 	bluez/src/sdpd-service.c \
 	bluez/src/sdpd-request.c \
android/Makefile.am +2 -0
index f2172a9..01dd8de 100644
@@ -31,8 +31,10 @@ android_bluetoothd_SOURCES = android/main.c \
 				src/shared/ringbuf.h src/shared/ringbuf.c \
 				src/shared/hfp.h src/shared/hfp.c \
 				src/shared/gatt-db.h src/shared/gatt-db.c \
+				src/shared/uhid.h src/shared/uhid.c \
 				android/bluetooth.h android/bluetooth.c \
 				android/hidhost.h android/hidhost.c \
+				android/hog.h android/hog.c \
 				android/ipc-common.h \
 				android/ipc.h android/ipc.c \
 				android/avdtp.h android/avdtp.c \
android/hog.c +169 -296

757 lines not on this page · raw message

android/hog.h new file +35 -0
new file mode 100644
index 0000000..fb95b2a
@@ -0,0 +1,35 @@
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2014  Intel Corporation. All rights reserved.
+ *
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+struct bt_hog;
+
+struct bt_hog *bt_hog_new(const char *name, uint16_t vendor, uint16_t product,
+			uint16_t version, const struct gatt_primary *primary);
+
+struct bt_hog *bt_hog_ref(struct bt_hog *hog);
+void bt_hog_unref(struct bt_hog *hog);
+
+bool bt_hog_attach(struct bt_hog *hog, void *gatt);
+void bt_hog_detach(struct bt_hog *hog);
+
+int bt_hog_set_control_point(struct bt_hog *hog, bool suspend);
Signature · 1 line
1.9.0