OSDN Git Service

android: Use ipc_send_rsp helper for replying success
authorSzymon Janc <szymon.janc@tieto.com>
Thu, 28 Nov 2013 14:15:23 +0000 (15:15 +0100)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 28 Nov 2013 16:02:26 +0000 (18:02 +0200)
Where applicable use helper as this make code easier to understand.

android/bluetooth.c
android/main.c

index 716c0eb..b5fd644 100644 (file)
@@ -2263,7 +2263,7 @@ void bt_bluetooth_handle_cmd(int sk, uint8_t opcode, void *buf, uint16_t len)
                goto error;
        }
 
-       ipc_send(sk, HAL_SERVICE_ID_BLUETOOTH, opcode, 0, NULL, -1);
+       ipc_send_rsp(HAL_SERVICE_ID_BLUETOOTH, opcode, HAL_STATUS_SUCCESS);
        return;
 
 error:
index 6fe0d1c..211503b 100644 (file)
@@ -115,8 +115,8 @@ static void service_register(void *buf, uint16_t len)
 
        services[m->service_id] = true;
 
-       ipc_send(g_io_channel_unix_get_fd(hal_cmd_io), HAL_SERVICE_ID_CORE,
-                                       HAL_OP_REGISTER_MODULE, 0, NULL, -1);
+       ipc_send_rsp(HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE,
+                                                       HAL_STATUS_SUCCESS);
 
        info("Service ID=%u registered", m->service_id);
        return;
@@ -157,8 +157,8 @@ static void service_unregister(void *buf, uint16_t len)
 
        services[m->service_id] = false;
 
-       ipc_send(g_io_channel_unix_get_fd(hal_cmd_io), HAL_SERVICE_ID_CORE,
-                                       HAL_OP_UNREGISTER_MODULE, 0, NULL, -1);
+       ipc_send_rsp(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE,
+                                                       HAL_STATUS_SUCCESS);
 
        info("Service ID=%u unregistered", m->service_id);
        return;