After daemon is started HAL needs to register those two interfaces to performe initialization procedure as described in IPC documentation. --- android/hal-bluetooth.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c index 3d3023f..c1e0261 100644 --- a/android/hal-bluetooth.c +++ b/android/hal-bluetooth.c @@ -257,6 +257,9 @@ static void stop_daemon(void) static int init(bt_callbacks_t *callbacks) { + struct hal_msg_cmd_register_module cmd; + struct hal_msg_rsp_error rsp; + DBG(""); if (interface_ready()) @@ -267,7 +270,27 @@ static int init(bt_callbacks_t *callbacks) bt_hal_cbacks = callbacks; + cmd.service_id = HAL_SERVICE_ID_BLUETOOTH; + + if (hal_send_msg(HAL_SERVICE_ID_CORE, HAL_MSG_OP_REGISTER_MODULE, + sizeof(cmd), &cmd, + sizeof(rsp), &rsp, NULL) < 0) + goto fail; + + cmd.service_id = HAL_SERVICE_ID_SOCK; + + if (hal_send_msg(HAL_SERVICE_ID_CORE, HAL_MSG_OP_REGISTER_MODULE, + sizeof(cmd), &cmd, + sizeof(rsp), &rsp, NULL) < 0) + goto fail; + return BT_STATUS_SUCCESS; + +fail: + stop_daemon(); + bt_hal_cbacks = NULL; + return BT_STATUS_FAIL; + } static int enable(void) -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html