diff --git a/android/Android.mk b/android/Android.mk
index 0352beb..34e21ea 100644
--- a/android/Android.mk
+++ b/android/Android.mk
bluez/android/pan.c \
bluez/android/handsfree.c \
bluez/android/gatt.c \
+ bluez/android/health.c \
bluez/src/log.c \
bluez/src/shared/mgmt.c \
bluez/src/shared/util.c \
diff --git a/android/Makefile.am b/android/Makefile.am
index 8486dce..e7de560 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
android/pan.h android/pan.c \
android/handsfree.h android/handsfree.c \
android/gatt.h android/gatt.c \
+ android/health.h android/health.c \
btio/btio.h btio/btio.c \
src/sdp-client.h src/sdp-client.c \
profiles/network/bnep.h profiles/network/bnep.c
diff --git a/android/health.c b/android/health.c
new file mode 100644
index 0000000..e4f8cbd
--- /dev/null
+++ b/android/health.c
+/*
+ *
+ * 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
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <unistd.h>
+#include <glib.h>
+
+#include "lib/bluetooth.h"
+#include "lib/sdp.h"
+#include "lib/sdp_lib.h"
+#include "src/log.h"
+
+#include "hal-msg.h"
+#include "ipc-common.h"
+#include "ipc.h"
+#include "utils.h"
+#include "bluetooth.h"
+#include "health.h"
+
+static bdaddr_t adapter_addr;
+static struct ipc *hal_ipc = NULL;
+
+static void bt_health_register_app(const void *buf, uint16_t len)
+{
+ DBG("Not implemented");
+
+ ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH, HAL_OP_HEALTH_REG_APP,
+ HAL_STATUS_UNSUPPORTED);
+}
+
+static void bt_health_unregister_app(const void *buf, uint16_t len)
+{
+ DBG("Not implemented");
+
+ ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH, HAL_OP_HEALTH_UNREG_APP,
+ HAL_STATUS_UNSUPPORTED);
+}
+
+static void bt_health_connect_channel(const void *buf, uint16_t len)
+{
+ DBG("Not implemented");
+
+ ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH,
+ HAL_OP_HEALTH_CONNECT_CHANNEL, HAL_STATUS_UNSUPPORTED);
+}
+
+static void bt_health_destroy_channel(const void *buf, uint16_t len)
+{
+ DBG("Not implemented");
+
+ ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH,
+ HAL_OP_HEALTH_DESTROY_CHANNEL, HAL_STATUS_UNSUPPORTED);
+}
+
+static const struct ipc_handler cmd_handlers[] = {
+ /* HAL_OP_HEALTH_REG_APP */
+ { bt_health_register_app, false,
+ sizeof(struct hal_cmd_health_reg_app) },
+ /* HAL_OP_HEALTH_UNREG_APP */
+ { bt_health_unregister_app, false,
+ sizeof(struct hal_cmd_health_unreg_app) },
+ /* HAL_OP_HEALTH_CONNECT_CHANNEL */
+ { bt_health_connect_channel, false,
+ sizeof(struct hal_cmd_health_connect_channel) },
+ /* HAL_OP_HEALTH_DESTROY_CHANNEL */
+ { bt_health_destroy_channel, false,
+ sizeof(struct hal_cmd_health_destroy_channel) },
+};
+
+bool bt_health_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
+{
+ DBG("");
+
+ bacpy(&adapter_addr, addr);
+
+ hal_ipc = ipc;
+ ipc_register(hal_ipc, HAL_SERVICE_ID_HEALTH, cmd_handlers,
+ G_N_ELEMENTS(cmd_handlers));
+
+ return true;
+}
+
+void bt_health_unregister(void)
+{
+ DBG("");
+
+ ipc_unregister(hal_ipc, HAL_SERVICE_ID_HEALTH);
+ hal_ipc = NULL;
+}
diff --git a/android/health.h b/android/health.h
new file mode 100644
index 0000000..0b32fd3
--- /dev/null
+++ b/android/health.h
+/*
+ *
+ * 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
+ *
+ */
+
+bool bt_health_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode);
+void bt_health_unregister(void);
diff --git a/android/main.c b/android/main.c
index a34f885..35ff718 100644
--- a/android/main.c
+++ b/android/main.c
#include "avrcp.h"
#include "handsfree.h"
#include "gatt.h"
+#include "health.h"
#define STARTUP_GRACE_SECONDS 5
#define SHUTDOWN_GRACE_SECONDS 10
}
break;
+ case HAL_SERVICE_ID_HEALTH:
+ if (!bt_health_register(hal_ipc, &adapter_bdaddr, m->mode)) {
+ status = HAL_STATUS_FAILED;
+ goto failed;
+ }
+
+ break;
default:
DBG("service %u not supported", m->service_id);
status = HAL_STATUS_FAILED;
case HAL_SERVICE_ID_GATT:
bt_gatt_unregister();
break;
+ case HAL_SERVICE_ID_HEALTH:
+ bt_health_unregister();
+ break;
default:
/* This would indicate bug in HAL, as unregister should not be
* called in init failed */
case HAL_SERVICE_ID_GATT:
bt_gatt_unregister();
break;
+ case HAL_SERVICE_ID_HEALTH:
+ bt_health_unregister();
+ break;
}
services[i] = false;