This will be used to enable services on respective HAL init calls. --- android/main.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/android/main.c b/android/main.c index e13e5b0..af7ebf3 100644 --- a/android/main.c +++ b/android/main.c @@ -72,10 +72,13 @@ static void service_register(void *buf, uint16_t len) { struct hal_msg_cmd_register_module *m = buf; - if (m->service_id > HAL_SERVICE_ID_MAX || services[m->service_id]) { - ipc_send_error(hal_cmd_io, HAL_SERVICE_ID_CORE, - HAL_ERROR_FAILED); - return; + if (m->service_id > HAL_SERVICE_ID_MAX || services[m->service_id]) + goto error; + + switch (m->service_id) { + default: + DBG("service %u not supported", m->service_id); + goto error; } services[m->service_id] = true; @@ -84,6 +87,9 @@ static void service_register(void *buf, uint16_t len) NULL, -1); info("Service ID=%u registered", m->service_id); + return; +error: + ipc_send_error(hal_cmd_io, HAL_SERVICE_ID_CORE, HAL_ERROR_FAILED); } static void service_unregister(void *buf, uint16_t len) -- 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