OSDN Git Service

android: Add proper define for HAL IPC error
authorJohan Hedberg <johan.hedberg@intel.com>
Mon, 21 Oct 2013 19:57:08 +0000 (22:57 +0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 21 Oct 2013 19:57:08 +0000 (22:57 +0300)
android/hal-msg.h
android/main.c

index f19d0d0..1f77586 100644 (file)
@@ -46,6 +46,8 @@ struct hal_msg_hdr {
 
 /* Core Service */
 
+#define HAL_ERROR_FAILED               0x01
+
 #define HAL_MSG_OP_ERROR               0x00
 struct hal_msg_rsp_error {
        uint8_t status;
index fe4f9de..aba7f66 100644 (file)
@@ -70,7 +70,8 @@ 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, 0x01);
+               ipc_send_error(hal_cmd_io, HAL_SERVICE_ID_CORE,
+                                                       HAL_ERROR_FAILED);
                return;
        }
 
@@ -87,7 +88,8 @@ static void service_unregister(void *buf, uint16_t len)
        struct hal_msg_cmd_unregister_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, 0x01);
+               ipc_send_error(hal_cmd_io, HAL_SERVICE_ID_CORE,
+                                                       HAL_ERROR_FAILED);
                return;
        }
 
@@ -109,7 +111,8 @@ static void handle_service_core(uint8_t opcode, void *buf, uint16_t len)
                service_unregister(buf, len);
                break;
        default:
-               ipc_send_error(hal_cmd_io, HAL_SERVICE_ID_CORE, 0x01);
+               ipc_send_error(hal_cmd_io, HAL_SERVICE_ID_CORE,
+                                                       HAL_ERROR_FAILED);
                break;
        }
 }
@@ -151,7 +154,7 @@ static gboolean cmd_watch_cb(GIOChannel *io, GIOCondition cond,
                handle_service_core(msg->opcode, buf + sizeof(*msg), msg->len);
                break;
        default:
-               ipc_send_error(hal_cmd_io, msg->service_id, 0x01);
+               ipc_send_error(hal_cmd_io, msg->service_id, HAL_ERROR_FAILED);
                break;
        }