*/
#include <stdint.h>
+#include <stdbool.h>
#include <glib.h>
+#include "lib/bluetooth.h"
#include "log.h"
#include "hal-msg.h"
#include "ipc.h"
#include "hid.h"
+static GIOChannel *notification_io = NULL;
+
void bt_hid_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, uint16_t len)
{
uint8_t status = HAL_ERROR_FAILED;
ipc_send_error(io, HAL_SERVICE_ID_HIDHOST, status);
}
+
+bool bt_hid_register(GIOChannel *io, const bdaddr_t *addr)
+{
+ DBG("");
+
+ notification_io = g_io_channel_ref(io);
+
+ return true;
+}
+
+void bt_hid_unregister(void)
+{
+ DBG("");
+
+ g_io_channel_unref(notification_io);
+ notification_io = NULL;
+}
*/
void bt_hid_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, uint16_t len);
+
+bool bt_hid_register(GIOChannel *io, const bdaddr_t *addr);
+void bt_hid_unregister(void);
goto error;
break;
+ case HAL_SERVICE_ID_HIDHOST:
+ if (!bt_hid_register(hal_notif_io, bt_adapter_get_address()))
+ goto error;
+
+ break;
default:
DBG("service %u not supported", m->service_id);
goto error;
case HAL_SERVICE_ID_SOCK:
bt_socket_unregister();
break;
+ case HAL_SERVICE_ID_HIDHOST:
+ bt_hid_unregister();
+ break;
default:
/* This would indicate bug in HAL, as unregister should not be
* called in init failed */