Fixed build error due to modification of HAL layer 43/316643/2
authorJihoon Jung <jh8801.jung@samsung.com>
Mon, 16 Dec 2024 08:51:27 +0000 (17:51 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Wed, 8 Jan 2025 02:23:57 +0000 (11:23 +0900)
Change-Id: I34f65f0f54f1af61df03c2f64b0c275d36da3a62
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
src/oem_emul.c

index 169dc6111ba951d5a23f717e370c674cfeb62f55..4dca47117ef6847b5a6434e9e64acecf29e34bbc 100644 (file)
@@ -110,19 +110,19 @@ typedef struct _net_nfc_oem_llcp_state_t {
        net_nfc_target_handle_s *handle;
        net_nfc_error_e prev_result;
        net_nfc_llcp_socket_t incomming_socket;
-       ndef_message_s *requester;
-       ndef_message_s *selector;
+       net_nfc_ndef_message_s *requester;
+       net_nfc_ndef_message_s *selector;
        bool low_power;
        void *user_data;
        void *payload;
 
-       llcp_app_protocol_e type_app_protocol;
+       net_nfc_llcp_app_protocol_e type_app_protocol;
        net_nfc_conn_handover_carrier_type_e type;
 
 } net_nfc_oem_llcp_state_t;
 
 typedef struct _snep_msg_s {
-       data_s *data;
+       net_nfc_data_s *data;
        int offset;
        bool isSegment;
 
@@ -133,9 +133,9 @@ typedef struct _snep_msg_s {
 
 typedef struct _emulMsg_data_s {
        net_nfc_record_tnf_e tnf;
-       data_s typeName;
-       data_s id;
-       data_s payload;
+       net_nfc_data_s typeName;
+       net_nfc_data_s id;
+       net_nfc_data_s payload;
 
        bool realRecord;
 } emulMsg_data_s;
@@ -184,10 +184,10 @@ typedef void* (*emul_Nfc_thread_handler_t)(void *pParam);
 #define NET_NFC_MAX_LLCP_SOCKET_BUFFER BUFFER_LENGTH_MAX
 
 /* listener callback */
-static target_detection_listener_cb g_emul_controller_target_cb;
-static se_transaction_listener_cb g_emul_controller_se_cb;
-static llcp_event_listener_cb g_emul_controller_llcp_cb;
-static hce_apdu_listener_cb g_emul_controller_hce_cb;
+static net_nfc_target_detection_listener_cb g_emul_controller_target_cb;
+static net_nfc_se_transaction_listener_cb g_emul_controller_se_cb;
+static net_nfc_llcp_event_listener_cb g_emul_controller_llcp_cb;
+static net_nfc_hce_apdu_listener_cb g_emul_controller_hce_cb;
 
 /* for emulator management */
 static pthread_t gEmulThread;
@@ -203,7 +203,7 @@ static int current_connection_id = 1;
 static socket_info_s socket_info_array[LLCP_NB_SOCKET_MAX] = {{0}};
 
 static snep_msg_s *Snep_Server_msg;
-static data_s *llcp_server_data = NULL;
+static net_nfc_data_s *llcp_server_data = NULL;
 
 static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
 
@@ -245,7 +245,7 @@ static void __nfc_emul_util_alloc_mem(void **mem, int size, char *filename, unsi
                DEBUG_ERR_MSG("FILE: %s, LINE:%d, Allocation is failed", filename, line);
 }
 
-static bool _net_nfc_util_init_data(data_s * data, uint32_t length)
+static bool _net_nfc_util_init_data(net_nfc_data_s * data, uint32_t length)
 {
        if (data == NULL || length == 0)
                return false;
@@ -259,7 +259,7 @@ static bool _net_nfc_util_init_data(data_s * data, uint32_t length)
        return true;
 }
 
-static void _net_nfc_util_clear_data(data_s * data)
+static void _net_nfc_util_clear_data(net_nfc_data_s * data)
 {
        if (data == NULL)
                return;
@@ -272,7 +272,7 @@ static void _net_nfc_util_clear_data(data_s * data)
        data->length = 0;
 }
 
-static net_nfc_error_e _net_nfc_util_free_record(ndef_record_s * record)
+static net_nfc_error_e _net_nfc_util_free_record(net_nfc_ndef_record_s * record)
 {
        if (record == NULL)
                return NET_NFC_NULL_PARAMETER;
@@ -286,10 +286,10 @@ static net_nfc_error_e _net_nfc_util_free_record(ndef_record_s * record)
        return NET_NFC_OK;
 }
 
-static net_nfc_error_e _net_nfc_util_free_ndef_message(ndef_message_s * msg)
+static net_nfc_error_e _net_nfc_util_free_ndef_message(net_nfc_ndef_message_s * msg)
 {
        int idx = 0;
-       ndef_record_s *prev, *current;
+       net_nfc_ndef_record_s *prev, *current;
 
        if (msg == NULL)
                return NET_NFC_NULL_PARAMETER;
@@ -311,14 +311,14 @@ static net_nfc_error_e _net_nfc_util_free_ndef_message(ndef_message_s * msg)
        return NET_NFC_OK;
 }
 
-static net_nfc_error_e _net_nfc_util_create_record(net_nfc_record_tnf_e recordType, data_s * typeName, data_s * id, data_s * payload, ndef_record_s ** record)
+static net_nfc_error_e _net_nfc_util_create_record(net_nfc_record_tnf_e recordType, net_nfc_data_s * typeName, net_nfc_data_s * id, net_nfc_data_s * payload, net_nfc_ndef_record_s ** record)
 {
-       ndef_record_s *record_temp = NULL;
+       net_nfc_ndef_record_s *record_temp = NULL;
 
        if (record == NULL)
                return NET_NFC_NULL_PARAMETER;
 
-       if (recordType < NET_NFC_RECORD_EMPTY || recordType > NET_NFC_RECORD_UNCHAGNED)
+       if (recordType < NET_NFC_RECORD_EMPTY || recordType > NET_NFC_RECORD_UNCHANGED)
                return NET_NFC_OUT_OF_BOUND;
 
        /* empty_tag */
@@ -330,7 +330,7 @@ static net_nfc_error_e _net_nfc_util_create_record(net_nfc_record_tnf_e recordTy
                        return NET_NFC_INVALID_PARAM;
        }
 
-       _nfc_emul_util_alloc_mem(record_temp, sizeof(ndef_record_s));
+       _nfc_emul_util_alloc_mem(record_temp, sizeof(net_nfc_ndef_record_s));
        if (record_temp == NULL)
                return NET_NFC_ALLOC_FAIL;
        // set type name and length and  TNF field
@@ -398,7 +398,7 @@ static net_nfc_error_e _net_nfc_util_create_record(net_nfc_record_tnf_e recordTy
        return NET_NFC_OK;
 }
 
-static net_nfc_error_e _net_nfc_util_append_record(ndef_message_s * msg, ndef_record_s * record)
+static net_nfc_error_e _net_nfc_util_append_record(net_nfc_ndef_message_s * msg, net_nfc_ndef_record_s * record)
 {
        if (msg == NULL || record == NULL)
                return NET_NFC_NULL_PARAMETER;
@@ -415,8 +415,8 @@ static net_nfc_error_e _net_nfc_util_append_record(ndef_message_s * msg, ndef_re
 
                DEBUG_MSG("record is added to NDEF message :: count [%d]", msg->recordCount);
        } else {
-               ndef_record_s *current = NULL;
-               ndef_record_s *prev = NULL;
+               net_nfc_ndef_record_s *current = NULL;
+               net_nfc_ndef_record_s *prev = NULL;
 
                // set flag :: this record is FIRST
                current = msg->records;
@@ -450,7 +450,7 @@ static net_nfc_error_e _net_nfc_util_append_record(ndef_message_s * msg, ndef_re
        return NET_NFC_OK;
 }
 
-static uint32_t _net_nfc_util_get_record_length(ndef_record_s * Record)
+static uint32_t _net_nfc_util_get_record_length(net_nfc_ndef_record_s * Record)
 {
        uint32_t RecordLength = 1;
 
@@ -492,9 +492,9 @@ static uint32_t _net_nfc_util_get_record_length(ndef_record_s * Record)
        return RecordLength;
 }
 
-static uint32_t _net_nfc_util_get_ndef_message_length(ndef_message_s * message)
+static uint32_t _net_nfc_util_get_ndef_message_length(net_nfc_ndef_message_s * message)
 {
-       ndef_record_s *current;
+       net_nfc_ndef_record_s *current;
        int total = 0;
 
        if (message == NULL)
@@ -510,21 +510,21 @@ static uint32_t _net_nfc_util_get_ndef_message_length(ndef_message_s * message)
        return total;
 }
 
-static net_nfc_error_e _net_nfc_util_create_ndef_message(ndef_message_s ** ndef_message)
+static net_nfc_error_e _net_nfc_util_create_ndef_message(net_nfc_ndef_message_s ** ndef_message)
 {
        if (ndef_message == NULL)
                return NET_NFC_NULL_PARAMETER;
 
-       _nfc_emul_util_alloc_mem(*ndef_message, sizeof(ndef_message_s));
+       _nfc_emul_util_alloc_mem(*ndef_message, sizeof(net_nfc_ndef_message_s));
        if (*ndef_message == NULL)
                return NET_NFC_ALLOC_FAIL;
 
        return NET_NFC_OK;
 }
 
-static net_nfc_error_e _net_nfc_util_convert_ndef_message_to_rawdata(ndef_message_s * ndef, data_s * rawdata)
+static net_nfc_error_e _net_nfc_util_convert_ndef_message_to_rawdata(net_nfc_ndef_message_s * ndef, net_nfc_data_s * rawdata)
 {
-       ndef_record_s *record = NULL;
+       net_nfc_ndef_record_s *record = NULL;
        uint8_t *current = NULL;
        uint8_t ndef_header;
 
@@ -687,7 +687,7 @@ static void _net_nfc_initialize_llcp(void)
                if (Snep_Server_msg == NULL)
                        return;
 
-               Snep_Server_msg->data = calloc(1, sizeof(data_s));
+               Snep_Server_msg->data = calloc(1, sizeof(net_nfc_data_s));
                if (Snep_Server_msg->data == NULL)
                        return;
 
@@ -818,12 +818,12 @@ static net_nfc_record_tnf_e _net_nfc_get_tnf_type(int name_format)
 
 }
 
-static inline int _create_records_well_known(emulMsg_data_s *record, char *record_payload, ndef_record_h *new_record)
+static inline int _create_records_well_known(emulMsg_data_s *record, char *record_payload, net_nfc_ndef_record_h *new_record)
 {
        if (!strncmp((char *)record->typeName.buffer, "U", 1)) {
                DEBUG_MSG("URI Type ");
 
-               data_s payload_data = {NULL, 0};
+               net_nfc_data_s payload_data = {NULL, 0};
 
                if (record->payload.buffer != NULL) {
                        payload_data.length = strlen(record_payload) + 1;
@@ -838,7 +838,7 @@ static inline int _create_records_well_known(emulMsg_data_s *record, char *recor
                        memcpy(payload_data.buffer + 1, record->payload.buffer, payload_data.length - 1);
                }
 
-               if (_net_nfc_util_create_record(record->tnf, &record->typeName, &record->id, &payload_data, (ndef_record_s**)new_record) != NET_NFC_OK) {
+               if (_net_nfc_util_create_record(record->tnf, &record->typeName, &record->id, &payload_data, (net_nfc_ndef_record_s**)new_record) != NET_NFC_OK) {
                        DEBUG_ERR_MSG("net_nfc_util_create_record is failed");
                        return -1;
                }
@@ -848,7 +848,7 @@ static inline int _create_records_well_known(emulMsg_data_s *record, char *recor
        } else if (!strncmp((char *)record->typeName.buffer, "T", 1)) {
                DEBUG_MSG("TEXT Type ");
 
-               data_s payload_data = {NULL, 0};
+               net_nfc_data_s payload_data = {NULL, 0};
                int offset = 0;
                int controll_byte;
 
@@ -872,7 +872,7 @@ static inline int _create_records_well_known(emulMsg_data_s *record, char *recor
                        memcpy(payload_data.buffer + offset, record->payload.buffer, strlen(record_payload));
                }
 
-               if (_net_nfc_util_create_record(record->tnf, &record->typeName, &record->id, &payload_data, (ndef_record_s**)new_record) != NET_NFC_OK) {
+               if (_net_nfc_util_create_record(record->tnf, &record->typeName, &record->id, &payload_data, (net_nfc_ndef_record_s**)new_record) != NET_NFC_OK) {
                        DEBUG_ERR_MSG("net_nfc_util_create_record is failed");
                        return -1;
                }
@@ -886,10 +886,10 @@ static inline int _create_records_well_known(emulMsg_data_s *record, char *recor
        return 0;
 }
 
-static inline int _create_records_mime(emulMsg_data_s *record, char *record_payload, ndef_record_h *new_record)
+static inline int _create_records_mime(emulMsg_data_s *record, char *record_payload, net_nfc_ndef_record_h *new_record)
 {
        FILE *file = NULL;
-       data_s filePayload = {NULL, 0};
+       net_nfc_data_s filePayload = {NULL, 0};
 
        /* open file : size limit? 10k? */
        file = fopen(record_payload, "r");
@@ -958,7 +958,7 @@ static inline int _create_records_mime(emulMsg_data_s *record, char *record_payl
 
        /* create record */
        int ret = _net_nfc_util_create_record(record->tnf, &record->typeName, &record->id,
-               &filePayload, (ndef_record_s **)new_record);
+               &filePayload, (net_nfc_ndef_record_s **)new_record);
        _nfc_emul_util_free_mem(filePayload.buffer);
        if (ret != NET_NFC_OK) {
                DEBUG_MSG("net_nfc_create_record failed[%d]", ret);
@@ -980,7 +980,7 @@ static void _create_records_free(emulMsg_data_s *record)
                _nfc_emul_util_free_mem(record->payload.buffer);
 }
 
-static int _net_nfc_create_records_from_emulMsg(emulMsg_s *emul_msg, ndef_message_s **ndef_message, int record_count)
+static int _net_nfc_create_records_from_emulMsg(emulMsg_s *emul_msg, net_nfc_ndef_message_s **ndef_message, int record_count)
 {
        DEBUG_EMUL_BEGIN();
 
@@ -1063,13 +1063,13 @@ static int _net_nfc_create_records_from_emulMsg(emulMsg_s *emul_msg, ndef_messag
 #endif
 
                /* create record */
-               ndef_record_h new_record = NULL;
+               net_nfc_ndef_record_h new_record = NULL;
                net_nfc_error_e result = NET_NFC_OK;
 
                switch (record.tnf) {
                case NET_NFC_RECORD_EMPTY:
                        result = _net_nfc_util_create_record(NET_NFC_RECORD_EMPTY, &record.typeName,
-                               &record.id, &record.payload, (ndef_record_s **)&new_record);
+                               &record.id, &record.payload, (net_nfc_ndef_record_s **)&new_record);
                        if (NET_NFC_OK != result) {
                                DEBUG_MSG("net_nfc_create_record failed[%d]", result);
                                _create_records_free(&record);
@@ -1078,7 +1078,7 @@ static int _net_nfc_create_records_from_emulMsg(emulMsg_s *emul_msg, ndef_messag
                        break;
                case NET_NFC_RECORD_UNKNOWN:
                        result = _net_nfc_util_create_record(NET_NFC_RECORD_UNKNOWN, &record.typeName,
-                               &record.id, &record.payload, (ndef_record_s **)&new_record);
+                               &record.id, &record.payload, (net_nfc_ndef_record_s **)&new_record);
                        if (NET_NFC_OK != result) {
                                DEBUG_MSG("net_nfc_create_record failed[%d]", result);
                                _create_records_free(&record);
@@ -1100,7 +1100,7 @@ static int _net_nfc_create_records_from_emulMsg(emulMsg_s *emul_msg, ndef_messag
                default:
                        /* NET_NFC_RECORD_URI or NET_NFC_RECORD_EXTERNAL_RTD */
                        result = _net_nfc_util_create_record(record.tnf, &record.typeName,
-                               &record.id, &record.payload, (ndef_record_s **)&new_record);
+                               &record.id, &record.payload, (net_nfc_ndef_record_s **)&new_record);
                        if (NET_NFC_OK != result) {
                                DEBUG_MSG("net_nfc_create_record failed[%d]", result);
                                _create_records_free(&record);
@@ -1110,7 +1110,7 @@ static int _net_nfc_create_records_from_emulMsg(emulMsg_s *emul_msg, ndef_messag
                }
 
                /* append record to ndef msg */
-               if ((result = _net_nfc_util_append_record((ndef_message_s*)*ndef_message, (ndef_record_s *)new_record)) != NET_NFC_OK) {
+               if ((result = _net_nfc_util_append_record((net_nfc_ndef_message_s*)*ndef_message, (net_nfc_ndef_record_s *)new_record)) != NET_NFC_OK) {
                        DEBUG_MSG("net_nfc_util_append_record failed[%d]", result);
                        _create_records_free(&record);
                        return create_record_count;
@@ -1176,7 +1176,7 @@ static bool _net_nfc_change_file_owner_permission(FILE *file)
        return true;
 }
 
-static void _net_nfc_store_ndef_message(data_s *data)
+static void _net_nfc_store_ndef_message(net_nfc_data_s *data)
 {
        char file_name[1024] = {0};
        FILE *fp = NULL;
@@ -1207,7 +1207,7 @@ static void _net_nfc_store_ndef_message(data_s *data)
        }
 }
 
-static net_nfc_error_e _net_nfc_retrieve_ndef_message(data_s *data)
+static net_nfc_error_e _net_nfc_retrieve_ndef_message(net_nfc_data_s *data)
 {
        char file_name[1024] = {0};
        FILE *fp = NULL;
@@ -1273,7 +1273,7 @@ static bool _net_nfc_create_ndef_from_emulMsg(emulMsg_s *emul_msg)
 
        int retval = true;
        net_nfc_error_e result = NET_NFC_OK;
-       data_s rawdata = {NULL, 0};
+       net_nfc_data_s rawdata = {NULL, 0};
 
        int record_count = emul_msg->record_count;
 
@@ -1281,17 +1281,17 @@ static bool _net_nfc_create_ndef_from_emulMsg(emulMsg_s *emul_msg)
                return false;
 
        /* create ndef msg */
-       ndef_message_h ndef_message = NULL;
+       net_nfc_ndef_message_h ndef_message = NULL;
        int ndef_length = 0;
 
-       if ((result = _net_nfc_util_create_ndef_message((ndef_message_s **)&ndef_message)) != NET_NFC_OK)
+       if ((result = _net_nfc_util_create_ndef_message((net_nfc_ndef_message_s **)&ndef_message)) != NET_NFC_OK)
                DEBUG_MSG("failed to create ndef message [%d]", result);
 
        /* create records and append it to ndef_msg*/
-       emul_msg->record_count = _net_nfc_create_records_from_emulMsg(emul_msg, (ndef_message_s **)&ndef_message, record_count);
+       emul_msg->record_count = _net_nfc_create_records_from_emulMsg(emul_msg, (net_nfc_ndef_message_s **)&ndef_message, record_count);
 
        /* convert ndef msg to raw data */
-       ndef_length = _net_nfc_util_get_ndef_message_length((ndef_message_s *)ndef_message);
+       ndef_length = _net_nfc_util_get_ndef_message_length((net_nfc_ndef_message_s *)ndef_message);
 
        if (!ndef_length)
                DEBUG_MSG("ndef_message size is zero!");
@@ -1299,7 +1299,7 @@ static bool _net_nfc_create_ndef_from_emulMsg(emulMsg_s *emul_msg)
        rawdata.length = ndef_length;
        _nfc_emul_util_alloc_mem(rawdata.buffer, ndef_length);
 
-       if ((result = _net_nfc_util_convert_ndef_message_to_rawdata((ndef_message_s*)ndef_message, &rawdata)) != NET_NFC_OK)
+       if ((result = _net_nfc_util_convert_ndef_message_to_rawdata((net_nfc_ndef_message_s*)ndef_message, &rawdata)) != NET_NFC_OK)
                DEBUG_MSG("net_nfc_util_convert_ndef_message_to_rawdata is failed![%d]", result);
 
        _net_nfc_store_ndef_message(&rawdata);
@@ -1493,20 +1493,20 @@ static void _net_nfc_target_discovered_cb(emulMsg_s *emul_msg)
        target_detected->request_type = NET_NFC_MESSAGE_SERVICE_STANDALONE_TARGET_DETECTED;
        target_detected->handle = handle;
 
-       target_detected->devType = _net_nfc_emul_convert_target_type(emul_msg->target_type);
-       if (!target_detected->devType) {
-               DEBUG_MSG("target_detected->devType is unknown");
+       target_detected->dev_type = _net_nfc_emul_convert_target_type(emul_msg->target_type);
+       if (!target_detected->dev_type) {
+               DEBUG_MSG("target_detected->dev_type is unknown");
                _nfc_emul_util_free_mem(target_detected);
                return;
        }
 
        target_detected->handle->connection_id = current_connection_id++;
 
-       if (target_detected->devType == NET_NFC_NFCIP1_TARGET) {
+       if (target_detected->dev_type == NET_NFC_NFCIP1_TARGET) {
                DEBUG_MSG("set llcp connection type. remote device is target");
                handle->connection_type = NET_NFC_P2P_CONNECTION_TARGET;
                _net_nfc_emul_set_is_p2p_attached(true);
-       } else if (target_detected->devType == NET_NFC_NFCIP1_INITIATOR) {
+       } else if (target_detected->dev_type == NET_NFC_NFCIP1_INITIATOR) {
                DEBUG_MSG("set llcp connection type. remote device is initiator");
                handle->connection_type = NET_NFC_P2P_CONNECTION_INITIATOR;
                _net_nfc_emul_set_is_p2p_attached(true);
@@ -1605,7 +1605,7 @@ static void _net_nfc_llcp_create_snep_server_msg(snep_command_field_e resp_field
        uint8_t response = (uint8_t)resp_field;
        uint8_t version = 0;
        uint32_t length_field = 0;
-       data_s rawdata = {NULL, 0};
+       net_nfc_data_s rawdata = {NULL, 0};
 
        version = SNEP_MAJOR_VER;
        version = (((version << 4) & 0xf0) | (SNEP_MINOR_VER & 0x0f));
@@ -1653,7 +1653,7 @@ static llcp_state_e _net_nfc_get_llcp_state(void *pContext)
 static bool _net_nfc_make_llcp_data(emulMsg_s *emul_msg)
 {
        DEBUG_EMUL_BEGIN();
-       data_s rawdata = {NULL, 0};
+       net_nfc_data_s rawdata = {NULL, 0};
 
        _net_nfc_retrieve_ndef_message(&rawdata);
        _nfc_emul_util_free_mem(rawdata.buffer);
@@ -1978,13 +1978,8 @@ static void _net_nfc_emul_controller_stop_thread(void)
        DEBUG_EMUL_END();
 }
 
-static bool net_nfc_emul_controller_init(net_nfc_error_e *result)
+static int net_nfc_emul_controller_init()
 {
-       bool ret = true;
-
-       if (result == NULL)
-               return false;
-
        DEBUG_EMUL_BEGIN();
 
        DEBUG_MSG("start stack init ");
@@ -2004,21 +1999,20 @@ static bool net_nfc_emul_controller_init(net_nfc_error_e *result)
        DEBUG_MSG("Stack init finished");
 
        g_stack_init_successful = true;
-       *result = NET_NFC_OK;
 
        DEBUG_EMUL_END();
 
-       return ret;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_deinit(void)
+static int net_nfc_emul_controller_deinit(void)
 {
        DEBUG_EMUL_BEGIN();
 
        /* End thread */
        if (g_stack_init_successful == false) {
                DEBUG_MSG("Already statck is deinitialized");
-               return true;
+               return NET_NFC_OK;
        }
 
        _net_nfc_emul_controller_stop_thread();
@@ -2027,20 +2021,15 @@ static bool net_nfc_emul_controller_deinit(void)
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
-static bool net_nfc_emul_controller_register_listener(
-       target_detection_listener_cb target_detection_listener,
-       se_transaction_listener_cb se_transaction_listener,
-       llcp_event_listener_cb llcp_event_listener,
-       hce_apdu_listener_cb hce_apdu_listener,
-       net_nfc_error_e *result)
-{
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
 
+static int net_nfc_emul_controller_register_listener(
+       net_nfc_target_detection_listener_cb target_detection_listener,
+       net_nfc_se_transaction_listener_cb se_transaction_listener,
+       net_nfc_llcp_event_listener_cb llcp_event_listener,
+       net_nfc_hce_apdu_listener_cb hce_apdu_listener)
+{
        DEBUG_EMUL_BEGIN();
 
        g_emul_controller_target_cb = target_detection_listener;
@@ -2050,10 +2039,10 @@ static bool net_nfc_emul_controller_register_listener(
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_unregister_listener()
+static int net_nfc_emul_controller_unregister_listener()
 {
        DEBUG_EMUL_BEGIN();
 
@@ -2063,19 +2052,17 @@ static bool net_nfc_emul_controller_unregister_listener()
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_get_firmware_version(data_s **data, net_nfc_error_e *result)
+static int net_nfc_emul_controller_get_firmware_version(net_nfc_data_s **data)
 {
-       if (data == NULL || result == NULL)
+       if (data == NULL)
                return false;
 
-       *result = NET_NFC_OK;
-
        DEBUG_EMUL_BEGIN();
 
-       *data = calloc(1, sizeof(data_s));
+       *data = calloc(1, sizeof(net_nfc_data_s));
 
        if (*data == NULL)
                return false;
@@ -2090,60 +2077,40 @@ static bool net_nfc_emul_controller_get_firmware_version(data_s **data, net_nfc_
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_check_firmware_version(net_nfc_error_e *result)
+static int net_nfc_emul_controller_check_firmware_version()
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_update_firmware(net_nfc_error_e *result)
+static int net_nfc_emul_controller_update_firmware()
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_get_stack_information(net_nfc_stack_information_s *stack_info, net_nfc_error_e *result)
+static int net_nfc_emul_controller_get_stack_information(net_nfc_stack_information_s *stack_info)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_configure_discovery(net_nfc_discovery_mode_e mode, net_nfc_event_filter_e config, net_nfc_error_e *result)
+static int net_nfc_emul_controller_configure_discovery(net_nfc_discovery_mode_e mode, net_nfc_event_filter_e config)
 {
        int idx;
-       bool ret = true;
-
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
+       int ret = NET_NFC_OK;
 
        if (mode == NET_NFC_DISCOVERY_MODE_START) {
                mode = NET_NFC_DISCOVERY_MODE_CONFIG;
@@ -2167,10 +2134,8 @@ static bool net_nfc_emul_controller_configure_discovery(net_nfc_discovery_mode_e
 
                        ret = net_nfc_emul_controller_deinit();
                } else if (config == NET_NFC_ALL_ENABLE) {
-                       net_nfc_error_e err;
-
                        DEBUG_MSG("Create Thread");
-                       ret = net_nfc_emul_controller_init(&err);
+                       ret = net_nfc_emul_controller_init();
                }
        }
 
@@ -2179,84 +2144,55 @@ static bool net_nfc_emul_controller_configure_discovery(net_nfc_discovery_mode_e
        return ret;
 }
 
-static bool net_nfc_emul_controller_get_secure_element_list(net_nfc_secure_element_info_s *list, int *count, net_nfc_error_e *result)
+static int net_nfc_emul_controller_get_secure_element_list(net_nfc_secure_element_info_s *list, int *count)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_set_secure_element_mode(net_nfc_secure_element_type_e element_type, net_nfc_secure_element_mode_e mode, net_nfc_error_e *result)
+static int net_nfc_emul_controller_set_secure_element_mode(net_nfc_secure_element_type_e element_type, net_nfc_secure_element_mode_e mode)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_check_target_presence(net_nfc_target_handle_s *handle, net_nfc_error_e *result)
+static int net_nfc_emul_controller_check_target_presence(net_nfc_target_handle_s *handle)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
        usleep(300 * 1000);
 
        if (_net_nfc_emul_get_is_tag_attached()) {
-               return true;
+               return NET_NFC_OK;
        } else {
                DEBUG_MSG("TAG Detached");
                return false;
        }
 }
 
-static bool net_nfc_emul_controller_connect(net_nfc_target_handle_s *handle, net_nfc_error_e *result)
+static int net_nfc_emul_controller_connect(net_nfc_target_handle_s *handle)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_disconnect(net_nfc_target_handle_s *handle, net_nfc_error_e *result)
+static int net_nfc_emul_controller_disconnect(net_nfc_target_handle_s *handle)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
-
        // This handle is not useful anymore
        __net_nfc_make_invalid_target_handle();
 
@@ -2267,27 +2203,18 @@ static bool net_nfc_emul_controller_disconnect(net_nfc_target_handle_s *handle,
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_check_ndef(net_nfc_target_handle_s *handle, uint8_t *ndef_card_state, int *max_data_size, int *real_data_size, net_nfc_error_e *result)
+static int net_nfc_emul_controller_check_ndef(net_nfc_target_handle_s *handle, uint8_t *ndef_card_state, int *max_net_nfc_data_size, int *real_net_nfc_data_size)
 {
-       data_s rawdata = {NULL, 0};
+       net_nfc_data_s rawdata = {NULL, 0};
 
-       if (result == NULL)
-               return false;
+       if (handle == NULL || ndef_card_state == NULL || max_net_nfc_data_size == NULL || real_net_nfc_data_size == NULL)
+               return NET_NFC_NULL_PARAMETER;
 
-       *result = NET_NFC_OK;
-
-       if (handle == NULL || ndef_card_state == NULL || max_data_size == NULL || real_data_size == NULL || result == NULL) {
-               *result = NET_NFC_NULL_PARAMETER;
-               return false;
-       }
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
@@ -2296,120 +2223,94 @@ static bool net_nfc_emul_controller_check_ndef(net_nfc_target_handle_s *handle,
 
        if (_net_nfc_emul_get_is_tag_attached()) {
                *ndef_card_state = NET_NFC_NDEF_CARD_READ_WRITE;
-               *max_data_size = BUFFER_LENGTH_MAX;
-               *real_data_size = rawdata.length;
-               DEBUG_MSG("Card State : [%d] MAX data size :[%d] actual data size = [%d]", *ndef_card_state, *max_data_size, *real_data_size);
+               *max_net_nfc_data_size = BUFFER_LENGTH_MAX;
+               *real_net_nfc_data_size = rawdata.length;
+               DEBUG_MSG("Card State : [%d] MAX data size :[%d] actual data size = [%d]", *ndef_card_state, *max_net_nfc_data_size, *real_net_nfc_data_size);
        } else {
                DEBUG_MSG("target detached");
        }
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_make_read_only_ndef(net_nfc_target_handle_s *handle, net_nfc_error_e *result)
+static int net_nfc_emul_controller_make_read_only_ndef(net_nfc_target_handle_s *handle)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_read_ndef(net_nfc_target_handle_s *handle, data_s **data, net_nfc_error_e *result)
+static int net_nfc_emul_controller_read_ndef(net_nfc_target_handle_s *handle, net_nfc_data_s **data)
 {
-       int real_data_size = 0;
-       data_s rawdata = {NULL, 0};
+       int result = NET_NFC_OK;
+       int real_net_nfc_data_size = 0;
+       net_nfc_data_s rawdata = {NULL, 0};
 
        DEBUG_EMUL_BEGIN();
 
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (handle == NULL || data == NULL || result == NULL) {
+       if (handle == NULL || data == NULL) {
                DEBUG_ERR_MSG("NET_NFC_NULL_PARAMETER >>>");
-               *result = NET_NFC_NULL_PARAMETER;
-               return false;
+               return NET_NFC_NULL_PARAMETER;
        }
 
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               DEBUG_ERR_MSG("NET_NFC_INVALID_HANDLE >>>");
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        if (!_net_nfc_emul_get_is_tag_attached()) {
                DEBUG_ERR_MSG("NET_NFC_NOT_ALLOWED_OPERATION >>>");
-               *result = NET_NFC_NOT_ALLOWED_OPERATION;
-               return false;
+               return NET_NFC_NOT_ALLOWED_OPERATION;
        }
 
-       *result = _net_nfc_retrieve_ndef_message(&rawdata);
-       if (*result != NET_NFC_OK) {
+       result = _net_nfc_retrieve_ndef_message(&rawdata);
+       if (result != NET_NFC_OK) {
                _nfc_emul_util_free_mem(rawdata.buffer);
                return false;
        }
 
-       real_data_size = rawdata.length;
+       real_net_nfc_data_size = rawdata.length;
 
-       if (real_data_size == 0) {
-               DEBUG_ERR_MSG("read ndef_msg is failed >>> real_data_size is zero");
-               *result = NET_NFC_NO_NDEF_MESSAGE;
+       if (real_net_nfc_data_size == 0) {
+               DEBUG_ERR_MSG("read ndef_msg is failed >>> real_net_nfc_data_size is zero");
                _nfc_emul_util_free_mem(rawdata.buffer);
-               return false;
+               return NET_NFC_NO_NDEF_MESSAGE;
        }
 
-       *data = calloc(1, sizeof(data_s));
+       *data = calloc(1, sizeof(net_nfc_data_s));
 
        if (*data == NULL) {
-               *result = NET_NFC_ALLOC_FAIL;
                _nfc_emul_util_free_mem(rawdata.buffer);
-               return false;
+               return NET_NFC_ALLOC_FAIL;
        }
 
-       (*data)->length = real_data_size;
-       (*data)->buffer = calloc(1, real_data_size);
+       (*data)->length = real_net_nfc_data_size;
+       (*data)->buffer = calloc(1, real_net_nfc_data_size);
 
        if ((*data)->buffer == NULL) {
                free(*data);
-               *result = NET_NFC_ALLOC_FAIL;
                _nfc_emul_util_free_mem(rawdata.buffer);
-               return false;
+               return NET_NFC_ALLOC_FAIL;
        }
 
        /* copy rawdata to data->buffer */
-       memcpy((*data)->buffer, rawdata.buffer, real_data_size);
+       memcpy((*data)->buffer, rawdata.buffer, real_net_nfc_data_size);
        _nfc_emul_util_free_mem(rawdata.buffer);
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_write_ndef(net_nfc_target_handle_s *handle, data_s *data, net_nfc_error_e *result)
+static int net_nfc_emul_controller_write_ndef(net_nfc_target_handle_s *handle, net_nfc_data_s *data)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
@@ -2419,31 +2320,22 @@ static bool net_nfc_emul_controller_write_ndef(net_nfc_target_handle_s *handle,
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
 
-static bool net_nfc_emul_controller_transceive(net_nfc_target_handle_s *handle,
-       net_nfc_transceive_info_s *info, data_s **data, net_nfc_error_e *result)
+static int net_nfc_emul_controller_transceive(net_nfc_target_handle_s *handle,
+       net_nfc_transceive_info_s *info, net_nfc_data_s **data)
 {
-       bool ret = false;
-
-       if (result == NULL)
-               return ret;
-
        if (info == NULL || info->trans_data.buffer == NULL ||
                info->trans_data.length == 0) {
-               *result = NET_NFC_INVALID_PARAM;
-               return ret;
+               return NET_NFC_INVALID_PARAM;
        }
 
-       *result = NET_NFC_OK;
        *data = NULL;
 
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return ret;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
@@ -2451,56 +2343,42 @@ static bool net_nfc_emul_controller_transceive(net_nfc_target_handle_s *handle,
 
        DEBUG_EMUL_END();
 
-       return ret;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_format_ndef(net_nfc_target_handle_s *handle, data_s *secure_key, net_nfc_error_e *result)
+static int net_nfc_emul_controller_format_ndef(net_nfc_target_handle_s *handle, net_nfc_data_s *secure_key)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_exception_handler(void)
+static int net_nfc_emul_controller_exception_handler(void)
 {
        DEBUG_EMUL_BEGIN();
 
-       net_nfc_error_e error;
-
-       if (net_nfc_emul_controller_init(&error) == false) {
+       if (net_nfc_emul_controller_init() == false) {
                DEBUG_ERR_MSG("exception handler is failed!!");
                exit(0xff);
        }
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_is_ready(net_nfc_error_e *result)
+static int net_nfc_emul_controller_is_ready()
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return g_stack_init_successful;
+       return NET_NFC_OK;
 }
 
 
@@ -2508,65 +2386,41 @@ static bool net_nfc_emul_controller_is_ready(net_nfc_error_e *result)
 *      LLCP definition     *
 ********************/
 
-static bool net_nfc_emul_controller_llcp_config(net_nfc_llcp_config_info_s *config, net_nfc_error_e *result)
+static int net_nfc_emul_controller_llcp_config(net_nfc_llcp_config_info_s *config)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_check_llcp(net_nfc_target_handle_s *handle, net_nfc_error_e *result)
+static int net_nfc_emul_controller_llcp_check_llcp(net_nfc_target_handle_s *handle)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_activate_llcp(net_nfc_target_handle_s *handle, net_nfc_error_e *result)
+static int net_nfc_emul_controller_llcp_activate_llcp(net_nfc_target_handle_s *handle)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_create_socket(net_nfc_llcp_socket_t *socket, net_nfc_socket_type_e socketType, uint16_t miu, uint8_t rw, net_nfc_error_e *result, void *user_param)
+static int net_nfc_emul_controller_llcp_create_socket(net_nfc_llcp_socket_t *socket, net_nfc_socket_type_e socketType, uint16_t miu, uint8_t rw, void *user_param)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
        DEBUG_EMUL_BEGIN();
 
        /* get available socket */
@@ -2617,34 +2471,22 @@ static bool net_nfc_emul_controller_llcp_create_socket(net_nfc_llcp_socket_t *so
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_bind(net_nfc_llcp_socket_t socket, uint8_t service_access_point, net_nfc_error_e *result)
+static int net_nfc_emul_controller_llcp_bind(net_nfc_llcp_socket_t socket, uint8_t service_access_point)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_listen(net_nfc_target_handle_s *handle, uint8_t *service_access_name, net_nfc_llcp_socket_t socket, net_nfc_error_e *result, void *user_param)
+static int net_nfc_emul_controller_llcp_listen(net_nfc_target_handle_s *handle, uint8_t *service_access_name, net_nfc_llcp_socket_t socket, void *user_param)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
@@ -2688,35 +2530,23 @@ static bool net_nfc_emul_controller_llcp_listen(net_nfc_target_handle_s *handle,
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
 /* below accept function does not used. */
-static bool net_nfc_emul_controller_llcp_accept(net_nfc_llcp_socket_t socket, net_nfc_error_e *result, void *user_param)
+static int net_nfc_emul_controller_llcp_accept(net_nfc_llcp_socket_t socket, void *user_param)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_connect(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t        socket, uint8_t service_access_point, net_nfc_error_e *result, void *user_param)
+static int net_nfc_emul_controller_llcp_connect(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, uint8_t service_access_point, void *user_param)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
@@ -2735,20 +2565,13 @@ static bool net_nfc_emul_controller_llcp_connect(net_nfc_target_handle_s *handle
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_connect_by_url(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, uint8_t *service_access_name, net_nfc_error_e *result, void *user_param)
+static int net_nfc_emul_controller_llcp_connect_by_url(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t  socket, uint8_t *service_access_name, void *user_param)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
@@ -2767,20 +2590,13 @@ static bool net_nfc_emul_controller_llcp_connect_by_url(net_nfc_target_handle_s
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_send(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t   socket, data_s *data, net_nfc_error_e *result, void *user_param)
+static int net_nfc_emul_controller_llcp_send(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t    socket, net_nfc_data_s *data, void *user_param)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
@@ -2816,20 +2632,13 @@ static bool net_nfc_emul_controller_llcp_send(net_nfc_target_handle_s *handle, n
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_send_to(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t        socket, data_s *data, uint8_t service_access_point, net_nfc_error_e *result, void *user_param)
+static int net_nfc_emul_controller_llcp_send_to(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, net_nfc_data_s *data, uint8_t service_access_point, void *user_param)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
@@ -2865,21 +2674,17 @@ static bool net_nfc_emul_controller_llcp_send_to(net_nfc_target_handle_s *handle
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
 
-static bool net_nfc_emul_controller_llcp_recv(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, data_s *data, net_nfc_error_e *result, void *user_param)
+static int net_nfc_emul_controller_llcp_recv(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, net_nfc_data_s *data, void *user_param)
 {
-       if (result == NULL || data == NULL)
+       if (data == NULL)
                return false;
 
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
@@ -2940,20 +2745,13 @@ static bool net_nfc_emul_controller_llcp_recv(net_nfc_target_handle_s *handle, n
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_recv_from(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, data_s *data, net_nfc_error_e *result, void *user_param)
+static int net_nfc_emul_controller_llcp_recv_from(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, net_nfc_data_s *data, void *user_param)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
@@ -3019,20 +2817,13 @@ static bool net_nfc_emul_controller_llcp_recv_from(net_nfc_target_handle_s *hand
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_disconnect(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t     socket, net_nfc_error_e *result, void *user_param)
+static int net_nfc_emul_controller_llcp_disconnect(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, void *user_param)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
@@ -3070,57 +2861,37 @@ static bool net_nfc_emul_controller_llcp_disconnect(net_nfc_target_handle_s *han
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_socket_close(net_nfc_llcp_socket_t socket,
-       net_nfc_error_e *result)
+static int net_nfc_emul_controller_llcp_socket_close(net_nfc_llcp_socket_t socket)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_reject(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, net_nfc_error_e *result)
+static int net_nfc_emul_controller_llcp_reject(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket)
 {
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_get_remote_config(net_nfc_target_handle_s *handle, net_nfc_llcp_config_info_s *config, net_nfc_error_e *result)
+static int net_nfc_emul_controller_llcp_get_remote_config(net_nfc_target_handle_s *handle, net_nfc_llcp_config_info_s *config)
 {
        /* In llcp specification ver 1.1, default miu size is 128 */
        const uint16_t default_miu = 128;
 
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
@@ -3128,23 +2899,16 @@ static bool net_nfc_emul_controller_llcp_get_remote_config(net_nfc_target_handle
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-static bool net_nfc_emul_controller_llcp_get_remote_socket_info(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, net_nfc_llcp_socket_option_s *option, net_nfc_error_e *result)
+static int net_nfc_emul_controller_llcp_get_remote_socket_info(net_nfc_target_handle_s *handle, net_nfc_llcp_socket_t socket, net_nfc_llcp_socket_option_s *option)
 {
        /* In llcp specification ver 1.1, default miu size is 128 */
        const uint16_t default_miu = 128;
 
-       if (result == NULL)
-               return false;
-
-       *result = NET_NFC_OK;
-
-       if (!__net_nfc_is_valide_target_handle(handle)) {
-               *result = NET_NFC_INVALID_HANDLE;
-               return false;
-       }
+       if (!__net_nfc_is_valide_target_handle(handle))
+               return NET_NFC_INVALID_HANDLE;
 
        DEBUG_EMUL_BEGIN();
 
@@ -3152,47 +2916,37 @@ static bool net_nfc_emul_controller_llcp_get_remote_socket_info(net_nfc_target_h
 
        DEBUG_EMUL_END();
 
-       return true;
+       return NET_NFC_OK;
 }
 
-
-static bool net_nfc_emul_controller_support_nfc(net_nfc_error_e *result)
+static int net_nfc_emul_controller_support_nfc()
 {
-       bool ret = false;
        struct stat st = {0};
 
-       if (stat("/dev/nfc0", &st) == -1) {
-               if (result)
-                       *result = NET_NFC_NOT_SUPPORTED;
-               return ret;
-       }
-
-       if (result)
-               *result = NET_NFC_OK;
-
-       ret = true;
-
-       return ret;
+       return (stat("/dev/nfc0", &st) == -1) ? NET_NFC_NOT_SUPPORTED : NET_NFC_OK;
 }
-static bool net_nfc_emul_controller_secure_element_open(net_nfc_secure_element_type_e element_type, net_nfc_target_handle_s **handle, net_nfc_error_e *result)
+
+static int net_nfc_emul_controller_secure_element_open(net_nfc_secure_element_type_e element_type, net_nfc_target_handle_s **handle)
 {
        DEBUG_ERR_MSG("se open start");
-       *result = NET_NFC_OK;
+
        __net_nfc_make_valid_target_handle(handle);
 
        DEBUG_ERR_MSG("se_open end");
-       return true;
+
+       return NET_NFC_OK;
 }
-static bool net_nfc_emul_controller_secure_element_get_atr(net_nfc_target_handle_s *handle,
-       data_s **atr, net_nfc_error_e *result)
+
+static int net_nfc_emul_controller_secure_element_get_atr(net_nfc_target_handle_s *handle,
+       net_nfc_data_s **atr)
 {
-       bool ret = true;
+       int result = NET_NFC_OK;
        char buffer[1024];
        int length = sizeof(buffer);
-       data_s *temp;
+       net_nfc_data_s *temp;
 
        DEBUG_ERR_MSG("se get_atr start");
-       *result = NET_NFC_OK;
+
        *atr = NULL;
 
        strncpy(buffer, "getatr", sizeof(buffer));
@@ -3204,30 +2958,29 @@ static bool net_nfc_emul_controller_secure_element_get_atr(net_nfc_target_handle
                        memcpy(temp->buffer, buffer, length);
                        temp->length = length;
                        *atr = temp;
-                       *result = NET_NFC_OK;
+                       result = NET_NFC_OK;
                } else {
                        free(temp);
-                       *result = NET_NFC_ALLOC_FAIL;
-                       ret = false;
+                       result = NET_NFC_ALLOC_FAIL;
                }
        } else {
-               *result = NET_NFC_ALLOC_FAIL;
-               ret = false;
+               result = NET_NFC_ALLOC_FAIL;
        }
+
        DEBUG_ERR_MSG("se get atr end");
-       return ret;
+       return result;
 }
-static bool net_nfc_emul_controller_secure_element_send_apdu(net_nfc_target_handle_s *handle,
-       data_s *command, data_s **response, net_nfc_error_e *result)
+
+static int net_nfc_emul_controller_secure_element_send_apdu(net_nfc_target_handle_s *handle,
+       net_nfc_data_s *command, net_nfc_data_s **response)
 {
-       bool ret = true;
+       int result = NET_NFC_OK;
        char buffer[1024];
        int length;
-       data_s *temp;
+       net_nfc_data_s *temp;
 
        DEBUG_ERR_MSG("se send apdu start");
 
-       *result = NET_NFC_OK;
        *response = NULL;
 
        //buffer response
@@ -3243,27 +2996,25 @@ static bool net_nfc_emul_controller_secure_element_send_apdu(net_nfc_target_hand
                        temp->length = length;
 
                        *response = temp;
-                       *result = NET_NFC_OK;
+                       result = NET_NFC_OK;
                } else {
                        free(temp);
-                       *result = NET_NFC_ALLOC_FAIL;
-                       ret = false;
+                       result = NET_NFC_ALLOC_FAIL;
                }
        } else {
-               *result = NET_NFC_ALLOC_FAIL;
-               ret = false;
+               result = NET_NFC_ALLOC_FAIL;
        }
 
        DEBUG_ERR_MSG("se send apdu end");
-       return ret;
+       return result;
 }
-static bool net_nfc_emul_controller_secure_element_close(net_nfc_target_handle_s *handle,
-       net_nfc_error_e *result)
+
+static int net_nfc_emul_controller_secure_element_close(net_nfc_target_handle_s *handle)
 {
        DEBUG_ERR_MSG("se close start");
-       *result = NET_NFC_OK;
-       return true;
        DEBUG_ERR_MSG("se close end");
+
+       return NET_NFC_OK;
 }
 
 static int nfc_backend_init(void **data)
@@ -3357,7 +3108,6 @@ static int nfc_backend_exit(void *data)
 EXPORT hal_backend hal_backend_nfc_data = {
         .name = "nfc-backend",
         .vendor = "Samsung",
-        .abi_version = HAL_ABI_VERSION_TIZEN_6_5,
         .init = nfc_backend_init,
         .exit = nfc_backend_exit,
         .major_version = 1,