revise LOG macros
authorYoungjae Shin <yj99.shin@samsung.com>
Tue, 24 Sep 2013 03:11:20 +0000 (12:11 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 25 Sep 2013 08:39:58 +0000 (01:39 -0700)
Change-Id: I4f18a5733d3488281070c18934e3c545a9f46911

48 files changed:
client/net_nfc_client_handover.c
client/net_nfc_client_llcp.c
client/net_nfc_client_manager.c
client/net_nfc_client_ndef.c
client/net_nfc_client_ndef_message.c
client/net_nfc_client_ndef_record.c
client/net_nfc_client_p2p.c
client/net_nfc_client_se.c
client/net_nfc_client_snep.c
client/net_nfc_client_system_handler.c
client/net_nfc_client_tag.c
client/net_nfc_client_tag_felica.c
client/net_nfc_client_tag_jewel.c
client/net_nfc_client_tag_mifare.c
client/net_nfc_client_target_info.c
client/net_nfc_client_transceive.c
common/net_nfc_debug_internal.h
common/net_nfc_util.c
common/net_nfc_util_gdbus.c
common/net_nfc_util_handover.c
common/net_nfc_util_internal.h
common/net_nfc_util_ipc.c
common/net_nfc_util_ndef_message.c
common/net_nfc_util_ndef_record.c
common/net_nfc_util_openssl.c
common/net_nfc_util_sign_record.c
daemon/net_nfc_server.c
daemon/net_nfc_server_common.c
daemon/net_nfc_server_context.c
daemon/net_nfc_server_controller.c
daemon/net_nfc_server_handover.c
daemon/net_nfc_server_handover_bss.c
daemon/net_nfc_server_handover_bt.c
daemon/net_nfc_server_llcp.c
daemon/net_nfc_server_manager.c
daemon/net_nfc_server_ndef.c
daemon/net_nfc_server_p2p.c
daemon/net_nfc_server_process_handover.c
daemon/net_nfc_server_process_handover.h
daemon/net_nfc_server_process_npp.c
daemon/net_nfc_server_process_snep.c
daemon/net_nfc_server_se.c
daemon/net_nfc_server_snep.c
daemon/net_nfc_server_system_handler.c
daemon/net_nfc_server_tag.c
daemon/net_nfc_server_transceive.c
daemon/net_nfc_server_util.c
daemon/net_nfc_server_vconf.c

index c68a91a..24a908f 100644 (file)
@@ -53,7 +53,7 @@ static void p2p_connection_handover(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish"
+               NFC_ERR("Can not finish"
                                " connection handover: %s", error->message);
                g_error_free(error);
 
@@ -134,7 +134,7 @@ API net_nfc_error_e net_nfc_client_p2p_connection_handover(
 
        if (handover_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get handover Proxy");
+               NFC_ERR("Can not get handover Proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -178,7 +178,7 @@ API net_nfc_error_e net_nfc_client_p2p_connection_handover_sync(
 
        if (handover_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get handover Proxy");
+               NFC_ERR("Can not get handover Proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -205,7 +205,7 @@ API net_nfc_error_e net_nfc_client_p2p_connection_handover_sync(
                        *out_ac_data = net_nfc_util_gdbus_variant_to_data(out_data);
                }
        } else {
-               DEBUG_ERR_MSG("handover (sync call) failed: %s",error->message);
+               NFC_ERR("handover (sync call) failed: %s",error->message);
                g_error_free(error);
 
                out_result = NET_NFC_IPC_FAIL;
@@ -221,7 +221,7 @@ net_nfc_error_e net_nfc_client_handover_init(void)
 
        if (handover_proxy)
        {
-               DEBUG_CLIENT_MSG("Already initialized");
+               NFC_WARN("Already initialized");
                return NET_NFC_OK;
        }
 
@@ -235,7 +235,7 @@ net_nfc_error_e net_nfc_client_handover_init(void)
 
        if (handover_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
+               NFC_ERR("Can not create proxy : %s", error->message);
                g_error_free(error);
                return NET_NFC_UNKNOWN_ERROR;
        }
index 8537024..af9d3e2 100644 (file)
@@ -167,7 +167,7 @@ static void llcp_call_config(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish config: %s",
+               NFC_ERR("Can not finish config: %s",
                                error->message);
 
                g_error_free(error);
@@ -205,7 +205,7 @@ static void llcp_call_listen(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish listen: %s",
+               NFC_ERR("Can not finish listen: %s",
                                error->message);
 
                g_error_free(error);
@@ -216,7 +216,7 @@ static void llcp_call_listen(GObject *source_object,
        socket_data = llcp_socket_data_find(out_client_socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("Wrong client socket is returned");
+               NFC_ERR("Wrong client socket is returned");
                return;
        }
 
@@ -248,7 +248,7 @@ static void llcp_call_accept(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish accept: %s",
+               NFC_ERR("Can not finish accept: %s",
                                error->message);
 
                g_error_free(error);
@@ -283,7 +283,7 @@ static void llcp_call_reject(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish reject: %s",
+               NFC_ERR("Can not finish reject: %s",
                                error->message);
 
                g_error_free(error);
@@ -321,7 +321,7 @@ static void llcp_call_connect(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish connect: %s", error->message);
+               NFC_ERR("Can not finish connect: %s", error->message);
 
                g_error_free(error);
 
@@ -331,7 +331,7 @@ static void llcp_call_connect(GObject *source_object,
        socket_data = llcp_socket_data_find(out_client_socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("Wrong client socket is returned");
+               NFC_ERR("Wrong client socket is returned");
                return;
        }
 
@@ -366,7 +366,7 @@ static void llcp_call_connect_sap(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish connect sap: %s", error->message);
+               NFC_ERR("Can not finish connect sap: %s", error->message);
                g_error_free(error);
 
                result = NET_NFC_IPC_FAIL;
@@ -375,7 +375,7 @@ static void llcp_call_connect_sap(GObject *source_object,
        socket_data = llcp_socket_data_find(out_client_socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("Wrong client socket is returned");
+               NFC_ERR("Wrong client socket is returned");
                return;
        }
 
@@ -409,7 +409,7 @@ static void llcp_call_send(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish send: %s",
+               NFC_ERR("Can not finish send: %s",
                                error->message);
 
                g_error_free(error);
@@ -446,7 +446,7 @@ static void llcp_call_send_to(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish send to: %s", error->message);
+               NFC_ERR("Can not finish send to: %s", error->message);
 
                g_error_free(error);
 
@@ -482,7 +482,7 @@ static void llcp_call_receive(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish receive: %s", error->message);
+               NFC_ERR("Can not finish receive: %s", error->message);
 
                g_error_free(error);
 
@@ -525,7 +525,7 @@ static void llcp_call_receive_from(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish receive from: %s",
+               NFC_ERR("Can not finish receive from: %s",
                                error->message);
 
                g_error_free(error);
@@ -569,7 +569,7 @@ static void llcp_call_close(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish close: %s", error->message);
+               NFC_ERR("Can not finish close: %s", error->message);
 
                g_error_free(error);
 
@@ -579,7 +579,7 @@ static void llcp_call_close(GObject *source_object,
        socket_data = llcp_socket_data_find(out_client_socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("Wrong client socket is returned");
+               NFC_ERR("Wrong client socket is returned");
                return;
        }
 
@@ -614,7 +614,7 @@ static void llcp_call_disconnect(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish disconnect: %s", error->message);
+               NFC_ERR("Can not finish disconnect: %s", error->message);
 
                g_error_free(error);
 
@@ -624,7 +624,7 @@ static void llcp_call_disconnect(GObject *source_object,
        socket_data = llcp_socket_data_find(out_client_socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("Wrong client socket is returned");
+               NFC_ERR("Wrong client socket is returned");
                return;
        }
 
@@ -644,7 +644,7 @@ static void llcp_error(NetNfcGDbusLlcp *object,
                gint error,
                gpointer user_data)
 {
-       INFO_MSG(">>> SIGNAL arrived");
+       NFC_INFO(">>> SIGNAL arrived");
 }
 
 static void llcp_incoming(NetNfcGDbusLlcp *object,
@@ -653,7 +653,7 @@ static void llcp_incoming(NetNfcGDbusLlcp *object,
                guint incoming_socket,
                gpointer user_data)
 {
-       INFO_MSG(">>> SIGNAL arrived");
+       NFC_INFO(">>> SIGNAL arrived");
 }
 
 /* Public APIs */
@@ -664,16 +664,12 @@ API net_nfc_error_e net_nfc_client_llcp_config(net_nfc_llcp_config_info_h config
        LlcpFuncData *func_data;
        GVariant *variant;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (config == NULL) {
                return NET_NFC_NULL_PARAMETER;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
 
        /* prevent executing daemon when nfc is off */
        if (net_nfc_client_manager_is_activated() == false) {
@@ -682,7 +678,7 @@ API net_nfc_error_e net_nfc_client_llcp_config(net_nfc_llcp_config_info_h config
 
        func_data = g_new0(LlcpFuncData, 1);
        if (func_data == NULL) {
-               DEBUG_ERR_MSG("g_new0 failed");
+               NFC_ERR("g_new0 failed");
 
                return NET_NFC_ALLOC_FAIL;
        }
@@ -715,12 +711,7 @@ API net_nfc_error_e net_nfc_client_llcp_config_sync(
        GVariant *variant = NULL;
        GError *error = NULL;
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
 
        /* prevent executing daemon when nfc is off */
        if (net_nfc_client_manager_is_activated() == false) {
@@ -742,7 +733,7 @@ API net_nfc_error_e net_nfc_client_llcp_config_sync(
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("can not config: %s", error->message);
+               NFC_ERR("can not config: %s", error->message);
 
                g_error_free(error);
 
@@ -772,17 +763,12 @@ API net_nfc_error_e net_nfc_client_llcp_listen(net_nfc_llcp_socket_t socket,
        LlcpFuncData *func_data;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
 
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -797,7 +783,7 @@ API net_nfc_error_e net_nfc_client_llcp_listen(net_nfc_llcp_socket_t socket,
 
        func_data = g_new0(LlcpFuncData, 1);
        if (func_data == NULL) {
-               DEBUG_ERR_MSG("g_new0 failed");
+               NFC_ERR("g_new0 failed");
 
                return NET_NFC_ALLOC_FAIL;
        }
@@ -837,23 +823,18 @@ API net_nfc_error_e net_nfc_client_llcp_listen_sync(net_nfc_llcp_socket_t socket
                return NET_NFC_NULL_PARAMETER;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
 
        if (service_name == NULL)
        {
-               DEBUG_ERR_MSG("service_name is empty");
+               NFC_ERR("service_name is empty");
                return NET_NFC_UNKNOWN_ERROR;
        }
 
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -882,7 +863,7 @@ API net_nfc_error_e net_nfc_client_llcp_listen_sync(net_nfc_llcp_socket_t socket
                out_socket_data = llcp_socket_data_find(out_client_socket);
                if (out_socket_data == NULL || out_socket_data !=  socket_data)
                {
-                       DEBUG_ERR_MSG("Wrong client socket is returned");
+                       NFC_ERR("Wrong client socket is returned");
                        return NET_NFC_UNKNOWN_ERROR;
                }
 
@@ -891,10 +872,8 @@ API net_nfc_error_e net_nfc_client_llcp_listen_sync(net_nfc_llcp_socket_t socket
                if (out_socket)
                        *out_socket = out_client_socket;
        } else {
-               DEBUG_ERR_MSG("can not listen: %s", error->message);
-
+               NFC_ERR("can not listen: %s", error->message);
                g_error_free(error);
-
                result = NET_NFC_IPC_FAIL;
        }
 
@@ -906,12 +885,7 @@ API net_nfc_error_e net_nfc_client_llcp_accept(net_nfc_llcp_socket_t socket,
 {
        LlcpFuncData *func_data;
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
 
        /* prevent executing daemon when nfc is off */
        if (net_nfc_client_manager_is_activated() == false) {
@@ -920,8 +894,7 @@ API net_nfc_error_e net_nfc_client_llcp_accept(net_nfc_llcp_socket_t socket,
 
        func_data = g_new0(LlcpFuncData, 1);
        if (func_data == NULL) {
-               DEBUG_ERR_MSG("g_new0 failed");
-
+               NFC_ERR("g_new0 failed");
                return NET_NFC_ALLOC_FAIL;
        }
 
@@ -944,12 +917,7 @@ API net_nfc_error_e net_nfc_client_llcp_accept_sync(net_nfc_llcp_socket_t socket
        net_nfc_error_e result;
        GError *error = NULL;
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
 
        /* prevent executing daemon when nfc is off */
        if (net_nfc_client_manager_is_activated() == false) {
@@ -962,11 +930,10 @@ API net_nfc_error_e net_nfc_client_llcp_accept_sync(net_nfc_llcp_socket_t socket
                                net_nfc_client_gdbus_get_privilege(),
                                &result,
                                NULL,
-                               &error) == false) {
-               DEBUG_ERR_MSG("can not connect: %s", error->message);
-
+                               &error) == false)
+       {
+               NFC_ERR("can not connect: %s", error->message);
                g_error_free(error);
-
                result = NET_NFC_IPC_FAIL;
        }
 
@@ -979,12 +946,7 @@ API net_nfc_error_e net_nfc_client_llcp_reject(net_nfc_llcp_socket_t socket,
 {
        LlcpFuncData *func_data;
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
 
        /* prevent executing daemon when nfc is off */
        if (net_nfc_client_manager_is_activated() == false) {
@@ -993,8 +955,7 @@ API net_nfc_error_e net_nfc_client_llcp_reject(net_nfc_llcp_socket_t socket,
 
        func_data = g_new0(LlcpFuncData, 1);
        if (func_data == NULL) {
-               DEBUG_ERR_MSG("g_new0 failed");
-
+               NFC_ERR("g_new0 failed");
                return NET_NFC_ALLOC_FAIL;
        }
 
@@ -1017,12 +978,7 @@ API net_nfc_error_e net_nfc_client_llcp_reject_sync(net_nfc_llcp_socket_t socket
        net_nfc_error_e result;
        GError *error = NULL;
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
 
        /* prevent executing daemon when nfc is off */
        if (net_nfc_client_manager_is_activated() == false) {
@@ -1035,11 +991,10 @@ API net_nfc_error_e net_nfc_client_llcp_reject_sync(net_nfc_llcp_socket_t socket
                                net_nfc_client_gdbus_get_privilege(),
                                &result,
                                NULL,
-                               &error) == false) {
-               DEBUG_ERR_MSG("can not connect: %s", error->message);
-
+                               &error) == false)
+       {
+               NFC_ERR("can not connect: %s", error->message);
                g_error_free(error);
-
                result = NET_NFC_IPC_FAIL;
        }
 
@@ -1058,17 +1013,12 @@ API net_nfc_error_e net_nfc_client_llcp_connect(net_nfc_llcp_socket_t socket,
                return NET_NFC_NULL_PARAMETER;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
 
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -1079,7 +1029,7 @@ API net_nfc_error_e net_nfc_client_llcp_connect(net_nfc_llcp_socket_t socket,
 
        func_data = g_new0(LlcpFuncData, 1);
        if (func_data == NULL) {
-               DEBUG_ERR_MSG("g_new0 failed");
+               NFC_ERR("g_new0 failed");
 
                return NET_NFC_ALLOC_FAIL;
        }
@@ -1109,25 +1059,19 @@ API net_nfc_error_e net_nfc_client_llcp_connect_sync(net_nfc_llcp_socket_t socke
        net_nfc_error_e result;
        GError *error = NULL;
        guint32 out_client_socket;
-
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
        net_nfc_llcp_internal_socket_s *out_socket_data = NULL;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (service_name == NULL || out_socket == NULL) {
                return NET_NFC_NULL_PARAMETER;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -1151,7 +1095,7 @@ API net_nfc_error_e net_nfc_client_llcp_connect_sync(net_nfc_llcp_socket_t socke
                out_socket_data = llcp_socket_data_find(out_client_socket);
                if (out_socket_data == NULL || out_socket_data !=  socket_data)
                {
-                       DEBUG_ERR_MSG("Wrong client socket is returned");
+                       NFC_ERR("Wrong client socket is returned");
                        return NET_NFC_UNKNOWN_ERROR;
                }
 
@@ -1160,7 +1104,7 @@ API net_nfc_error_e net_nfc_client_llcp_connect_sync(net_nfc_llcp_socket_t socke
                if (out_socket)
                        *out_socket = out_client_socket;
        } else {
-               DEBUG_ERR_MSG("can not connect: %s", error->message);
+               NFC_ERR("can not connect: %s", error->message);
 
                g_error_free(error);
 
@@ -1178,21 +1122,16 @@ API net_nfc_error_e net_nfc_client_llcp_connect_sap(net_nfc_llcp_socket_t socket
        LlcpFuncData *func_data;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (sap == 0) {
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -1203,7 +1142,7 @@ API net_nfc_error_e net_nfc_client_llcp_connect_sap(net_nfc_llcp_socket_t socket
 
        func_data = g_new0(LlcpFuncData, 1);
        if (func_data == NULL) {
-               DEBUG_ERR_MSG("g_new0 failed");
+               NFC_ERR("g_new0 failed");
 
                return NET_NFC_ALLOC_FAIL;
        }
@@ -1234,10 +1173,11 @@ API net_nfc_error_e net_nfc_client_llcp_connect_sap_sync(
        net_nfc_error_e result;
        GError *error = NULL;
        guint32 out_client_socket;
-
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
        net_nfc_llcp_internal_socket_s *out_socket_data = NULL;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (out_socket == NULL) {
                return NET_NFC_NULL_PARAMETER;
        }
@@ -1246,17 +1186,10 @@ API net_nfc_error_e net_nfc_client_llcp_connect_sap_sync(
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -1280,7 +1213,7 @@ API net_nfc_error_e net_nfc_client_llcp_connect_sap_sync(
                out_socket_data = llcp_socket_data_find(out_client_socket);
                if (out_socket_data == NULL || out_socket_data !=  socket_data)
                {
-                       DEBUG_ERR_MSG("Wrong client socket is returned");
+                       NFC_ERR("Wrong client socket is returned");
                        return NET_NFC_UNKNOWN_ERROR;
                }
 
@@ -1289,7 +1222,7 @@ API net_nfc_error_e net_nfc_client_llcp_connect_sap_sync(
                if (out_socket)
                        *out_socket = out_client_socket;
        } else {
-               DEBUG_ERR_MSG("can not connect: %s", error->message);
+               NFC_ERR("can not connect: %s", error->message);
 
                g_error_free(error);
 
@@ -1308,6 +1241,8 @@ API net_nfc_error_e net_nfc_client_llcp_send(net_nfc_llcp_socket_t socket,
        GVariant *variant;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (data == NULL) {
                return NET_NFC_NULL_PARAMETER;
        }
@@ -1316,13 +1251,6 @@ API net_nfc_error_e net_nfc_client_llcp_send(net_nfc_llcp_socket_t socket,
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        /* prevent executing daemon when nfc is off */
        if (net_nfc_client_manager_is_activated() == false) {
                return NET_NFC_INVALID_STATE;
@@ -1331,13 +1259,13 @@ API net_nfc_error_e net_nfc_client_llcp_send(net_nfc_llcp_socket_t socket,
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
        func_data = g_new0(LlcpFuncData, 1);
        if (func_data == NULL) {
-               DEBUG_ERR_MSG("g_new0 failed");
+               NFC_ERR("g_new0 failed");
 
                return NET_NFC_ALLOC_FAIL;
        }
@@ -1366,10 +1294,11 @@ API net_nfc_error_e net_nfc_client_llcp_send_sync(net_nfc_llcp_socket_t socket,
        GVariant *variant;
        GError *error = NULL;
        guint32 out_client_socket;
-
        net_nfc_llcp_internal_socket_s *socket_data;
        net_nfc_llcp_internal_socket_s *out_socket_data;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (data == NULL) {
                return NET_NFC_NULL_PARAMETER;
        }
@@ -1378,23 +1307,16 @@ API net_nfc_error_e net_nfc_client_llcp_send_sync(net_nfc_llcp_socket_t socket,
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("data is empty");
+               NFC_ERR("data is empty");
                return NET_NFC_INVALID_PARAM;
        }
 
@@ -1417,11 +1339,11 @@ API net_nfc_error_e net_nfc_client_llcp_send_sync(net_nfc_llcp_socket_t socket,
                out_socket_data = llcp_socket_data_find(out_client_socket);
                if (out_socket_data == NULL)
                {
-                       DEBUG_ERR_MSG("can not find socket_data");
+                       NFC_ERR("can not find socket_data");
                        return NET_NFC_UNKNOWN_ERROR;
                }
        } else {
-               DEBUG_ERR_MSG("can not call send: %s", error->message);
+               NFC_ERR("can not call send: %s", error->message);
 
                g_error_free(error);
 
@@ -1441,6 +1363,8 @@ API net_nfc_error_e net_nfc_client_llcp_send_to(net_nfc_llcp_socket_t socket,
        GVariant *variant;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (data == NULL) {
                return NET_NFC_NULL_PARAMETER;
        }
@@ -1449,17 +1373,10 @@ API net_nfc_error_e net_nfc_client_llcp_send_to(net_nfc_llcp_socket_t socket,
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -1470,7 +1387,7 @@ API net_nfc_error_e net_nfc_client_llcp_send_to(net_nfc_llcp_socket_t socket,
 
        func_data = g_new0(LlcpFuncData, 1);
        if (func_data == NULL) {
-               DEBUG_ERR_MSG("g_new0 failed");
+               NFC_ERR("g_new0 failed");
 
                return NET_NFC_ALLOC_FAIL;
        }
@@ -1504,6 +1421,8 @@ API net_nfc_error_e net_nfc_client_llcp_send_to_sync(net_nfc_llcp_socket_t socke
        net_nfc_llcp_internal_socket_s *socket_data;
        net_nfc_llcp_internal_socket_s *out_socket_data;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (data == NULL) {
                return NET_NFC_NULL_PARAMETER;
        }
@@ -1512,17 +1431,10 @@ API net_nfc_error_e net_nfc_client_llcp_send_to_sync(net_nfc_llcp_socket_t socke
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -1546,11 +1458,11 @@ API net_nfc_error_e net_nfc_client_llcp_send_to_sync(net_nfc_llcp_socket_t socke
                out_socket_data = llcp_socket_data_find(out_client_socket);
                if (out_socket_data == NULL)
                {
-                       DEBUG_ERR_MSG("can not find socket_data");
+                       NFC_ERR("can not find socket_data");
                        return NET_NFC_UNKNOWN_ERROR;
                }
        } else {
-               DEBUG_ERR_MSG("can not call send to: %s", error->message);
+               NFC_ERR("can not call send to: %s", error->message);
 
                g_error_free(error);
 
@@ -1568,21 +1480,16 @@ API net_nfc_error_e net_nfc_client_llcp_receive(net_nfc_llcp_socket_t socket,
        LlcpFuncData *func_data;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (socket <= 0 || request_length == 0) {
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -1593,7 +1500,7 @@ API net_nfc_error_e net_nfc_client_llcp_receive(net_nfc_llcp_socket_t socket,
 
        func_data = g_new0(LlcpFuncData, 1);
        if (func_data == NULL) {
-               DEBUG_ERR_MSG("g_new0 failed");
+               NFC_ERR("g_new0 failed");
 
                return NET_NFC_ALLOC_FAIL;
        }
@@ -1622,6 +1529,8 @@ API net_nfc_error_e net_nfc_client_llcp_receive_sync(net_nfc_llcp_socket_t socke
        GError *error = NULL;
        net_nfc_llcp_internal_socket_s *socket_data;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (out_data == NULL) {
                return NET_NFC_NULL_PARAMETER;
        }
@@ -1632,17 +1541,10 @@ API net_nfc_error_e net_nfc_client_llcp_receive_sync(net_nfc_llcp_socket_t socke
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -1662,7 +1564,7 @@ API net_nfc_error_e net_nfc_client_llcp_receive_sync(net_nfc_llcp_socket_t socke
                                &error) == true) {
                *out_data = net_nfc_util_gdbus_variant_to_data(variant);
        } else {
-               DEBUG_ERR_MSG("can not call receive: %s", error->message);
+               NFC_ERR("can not call receive: %s", error->message);
 
                g_error_free(error);
 
@@ -1680,27 +1582,22 @@ API net_nfc_error_e net_nfc_client_llcp_receive_from(net_nfc_llcp_socket_t socke
        LlcpFuncData *func_data;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (socket <= 0 || request_length == 0) {
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
        func_data = g_new0(LlcpFuncData, 1);
        if (func_data == NULL) {
-               DEBUG_ERR_MSG("g_new0 failed");
+               NFC_ERR("g_new0 failed");
 
                return NET_NFC_ALLOC_FAIL;
        }
@@ -1730,9 +1627,10 @@ API net_nfc_error_e net_nfc_client_llcp_receive_from_sync(
        GError *error = NULL;
        GVariant *variant;
        sap_t sap;
-
        net_nfc_llcp_internal_socket_s *socket_data;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (out_sap == NULL || out_data == NULL) {
                return NET_NFC_NULL_PARAMETER;
        }
@@ -1744,17 +1642,10 @@ API net_nfc_error_e net_nfc_client_llcp_receive_from_sync(
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -1776,7 +1667,7 @@ API net_nfc_error_e net_nfc_client_llcp_receive_from_sync(
                *out_sap = sap;
                *out_data = net_nfc_util_gdbus_variant_to_data(variant);
        } else {
-               DEBUG_ERR_MSG("can not call receive from: %s", error->message);
+               NFC_ERR("can not call receive from: %s", error->message);
 
                g_error_free(error);
 
@@ -1793,21 +1684,16 @@ API net_nfc_error_e net_nfc_client_llcp_close(net_nfc_llcp_socket_t socket,
        LlcpFuncData *func_data;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (socket <= 0) {
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -1818,7 +1704,7 @@ API net_nfc_error_e net_nfc_client_llcp_close(net_nfc_llcp_socket_t socket,
 
        func_data = g_new0(LlcpFuncData, 1);
        if (func_data == NULL) {
-               DEBUG_ERR_MSG("g_new0 failed");
+               NFC_ERR("g_new0 failed");
 
                return NET_NFC_ALLOC_FAIL;
        }
@@ -1842,25 +1728,19 @@ API net_nfc_error_e net_nfc_client_llcp_close_sync(net_nfc_llcp_socket_t socket)
        net_nfc_error_e result;
        GError *error = NULL;
        guint32 out_client_socket;
-
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
        net_nfc_llcp_internal_socket_s *out_socket_data = NULL;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (socket <= 0) {
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -1880,11 +1760,11 @@ API net_nfc_error_e net_nfc_client_llcp_close_sync(net_nfc_llcp_socket_t socket)
                out_socket_data = llcp_socket_data_find(out_client_socket);
                if (out_socket_data == NULL || out_socket_data !=  socket_data)
                {
-                       DEBUG_ERR_MSG("Wrong client socket is returned");
+                       NFC_ERR("Wrong client socket is returned");
                        return NET_NFC_UNKNOWN_ERROR;
                }
        } else {
-               DEBUG_ERR_MSG("can not close: %s", error->message);
+               NFC_ERR("can not close: %s", error->message);
 
                g_error_free(error);
 
@@ -1901,21 +1781,16 @@ API net_nfc_error_e net_nfc_client_llcp_disconnect(net_nfc_llcp_socket_t socket,
        LlcpFuncData *func_data;
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (socket <= 0) {
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -1926,7 +1801,7 @@ API net_nfc_error_e net_nfc_client_llcp_disconnect(net_nfc_llcp_socket_t socket,
 
        func_data = g_new0(LlcpFuncData, 1);
        if (func_data == NULL) {
-               DEBUG_ERR_MSG("g_new0 failed");
+               NFC_ERR("g_new0 failed");
 
                return NET_NFC_ALLOC_FAIL;
        }
@@ -1951,25 +1826,19 @@ API net_nfc_error_e net_nfc_client_llcp_disconnect_sync(
        net_nfc_error_e result;
        GError *error = NULL;
        guint32 out_client_socket;
-
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
        net_nfc_llcp_internal_socket_s *out_socket_data = NULL;
 
+       RETVM_IF(NULL == llcp_proxy, NET_NFC_NOT_INITIALIZED, "Can not get LlcpProxy");
+
        if (socket <= 0) {
                return NET_NFC_INVALID_PARAM;
        }
 
-       if (llcp_proxy == NULL)
-       {
-               DEBUG_ERR_MSG("Can not get LlcpProxy");
-
-               return NET_NFC_NOT_INITIALIZED;
-       }
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
        {
-               DEBUG_ERR_MSG("can not get socket_data");
+               NFC_ERR("can not get socket_data");
                return NET_NFC_LLCP_INVALID_SOCKET;
        }
 
@@ -1989,11 +1858,11 @@ API net_nfc_error_e net_nfc_client_llcp_disconnect_sync(
                out_socket_data = llcp_socket_data_find(out_client_socket);
                if (out_socket_data == NULL || out_socket_data !=  socket_data)
                {
-                       DEBUG_ERR_MSG("Wrong client socket is returned");
+                       NFC_ERR("Wrong client socket is returned");
                        return NET_NFC_UNKNOWN_ERROR;
                }
        } else {
-               DEBUG_ERR_MSG("can not disconnect: %s", error->message);
+               NFC_ERR("can not disconnect: %s", error->message);
 
                g_error_free(error);
 
@@ -2052,8 +1921,6 @@ API net_nfc_error_e net_nfc_client_llcp_get_local_socket_option(
 {
        net_nfc_llcp_internal_socket_s *socket_data = NULL;
 
-       DEBUG_CLIENT_MSG("function %s is called", __func__);
-
        socket_data = llcp_socket_data_find(socket);
        if (socket_data == NULL)
                return NET_NFC_LLCP_INVALID_SOCKET;
@@ -2378,7 +2245,7 @@ net_nfc_error_e net_nfc_client_llcp_init(void)
 
        if (llcp_proxy)
        {
-               DEBUG_CLIENT_MSG("Already initialized");
+               NFC_WARN("Already initialized");
                return NET_NFC_OK;
        }
 
@@ -2392,7 +2259,7 @@ net_nfc_error_e net_nfc_client_llcp_init(void)
 
        if (llcp_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
+               NFC_ERR("Can not create proxy : %s", error->message);
                g_error_free(error);
                return NET_NFC_UNKNOWN_ERROR;
        }
index 4f3ea3d..b4cf043 100644 (file)
@@ -85,7 +85,7 @@ static void manager_call_set_active_callback(GObject *source_object,
        if (net_nfc_gdbus_manager_call_set_active_finish(NET_NFC_GDBUS_MANAGER(source_object),
                                &result, res, &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish call_set_active: %s", error->message);
+               NFC_ERR("Can not finish call_set_active: %s", error->message);
                g_error_free(error);
 
                result = NET_NFC_IPC_FAIL;
@@ -127,7 +127,7 @@ static void manager_call_get_server_state_callback(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish get_server_state: %s",
+               NFC_ERR("Can not finish get_server_state: %s",
                                error->message);
                g_error_free(error);
 
@@ -160,8 +160,7 @@ static gboolean _activated_time_elapsed_callback(gpointer user_data)
 static void manager_activated(NetNfcGDbusManager *manager, gboolean activated,
                gpointer user_data)
 {
-       INFO_MSG(">>> SIGNAL arrived");
-       DEBUG_CLIENT_MSG("activated %d", activated);
+       NFC_INFO(">>> SIGNAL arrived : activated %d", activated);
 
        /* update current state */
        is_activated = (int)activated;
@@ -250,8 +249,7 @@ API net_nfc_error_e net_nfc_client_manager_set_active_sync(int state)
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_CLIENT_MSG("can not call SetActive: %s",
-                               error->message);
+               NFC_ERR("can not call SetActive: %s", error->message);
                g_error_free(error);
 
                out_result = NET_NFC_IPC_FAIL;
@@ -320,8 +318,7 @@ API net_nfc_error_e net_nfc_client_manager_get_server_state_sync(
        }
        else
        {
-               DEBUG_CLIENT_MSG("can not call GetServerState: %s",
-                               error->message);
+               NFC_ERR("can not call GetServerState: %s", error->message);
                g_error_free(error);
 
                out_result = NET_NFC_IPC_FAIL;
@@ -336,8 +333,7 @@ net_nfc_error_e net_nfc_client_manager_init(void)
 
        if (manager_proxy)
        {
-               DEBUG_CLIENT_MSG("Already initialized");
-
+               NFC_WARN("Already initialized");
                return NET_NFC_OK;
        }
 
@@ -351,7 +347,7 @@ net_nfc_error_e net_nfc_client_manager_init(void)
 
        if (manager_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
+               NFC_ERR("Can not create proxy : %s", error->message);
                g_error_free(error);
 
                return NET_NFC_UNKNOWN_ERROR;
index 048e16d..3136c31 100644 (file)
@@ -57,7 +57,7 @@ static gboolean ndef_is_supported_tag(void)
 
        if (target_info == NULL)
        {
-               DEBUG_ERR_MSG("target_info does not exist");
+               NFC_ERR("target_info does not exist");
                return FALSE;
        }
 
@@ -72,8 +72,7 @@ static gboolean ndef_is_supported_tag(void)
                return TRUE;
                break;
        default:
-               DEBUG_CLIENT_MSG(
-                               "not supported tag for read only tag");
+               NFC_ERR("not supported tag(%d) for read only tag", target_info->devType);
                return FALSE;
        }
 }
@@ -98,7 +97,7 @@ static void ndef_call_read(GObject *source_object,
                                &error) == FALSE)
        {
 
-               DEBUG_ERR_MSG("Can not finish read: %s", error->message);
+               NFC_ERR("Can not finish read: %s", error->message);
                g_error_free(error);
 
                out_result = NET_NFC_IPC_FAIL;
@@ -138,7 +137,7 @@ static void ndef_call_write(GObject *source_object,
                                &error) == FALSE)
        {
 
-               DEBUG_ERR_MSG("Can not finish write: %s", error->message);
+               NFC_ERR("Can not finish write: %s", error->message);
                g_error_free(error);
 
                out_result = NET_NFC_IPC_FAIL;
@@ -173,7 +172,7 @@ static void ndef_call_make_read_only(GObject *source_object,
                                &error) == FALSE)
        {
 
-               DEBUG_ERR_MSG("Can not finish make read only: %s",
+               NFC_ERR("Can not finish make read only: %s",
                                error->message);
                g_error_free(error);
 
@@ -209,7 +208,7 @@ static void ndef_call_format(GObject *source_object,
                                &error) == FALSE)
        {
 
-               DEBUG_ERR_MSG("Can not finish format: %s", error->message);
+               NFC_ERR("Can not finish format: %s", error->message);
                g_error_free(error);
 
                out_result = NET_NFC_IPC_FAIL;
@@ -227,8 +226,7 @@ static void ndef_call_format(GObject *source_object,
 }
 
 API net_nfc_error_e net_nfc_client_ndef_read(net_nfc_target_handle_h handle,
-               net_nfc_client_ndef_read_completed callback,
-               void *user_data)
+               net_nfc_client_ndef_read_completed callback, void *user_data)
 {
        NetNfcCallback *func_data;
 
@@ -237,7 +235,7 @@ API net_nfc_error_e net_nfc_client_ndef_read(net_nfc_target_handle_h handle,
 
        if (ndef_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get NdefProxy");
+               NFC_ERR("Can not get NdefProxy");
                return NET_NFC_NOT_INITIALIZED;
        }
 
@@ -249,7 +247,7 @@ API net_nfc_error_e net_nfc_client_ndef_read(net_nfc_target_handle_h handle,
        if (net_nfc_client_tag_is_connected() == FALSE)
                return NET_NFC_NOT_CONNECTED;
 
-       DEBUG_CLIENT_MSG("send request :: read ndef = [%p]", handle);
+       NFC_DBG("send request :: read ndef = [%p]", handle);
 
        func_data = g_try_new0(NetNfcCallback, 1);
        if (func_data == NULL) {
@@ -281,7 +279,7 @@ API net_nfc_error_e net_nfc_client_ndef_read_sync(net_nfc_target_handle_h handle
 
        if (ndef_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get NdefProxy");
+               NFC_ERR("Can not get NdefProxy");
                return NET_NFC_NOT_INITIALIZED;
        }
 
@@ -293,7 +291,7 @@ API net_nfc_error_e net_nfc_client_ndef_read_sync(net_nfc_target_handle_h handle
        if (net_nfc_client_tag_is_connected() == FALSE)
                return NET_NFC_NOT_CONNECTED;
 
-       DEBUG_CLIENT_MSG("send request :: read ndef = [%p]", handle);
+       NFC_DBG("send request :: read ndef = [%p]", handle);
 
        if (net_nfc_gdbus_ndef_call_read_sync(ndef_proxy,
                                GPOINTER_TO_UINT(handle),
@@ -304,7 +302,7 @@ API net_nfc_error_e net_nfc_client_ndef_read_sync(net_nfc_target_handle_h handle
                                &error) == TRUE) {
                *message = net_nfc_util_gdbus_variant_to_ndef_message(out_data);
        } else {
-               DEBUG_ERR_MSG("can not call read: %s",
+               NFC_ERR("can not call read: %s",
                                error->message);
                g_error_free(error);
                out_result = NET_NFC_IPC_FAIL;
@@ -326,7 +324,7 @@ API net_nfc_error_e net_nfc_client_ndef_write(net_nfc_target_handle_h handle,
 
        if (ndef_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get NdefProxy");
+               NFC_ERR("Can not get NdefProxy");
                return NET_NFC_NOT_INITIALIZED;
        }
 
@@ -371,7 +369,7 @@ API net_nfc_error_e net_nfc_client_ndef_write_sync(net_nfc_target_handle_h handl
 
        if (ndef_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get NdefProxy");
+               NFC_ERR("Can not get NdefProxy");
                return NET_NFC_NOT_INITIALIZED;
        }
 
@@ -393,7 +391,7 @@ API net_nfc_error_e net_nfc_client_ndef_write_sync(net_nfc_target_handle_h handl
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("can not call write: %s",
+               NFC_ERR("can not call write: %s",
                                error->message);
                g_error_free(error);
                out_result = NET_NFC_IPC_FAIL;
@@ -414,7 +412,7 @@ API net_nfc_error_e net_nfc_client_ndef_make_read_only(
 
        if (ndef_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get NdefProxy");
+               NFC_ERR("Can not get NdefProxy");
                return NET_NFC_NOT_INITIALIZED;
        }
 
@@ -459,7 +457,7 @@ API net_nfc_error_e net_nfc_client_ndef_make_read_only_sync(
 
        if (ndef_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get NdefProxy");
+               NFC_ERR("Can not get NdefProxy");
                return NET_NFC_NOT_INITIALIZED;
        }
 
@@ -482,7 +480,7 @@ API net_nfc_error_e net_nfc_client_ndef_make_read_only_sync(
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("can not make read only: %s",
+               NFC_ERR("can not make read only: %s",
                                error->message);
                g_error_free(error);
                out_result = NET_NFC_IPC_FAIL;
@@ -502,7 +500,7 @@ API net_nfc_error_e net_nfc_client_ndef_format(net_nfc_target_handle_h handle,
 
        if (ndef_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get NdefProxy");
+               NFC_ERR("Can not get NdefProxy");
                return NET_NFC_NOT_INITIALIZED;
        }
 
@@ -546,7 +544,7 @@ API net_nfc_error_e net_nfc_client_ndef_format_sync(
 
        if (ndef_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get NdefProxy");
+               NFC_ERR("Can not get NdefProxy");
                return NET_NFC_NOT_INITIALIZED;
        }
 
@@ -569,7 +567,7 @@ API net_nfc_error_e net_nfc_client_ndef_format_sync(
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("can not call format: %s",
+               NFC_ERR("can not call format: %s",
                                error->message);
                g_error_free(error);
                out_result = NET_NFC_IPC_FAIL;
@@ -584,7 +582,7 @@ net_nfc_error_e net_nfc_client_ndef_init(void)
 
        if (ndef_proxy)
        {
-               DEBUG_CLIENT_MSG("Already initialized");
+               NFC_WARN("Already initialized");
                return NET_NFC_OK;
        }
 
@@ -598,7 +596,7 @@ net_nfc_error_e net_nfc_client_ndef_init(void)
 
        if (ndef_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
+               NFC_ERR("Can not create proxy : %s", error->message);
                g_error_free(error);
                return NET_NFC_UNKNOWN_ERROR;
        }
index 4e66b69..09d3c89 100644 (file)
@@ -184,7 +184,7 @@ API net_nfc_error_e net_nfc_retrieve_current_ndef_message(
                size = ftell(fp);
                fseek(fp, 0, SEEK_SET);
 
-               DEBUG_CLIENT_MSG("message length = [%ld]", size);
+               NFC_DBG("message length = [%ld]", size);
 
                if (size > 0)
                {
@@ -207,7 +207,7 @@ API net_nfc_error_e net_nfc_retrieve_current_ndef_message(
                                if (offset == data.length) {
                                        result = net_nfc_create_ndef_message_from_rawdata(ndef_message, &data);
                                } else {
-                                       DEBUG_ERR_MSG("failed to read ndef message");
+                                       NFC_ERR("failed to read ndef message");
                                }
                                net_nfc_util_free_data(&data);
                        }
index caec3be..d5d9326 100644 (file)
@@ -188,7 +188,7 @@ API net_nfc_error_e net_nfc_create_text_string_from_text_record(
 
        if (_is_text_record(record) == false)
        {
-               DEBUG_ERR_MSG("record type is not matched");
+               NFC_ERR("record type is not matched");
                return NET_NFC_NDEF_RECORD_IS_NOT_EXPECTED_TYPE;
        }
 
@@ -212,8 +212,7 @@ API net_nfc_error_e net_nfc_create_text_string_from_text_record(
                if (temp != NULL)
                {
                        memcpy(temp, &(buffer_temp[index]), text_length);
-
-                       DEBUG_CLIENT_MSG("text = [%s]", temp);
+                       NFC_DBG("text = [%s]", temp);
 
                        *buffer = temp;
                }
@@ -239,7 +238,7 @@ API net_nfc_error_e net_nfc_get_languange_code_string_from_text_record(
 
        if (_is_text_record(record) == false)
        {
-               DEBUG_ERR_MSG("record type is not matched");
+               NFC_ERR("record type is not matched");
                return NET_NFC_NDEF_RECORD_IS_NOT_EXPECTED_TYPE;
        }
 
@@ -260,7 +259,7 @@ API net_nfc_error_e net_nfc_get_languange_code_string_from_text_record(
                if (buffer != NULL)
                {
                        memcpy(buffer, &(buffer_temp[index]), lang_code_length);
-                       DEBUG_CLIENT_MSG("language code = [%s]", buffer);
+                       NFC_DBG("language code = [%s]", buffer);
 
                        *lang_code_str = buffer;
                }
@@ -286,7 +285,7 @@ API net_nfc_error_e net_nfc_get_encoding_type_from_text_record(
 
        if (_is_text_record(record) == false)
        {
-               DEBUG_ERR_MSG("record type is not matched");
+               NFC_ERR("record type is not matched");
                return NET_NFC_NDEF_RECORD_IS_NOT_EXPECTED_TYPE;
        }
 
index a76c874..8017ec5 100644 (file)
@@ -59,7 +59,7 @@ static void p2p_call_send(GObject *source_object,
 static void p2p_device_detached(GObject *source_object,
                gpointer user_data)
 {
-       INFO_MSG(">>> SIGNAL arrived");
+       NFC_INFO(">>> SIGNAL arrived");
 
        /*llcp client function to set/unset the current target id needs to be implemented*/
        /*net_nfc_client_llcp_current_target_id(NULL);*/
@@ -79,7 +79,7 @@ static void p2p_device_discovered(GObject *source_object, guint arg_handle,
 {
        net_nfc_target_handle_s *handle_info = NULL;
 
-       INFO_MSG(">>> SIGNAL arrived");
+       NFC_INFO(">>> SIGNAL arrived");
 
        handle_info = GUINT_TO_POINTER(arg_handle);
 
@@ -93,7 +93,7 @@ static void p2p_device_discovered(GObject *source_object, guint arg_handle,
 static void p2p_device_data_received(GObject *source_object, GVariant *arg_data,
                gpointer user_data)
 {
-       INFO_MSG(">>> SIGNAL arrived");
+       NFC_INFO(">>> SIGNAL arrived");
 
        if (p2p_signal_handler.p2p_data_received_cb)
        {
@@ -125,7 +125,7 @@ static void p2p_call_send(GObject *source_object, GAsyncResult *res,
        {
                out_result = NET_NFC_IPC_FAIL;
 
-               DEBUG_ERR_MSG("Can not finish p2p send: %s", error->message);
+               NFC_ERR("Can not finish p2p send: %s", error->message);
                g_error_free(error);
        }
 
@@ -149,7 +149,7 @@ API net_nfc_error_e net_nfc_client_p2p_send(net_nfc_target_handle_h handle,
 
        if (p2p_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get P2pProxy");
+               NFC_ERR("Can not get P2pProxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -193,7 +193,7 @@ API net_nfc_error_e net_nfc_client_p2p_send_sync(net_nfc_target_handle_h handle,
 
        if (p2p_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get P2pProxy");
+               NFC_ERR("Can not get P2pProxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -214,7 +214,7 @@ API net_nfc_error_e net_nfc_client_p2p_send_sync(net_nfc_target_handle_h handle,
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("p2p send (sync call) failed: %s",
+               NFC_ERR("p2p send (sync call) failed: %s",
                                error->message);
 
                g_error_free(error);
@@ -284,8 +284,7 @@ net_nfc_error_e net_nfc_client_p2p_init(void)
 
        if (p2p_proxy)
        {
-               DEBUG_CLIENT_MSG("Already initialized");
-
+               NFC_WARN("Already initialized");
                return NET_NFC_OK;
        }
 
@@ -298,7 +297,7 @@ net_nfc_error_e net_nfc_client_p2p_init(void)
                        &error);
        if (p2p_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
+               NFC_ERR("Can not create proxy : %s", error->message);
                g_error_free(error);
 
                return NET_NFC_UNKNOWN_ERROR;
index d0cc2b7..9a23921 100644 (file)
@@ -98,7 +98,7 @@ static void se_ese_detected(GObject *source_object,
                gint arg_se_type,
                GVariant *arg_data)
 {
-       INFO_MSG(">>> SIGNAL arrived");
+       NFC_INFO(">>> SIGNAL arrived");
 
        if (se_esedetecthandler.se_ese_detected_cb != NULL) {
                data_s buffer_data = { NULL, 0 };
@@ -118,7 +118,7 @@ static void se_ese_detected(GObject *source_object,
 static void se_type_changed(GObject *source_object,
                gint arg_se_type)
 {
-       INFO_MSG(">>> SIGNAL arrived");
+       NFC_INFO(">>> SIGNAL arrived");
 
        if (se_eventhandler.se_event_cb != NULL)
        {
@@ -136,7 +136,7 @@ static void se_transaction_event(GObject *source_object,
                GVariant *arg_aid,
                GVariant *arg_param)
 {
-       INFO_MSG(">>> SIGNAL arrived");
+       NFC_INFO(">>> SIGNAL arrived");
 
        if (se_transeventhandler.se_transaction_event_cb != NULL) {
                net_nfc_client_se_transaction_event callback =
@@ -173,7 +173,7 @@ static void set_secure_element(GObject *source_object,
        {
                result = NET_NFC_IPC_FAIL;
 
-               DEBUG_ERR_MSG("Could not set secure element: %s",
+               NFC_ERR("Could not set secure element: %s",
                                error->message);
 
                g_error_free(error);
@@ -207,7 +207,7 @@ static void get_secure_element(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Could not set secure element: %s",
+               NFC_ERR("Could not set secure element: %s",
                                error->message);
 
                g_error_free(error);
@@ -242,7 +242,7 @@ static void _set_card_emulation_cb(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Could not set card emulation: %s",
+               NFC_ERR("Could not set card emulation: %s",
                                error->message);
 
                g_error_free(error);
@@ -282,7 +282,7 @@ static void open_secure_element(GObject *source_object,
        {
                result = NET_NFC_IPC_FAIL;
 
-               DEBUG_ERR_MSG("Could not open secure element: %s",
+               NFC_ERR("Could not open secure element: %s",
                                error->message);
 
                g_error_free(error);
@@ -318,7 +318,7 @@ static void close_secure_element(GObject *source_object,
        {
                result = NET_NFC_IPC_FAIL;
 
-               DEBUG_ERR_MSG("Could not close secure element: %s", error->message);
+               NFC_ERR("Could not close secure element: %s", error->message);
 
                g_error_free(error);
        }
@@ -355,7 +355,7 @@ static void send_apdu_secure_element(GObject *source_object,
        {
                result = NET_NFC_IPC_FAIL;
 
-               DEBUG_ERR_MSG("Could not send apdu: %s", error->message);
+               NFC_ERR("Could not send apdu: %s", error->message);
 
                g_error_free(error);
        }
@@ -397,7 +397,7 @@ static void get_atr_secure_element(GObject *source_object,
        {
                result = NET_NFC_IPC_FAIL;
 
-               DEBUG_ERR_MSG("Could not get atr: %s", error->message);
+               NFC_ERR("Could not get atr: %s", error->message);
 
                g_error_free(error);
        }
@@ -428,7 +428,7 @@ API net_nfc_error_e net_nfc_client_se_set_secure_element_type(
 
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -465,7 +465,7 @@ API net_nfc_error_e net_nfc_client_se_set_secure_element_type_sync(
 
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -483,7 +483,7 @@ API net_nfc_error_e net_nfc_client_se_set_secure_element_type_sync(
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Set secure element failed: %s", error->message);
+               NFC_ERR("Set secure element failed: %s", error->message);
 
                g_error_free(error);
 
@@ -501,7 +501,7 @@ API net_nfc_error_e net_nfc_client_se_get_secure_element_type(
 
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -538,7 +538,7 @@ API net_nfc_error_e net_nfc_client_se_get_secure_element_type_sync(
 #endif
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -563,7 +563,7 @@ API net_nfc_error_e net_nfc_client_se_get_secure_element_type_sync(
                                &error) == true) {
                *se_type = type;
        } else {
-               DEBUG_ERR_MSG("Set secure element failed: %s", error->message);
+               NFC_ERR("Set secure element failed: %s", error->message);
 
                g_error_free(error);
 
@@ -581,7 +581,7 @@ API net_nfc_error_e net_nfc_set_card_emulation_mode(
        NetNfcCallback *func_data;
 
        if (se_proxy == NULL) {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -618,7 +618,7 @@ API net_nfc_error_e net_nfc_set_card_emulation_mode_sync(
 
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -636,7 +636,7 @@ API net_nfc_error_e net_nfc_set_card_emulation_mode_sync(
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Set card emulation failed: %s", error->message);
+               NFC_ERR("Set card emulation failed: %s", error->message);
 
                g_error_free(error);
 
@@ -656,7 +656,7 @@ API net_nfc_error_e net_nfc_client_se_open_internal_secure_element(
 
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -695,7 +695,7 @@ API net_nfc_error_e net_nfc_client_se_open_internal_secure_element_sync(
 
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -712,7 +712,7 @@ API net_nfc_error_e net_nfc_client_se_open_internal_secure_element_sync(
                                &error) == true) {
                *handle = GUINT_TO_POINTER(out_handle);
        } else {
-               DEBUG_ERR_MSG("Open internal secure element failed: %s", error->message);
+               NFC_ERR("Open internal secure element failed: %s", error->message);
                g_error_free(error);
 
                result = NET_NFC_IPC_FAIL;
@@ -729,7 +729,7 @@ API net_nfc_error_e net_nfc_client_se_close_internal_secure_element(
 
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -763,7 +763,7 @@ API net_nfc_error_e net_nfc_client_se_close_internal_secure_element_sync(
 
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -778,7 +778,7 @@ API net_nfc_error_e net_nfc_client_se_close_internal_secure_element_sync(
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("close internal secure element failed: %s",
+               NFC_ERR("close internal secure element failed: %s",
                                error->message);
                g_error_free(error);
 
@@ -796,7 +796,7 @@ API net_nfc_error_e net_nfc_client_se_get_atr(net_nfc_target_handle_h handle,
 
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -836,7 +836,7 @@ API net_nfc_error_e net_nfc_client_se_get_atr_sync(
 
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
                return NET_NFC_NOT_INITIALIZED;
        }
 
@@ -852,7 +852,7 @@ API net_nfc_error_e net_nfc_client_se_get_atr_sync(
                                &error) == true) {
                *atr = net_nfc_util_gdbus_variant_to_data(out_atr);
        } else {
-               DEBUG_ERR_MSG("Get attributes failed: %s", error->message);
+               NFC_ERR("Get attributes failed: %s", error->message);
                g_error_free(error);
 
                result = NET_NFC_IPC_FAIL;
@@ -870,7 +870,7 @@ API net_nfc_error_e net_nfc_client_se_send_apdu(net_nfc_target_handle_h handle,
 
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -919,7 +919,7 @@ API net_nfc_error_e net_nfc_client_se_send_apdu_sync(
 
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get se_proxy");
+               NFC_ERR("Can not get se_proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -941,7 +941,7 @@ API net_nfc_error_e net_nfc_client_se_send_apdu_sync(
                                &error) == true) {
                *response = net_nfc_util_gdbus_variant_to_data(out_data);
        } else {
-               DEBUG_ERR_MSG("Send APDU failed: %s",
+               NFC_ERR("Send APDU failed: %s",
                                error->message);
                g_error_free(error);
 
@@ -1002,8 +1002,7 @@ net_nfc_error_e net_nfc_client_se_init(void)
 
        if (se_proxy)
        {
-               DEBUG_CLIENT_MSG("Already initialized");
-
+               NFC_WARN("Already initialized");
                return NET_NFC_OK;
        }
 
@@ -1016,7 +1015,7 @@ net_nfc_error_e net_nfc_client_se_init(void)
                        &error);
        if (se_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
+               NFC_ERR("Can not create proxy : %s", error->message);
 
                g_error_free(error);
 
index 6a661aa..57a0a26 100644 (file)
@@ -61,7 +61,7 @@ static void snep_send_client_request(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish send client request %s",
+               NFC_ERR("Can not finish send client request %s",
                                error->message);
                g_error_free(error);
 
@@ -99,7 +99,7 @@ API net_nfc_error_e net_nfc_client_snep_start_server(
 
        if (snep_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get Snep Proxy");
+               NFC_ERR("Can not get Snep Proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -123,7 +123,7 @@ API net_nfc_error_e net_nfc_client_snep_start_server(
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("snep server(sync call) failed: %s",
+               NFC_ERR("snep server(sync call) failed: %s",
                                error->message);
                g_error_free(error);
 
@@ -148,7 +148,7 @@ API net_nfc_error_e net_nfc_client_snep_start_client(
 
        if (snep_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get Snep Proxy");
+               NFC_ERR("Can not get Snep Proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -172,7 +172,7 @@ API net_nfc_error_e net_nfc_client_snep_start_client(
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("snep client(sync call) failed: %s",
+               NFC_ERR("snep client(sync call) failed: %s",
                                error->message);
                g_error_free(error);
 
@@ -201,7 +201,7 @@ API net_nfc_error_e net_nfc_client_snep_send_client_request(
 
        if (snep_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get Snep Proxy");
+               NFC_ERR("Can not get Snep Proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -253,7 +253,7 @@ API net_nfc_error_e net_nfc_client_snep_send_client_request_sync(
 
        if (snep_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get Snep Proxy");
+               NFC_ERR("Can not get Snep Proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -286,7 +286,7 @@ API net_nfc_error_e net_nfc_client_snep_send_client_request_sync(
        }
        else
        {
-               DEBUG_ERR_MSG(" send client request (sync call) failed: %s",
+               NFC_ERR(" send client request (sync call) failed: %s",
                                error->message);
                g_error_free(error);
 
@@ -309,7 +309,7 @@ API net_nfc_error_e net_nfc_client_snep_stop_service_sync(
 
        if (snep_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get Snep Proxy");
+               NFC_ERR("Can not get Snep Proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -328,7 +328,7 @@ API net_nfc_error_e net_nfc_client_snep_stop_service_sync(
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("snep stop service(sync call) failed: %s",
+               NFC_ERR("snep stop service(sync call) failed: %s",
                                error->message);
                g_error_free(error);
 
@@ -347,9 +347,7 @@ static void _snep_event_cb(NetNfcGDbusSnep *object,
 {
        GVariant *parameter = (GVariant *)GUINT_TO_POINTER(arg_user_data);
 
-       INFO_MSG(">>> SIGNAL arrived");
-
-       DEBUG_CLIENT_MSG("handle [%p], event [%d], result [%d], user_data [%p]",
+       NFC_DBG("handle [%p], event [%d], result [%d], user_data [%p]",
                        GUINT_TO_POINTER(arg_handle),
                        arg_event,
                        arg_result,
@@ -398,7 +396,7 @@ API net_nfc_error_e net_nfc_client_snep_register_server(const char *san,
 
        if (snep_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get Snep Proxy");
+               NFC_ERR("Can not get Snep Proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -421,7 +419,7 @@ API net_nfc_error_e net_nfc_client_snep_register_server(const char *san,
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("snep register server(sync call) failed: %s",
+               NFC_ERR("snep register server(sync call) failed: %s",
                                error->message);
                g_error_free(error);
 
@@ -441,7 +439,7 @@ API net_nfc_error_e net_nfc_client_snep_unregister_server(const char *san,
 
        if (snep_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get Snep Proxy");
+               NFC_ERR("Can not get Snep Proxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -459,7 +457,7 @@ API net_nfc_error_e net_nfc_client_snep_unregister_server(const char *san,
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("snep unregister server(sync call) failed: %s",
+               NFC_ERR("snep unregister server(sync call) failed: %s",
                                error->message);
                g_error_free(error);
 
@@ -475,8 +473,7 @@ net_nfc_error_e net_nfc_client_snep_init(void)
 
        if (snep_proxy)
        {
-               DEBUG_CLIENT_MSG("Already initialized");
-
+               NFC_WARN("Already initialized");
                return NET_NFC_OK;
        }
 
@@ -489,7 +486,7 @@ net_nfc_error_e net_nfc_client_snep_init(void)
                        &error);
        if (snep_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
+               NFC_ERR("Can not create proxy : %s", error->message);
                g_error_free(error);
 
                return NET_NFC_UNKNOWN_ERROR;
index 4882216..75a5c0d 100644 (file)
@@ -47,7 +47,7 @@ static void popup_set_active_callback(GObject *source_object, GAsyncResult *res,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish popup_set_active: %s",
+               NFC_ERR("Can not finish popup_set_active: %s",
                                error->message);
                g_error_free(error);
 
@@ -117,8 +117,7 @@ API net_nfc_error_e net_nfc_client_sys_handler_set_state_sync(int state)
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_CLIENT_MSG("can not call SetActive: %s",
-                               error->message);
+               NFC_ERR("can not call SetActive: %s", error->message);
                g_error_free(error);
 
                result = NET_NFC_IPC_FAIL;
@@ -179,8 +178,7 @@ API net_nfc_error_e net_nfc_client_sys_handler_set_state_force_sync(int state)
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_CLIENT_MSG("can not call SetActive: %s",
-                               error->message);
+               NFC_ERR("can not call SetActive: %s", error->message);
                g_error_free(error);
 
                result = NET_NFC_IPC_FAIL;
@@ -218,7 +216,7 @@ API net_nfc_error_e net_nfc_client_sys_handler_get_launch_popup_state(
        *state = NET_NFC_LAUNCH_APP_SELECT;
 
        if (popup_proxy == NULL) {
-               DEBUG_ERR_MSG("popup_proxy is null");
+               NFC_ERR("popup_proxy is null");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -237,7 +235,7 @@ API net_nfc_error_e net_nfc_client_sys_handler_get_launch_popup_state(
                *state = out_state;
        } else {
 
-               DEBUG_ERR_MSG("net_nfc_gdbus_popup_call_get_sync failed: %s",
+               NFC_ERR("net_nfc_gdbus_popup_call_get_sync failed: %s",
                                error->message);
                g_error_free(error);
 
@@ -253,8 +251,7 @@ net_nfc_error_e net_nfc_client_sys_handler_init(void)
 
        if (popup_proxy)
        {
-               DEBUG_CLIENT_MSG("Already initialized");
-
+               NFC_WARN("Already initialized");
                return NET_NFC_OK;
        }
 
@@ -267,7 +264,7 @@ net_nfc_error_e net_nfc_client_sys_handler_init(void)
                        &error);
        if (popup_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
+               NFC_ERR("Can not create proxy : %s", error->message);
                g_error_free(error);
 
                return NET_NFC_OPERATION_FAIL;
index 46862c9..10e0920 100644 (file)
@@ -86,7 +86,7 @@ static gboolean tag_check_filter(net_nfc_target_type_e type)
 {
        net_nfc_event_filter_e converted = NET_NFC_ALL_ENABLE;
 
-       DEBUG_CLIENT_MSG("client filter =  %d", client_filter);
+       NFC_DBG("client filter =  %d", client_filter);
 
        if (type >= NET_NFC_ISO14443_A_PICC
                        && type <= NET_NFC_MIFARE_DESFIRE_PICC)
@@ -147,7 +147,7 @@ static void tag_get_info_list(guint8 *buffer,
                str = g_new0(gchar, length + 1);
                memcpy(str, pos, length);
 
-               DEBUG_CLIENT_MSG("key = [%s]", str);
+               NFC_DBG("key = [%s]", str);
 
                pos += length;
 
@@ -232,7 +232,7 @@ static void tag_is_tag_connected(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish is_tag_connected: %s",
+               NFC_ERR("Can not finish is_tag_connected: %s",
                                error->message);
                g_error_free(error);
 
@@ -292,7 +292,7 @@ static void tag_get_current_tag_info(GObject *source_object,
        {
                out_result = NET_NFC_IPC_FAIL;
 
-               DEBUG_ERR_MSG("Can not finish get_current_tag_info: %s",
+               NFC_ERR("Can not finish get_current_tag_info: %s",
                                error->message);
                g_error_free(error);
        }
@@ -313,7 +313,7 @@ static void tag_get_current_tag_info(GObject *source_object,
                                        out_raw_data,
                                        &client_target_info);
                } else {
-                       INFO_MSG("The detected target is filtered out, type [%d]", out_dev_type);
+                       NFC_INFO("The detected target is filtered out, type [%d]", out_dev_type);
 
                        out_is_connected = false;
                }
@@ -354,7 +354,7 @@ static void tag_get_current_target_handle(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish get_current_target_handle: %s",
+               NFC_ERR("Can not finish get_current_target_handle: %s",
                                error->message);
                g_error_free(error);
 
@@ -389,13 +389,13 @@ static void tag_tag_discovered(NetNfcGDbusTag *object,
                GVariant *arg_raw_data,
                gpointer user_data)
 {
-       INFO_MSG(">>> SIGNAL arrived");
+       NFC_INFO(">>> SIGNAL arrived");
 
        net_nfc_release_tag_info((net_nfc_target_info_h)client_target_info);
        client_target_info = NULL;
 
        if (tag_check_filter(arg_dev_type) == FALSE) {
-               INFO_MSG("The detected target is filtered out, type [%d]", arg_dev_type);
+               NFC_INFO("The detected target is filtered out, type [%d]", arg_dev_type);
 
                return;
        }
@@ -425,7 +425,7 @@ static void tag_tag_detached(NetNfcGDbusTag *object,
                gint arg_dev_type,
                gpointer user_data)
 {
-       INFO_MSG(">>> SIGNAL arrived");
+       NFC_INFO(">>> SIGNAL arrived");
 
        if (tag_check_filter(arg_dev_type) == TRUE) {
                if (tag_detached_func_data.callback != NULL) {
@@ -435,7 +435,7 @@ static void tag_tag_detached(NetNfcGDbusTag *object,
                        callback(tag_detached_func_data.user_data);
                }
        } else {
-               INFO_MSG("The detected target is filtered out, type [%d]", arg_dev_type);
+               NFC_INFO("The detected target is filtered out, type [%d]", arg_dev_type);
        }
 
        net_nfc_release_tag_info((net_nfc_target_info_h)client_target_info);
@@ -518,7 +518,7 @@ API net_nfc_error_e net_nfc_client_tag_is_tag_connected_sync(
                                        NULL,
                                        &error) == FALSE)
                {
-                       DEBUG_ERR_MSG("Can not get is_tag_connected result: %s",
+                       NFC_ERR("Can not get is_tag_connected result: %s",
                                        error->message);
                        g_error_free(error);
 
@@ -619,7 +619,7 @@ API net_nfc_error_e net_nfc_client_tag_get_current_tag_info_sync(
                                        NULL,
                                        &error) == FALSE)
                {
-                       DEBUG_ERR_MSG("Can not get current_tag_info result: %s",
+                       NFC_ERR("Can not get current_tag_info result: %s",
                                        error->message);
                        g_error_free(error);
 
@@ -641,7 +641,7 @@ API net_nfc_error_e net_nfc_client_tag_get_current_tag_info_sync(
 
                                result = NET_NFC_OK;
                        } else {
-                               INFO_MSG("The detected target is filtered out");
+                               NFC_INFO("The detected target is filtered out");
 
                                result = NET_NFC_NOT_CONNECTED;
                        }
@@ -721,7 +721,7 @@ API net_nfc_error_e net_nfc_client_tag_get_current_target_handle_sync(
                                        NULL,
                                        &error) == FALSE)
                {
-                       DEBUG_ERR_MSG("Can not get current_target_handle result: %s",
+                       NFC_ERR("Can not get current_target_handle result: %s",
                                        error->message);
                        g_error_free(error);
 
@@ -797,7 +797,7 @@ net_nfc_error_e net_nfc_client_tag_init(void)
 
        if (tag_proxy)
        {
-               DEBUG_CLIENT_MSG("Alrady initialized");
+               NFC_WARN("Alrady initialized");
                return NET_NFC_OK;
        }
 
@@ -819,7 +819,7 @@ net_nfc_error_e net_nfc_client_tag_init(void)
                        &error);
        if (tag_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
+               NFC_ERR("Can not create proxy : %s", error->message);
                g_error_free(error);
 
                return NET_NFC_UNKNOWN_ERROR;
index c0c34bc..f2c24a9 100644 (file)
@@ -57,7 +57,7 @@ API net_nfc_error_e net_nfc_client_felica_poll(net_nfc_target_handle_h handle,
 
        if (target_info->devType != NET_NFC_FELICA_PICC)
        {
-               DEBUG_CLIENT_MSG("only felica tag is available");
+               NFC_ERR("only felica tag is available(TAG = %d)", target_info->devType);
                return NET_NFC_NOT_ALLOWED_OPERATION;
        }
 
@@ -115,7 +115,7 @@ API net_nfc_error_e net_nfc_client_felica_request_service(
 
        if (target_info->devType != NET_NFC_FELICA_PICC)
        {
-               DEBUG_CLIENT_MSG("only Jewel tag is available");
+               NFC_ERR("only Felica tag is available(TAG=%d)", target_info->devType);
                return NET_NFC_NOT_ALLOWED_OPERATION;
        }
 
@@ -205,7 +205,7 @@ API net_nfc_error_e net_nfc_client_felica_request_response(
 
        if (target_info->devType != NET_NFC_FELICA_PICC)
        {
-               DEBUG_CLIENT_MSG("only Jewel tag is available");
+               NFC_ERR("only Felica tag is available(TAG=%d)", target_info->devType);
                return NET_NFC_NOT_ALLOWED_OPERATION;
        }
 
@@ -268,7 +268,7 @@ API net_nfc_error_e net_nfc_client_felica_read_without_encryption(
 
        if (target_info->devType != NET_NFC_FELICA_PICC)
        {
-               DEBUG_CLIENT_MSG("only Jewel tag is available");
+               NFC_ERR("only Felica tag is available(TAG=%d)", target_info->devType);
                return NET_NFC_NOT_ALLOWED_OPERATION;
        }
 
@@ -375,7 +375,7 @@ API net_nfc_error_e net_nfc_client_felica_write_without_encryption(
 
        if (target_info->devType != NET_NFC_FELICA_PICC)
        {
-               DEBUG_CLIENT_MSG("only Jewel tag is available");
+               NFC_ERR("only Felica tag is available(TAG=%d)", target_info->devType);
                return NET_NFC_NOT_ALLOWED_OPERATION;
        }
 
@@ -478,7 +478,7 @@ API net_nfc_error_e net_nfc_client_felica_request_system_code(
 
        if (target_info->devType != NET_NFC_FELICA_PICC)
        {
-               DEBUG_CLIENT_MSG("only Jewel tag is available");
+               NFC_ERR("only Felica tag is available(TAG=%d)", target_info->devType);
                return NET_NFC_NOT_ALLOWED_OPERATION;
        }
 
index 0af7fdb..398af91 100644 (file)
@@ -56,7 +56,7 @@ API net_nfc_error_e net_nfc_client_jewel_read_id(net_nfc_target_handle_h handle,
 
        if(target_info->devType != NET_NFC_JEWEL_PICC)
        {
-               DEBUG_CLIENT_MSG("only Jewel tag is available");
+               NFC_ERR("only Jewel tag is available(TAG=%d)", target_info->devType);
                return NET_NFC_NOT_ALLOWED_OPERATION;
        }
 
@@ -101,7 +101,7 @@ API net_nfc_error_e net_nfc_client_jewel_read_byte(net_nfc_target_handle_h handl
 
        if(target_info->devType != NET_NFC_JEWEL_PICC)
        {
-               DEBUG_CLIENT_MSG("only Jewel tag is available");
+               NFC_ERR("only Jewel tag is available(TAG=%d)", target_info->devType);
                return NET_NFC_NOT_ALLOWED_OPERATION;
        }
 
@@ -166,7 +166,7 @@ API net_nfc_error_e net_nfc_client_jewel_read_all(net_nfc_target_handle_h handle
 
        if(target_info->devType != NET_NFC_JEWEL_PICC)
        {
-               DEBUG_CLIENT_MSG("only Jewel tag is available");
+               NFC_ERR("only Jewel tag is available(TAG=%d)", target_info->devType);
                return NET_NFC_NOT_ALLOWED_OPERATION;
        }
 
@@ -303,7 +303,7 @@ API net_nfc_error_e net_nfc_client_jewel_write_with_no_erase(
 
        if(target_info->devType != NET_NFC_JEWEL_PICC)
        {
-               DEBUG_CLIENT_MSG("only Jewel tag is available");
+               NFC_ERR("only Jewel tag is available(TAG=%d)", target_info->devType);
                return NET_NFC_NOT_ALLOWED_OPERATION;
        }
 
index 2afffae..a1a704c 100644 (file)
@@ -90,7 +90,7 @@ API net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyA(
                if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
                                target_info->devType > NET_NFC_MIFARE_4K_PICC)
                {
-                       DEBUG_CLIENT_MSG("not a MIFARE Classic TAG");
+                       NFC_ERR("not a MIFARE Classic TAG(%d)", target_info->devType);
                        return NET_NFC_NOT_SUPPORTED;
                }
        }
@@ -216,7 +216,7 @@ API net_nfc_error_e net_nfc_client_mifare_authenticate_with_keyB(
                if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
                                target_info->devType > NET_NFC_MIFARE_4K_PICC)
                {
-                       DEBUG_CLIENT_MSG("not a MIFARE Classic TAG");
+                       NFC_ERR("not a MIFARE Classic TAG(%d)", target_info->devType);
                        return NET_NFC_NOT_SUPPORTED;
                }
        }
@@ -321,8 +321,7 @@ API net_nfc_error_e net_nfc_client_mifare_read(net_nfc_target_handle_h handle,
                if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
                                target_info->devType > NET_NFC_MIFARE_ULTRA_PICC)
                {
-                       DEBUG_CLIENT_MSG("not a MIFARE TAG = [%d]",
-                                       target_info->devType);
+                       NFC_ERR("not a MIFARE Classic TAG(%d)", target_info->devType);
                        return NET_NFC_NOT_SUPPORTED;
                }
 
@@ -376,8 +375,7 @@ API net_nfc_error_e net_nfc_client_mifare_write_block(
        if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
                        target_info->devType > NET_NFC_MIFARE_ULTRA_PICC)
        {
-               DEBUG_CLIENT_MSG("not a MIFARE TAG = [%d] \n",
-                               target_info->devType);
+               NFC_ERR("not a MIFARE Classic TAG(%d)", target_info->devType);
                return NET_NFC_NOT_SUPPORTED;
        }
 
@@ -533,8 +531,7 @@ API net_nfc_error_e net_nfc_client_mifare_write_page(
        if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
                        target_info->devType > NET_NFC_MIFARE_ULTRA_PICC)
        {
-               DEBUG_CLIENT_MSG("not a MIFARE TAG = [%d] \n",
-                               target_info->devType);
+               NFC_ERR("not a MIFARE Classic TAG(%d)", target_info->devType);
                return NET_NFC_NOT_SUPPORTED;
        }
 
@@ -692,9 +689,7 @@ API net_nfc_error_e net_nfc_client_mifare_increment(
                if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
                                target_info->devType > NET_NFC_MIFARE_4K_PICC)
                {
-                       DEBUG_CLIENT_MSG(
-                                       "not a MIFARE Classic TAG = [%d]",
-                                       target_info->devType);
+                       NFC_ERR("not a MIFARE Classic TAG(%d)", target_info->devType);
                        return NET_NFC_NOT_SUPPORTED;
                }
        }
@@ -746,8 +741,7 @@ API net_nfc_error_e net_nfc_client_mifare_decrement(
                if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
                                target_info->devType > NET_NFC_MIFARE_4K_PICC)
                {
-                       DEBUG_CLIENT_MSG("not a MIFARE Classic TAG = [%d] \n",
-                                       target_info->devType);
+                       NFC_ERR("not a MIFARE Classic TAG(%d)", target_info->devType);
                        return NET_NFC_NOT_SUPPORTED;
                }
        }
@@ -793,8 +787,7 @@ API net_nfc_error_e net_nfc_client_mifare_transfer(net_nfc_target_handle_h handl
                if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
                                target_info->devType > NET_NFC_MIFARE_4K_PICC)
                {
-                       DEBUG_CLIENT_MSG("not a MIFARE Classic TAG = [%d]",
-                                       target_info->devType);
+                       NFC_ERR("not a MIFARE Classic TAG(%d)", target_info->devType);
                        return NET_NFC_NOT_SUPPORTED;
                }
        }
@@ -831,8 +824,7 @@ API net_nfc_error_e net_nfc_client_mifare_restore(net_nfc_target_handle_h handle
                if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
                                target_info->devType > NET_NFC_MIFARE_4K_PICC)
                {
-                       DEBUG_CLIENT_MSG("not a MIFARE Classic TAG = [%d]",
-                                       target_info->devType);
+                       NFC_ERR("not a MIFARE Classic TAG(%d)", target_info->devType);
                        return NET_NFC_NOT_SUPPORTED;
                }
        }
index 746abba..1a8ace0 100644 (file)
@@ -136,7 +136,7 @@ API net_nfc_error_e net_nfc_get_tag_info_keys(net_nfc_target_info_h target_info,
 
        *number_of_keys = handle->number_of_keys;
 
-       DEBUG_CLIENT_MSG("number of keys = [%d]", handle->number_of_keys);
+       NFC_DBG("number of keys = [%d]", handle->number_of_keys);
 
        handle->keylist = *keys;
 
index 318e86c..4578fea 100644 (file)
@@ -49,7 +49,7 @@ static GVariant *transceive_data_to_transceive_variant(
 
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("data is empty");
+               NFC_ERR("data is empty");
                return NULL;
        }
 
@@ -75,7 +75,7 @@ static GVariant *transceive_data_to_transceive_variant(
        case NET_NFC_JEWEL_PICC :
                if (data->length > 9)
                {
-                       DEBUG_ERR_MSG("data length is larger than 9");
+                       NFC_ERR("data length is larger than 9");
                        return NULL;
                }
 
@@ -125,7 +125,7 @@ static void transceive_data_call(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish transceive: %s", error->message);
+               NFC_ERR("Can not finish transceive: %s", error->message);
                g_error_free(error);
 
                out_result = NET_NFC_IPC_FAIL;
@@ -163,7 +163,7 @@ static void transceive_call(GObject *source_object,
                                res,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not finish transceive: %s", error->message);
+               NFC_ERR("Can not finish transceive: %s", error->message);
                g_error_free(error);
 
                out_result = NET_NFC_IPC_FAIL;
@@ -188,7 +188,7 @@ API net_nfc_error_e net_nfc_client_transceive(net_nfc_target_handle_h handle,
 
        if (transceive_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get TransceiveProxy");
+               NFC_ERR("Can not get TransceiveProxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -206,7 +206,7 @@ API net_nfc_error_e net_nfc_client_transceive(net_nfc_target_handle_h handle,
        if (target_info == NULL || target_info->handle == NULL)
                return NET_NFC_NOT_CONNECTED;
 
-       DEBUG_CLIENT_MSG("send request :: transceive = [%p]", handle);
+       NFC_DBG("send request :: transceive = [%p]", handle);
 
        arg_data = transceive_data_to_transceive_variant(target_info->devType,
                        rawdata);
@@ -245,7 +245,7 @@ API net_nfc_error_e net_nfc_client_transceive_data(net_nfc_target_handle_h handl
 
        if (transceive_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get TransceiveProxy");
+               NFC_ERR("Can not get TransceiveProxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -262,7 +262,7 @@ API net_nfc_error_e net_nfc_client_transceive_data(net_nfc_target_handle_h handl
        if (target_info == NULL || target_info->handle == NULL)
                return NET_NFC_NOT_CONNECTED;
 
-       DEBUG_CLIENT_MSG("send request :: transceive = [%p]", handle);
+       NFC_DBG("send request :: transceive = [%p]", handle);
 
        arg_data = transceive_data_to_transceive_variant(target_info->devType,
                        rawdata);
@@ -305,7 +305,7 @@ API net_nfc_error_e net_nfc_client_transceive_sync(net_nfc_target_handle_h handl
 
        if (transceive_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get TransceiveProxy");
+               NFC_ERR("Can not get TransceiveProxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -319,7 +319,7 @@ API net_nfc_error_e net_nfc_client_transceive_sync(net_nfc_target_handle_h handl
        if (target_info == NULL || target_info->handle == NULL)
                return NET_NFC_NOT_CONNECTED;
 
-       DEBUG_CLIENT_MSG("send request :: transceive = [%p]", handle);
+       NFC_DBG("send request :: transceive = [%p]", handle);
 
        arg_data = transceive_data_to_transceive_variant(target_info->devType,
                        rawdata);
@@ -335,7 +335,7 @@ API net_nfc_error_e net_nfc_client_transceive_sync(net_nfc_target_handle_h handl
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Transceive (sync call) failed: %s",
+               NFC_ERR("Transceive (sync call) failed: %s",
                                error->message);
                g_error_free(error);
 
@@ -359,7 +359,7 @@ API net_nfc_error_e net_nfc_client_transceive_data_sync(
 
        if (transceive_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not get TransceiveProxy");
+               NFC_ERR("Can not get TransceiveProxy");
 
                return NET_NFC_NOT_INITIALIZED;
        }
@@ -373,7 +373,7 @@ API net_nfc_error_e net_nfc_client_transceive_data_sync(
        if (target_info == NULL || target_info->handle == NULL)
                return NET_NFC_NOT_CONNECTED;
 
-       DEBUG_CLIENT_MSG("send request :: transceive = [%p]", handle);
+       NFC_DBG("send request :: transceive = [%p]", handle);
 
        arg_data = transceive_data_to_transceive_variant(target_info->devType,
                        rawdata);
@@ -391,7 +391,7 @@ API net_nfc_error_e net_nfc_client_transceive_data_sync(
                                NULL,
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Transceive (sync call) failed: %s",
+               NFC_ERR("Transceive (sync call) failed: %s",
                                error->message);
                g_error_free(error);
 
@@ -413,8 +413,7 @@ net_nfc_error_e net_nfc_client_transceive_init(void)
 
        if (transceive_proxy)
        {
-               DEBUG_CLIENT_MSG("Already initialized");
-
+               NFC_WARN("Already initialized");
                return NET_NFC_OK;
        }
 
@@ -427,7 +426,7 @@ net_nfc_error_e net_nfc_client_transceive_init(void)
                        &error);
        if (transceive_proxy == NULL)
        {
-               DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
+               NFC_ERR("Can not create proxy : %s", error->message);
                g_error_free(error);
 
                return NET_NFC_UNKNOWN_ERROR;
index 27ad787..4416d0c 100644 (file)
@@ -23,6 +23,8 @@
 #include <libgen.h>
 #include <dlog.h>
 
+#define NFC_DEBUGGING
+
 #define LOG_SERVER_TAG "NET_NFC_MANAGER"
 #define LOG_CLIENT_TAG "NET_NFC_CLIENT"
 
 #define LOG_COLOR_LIGHTBLUE    "\033[0;37m"
 #define LOG_COLOR_END          "\033[0;m"
 
-#ifndef API
-#define API __attribute__((visibility("default")))
+#ifdef API
+#undef API
 #endif
+#define API __attribute__((visibility("default")))
 
+const char* net_nfc_get_log_tag();
 
-/* nfc_log_to_file */
-extern FILE *nfc_log_file;
-#define NFC_DLOG_FILE "/opt/usr/share/nfc_debug/nfc_mgr_dlog.txt"
+#define DBG(fmt, arg...) SLOG(LOG_DEBUG, net_nfc_get_log_tag(), fmt, ##arg)
+#define INFO(fmt, arg...) SLOG(LOG_INFO, net_nfc_get_log_tag(), fmt, ##arg)
+#define WARN(fmt, arg...) SLOG(LOG_WARN, net_nfc_get_log_tag(), fmt, ##arg)
+#define ERR(fmt, arg...) SLOG(LOG_ERROR, net_nfc_get_log_tag(), fmt, ##arg)
 
-/* tag */
-const char *net_nfc_get_log_tag();
 
-#define NFC_LOGD(format, arg...) SLOG(LOG_DEBUG, net_nfc_get_log_tag(), format, ##arg)
-#define NFC_LOGI(format, arg...) SLOG(LOG_INFO, net_nfc_get_log_tag(), format, ##arg)
-#define NFC_LOGW(format, arg...) SLOG(LOG_WARN, net_nfc_get_log_tag(), format, ##arg)
-#define NFC_LOGE(format, arg...) SLOG(LOG_ERROR, net_nfc_get_log_tag(), format, ##arg)
+#ifdef NFC_DEBUGGING
+
+#define NFC_FN_CALL DBG(">>>>>>>> called")
+#define NFC_FN_END DBG("<<<<<<<< ended")
+#define NFC_DBG(fmt, arg...) DBG(fmt, ##arg)
+#define NFC_WARN(fmt, arg...) WARN(LOG_COLOR_BROWN fmt LOG_COLOR_END, ##arg)
+#define NFC_ERR(fmt, arg...) ERR(LOG_COLOR_RED fmt LOG_COLOR_END, ##arg)
+#define NFC_INFO(fmt, arg...) INFO(LOG_COLOR_BLUE fmt LOG_COLOR_END, ##arg)
+#define NFC_SECURE_DBG(fmt, arg...) \
+       SECURE_SLOG(LOG_DEBUG, net_nfc_get_log_tag(), fmt, ##arg)
+#define NFC_SECURE_ERR(fmt, arg...) \
+       SECURE_SLOG(LOG_ERROR, net_nfc_get_log_tag(), fmt, ##arg)
+
+#else /* NFC_DEBUGGING */
+
+#define NFC_FN_CALL
+#define NFC_FN_END
+#define NFC_DBG(fmt, arg...)
+#define NFC_WARN(fmt, arg...)
+#define NFC_ERR(fmt, arg...) ERR(fmt, ##arg)
+#define NFC_INFO(fmt, arg...)
+#define NFC_VERBOSE(fmt, arg...)
+#define NFC_SECURE_DBG(fmt, arg...)
+#define NFC_SECURE_ERR(fmt, arg...) \
+       SECURE_SLOG(LOG_ERROR, net_nfc_get_log_tag(), fmt, ##arg)
+
+#endif /* NFC_DEBUGGING */
 
-#ifndef SECURE_LOGD
-#define SECURE_LOGD NFC_LOGD
-#endif
 
 #define DEBUG_MSG_PRINT_BUFFER(buffer, length) \
        do { \
                int i = 0, offset = 0; \
                char temp_buffer[4096] = { 0, }; \
-               NFC_LOGD(LOG_COLOR_BLUE "BUFFER [%d] = {" LOG_COLOR_END, length); \
+               NFC_INFO("BUFFER [%d] = {", length); \
                for(; i < length && offset < sizeof(temp_buffer); i++) \
                { \
                        offset += snprintf(temp_buffer + offset, sizeof(temp_buffer) - offset, " %02x", buffer[i]); \
                        if (i % 16 == 15) \
                        { \
-                               NFC_LOGD(LOG_COLOR_BLUE "\t%s" LOG_COLOR_END, temp_buffer); \
+                               NFC_INFO("\t%s", temp_buffer); \
                                offset = 0; \
                        } \
                } \
-               NFC_LOGD(LOG_COLOR_BLUE "\t%s" LOG_COLOR_END, temp_buffer); \
-               NFC_LOGD(LOG_COLOR_BLUE "}" LOG_COLOR_END); \
+               NFC_INFO("\t%s", temp_buffer); \
+               NFC_INFO("}"); \
        } while(0)
 
-#define DEBUG_MSG_PRINT_BUFFER_CHAR(buffer, length) \
+#define PROFILING(str) \
        do { \
-               int i = 0, offset = 0; \
-               char temp_buffer[4096] = { 0, }; \
-               NFC_LOGD(LOG_COLOR_BLUE "BUFFER [%d] = {" LOG_COLOR_END, length); \
-               for(; i < length && offset < sizeof(temp_buffer); i++) \
-               { \
-                       offset += snprintf(temp_buffer + offset, sizeof(temp_buffer) - offset, " %c", buffer[i]); \
-                       if (i % 16 == 15) \
-                       { \
-                               NFC_LOGD(LOG_COLOR_BLUE "\t%s" LOG_COLOR_END, temp_buffer); \
-                               offset = 0; \
-                       } \
-               } \
-               NFC_LOGD(LOG_COLOR_BLUE "\t%s" LOG_COLOR_END, temp_buffer); \
-               NFC_LOGD(LOG_COLOR_BLUE "}" LOG_COLOR_END); \
+               struct timeval mytime;\
+               char buf[128]; = {0};\
+               memset(buf, 0x00, 128);\
+               gettimeofday(&mytime, NULL);\
+               char time_string[128] = {0,};\
+               sprintf(time_string, "%d.%4d", mytime.tv_sec, mytime.tv_usec);\
+               NFC_LOGD(str); \
+               NFC_LOGD("\t time = [%s]", time_string);\
        } while(0)
 
-#define DEBUG_MSG(format, args...) \
+#define RET_IF(expr) \
        do { \
-               NFC_LOGD(format, ##args); \
-               if (nfc_log_file) \
-               { \
-                       char timeBuf[50]; \
-                       time_t rawtime;   time (&rawtime);   strftime(timeBuf, sizeof(timeBuf), "%m-%d %H:%M:%S", localtime(&rawtime)); \
-                       fprintf(nfc_log_file, "\n%s",timeBuf); \
-                       fprintf(nfc_log_file, "[D][%s:%d] "format"",__func__, __LINE__,  ##args); \
-                       fflush(nfc_log_file);\
+               if (expr) { \
+                       NFC_ERR("(%s)", #expr); \
+                       return; \
                }\
        } while(0)
-
-#define DEBUG_SERVER_MSG(format, args...) \
+#define RETV_IF(expr, val) \
        do {\
-               NFC_LOGD(LOG_COLOR_PURPLE format LOG_COLOR_END, ##args);\
-               if (nfc_log_file) \
-               { \
-                       char timeBuf[50]; \
-                       time_t rawtime;   time (&rawtime);   strftime(timeBuf, sizeof(timeBuf), "%m-%d %H:%M:%S", localtime(&rawtime)); \
-                       fprintf(nfc_log_file, "\n%s",timeBuf); \
-                       fprintf(nfc_log_file, "[S][%s:%d] "format"",__func__, __LINE__,  ##args); \
-                       fflush(nfc_log_file);\
+               if (expr) { \
+                       NFC_ERR("(%s)", #expr); \
+                       return (val); \
                } \
        } while(0)
-
-#define DEBUG_CLIENT_MSG(format, args...) \
+#define RETM_IF(expr, fmt, arg...) \
        do {\
-               NFC_LOGD(LOG_COLOR_CYAN format LOG_COLOR_END, ##args); \
-               if (nfc_log_file) \
-               { \
-                       char timeBuf[50]; \
-                       time_t rawtime;   time (&rawtime);   strftime(timeBuf, sizeof(timeBuf), "%m-%d %H:%M:%S", localtime(&rawtime)); \
-                       fprintf(nfc_log_file, "\n%s",timeBuf); \
-                       fprintf(nfc_log_file, "[C][%s:%d] "format"",__func__, __LINE__,  ##args); \
-                       fflush(nfc_log_file);\
+               if (expr) { \
+                       NFC_ERR(fmt, ##arg); \
+                       return; \
                }\
        } while(0)
-
-#define DEBUG_ERR_MSG(format, args...) \
-       do {\
-               NFC_LOGD(LOG_COLOR_RED format LOG_COLOR_END, ##args);\
-               if (nfc_log_file) \
-               { \
-                       char timeBuf[50]; \
-                       time_t rawtime;   time (&rawtime);   strftime(timeBuf, sizeof(timeBuf), "%m-%d %H:%M:%S", localtime(&rawtime)); \
-                       fprintf(nfc_log_file, "\n%s",timeBuf); \
-                       fprintf(nfc_log_file, "[E][%s:%d] "format"",__func__, __LINE__,  ##args); \
-                       fflush(nfc_log_file);\
-               } \
-       } while(0)
-
-#define INFO_MSG(format, args...) \
-       do {\
-               NFC_LOGI(LOG_COLOR_GREEN format LOG_COLOR_END, ##args);\
-               if (nfc_log_file) \
-               { \
-                       char timeBuf[50]; \
-                       time_t rawtime;   time (&rawtime);   strftime(timeBuf, sizeof(timeBuf), "%m-%d %H:%M:%S", localtime(&rawtime)); \
-                       fprintf(nfc_log_file, "\n%s",timeBuf); \
-                       fprintf(nfc_log_file, "[I][%s:%d] "format"",__func__, __LINE__,  ##args); \
-                       fflush(nfc_log_file);\
-               } \
-       } while(0)
-
-#define WARN_MSG(format, args...) \
+#define RETVM_IF(expr, val, fmt, arg...) \
        do {\
-               NFC_LOGW(LOG_COLOR_BROWN format LOG_COLOR_END, ##args);\
-               if (nfc_log_file) \
-               { \
-                       char timeBuf[50]; \
-                       time_t rawtime;   time (&rawtime);   strftime(timeBuf, sizeof(timeBuf), "%m-%d %H:%M:%S", localtime(&rawtime)); \
-                       fprintf(nfc_log_file, "\n%s",timeBuf); \
-                       fprintf(nfc_log_file, "[W][%s:%d] "format"",__func__, __LINE__,  ##args); \
-                       fflush(nfc_log_file);\
+               if (expr) { \
+                       NFC_ERR(fmt, ##arg); \
+                       return (val); \
                } \
        } while(0)
 
-#define PROFILING(str) \
-       do{ \
-               struct timeval mytime;\
-               char buf[128]; = {0};\
-               memset(buf, 0x00, 128);\
-               gettimeofday(&mytime, NULL);\
-               char time_string[128] = {0,};\
-               sprintf(time_string, "%d.%4d", mytime.tv_sec, mytime.tv_usec);\
-               NFC_LOGD(str); \
-               NFC_LOGD("\t time = [%s]", time_string);\
-       } while(0)
 
 #endif //__NET_NFC_DEBUG_INTERNAL_H__
index aab4e28..a6005ce 100644 (file)
@@ -74,7 +74,6 @@ static uint8_t *bt_addr = NULL;
 
 /* for log tag */
 static const char *log_tag = LOG_CLIENT_TAG;
-FILE *nfc_log_file;
 
 const char *net_nfc_get_log_tag()
 {
@@ -86,42 +85,6 @@ void net_nfc_change_log_tag()
        log_tag = LOG_SERVER_TAG;
 }
 
-void net_nfc_manager_init_log()
-{
-       nfc_log_file = fopen(NFC_DLOG_FILE, "a+");
-       if (nfc_log_file != NULL)
-       {
-               char timeBuf[50];
-               time_t rawtime;
-
-               time (&rawtime);
-               strftime(timeBuf, sizeof(timeBuf), "%m-%d %H:%M:%S", localtime(&rawtime));
-               fprintf(nfc_log_file, "\n%s",timeBuf);
-               fprintf(nfc_log_file, "========== log begin, pid [%d] =========", getpid());
-               fflush(nfc_log_file);
-       }
-       else
-       {
-               fprintf(stderr, "\n\nfopen error\n\n");
-       }
-}
-
-void net_nfc_manager_fini_log()
-{
-       if (nfc_log_file != NULL)
-       {
-               char timeBuf[50];
-               time_t rawtime;
-
-               time (&rawtime);
-               strftime(timeBuf, sizeof(timeBuf), "%m-%d %H:%M:%S", localtime(&rawtime));
-               fprintf(nfc_log_file, "\n%s",timeBuf);
-               fprintf(nfc_log_file, "=========== log end, pid [%d] ==========", getpid());
-               fflush(nfc_log_file);
-               fclose(nfc_log_file);
-               nfc_log_file = NULL;
-       }
-}
 
 API void __net_nfc_util_free_mem(void **mem, char *filename, unsigned int line)
 {
index 30e59a1..72d4507 100644 (file)
@@ -196,12 +196,12 @@ ndef_message_s *net_nfc_util_gdbus_variant_to_ndef_message(GVariant *variant)
                                                &data, temp) == NET_NFC_OK) {
                                message = temp;
                        } else {
-                               DEBUG_ERR_MSG("net_nfc_create_ndef_message_from_rawdata failed");
+                               NFC_ERR("net_nfc_create_ndef_message_from_rawdata failed");
 
                                net_nfc_util_free_ndef_message(temp);
                        }
                } else {
-                       DEBUG_ERR_MSG("net_nfc_util_create_ndef_message failed");
+                       NFC_ERR("net_nfc_util_create_ndef_message failed");
                }
 
                net_nfc_util_free_data(&data);
@@ -228,15 +228,15 @@ GVariant *net_nfc_util_gdbus_ndef_message_to_variant(
                                                &temp) == NET_NFC_OK) {
                                data = &temp;
                        } else {
-                               DEBUG_ERR_MSG("can not convert ndef_message to rawdata");
+                               NFC_ERR("can not convert ndef_message to rawdata");
 
                                net_nfc_util_free_data(&temp);
                        }
                } else {
-                       DEBUG_ERR_MSG("net_nfc_util_alloc_data failed");
+                       NFC_ERR("net_nfc_util_alloc_data failed");
                }
        } else {
-               DEBUG_ERR_MSG("message length is 0");
+               NFC_ERR("message length is 0");
        }
 
        variant = net_nfc_util_gdbus_data_to_variant(data);
index f3a292f..8988500 100755 (executable)
@@ -32,7 +32,7 @@ typedef struct _search_index
        void *found;
 } search_index;
 
-inline void net_nfc_convert_byte_order(unsigned char *array, int size)
+void net_nfc_convert_byte_order(unsigned char *array, int size)
 {
        int i;
        unsigned char tmp_char;
@@ -107,12 +107,12 @@ static void __free_all_data(gpointer data, gpointer user_data)
 
        if (info->is_group)
        {
-               DEBUG_MSG("FREE: group is found");
+               NFC_DBG("FREE: group is found");
                net_nfc_util_free_carrier_group((net_nfc_carrier_property_s *)info);
        }
        else
        {
-               DEBUG_MSG("FREE: element is found ATTRIB:0x%X length:%d", info->attribute, info->length);
+               NFC_DBG("FREE: element is found ATTRIB:0x%X length:%d", info->attribute, info->length);
                _net_nfc_util_free_mem(info->data);
                _net_nfc_util_free_mem(info);
        }
@@ -141,7 +141,7 @@ static net_nfc_error_e __net_nfc_util_create_connection_handover_collsion_resolu
        payload.buffer = rand_buffer;
        payload.length = 2;
 
-       DEBUG_MSG("rand number = [0x%x] [0x%x] => [0x%x]", payload.buffer[0], payload.buffer[1], random_num);
+       NFC_DBG("rand number = [0x%x] [0x%x] => [0x%x]", payload.buffer[0], payload.buffer[1], random_num);
 
        return net_nfc_util_create_record(NET_NFC_RECORD_WELL_KNOWN_TYPE, &typeName, NULL, &payload, record);
 }
@@ -201,7 +201,7 @@ net_nfc_error_e net_nfc_util_add_carrier_config_property(net_nfc_carrier_config_
 {
        net_nfc_carrier_property_s *elem = NULL;
 
-       DEBUG_MSG("ADD property: [ATTRIB:0x%X, SIZE:%d]", attribute, size);
+       NFC_DBG("ADD property: [ATTRIB:0x%X, SIZE:%d]", attribute, size);
 
        if (config == NULL || data == NULL)
        {
@@ -233,7 +233,7 @@ net_nfc_error_e net_nfc_util_add_carrier_config_property(net_nfc_carrier_config_
        config->data = g_list_append(config->data, elem);
        config->length += size + 2 * __net_nfc_get_size_of_attribute(attribute);
 
-       DEBUG_MSG("ADD completed total length %d", config->length);
+       NFC_DBG("ADD completed total length %d", config->length);
 
        return NET_NFC_OK;
 }
@@ -396,7 +396,7 @@ net_nfc_error_e net_nfc_util_add_carrier_config_group_property(net_nfc_carrier_p
 {
        net_nfc_carrier_property_s *elem = NULL;
 
-       DEBUG_MSG("ADD group property: [ATTRIB:0x%X, SIZE:%d]", attribute, size);
+       NFC_DBG("ADD group property: [ATTRIB:0x%X, SIZE:%d]", attribute, size);
 
        if (group == NULL || data == NULL)
        {
@@ -427,7 +427,7 @@ net_nfc_error_e net_nfc_util_add_carrier_config_group_property(net_nfc_carrier_p
        group->length += size + 2 * __net_nfc_get_size_of_attribute(attribute);
        group->data = g_list_append((GList *)(group->data), elem);
 
-       DEBUG_MSG("ADD group completed total length %d", group->length);
+       NFC_DBG("ADD group completed total length %d", group->length);
 
        return NET_NFC_OK;
 }
@@ -496,7 +496,7 @@ net_nfc_error_e net_nfc_util_free_carrier_group(net_nfc_carrier_property_s *grou
 static void __make_serial_wifi(gpointer data, gpointer user_data)
 {
        net_nfc_carrier_property_s *info = (net_nfc_carrier_property_s *)data;
-       data_s *payload = (data_s *)user_data;
+       data_s *payload = user_data;
        uint8_t *current;
        int inc = 0;
 
@@ -508,7 +508,7 @@ static void __make_serial_wifi(gpointer data, gpointer user_data)
 
        if (info->is_group)
        {
-               DEBUG_MSG("[WIFI]Found Group make recursive");
+               NFC_DBG("[WIFI]Found Group make recursive");
                *(uint16_t *)current = info->attribute;
                net_nfc_convert_byte_order(current,2);
                *(uint16_t *)(current + inc) = info->length;
@@ -518,7 +518,7 @@ static void __make_serial_wifi(gpointer data, gpointer user_data)
        }
        else
        {
-               DEBUG_MSG("[WIFI]Element is found attrib:0x%X length:%d current:%d", info->attribute, info->length, payload->length);
+               NFC_DBG("[WIFI]Element is found attrib:0x%X length:%d current:%d", info->attribute, info->length, payload->length);
                *(uint16_t *)current = info->attribute;
                net_nfc_convert_byte_order(current,2);
                *(uint16_t *)(current + inc) = info->length;
@@ -542,14 +542,14 @@ static void __make_serial_bt(gpointer data, gpointer user_data)
 
        if (info->is_group)
        {
-               DEBUG_MSG("[BT]Found Group. call recursive");
+               NFC_DBG("[BT]Found Group. call recursive");
                g_list_foreach((GList *)info->data, __make_serial_bt, payload);
        }
        else
        {
                if (info->attribute != NET_NFC_BT_ATTRIBUTE_ADDRESS)
                {
-                       DEBUG_MSG("[BT]Element is found attrib:0x%X length:%d current:%d", info->attribute, info->length, payload->length);
+                       NFC_DBG("[BT]Element is found attrib:0x%X length:%d current:%d", info->attribute, info->length, payload->length);
                        inc = __net_nfc_get_size_of_attribute(info->attribute);
                        *current = info->length + 1;
                        *(current + inc) = info->attribute;
@@ -558,7 +558,7 @@ static void __make_serial_bt(gpointer data, gpointer user_data)
                }
                else
                {
-                       DEBUG_MSG("[BT]BT address is found length:%d", info->length);
+                       NFC_DBG("[BT]BT address is found length:%d", info->length);
                        memcpy(current, info->data, info->length);
                        payload->length += (info->length);
                }
@@ -610,7 +610,7 @@ net_nfc_error_e net_nfc_util_create_ndef_record_with_carrier_config(ndef_record_
                return NET_NFC_NOT_SUPPORTED;
        }
 
-       DEBUG_MSG("payload length = %d", payload.length);
+       NFC_DBG("payload length = %d", payload.length);
 
        return net_nfc_util_create_record(NET_NFC_RECORD_MIME_TYPE, &record_type, NULL, &payload, record);
 }
@@ -736,7 +736,7 @@ net_nfc_error_e net_nfc_util_create_carrier_config_from_config_record(net_nfc_ca
        }
        else
        {
-               DEBUG_MSG("Record type is not config type");
+               NFC_DBG("Record type is not config type");
                return NET_NFC_INVALID_FORMAT;
        }
 
@@ -1013,7 +1013,7 @@ static net_nfc_error_e __net_nfc_replace_inner_message(ndef_message_s *message,
        if (inner_record == NULL)
        {
                // This message is not connection handover message
-               DEBUG_ERR_MSG("inner_record == NULL");
+               NFC_ERR("inner_record == NULL");
                return NET_NFC_INVALID_FORMAT;
        }
 
@@ -1021,7 +1021,7 @@ static net_nfc_error_e __net_nfc_replace_inner_message(ndef_message_s *message,
                        && strncmp((char *)(inner_record->type_s.buffer), CH_SEL_RECORD_TYPE, (size_t)(inner_record->type_s.length)) != 0)
        {
                // This message is not connection handover message
-               DEBUG_ERR_MSG("unknown type [%s]", inner_record->type_s.buffer);
+               NFC_ERR("unknown type [%s]", inner_record->type_s.buffer);
                return NET_NFC_INVALID_FORMAT;
        }
 
@@ -1053,13 +1053,13 @@ static net_nfc_error_e __net_nfc_replace_inner_message(ndef_message_s *message,
                }
                else
                {
-                       DEBUG_ERR_MSG("net_nfc_util_convert_ndef_message_to_rawdata failed [%d]", error);
+                       NFC_ERR("net_nfc_util_convert_ndef_message_to_rawdata failed [%d]", error);
                        _net_nfc_util_free_mem(tdata.buffer);
                }
        }
        else
        {
-               DEBUG_ERR_MSG("inner_record->payload_s.length(%d) < 1 ", inner_record->payload_s.length);
+               NFC_ERR("inner_record->payload_s.length(%d) < 1 ", inner_record->payload_s.length);
                error = NET_NFC_INVALID_FORMAT;
        }
 
@@ -1088,7 +1088,7 @@ net_nfc_error_e net_nfc_util_append_carrier_config_record(ndef_message_s *messag
 
        if ((error = net_nfc_util_create_ndef_message(&inner_msg)) != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_util_create_ndef_message failed [%d]", error);
+               NFC_ERR("net_nfc_util_create_ndef_message failed [%d]", error);
 
                return error;
        }
@@ -1119,7 +1119,7 @@ net_nfc_error_e net_nfc_util_append_carrier_config_record(ndef_message_s *messag
                if (message->records != NULL &&
                                memcmp((char *)message->records->type_s.buffer, CH_SEL_RECORD_TYPE, (size_t)message->records->type_s.length) != 0)
                {
-                       DEBUG_ERR_MSG("ERROR [%d]", error);
+                       NFC_ERR("ERROR [%d]", error);
 
                        net_nfc_util_free_ndef_message(inner_msg);
 
@@ -1161,7 +1161,7 @@ net_nfc_error_e net_nfc_util_append_carrier_config_record(ndef_message_s *messag
        error = net_nfc_util_create_record(NET_NFC_RECORD_WELL_KNOWN_TYPE, &type, NULL, &payload, &carrier_rec);
        if (error != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_util_create_record failed [%d]", error);
+               NFC_ERR("net_nfc_util_create_record failed [%d]", error);
 
                net_nfc_util_free_ndef_message(inner_msg);
 
@@ -1171,7 +1171,7 @@ net_nfc_error_e net_nfc_util_append_carrier_config_record(ndef_message_s *messag
        error = net_nfc_util_append_record(inner_msg, carrier_rec);
        if (error != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_util_create_record failed [%d]", error);
+               NFC_ERR("net_nfc_util_create_record failed [%d]", error);
 
                net_nfc_util_free_record(carrier_rec);
                net_nfc_util_free_ndef_message(inner_msg);
@@ -1183,7 +1183,7 @@ net_nfc_error_e net_nfc_util_append_carrier_config_record(ndef_message_s *messag
        net_nfc_util_free_ndef_message(inner_msg);
        if (error != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("__net_nfc_replace_inner_message failed [%d]", error);
+               NFC_ERR("__net_nfc_replace_inner_message failed [%d]", error);
 
                return error;
        }
@@ -1192,7 +1192,7 @@ net_nfc_error_e net_nfc_util_append_carrier_config_record(ndef_message_s *messag
        error = net_nfc_util_set_record_id((ndef_record_s *)record, &id, sizeof(id));
        if (error != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_util_set_record_id failed [%d]", error);
+               NFC_ERR("net_nfc_util_set_record_id failed [%d]", error);
 
                return error;
        }
@@ -1200,7 +1200,7 @@ net_nfc_error_e net_nfc_util_append_carrier_config_record(ndef_message_s *messag
        error = net_nfc_util_append_record(message, (ndef_record_s *)record);
        if (error != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_util_append_record failed [%d]", error);
+               NFC_ERR("net_nfc_util_append_record failed [%d]", error);
 
                return error;
        }
@@ -1235,7 +1235,7 @@ net_nfc_error_e net_nfc_util_remove_carrier_config_record(ndef_message_s *messag
 
        if (current == NULL || idx == message->recordCount)
        {
-               DEBUG_MSG("The reference is not found in config records");
+               NFC_DBG("The reference is not found in config records");
 
                return NET_NFC_NO_DATA_FOUND;
        }
@@ -1243,7 +1243,7 @@ net_nfc_error_e net_nfc_util_remove_carrier_config_record(ndef_message_s *messag
 
        if ((error = net_nfc_util_create_ndef_message(&inner_msg)) != NET_NFC_OK)
        {
-               DEBUG_MSG("net_nfc_util_create_ndef_message failed [%d]", error);
+               NFC_DBG("net_nfc_util_create_ndef_message failed [%d]", error);
 
                return error;
        }
@@ -1267,7 +1267,7 @@ net_nfc_error_e net_nfc_util_remove_carrier_config_record(ndef_message_s *messag
 
                if (current == NULL || idx == message->recordCount)
                {
-                       DEBUG_MSG("The reference is not found in inner message");
+                       NFC_DBG("The reference is not found in inner message");
 
                        error = NET_NFC_NO_DATA_FOUND;
                }
@@ -1302,7 +1302,7 @@ net_nfc_error_e net_nfc_util_get_carrier_config_record(ndef_message_s *message,
 
        if ((error = net_nfc_util_create_ndef_message(&inner_msg)) != NET_NFC_OK)
        {
-               DEBUG_MSG("net_nfc_util_create_ndef_message failed [%d]", error);
+               NFC_DBG("net_nfc_util_create_ndef_message failed [%d]", error);
 
                return error;
        }
@@ -1323,7 +1323,7 @@ net_nfc_error_e net_nfc_util_get_carrier_config_record(ndef_message_s *message,
 
                if (current == NULL || idx == message->recordCount)
                {
-                       DEBUG_MSG("The reference is not found in inner message");
+                       NFC_DBG("The reference is not found in inner message");
 
                        error = NET_NFC_NO_DATA_FOUND;
                }
@@ -1354,7 +1354,7 @@ net_nfc_error_e net_nfc_util_get_handover_random_number(ndef_message_s *message,
 
        if ((error = net_nfc_util_create_ndef_message(&inner_msg)) != NET_NFC_OK)
        {
-               DEBUG_MSG("net_nfc_util_create_ndef_message failed [%d]", error);
+               NFC_DBG("net_nfc_util_create_ndef_message failed [%d]", error);
 
                return error;
        }
@@ -1365,7 +1365,7 @@ net_nfc_error_e net_nfc_util_get_handover_random_number(ndef_message_s *message,
                if (strncmp((char*)cr_record->type_s.buffer, COLLISION_DETECT_RECORD_TYPE, (size_t)cr_record->type_s.length) != 0
                                || cr_record->payload_s.length < 2)
                {
-                       DEBUG_MSG("There is no Collision resolution record");
+                       NFC_DBG("There is no Collision resolution record");
 
                        error = NET_NFC_INVALID_FORMAT;
                }
@@ -1394,7 +1394,7 @@ net_nfc_error_e net_nfc_util_get_alternative_carrier_record_count(ndef_message_s
 
        if ((error = net_nfc_util_create_ndef_message(&inner_msg)) != NET_NFC_OK)
        {
-               DEBUG_MSG("net_nfc_util_create_ndef_message failed [%d]", error);
+               NFC_DBG("net_nfc_util_create_ndef_message failed [%d]", error);
 
                return error;
        }
@@ -1439,7 +1439,7 @@ net_nfc_error_e net_nfc_util_get_alternative_carrier_power_status(ndef_message_s
 
        if ((error = net_nfc_util_create_ndef_message(&inner_msg)) != NET_NFC_OK)
        {
-               DEBUG_MSG("net_nfc_util_create_ndef_message failed [%d]", error);
+               NFC_DBG("net_nfc_util_create_ndef_message failed [%d]", error);
 
                return error;
        }
@@ -1485,7 +1485,7 @@ net_nfc_error_e net_nfc_util_set_alternative_carrier_power_status(ndef_message_s
 
        if ((error = net_nfc_util_create_ndef_message(&inner_msg)) != NET_NFC_OK)
        {
-               DEBUG_MSG("net_nfc_util_create_ndef_message failed [%d]", error);
+               NFC_DBG("net_nfc_util_create_ndef_message failed [%d]", error);
 
                return error;
        }
@@ -1523,7 +1523,7 @@ net_nfc_error_e net_nfc_util_get_alternative_carrier_type_from_record(ndef_recor
 {
        if(strncmp((char*)record->type_s.buffer, CH_CAR_RECORD_TYPE, (size_t)record->type_s.length) == 0)
        {
-               DEBUG_MSG("CH_CAR_RECORD_TYPE");
+               NFC_DBG("CH_CAR_RECORD_TYPE");
 
                char ctf = record->payload_s.buffer[0] & 0x07;
                char ctype_length = record->payload_s.buffer[1];
@@ -1552,7 +1552,7 @@ net_nfc_error_e net_nfc_util_get_alternative_carrier_type_from_record(ndef_recor
                        {
                                *type = NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;
                        }
-                       break;
+               break;
                case NET_NFC_RECORD_WELL_KNOWN_TYPE:    /* NFC Forum Well-known Type*/
                case NET_NFC_RECORD_URI:                                /* Absolute URIs as defined in [RFC 3986] */
                case NET_NFC_RECORD_EXTERNAL_RTD:               /* NFC Forum external type */
@@ -1564,19 +1564,20 @@ net_nfc_error_e net_nfc_util_get_alternative_carrier_type_from_record(ndef_recor
        }
        else
        {
-               DEBUG_MSG("Other record type");
-               if (strncmp((char *)record->type_s.buffer, CONN_HANDOVER_BT_CARRIER_MIME_NAME, (size_t)record->type_s.length) == 0)
+               NFC_DBG("Other record type");
+               if (strncmp((char *)record->type_s.buffer, CONN_HANDOVER_BT_CARRIER_MIME_NAME,
+                       (size_t)record->type_s.length) == 0)
                {
                        *type = NET_NFC_CONN_HANDOVER_CARRIER_BT;
                }
                else if (strncmp((char *)record->type_s.buffer,
-                                       CONN_HANDOVER_WIFI_BSS_CARRIER_MIME_NAME,
-                                       (size_t)record->type_s.length) == 0)
+                       CONN_HANDOVER_WIFI_BSS_CARRIER_MIME_NAME,
+                       (size_t)record->type_s.length) == 0)
                {
                        *type = NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS;
                }
                else if (strncmp((char *)record->type_s.buffer,
-                                       CONN_HANDOVER_WIFI_IBSS_CARRIER_MIME_NAME,
+                       CONN_HANDOVER_WIFI_IBSS_CARRIER_MIME_NAME,
                                        (size_t)record->type_s.length) == 0)
                {
                        *type = NET_NFC_CONN_HANDOVER_CARRIER_WIFI_IBSS;
@@ -1589,27 +1590,29 @@ net_nfc_error_e net_nfc_util_get_alternative_carrier_type_from_record(ndef_recor
        return NET_NFC_OK;
 }
 
-net_nfc_error_e net_nfc_util_get_alternative_carrier_type(ndef_message_s *message, int index, net_nfc_conn_handover_carrier_type_e *type)
+net_nfc_error_e net_nfc_util_get_alternative_carrier_type(ndef_message_s *message,
+       int index, net_nfc_conn_handover_carrier_type_e *type)
 {
        ndef_record_s *record = NULL;
-       net_nfc_error_e error;
+       net_nfc_error_e ret;
 
-       error = net_nfc_util_get_carrier_config_record(message, index, (ndef_record_s **)&record);
-       if (error != NET_NFC_OK)
-       {
-               return error;
-       }
+       ret = net_nfc_util_get_carrier_config_record(message, index, &record);
+       if (ret != NET_NFC_OK)
+               return ret;
 
        return net_nfc_util_get_alternative_carrier_type_from_record(record, type);
 }
 
-net_nfc_error_e net_nfc_util_get_selector_power_status(ndef_message_s *message, net_nfc_conn_handover_carrier_state_e *power_state)
+net_nfc_error_e net_nfc_util_get_selector_power_status(ndef_message_s *message,
+       net_nfc_conn_handover_carrier_state_e *power_state)
 {
        net_nfc_error_e error;
        ndef_message_s *inner_msg = NULL;
        ndef_record_s *current = NULL;
        int idx;
-       net_nfc_conn_handover_carrier_state_e selector_state = NET_NFC_CONN_HANDOVER_CARRIER_INACTIVATE;
+       net_nfc_conn_handover_carrier_state_e selector_state;
+
+       selector_state = NET_NFC_CONN_HANDOVER_CARRIER_INACTIVATE;
 
        if (message == NULL)
        {
@@ -1625,7 +1628,8 @@ net_nfc_error_e net_nfc_util_get_selector_power_status(ndef_message_s *message,
                                current = inner_msg->records;
                                for (idx = 0; idx < inner_msg->recordCount; idx++)
                                {
-                                       if (strncmp((char *)current->type_s.buffer, ALTERNATIVE_RECORD_TYPE, (size_t)current->type_s.length) == 0)
+                                       if (strncmp((char *)current->type_s.buffer, ALTERNATIVE_RECORD_TYPE,
+                                               (size_t)current->type_s.length) == 0)
                                        {
                                                if (((current->payload_s.buffer[0] & 0x3) == NET_NFC_CONN_HANDOVER_CARRIER_ACTIVATE) || ((current->payload_s.buffer[0] & 0x3) == NET_NFC_CONN_HANDOVER_CARRIER_ACTIVATING))
                                                {
@@ -1646,14 +1650,14 @@ net_nfc_error_e net_nfc_util_get_selector_power_status(ndef_message_s *message,
                }
                else
                {
-                       DEBUG_ERR_MSG("_net_nfc_util_create_ndef_message failed [%d]", error);
+                       NFC_ERR("_net_nfc_util_create_ndef_message failed [%d]", error);
                }
 
                net_nfc_util_free_ndef_message(inner_msg);
        }
        else
        {
-               DEBUG_ERR_MSG("_net_nfc_util_create_ndef_message failed [%d]", error);
+               NFC_ERR("_net_nfc_util_create_ndef_message failed [%d]", error);
                error = NET_NFC_ALLOC_FAIL;
        }
 
index 79bbe0e..de99753 100644 (file)
@@ -34,8 +34,6 @@ typedef enum
 } CRC_type_e;
 
 void net_nfc_change_log_tag();
-void net_nfc_manager_init_log();
-void net_nfc_manager_fini_log();
 
 /* Memory utils */
 /* allocation memory */
index 16f95b9..a0dfea4 100644 (file)
@@ -58,13 +58,13 @@ int net_nfc_util_fill_va_list(uint8_t *buffer, int length, va_list list)
 
 void net_nfc_util_set_non_block_socket(int socket)
 {
-       DEBUG_SERVER_MSG("set non block socket");
+       NFC_DBG("set non block socket");
 
        int flags = fcntl(socket, F_GETFL);
        flags |= O_NONBLOCK;
 
        if (fcntl(socket, F_SETFL, flags) < 0)
        {
-               DEBUG_ERR_MSG("fcntl, executing nonblock error");
+               NFC_ERR("fcntl, executing nonblock error");
        }
 }
index e83af4e..6aed70a 100644 (file)
@@ -222,7 +222,7 @@ net_nfc_error_e net_nfc_util_convert_rawdata_to_ndef_message(
 
 error:
 
-       DEBUG_ERR_MSG("parser error");
+       NFC_ERR("parser error");
 
        if (newRec)
        {
@@ -369,7 +369,7 @@ net_nfc_error_e net_nfc_util_append_record(ndef_message_s *msg, ndef_record_s *r
 
                msg->recordCount++;
 
-               DEBUG_MSG("record is added to NDEF message :: count [%d]", msg->recordCount);
+               NFC_DBG("record is added to NDEF message :: count [%d]", msg->recordCount);
        }
        else
        {
@@ -442,27 +442,27 @@ void net_nfc_util_print_ndef_message(ndef_message_s *msg)
        }
 
        //                123456789012345678901234567890123456789012345678901234567890
-       DEBUG_MSG("========== NDEF Message ====================================\n");
-       DEBUG_MSG("Total NDEF Records count: %d\n", msg->recordCount);
+       NFC_DBG("========== NDEF Message ====================================\n");
+       NFC_DBG("Total NDEF Records count: %d\n", msg->recordCount);
        current = msg->records;
        for (idx = 0; idx < msg->recordCount; idx++)
        {
                if (current == NULL)
                {
-                       DEBUG_ERR_MSG("Message Record is NULL!! unexpected error");
-                       DEBUG_MSG("============================================================\n");
+                       NFC_ERR("Message Record is NULL!! unexpected error");
+                       NFC_DBG("============================================================\n");
                        return;
                }
-               DEBUG_MSG("---------- Record -----------------------------------------\n");
-               DEBUG_MSG("MB:%d ME:%d CF:%d SR:%d IL:%d TNF:0x%02X\n",
+               NFC_DBG("---------- Record -----------------------------------------\n");
+               NFC_DBG("MB:%d ME:%d CF:%d SR:%d IL:%d TNF:0x%02X\n",
                                current->MB, current->ME, current->CF, current->SR, current->IL, current->TNF);
-               DEBUG_MSG("TypeLength:%d  PayloadLength:%d  IDLength:%d\n",
+               NFC_DBG("TypeLength:%d  PayloadLength:%d  IDLength:%d\n",
                                current->type_s.length, current->payload_s.length, current->id_s.length);
                if (current->type_s.buffer != NULL)
                {
                        memcpy(buffer, current->type_s.buffer, current->type_s.length);
                        buffer[current->type_s.length] = '\0';
-                       DEBUG_MSG("Type: %s\n", buffer);
+                       NFC_DBG("Type: %s\n", buffer);
                }
                if (current->id_s.buffer != NULL)
                {
@@ -472,19 +472,19 @@ void net_nfc_util_print_ndef_message(ndef_message_s *msg)
                }
                if (current->payload_s.buffer != NULL)
                {
-                       DEBUG_MSG("Payload: ");
+                       NFC_DBG("Payload: ");
                        for (idx2 = 0; idx2 < current->payload_s.length; idx2++)
                        {
                                if (idx2 % 16 == 0)
-                                       DEBUG_MSG("\n\t");
-                               DEBUG_MSG("%02X ", current->payload_s.buffer[idx2]);
+                                       NFC_DBG("\n\t");
+                               NFC_DBG("%02X ", current->payload_s.buffer[idx2]);
                        }
-                       DEBUG_MSG("\n");
+                       NFC_DBG("\n");
                }
                current = current->next;
        }
        //                123456789012345678901234567890123456789012345678901234567890
-       DEBUG_MSG("============================================================\n");
+       NFC_DBG("============================================================\n");
 
 }
 
index 0fe395a..7455e79 100644 (file)
@@ -359,7 +359,7 @@ net_nfc_error_e net_nfc_util_create_uri_string_from_uri_record(ndef_record_s *re
                }
                else
                {
-                       DEBUG_ERR_MSG("invalid payload in record");
+                       NFC_ERR("invalid payload in record");
                }
        }
        else if (record->TNF == NET_NFC_RECORD_URI)
@@ -382,7 +382,7 @@ net_nfc_error_e net_nfc_util_create_uri_string_from_uri_record(ndef_record_s *re
        }
        else
        {
-               DEBUG_ERR_MSG("no uri record");
+               NFC_ERR("no uri record");
                result = NET_NFC_NDEF_RECORD_IS_NOT_EXPECTED_TYPE;
        }
 
index 4a9810a..f72ed3e 100644 (file)
@@ -75,7 +75,7 @@ static X509 *_load_certificate_from_mem(int format, uint8_t *buffer, uint32_t le
        }
        else
        {
-               DEBUG_ERR_MSG("X509_LOOKUP_load_file failed");
+               NFC_ERR("X509_LOOKUP_load_file failed");
        }
 
        return x509;
@@ -106,24 +106,24 @@ static X509 *_load_certificate_from_mem(int format, uint8_t *buffer, uint32_t le
 //                             }
 //                             else
 //                             {
-//                                     DEBUG_ERR_MSG("X509_STORE_add_lookup failed");
+//                                     NFC_ERR("X509_STORE_add_lookup failed");
 //                             }
 //                     }
 //                     else
 //                     {
-//                             DEBUG_ERR_MSG("X509_LOOKUP_load_file failed");
+//                             NFC_ERR("X509_LOOKUP_load_file failed");
 //                     }
 //             }
 //             else
 //             {
-//                     DEBUG_ERR_MSG("X509_STORE_add_lookup failed");
+//                     NFC_ERR("X509_STORE_add_lookup failed");
 //             }
 //
 //             X509_STORE_free(cert_ctx);
 //     }
 //     else
 //     {
-//             DEBUG_ERR_MSG("X509_STORE_new failed");
+//             NFC_ERR("X509_STORE_new failed");
 //     }
 //
 //     return ret;
@@ -143,12 +143,12 @@ net_nfc_openssl_verify_context_s *net_nfc_util_openssl_init_verify_certificate(v
                }
                else
                {
-                       DEBUG_ERR_MSG("X509_STORE_new failed");
+                       NFC_ERR("X509_STORE_new failed");
                }
        }
        else
        {
-               DEBUG_ERR_MSG("alloc failed [%d]", sizeof(net_nfc_openssl_verify_context_s));
+               NFC_ERR("alloc failed [%d]", sizeof(net_nfc_openssl_verify_context_s));
        }
 
        return result;
@@ -217,14 +217,14 @@ int net_nfc_util_openssl_verify_certificate(net_nfc_openssl_verify_context_s *co
                }
                else
                {
-                       DEBUG_ERR_MSG("X509_STORE_CTX_init failed");
+                       NFC_ERR("X509_STORE_CTX_init failed");
                }
 
                X509_STORE_CTX_free(store_ctx);
        }
        else
        {
-               DEBUG_ERR_MSG("X509_STORE_CTX_new failed");
+               NFC_ERR("X509_STORE_CTX_new failed");
        }
 
        return result;
@@ -260,14 +260,14 @@ static int _load_pkcs12(BIO *in, const char *password, EVP_PKEY **pkey, X509 **c
                }
                else
                {
-                       DEBUG_ERR_MSG("Mac verify error (wrong password?) in PKCS12 file");
+                       NFC_ERR("Mac verify error (wrong password?) in PKCS12 file");
                }
 
                PKCS12_free(p12);
        }
        else
        {
-               DEBUG_ERR_MSG("Error loading PKCS12 file");
+               NFC_ERR("Error loading PKCS12 file");
        }
 
        return ret;
@@ -280,7 +280,7 @@ EVP_PKEY *_load_key(const char *file, int format, const char *pass, ENGINE *e)
 
        if (file == NULL)
        {
-               DEBUG_ERR_MSG("no keyfile specified\n");
+               NFC_ERR("no keyfile specified\n");
                return pkey;
        }
 
@@ -291,12 +291,12 @@ EVP_PKEY *_load_key(const char *file, int format, const char *pass, ENGINE *e)
                        pkey = ENGINE_load_private_key(e, file, NULL/*ui_method*/, (void *)pass);
                        if (!pkey)
                        {
-                               DEBUG_ERR_MSG("cannot load key from engine");
+                               NFC_ERR("cannot load key from engine");
                        }
                }
                else
                {
-                       DEBUG_ERR_MSG("no engine specified");
+                       NFC_ERR("no engine specified");
                }
        }
        else
@@ -318,7 +318,7 @@ EVP_PKEY *_load_key(const char *file, int format, const char *pass, ENGINE *e)
                                case OPENSSL_FORMAT_PKCS12 :
                                        if (_load_pkcs12(key, pass, &pkey, NULL, NULL) == false)
                                        {
-                                               DEBUG_ERR_MSG("_load_pkcs12 failed");
+                                               NFC_ERR("_load_pkcs12 failed");
                                        }
                                        break;
 
@@ -331,20 +331,20 @@ EVP_PKEY *_load_key(const char *file, int format, const char *pass, ENGINE *e)
                                        break;
 
                                default :
-                                       DEBUG_ERR_MSG("bad input format specified for key file");
+                                       NFC_ERR("bad input format specified for key file");
                                        break;
                                }
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("Error opening %s", file);
+                               NFC_ERR("Error opening %s", file);
                        }
 
                        BIO_free(key);
                }
                else
                {
-                       DEBUG_ERR_MSG("BIO_new failed");
+                       NFC_ERR("BIO_new failed");
                }
        }
 
@@ -358,7 +358,7 @@ EVP_PKEY *_load_pubkey(const char *file, int format, const char *pass, ENGINE *e
 
        if (file == NULL)
        {
-               DEBUG_ERR_MSG("no keyfile specified");
+               NFC_ERR("no keyfile specified");
                return pkey;
        }
 
@@ -370,7 +370,7 @@ EVP_PKEY *_load_pubkey(const char *file, int format, const char *pass, ENGINE *e
                }
                else
                {
-                       DEBUG_ERR_MSG("no engine specified");
+                       NFC_ERR("no engine specified");
                }
        }
        else
@@ -426,20 +426,20 @@ EVP_PKEY *_load_pubkey(const char *file, int format, const char *pass, ENGINE *e
                                        break;
 
                                default :
-                                       DEBUG_ERR_MSG("bad input format specified for key file");
+                                       NFC_ERR("bad input format specified for key file");
                                        break;
                                }
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("Error opening %s %s", key_descrip, file);
+                               NFC_ERR("Error opening %s %s", key_descrip, file);
                        }
 
                        BIO_free(key);
                }
                else
                {
-                       DEBUG_ERR_MSG("BIO_new failed");
+                       NFC_ERR("BIO_new failed");
                }
        }
 
@@ -567,7 +567,7 @@ int net_nfc_util_openssl_verify_signature(uint32_t type, uint8_t *buffer, uint32
        EVP_DigestVerifyUpdate(&ctx, buffer, length);
        result = EVP_DigestVerifyFinal(&ctx, sign, sign_len);
 
-       DEBUG_MSG("EVP_DigestVerifyFinal returns %d", result);
+       NFC_DBG("EVP_DigestVerifyFinal returns %d", result);
 
        return result;
 }
@@ -608,7 +608,7 @@ int net_nfc_util_get_cert_list_from_file(char *file_name, char *password, uint8_
                                        }
                                }
 
-                               DEBUG_MSG("count = %d, length = %d", sk_X509_INFO_num(xis), temp_len);
+                               NFC_DBG("count = %d, length = %d", sk_X509_INFO_num(xis), temp_len);
                                *length = temp_len;
                                _net_nfc_util_alloc_mem(*buffer, temp_len);
 
@@ -638,7 +638,7 @@ int net_nfc_util_get_cert_list_from_file(char *file_name, char *password, uint8_
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("PEM_X509_INFO_read_bio failed");
+                               NFC_ERR("PEM_X509_INFO_read_bio failed");
                        }
                }
 
@@ -691,7 +691,7 @@ int net_nfc_util_get_cert_list_from_file(char *file_name, char *password, uint8_
                                        }
                                }
 
-                               DEBUG_MSG("count = %d, length = %d", sk_X509_num(ca) + 1, temp_len);
+                               NFC_DBG("count = %d, length = %d", sk_X509_num(ca) + 1, temp_len);
                                *length = temp_len;
                                _net_nfc_util_alloc_mem(*buffer, temp_len);
 
@@ -732,7 +732,7 @@ int net_nfc_util_get_cert_list_from_file(char *file_name, char *password, uint8_
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("PEM_X509_INFO_read_bio failed");
+                               NFC_ERR("PEM_X509_INFO_read_bio failed");
                        }
                }
 
@@ -773,7 +773,7 @@ bool net_nfc_util_openssl_encode_base64(const uint8_t *buffer, const uint32_t bu
        }
        else
        {
-               DEBUG_ERR_MSG("not enough result buffer");
+               NFC_ERR("not enough result buffer");
        }
 
        BIO_free_all(b64);
@@ -815,14 +815,14 @@ bool net_nfc_util_openssl_decode_base64(const char *buffer, uint8_t *result, uin
                }
                else
                {
-                       DEBUG_ERR_MSG("not enough result buffer");
+                       NFC_ERR("not enough result buffer");
                }
 
                _net_nfc_util_free_mem(temp);
        }
        else
        {
-               DEBUG_ERR_MSG("alloc failed");
+               NFC_ERR("alloc failed");
        }
 
        return ret;
@@ -854,7 +854,7 @@ bool net_nfc_util_openssl_digest(const char *algorithm, const uint8_t *buffer, c
                        EVP_DigestInit(&mdCtx, md);
                        if (EVP_DigestUpdate(&mdCtx, buffer, buf_len) != 0)
                        {
-                               DEBUG_ERR_MSG("EVP_DigestUpdate failed");
+                               NFC_ERR("EVP_DigestUpdate failed");
                        }
                        EVP_DigestFinal(&mdCtx, temp, &resultLen);
 
@@ -866,19 +866,19 @@ bool net_nfc_util_openssl_digest(const char *algorithm, const uint8_t *buffer, c
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("not enough result buffer");
+                               NFC_ERR("not enough result buffer");
                        }
 
                        _net_nfc_util_free_mem(temp);
                }
                else
                {
-                       DEBUG_ERR_MSG("alloc failed");
+                       NFC_ERR("alloc failed");
                }
        }
        else
        {
-               DEBUG_ERR_MSG("EVP_get_digestbyname(\"%s\") returns NULL", algorithm);
+               NFC_ERR("EVP_get_digestbyname(\"%s\") returns NULL", algorithm);
        }
 
        return ret;
index f6ada37..6253e5e 100644 (file)
@@ -134,16 +134,16 @@ net_nfc_error_e net_nfc_util_verify_signature_records(ndef_record_s *begin_recor
                /* parse signature info */
                sign_info = (net_nfc_signature_record_s *)sign_record->payload_s.buffer;
 
-               DEBUG_MSG("record version : %d", sign_info->version);
-               DEBUG_MSG("signature URI present? : %s", sign_info->uri_present ? "true" : "false");
-               DEBUG_MSG("signature type : %d", sign_info->sign_type);
-               DEBUG_MSG("signature length : %d", sign_info->signature.length);
+               NFC_DBG("record version : %d", sign_info->version);
+               NFC_DBG("signature URI present? : %s", sign_info->uri_present ? "true" : "false");
+               NFC_DBG("signature type : %d", sign_info->sign_type);
+               NFC_DBG("signature length : %d", sign_info->signature.length);
 
                if (sign_info->uri_present == true)
                {
                        /* TODO */
                        /* receive the signature data directed by uri */
-                       DEBUG_ERR_MSG("NOT IMPLEMENTED (sign_info->uri_present == true)");
+                       NFC_ERR("NOT IMPLEMENTED (sign_info->uri_present == true)");
                        _net_nfc_util_free_mem(buffer);
                        return result;
                }
@@ -152,15 +152,15 @@ net_nfc_error_e net_nfc_util_verify_signature_records(ndef_record_s *begin_recor
                chain_info = (net_nfc_certificate_chain_s *)__NEXT_SUB_FIELD(&(sign_info->signature));
 
                SECURE_LOGD("certificate URI present? : %s", chain_info->uri_present ? "true" : "false");
-               DEBUG_MSG("certificate format : %d", chain_info->cert_format);
-               DEBUG_MSG("number of certificates : %d", chain_info->num_of_certs);
+               NFC_DBG("certificate format : %d", chain_info->cert_format);
+               NFC_DBG("number of certificates : %d", chain_info->num_of_certs);
 
                if (chain_info->num_of_certs > 0)
                {
                        net_nfc_sub_field_s *data_info = NULL;
 
                        data_info = (net_nfc_sub_field_s *)chain_info->cert_store;
-                       DEBUG_MSG("certficate length : %d", data_info->length);
+                       NFC_DBG("certficate length : %d", data_info->length);
 
                        //              DEBUG_MSG_PRINT_BUFFER(data_info->value, data_info->length);
 
@@ -184,7 +184,7 @@ net_nfc_error_e net_nfc_util_verify_signature_records(ndef_record_s *begin_recor
                                                        i < chain_info->num_of_certs;
                                                        i++, data_info = (net_nfc_sub_field_s *)__NEXT_SUB_FIELD(data_info))
                                        {
-                                               DEBUG_MSG("certficate length : %d", data_info->length);
+                                               NFC_DBG("certficate length : %d", data_info->length);
                                                //DEBUG_MSG_PRINT_BUFFER(data_info->value, data_info->length);
 
                                                net_nfc_util_openssl_add_certificate_of_ca(context, data_info->value, data_info->length);
@@ -194,12 +194,12 @@ net_nfc_error_e net_nfc_util_verify_signature_records(ndef_record_s *begin_recor
                                        if (chain_info->uri_present == true)
                                        {
                                                /* TODO : Need to implement */
-                                               DEBUG_ERR_MSG("NOT IMPLEMENTED (found_root == false && chain_info->uri_present == true)");
+                                               NFC_ERR("NOT IMPLEMENTED (found_root == false && chain_info->uri_present == true)");
                                                net_nfc_util_openssl_release_verify_certificate(context);
                                                _net_nfc_util_free_mem(buffer);
                                                return result;
 
-                                               //DEBUG_MSG("certficate length : %d", data_info->length);
+                                               //NFC_DBG("certficate length : %d", data_info->length);
                                                //DEBUG_MSG_PRINT_BUFFER(data_info->value, data_info->length);
                                        }
 
@@ -215,16 +215,16 @@ net_nfc_error_e net_nfc_util_verify_signature_records(ndef_record_s *begin_recor
                                        result = NET_NFC_OK;
                                }
 
-                               DEBUG_MSG("verifying signature %d", result);
+                               NFC_DBG("verifying signature %d", result);
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("verifying signature failed");
+                               NFC_ERR("verifying signature failed");
                        }
                }
                else
                {
-                       DEBUG_ERR_MSG("certificate not found");
+                       NFC_ERR("certificate not found");
                }
 
                _net_nfc_util_free_mem(buffer);
@@ -235,7 +235,7 @@ net_nfc_error_e net_nfc_util_verify_signature_records(ndef_record_s *begin_recor
                {
                        _net_nfc_util_free_mem(buffer);
                }
-               DEBUG_ERR_MSG("_get_records_data_buffer failed");
+               NFC_ERR("_get_records_data_buffer failed");
        }
 
        return result;
@@ -293,7 +293,7 @@ net_nfc_error_e net_nfc_util_sign_records(ndef_message_s *msg, int begin_index,
        net_nfc_util_get_record_by_index(msg, begin_index, &begin_record);
        net_nfc_util_get_record_by_index(msg, end_index, &end_record);
 
-       DEBUG_MSG("total record count : %d, begin_index : %d, end_index : %d", msg->recordCount, begin_index, end_index);
+       NFC_DBG("total record count : %d, begin_index : %d, end_index : %d", msg->recordCount, begin_index, end_index);
 
        /* get target data */
        _get_records_data_buffer(begin_record, end_record->next, &data_buffer, &data_len);
@@ -341,7 +341,7 @@ net_nfc_error_e net_nfc_util_sign_records(ndef_message_s *msg, int begin_index,
        if (chain->uri_present)
        {
                /* TODO */
-               DEBUG_ERR_MSG("num_of_certs is greater than 15 [%d]", cert_count);
+               NFC_ERR("num_of_certs is greater than 15 [%d]", cert_count);
        }
 
        /* create record */
index 6a79137..6b087f6 100644 (file)
@@ -79,7 +79,7 @@ static void _name_owner_changed(GDBusProxy *proxy,
                const gchar *new_owner, void *user_data)
 {
        if (name == NULL || old_owner == NULL || new_owner == NULL) {
-               DEBUG_ERR_MSG("invalid parameter");
+               NFC_ERR("invalid parameter");
 
                return;
        }
@@ -152,7 +152,7 @@ static void net_nfc_server_gdbus_init(void)
        connection = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
        if (connection == NULL)
        {
-               DEBUG_ERR_MSG("Can not get connection %s", error->message);
+               NFC_ERR("Can not get connection %s", error->message);
                g_error_free (error);
                return;
        }
@@ -161,67 +161,67 @@ static void net_nfc_server_gdbus_init(void)
 
        if (net_nfc_server_manager_init(connection) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not init manager");
+               NFC_ERR("Can not init manager");
                return;
        }
 
        if (net_nfc_server_tag_init(connection) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not init tag");
+               NFC_ERR("Can not init tag");
                return;
        }
 
        if (net_nfc_server_ndef_init(connection) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not init ndef");
+               NFC_ERR("Can not init ndef");
                return;
        }
 
        if (net_nfc_server_llcp_init(connection) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not init llcp");
+               NFC_ERR("Can not init llcp");
                return;
        }
 
        if (net_nfc_server_p2p_init(connection) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not init tag");
+               NFC_ERR("Can not init tag");
                return;
        }
 
        if (net_nfc_server_transceive_init(connection) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not initialize transceive");
+               NFC_ERR("Can not initialize transceive");
                return;
        }
 
        if (net_nfc_server_handover_init(connection) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not initialize transceive");
+               NFC_ERR("Can not initialize transceive");
                return;
        }
 
        if (net_nfc_server_se_init(connection) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not init Test");
+               NFC_ERR("Can not init Test");
                return;
        }
 
        if (net_nfc_server_snep_init(connection) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not init controller thread");
+               NFC_ERR("Can not init controller thread");
                return;
        }
 
        if (net_nfc_server_system_handler_init(connection) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not init controller thread");
+               NFC_ERR("Can not init controller thread");
                return;
        }
 
        if (net_nfc_server_controller_thread_init() == FALSE)
        {
-               DEBUG_ERR_MSG("Can not init controller thread");
+               NFC_ERR("Can not init controller thread");
                return;
        }
 
@@ -255,7 +255,7 @@ static void net_nfc_server_gdbus_deinit(void)
 
 void net_nfc_manager_quit()
 {
-       DEBUG_MSG("net_nfc_manager_quit kill the nfc-manager daemon!!");
+       NFC_DBG("net_nfc_manager_quit kill the nfc-manager daemon!!");
 
        if (loop != NULL)
                g_main_loop_quit(loop);
@@ -266,7 +266,7 @@ static void on_bus_acquired(GDBusConnection *connection, const gchar *path,
 {
        gint state;
 
-       DEBUG_MSG("bus path : %s", path);
+       NFC_DBG("bus path : %s", path);
 
        net_nfc_server_gdbus_init();
 
@@ -274,7 +274,7 @@ static void on_bus_acquired(GDBusConnection *connection, const gchar *path,
 
        if (vconf_get_bool(VCONFKEY_NFC_STATE, &state) != 0)
        {
-               DEBUG_MSG("VCONFKEY_NFC_STATE is not exist");
+               NFC_DBG("VCONFKEY_NFC_STATE is not exist");
                net_nfc_manager_quit();
 
                return;
@@ -293,13 +293,13 @@ static void on_bus_acquired(GDBusConnection *connection, const gchar *path,
 static void on_name_acquired(GDBusConnection *connection, const gchar *name,
                gpointer user_data)
 {
-       DEBUG_SERVER_MSG("name : %s", name);
+       NFC_INFO("name : %s", name);
 }
 
 static void on_name_lost(GDBusConnection *connnection, const gchar *name,
                gpointer user_data)
 {
-       DEBUG_SERVER_MSG("name : %s", name);
+       NFC_INFO("name : %s", name);
 
        net_nfc_manager_quit();
 }
@@ -321,36 +321,34 @@ int main(int argc, char *argv[])
 
        if (g_option_context_parse(option_context, &argc, &argv, &error) == FALSE)
        {
-               DEBUG_ERR_MSG("can not parse option: %s", error->message);
+               NFC_ERR("can not parse option: %s", error->message);
                g_error_free(error);
 
                g_option_context_free(option_context);
                return 0;
        }
 
-       DEBUG_SERVER_MSG("start nfc manager");
-       DEBUG_SERVER_MSG("use_daemon : %d", use_daemon);
-
-       net_nfc_manager_init_log();
+       NFC_DBG("start nfc manager");
+       NFC_INFO("use_daemon : %d", use_daemon);
 
        net_nfc_app_util_clean_storage(MESSAGE_STORAGE);
 
        handle = net_nfc_controller_onload();
        if (handle == NULL)
        {
-               DEBUG_ERR_MSG("load plugin library is failed");
+               NFC_ERR("load plugin library is failed");
 
                if (vconf_set_bool(VCONFKEY_NFC_FEATURE, VCONFKEY_NFC_FEATURE_OFF) != 0)
-                       DEBUG_ERR_MSG("VCONFKEY_NFC_FEATURE set to %d failed", VCONFKEY_NFC_FEATURE_OFF);
+                       NFC_ERR("VCONFKEY_NFC_FEATURE set to %d failed", VCONFKEY_NFC_FEATURE_OFF);
 
                if (vconf_set_bool(VCONFKEY_NFC_STATE, 0) != 0)
-                       DEBUG_ERR_MSG("VCONFKEY_NFC_STATE set to %d failed", 0);
+                       NFC_ERR("VCONFKEY_NFC_STATE set to %d failed", 0);
 
                goto EXIT;
        }
 
        if (vconf_set_bool(VCONFKEY_NFC_FEATURE, VCONFKEY_NFC_FEATURE_ON) != 0)
-               DEBUG_ERR_MSG("VCONFKEY_NFC_FEATURE set to %d failed", VCONFKEY_NFC_FEATURE_ON);
+               NFC_ERR("VCONFKEY_NFC_FEATURE set to %d failed", VCONFKEY_NFC_FEATURE_ON);
 
        id = g_bus_own_name(G_BUS_TYPE_SYSTEM,
                        "org.tizen.NetNfcService",
@@ -374,8 +372,6 @@ EXIT :
 
        net_nfc_controller_unload(handle);
 
-       net_nfc_manager_fini_log();
-
        g_option_context_free(option_context);
 
        return 0;
index 3831c6a..79b5529 100644 (file)
@@ -168,7 +168,7 @@ static void _controller_llcp_event_cb(gpointer user_data)
 
        if (req_msg == NULL)
        {
-               DEBUG_ERR_MSG("can not get llcp_event info");
+               NFC_ERR("can not get llcp_event info");
 
                return;
        }
@@ -265,7 +265,7 @@ static void controller_llcp_event_cb(void *info, void *user_context)
        if(net_nfc_server_controller_async_queue_push(
                                _controller_llcp_event_cb, info) == FALSE)
        {
-               DEBUG_ERR_MSG("Failed to push onto the queue");
+               NFC_ERR("Failed to push onto the queue");
        }
 }
 
@@ -275,33 +275,33 @@ static void controller_init_thread_func(gpointer user_data)
 
        if (net_nfc_controller_init(&result) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_init failed, [%d]", result);
+               NFC_ERR("net_nfc_controller_init failed, [%d]", result);
 
                net_nfc_manager_quit();
                return;
        }
 
-       INFO_MSG("net_nfc_controller_init success, [%d]", result);
+       NFC_INFO("net_nfc_controller_init success, [%d]", result);
 
        if (net_nfc_controller_register_listener(controller_target_detected_cb,
                                controller_se_transaction_cb,
                                controller_llcp_event_cb,
                                &result) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_contorller_register_listener failed [%d]",
+               NFC_ERR("net_nfc_contorller_register_listener failed [%d]",
                                result);
        }
 
-       INFO_MSG("net_nfc_contorller_register_listener success");
+       NFC_INFO("net_nfc_contorller_register_listener success");
 
        result = net_nfc_server_llcp_set_config(NULL);
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_server_llcp_set config failed, [%d]",
+               NFC_ERR("net_nfc_server_llcp_set config failed, [%d]",
                                result);
        }
 
-       INFO_MSG("net_nfc_server_llcp_set_config success");
+       NFC_INFO("net_nfc_server_llcp_set_config success");
 }
 
 #ifndef ESE_ALWAYS_ON
@@ -313,18 +313,18 @@ static void controller_deinit_thread_func(gpointer user_data)
                                NET_NFC_ALL_DISABLE,
                                &result) == false) {
 
-               DEBUG_ERR_MSG("net_nfc_controller_configure_discovery failed, [%d]", result);
+               NFC_ERR("net_nfc_controller_configure_discovery failed, [%d]", result);
        }
 
        net_nfc_server_free_target_info();
 
        if (net_nfc_controller_deinit() == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_deinit failed, [%d]", result);
+               NFC_ERR("net_nfc_controller_deinit failed, [%d]", result);
                return;
        }
 
-       INFO_MSG("net_nfc_controller_deinit success");
+       NFC_INFO("net_nfc_controller_deinit success");
 
        net_nfc_manager_quit();
 }
@@ -339,16 +339,15 @@ static void restart_polling_loop_thread_func(gpointer user_data)
        net_nfc_error_e result;
 
        if (vconf_get_bool(VCONFKEY_NFC_STATE, &state) != 0)
-               DEBUG_ERR_MSG("%s does not exist", "VCONFKEY_NFC_STATE");
+               NFC_ERR("%s does not exist", "VCONFKEY_NFC_STATE");
 
        if (state == 0)
                return;
 
        if (vconf_get_int(VCONFKEY_PM_STATE, &pm_state) != 0)
-               DEBUG_ERR_MSG("%s does not exist", "VCONFKEY_PM_STATE");
+               NFC_ERR("%s does not exist", "VCONFKEY_PM_STATE");
 
-       DEBUG_SERVER_MSG("net_nfc_service_restart_polling, state = [%d]",
-                       pm_state);
+       NFC_DBG("net_nfc_service_restart_polling, state = [%d]", pm_state);
 
        if (pm_state == VCONFKEY_PM_STATE_NORMAL)
        {
@@ -357,7 +356,7 @@ static void restart_polling_loop_thread_func(gpointer user_data)
                                        NET_NFC_ALL_ENABLE,
                                        &result) == true)
                {
-                       DEBUG_SERVER_MSG("polling enable");
+                       NFC_DBG("polling enable");
                }
 
                return;
@@ -370,7 +369,7 @@ static void restart_polling_loop_thread_func(gpointer user_data)
                                        NET_NFC_ALL_DISABLE,
                                        &result) == true)
                {
-                       DEBUG_SERVER_MSG("polling disabled");
+                       NFC_DBG("polling disabled");
                }
 
                return;
@@ -391,7 +390,7 @@ gboolean net_nfc_server_controller_thread_init(void)
 
        if (controller_thread == NULL)
        {
-               DEBUG_ERR_MSG("can not create controller thread: %s",
+               NFC_ERR("can not create controller thread: %s",
                                error->message);
                g_error_free(error);
                return FALSE;
@@ -406,7 +405,7 @@ void net_nfc_server_controller_thread_deinit(void)
                                controller_thread_deinit_thread_func,
                                NULL)==FALSE)
        {
-               DEBUG_ERR_MSG("Failed to push onto the queue");
+               NFC_ERR("Failed to push onto the queue");
        }
 
        g_thread_join(controller_thread);
@@ -422,7 +421,7 @@ void net_nfc_server_controller_init(void)
                                controller_init_thread_func,
                                NULL)==FALSE)
        {
-               DEBUG_ERR_MSG("Failed to push onto the queue");
+               NFC_ERR("Failed to push onto the queue");
        }
 }
 
@@ -434,7 +433,7 @@ void net_nfc_server_controller_deinit(void)
        ret = net_nfc_server_controller_async_queue_push(controller_deinit_thread_func, NULL);
        if (FALSE == ret)
        {
-               DEBUG_ERR_MSG("Failed to push onto the queue");
+               NFC_ERR("Failed to push onto the queue");
        }
 }
 #endif
@@ -447,7 +446,7 @@ gboolean net_nfc_server_controller_async_queue_push(
 
        if(controller_async_queue == NULL)
        {
-               DEBUG_ERR_MSG("controller_async_queue is not initialized");
+               NFC_ERR("controller_async_queue is not initialized");
 
                return FALSE;
        }
@@ -467,7 +466,7 @@ void net_nfc_server_restart_polling_loop(void)
                                restart_polling_loop_thread_func,
                                NULL) == FALSE)
        {
-               DEBUG_ERR_MSG("Failed to push onto the queue");
+               NFC_ERR("Failed to push onto the queue");
        }
 }
 
index 87418a0..49b474c 100644 (file)
@@ -88,7 +88,7 @@ bool net_nfc_server_gdbus_check_privilege(GDBusMethodInvocation *invocation,
        net_nfc_util_free_data(&priv);
 
        if (result < 0) {
-               DEBUG_ERR_MSG("permission denied : \"%s\", \"%s\"", object, right);
+               NFC_ERR("permission denied : \"%s\", \"%s\"", object, right);
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.Privilege",
                                "Permission denied");
@@ -161,7 +161,7 @@ void net_nfc_server_gdbus_add_client_context(const char *id,
                        pid_t pid;
 
                        pid = net_nfc_server_gdbus_get_pid(id);
-                       DEBUG_SERVER_MSG("added client id : [%s], pid [%d]", id, pid);
+                       NFC_DBG("added client id : [%s], pid [%d]", id, pid);
 
                        info->id = g_strdup(id);
                        info->pid = pid;
@@ -174,12 +174,12 @@ void net_nfc_server_gdbus_add_client_context(const char *id,
                                        (gpointer)info->id,
                                        (gpointer)info);
 
-                       DEBUG_SERVER_MSG("current client count = [%d]",
+                       NFC_DBG("current client count = [%d]",
                                        net_nfc_server_gdbus_get_client_count_no_lock());
                }
                else
                {
-                       DEBUG_ERR_MSG("alloc failed");
+                       NFC_ERR("alloc failed");
                }
        }
 
@@ -195,14 +195,13 @@ void net_nfc_server_gdbus_cleanup_client_context(const char *id)
        info = net_nfc_server_gdbus_get_client_context_no_lock(id);
        if (info != NULL)
        {
-               DEBUG_SERVER_MSG("clean up client context, [%s, %d]", info->id,
-                               info->pid);
+               NFC_DBG("clean up client context, [%s, %d]", info->id, info->pid);
 
                g_hash_table_remove(client_contexts, id);
 
                _cleanup_client_context(info);
 
-               DEBUG_SERVER_MSG("current client count = [%d]",
+               NFC_DBG("current client count = [%d]",
                                net_nfc_server_gdbus_get_client_count_no_lock());
 
                ///* TODO : exit when no client */
index a576aa7..58b575a 100644 (file)
 #include "net_nfc_debug_internal.h"
 #include "net_nfc_server_tag.h"
 
-#define NET_NFC_OEM_LIBRARY_PATH "/usr/lib/libnfc-plugin.so"
 #define NET_NFC_DEFAULT_PLUGIN "libnfc-plugin.so"
 
-
 static net_nfc_oem_interface_s g_interface;
 
 static void *net_nfc_controller_load_file(const char *dir_path,
@@ -50,22 +48,22 @@ static void *net_nfc_controller_load_file(const char *dir_path,
        bool (*onload)(net_nfc_oem_interface_s *interfaces);
 
        snprintf(path, PATH_MAX, "%s/%s", dir_path, filename);
-       DEBUG_SERVER_MSG("path : %s", path);
+       NFC_DBG("path : %s", path);
 
        if (stat(path, &st) == -1) {
-               DEBUG_ERR_MSG("stat failed : file not found");
+               NFC_ERR("stat failed : file not found");
                goto ERROR;
        }
 
        if (S_ISREG(st.st_mode) == 0) {
-               DEBUG_ERR_MSG("S_ISREG(st.st_mode) == 0");
+               NFC_ERR("S_ISREG(st.st_mode) == 0");
                goto ERROR;
        }
 
        handle = dlopen(path, RTLD_LAZY);
        if (handle == NULL) {
                char buffer[1024];
-               DEBUG_ERR_MSG("dlopen failed, [%d] : %s",
+               NFC_ERR("dlopen failed, [%d] : %s",
                                errno, strerror_r(errno, buffer, sizeof(buffer)));
                goto ERROR;
        }
@@ -73,19 +71,19 @@ static void *net_nfc_controller_load_file(const char *dir_path,
        onload = dlsym(handle, "onload");
        if (onload == NULL) {
                char buffer[1024];
-               DEBUG_ERR_MSG("dlsym failed, [%d] : %s",
+               NFC_ERR("dlsym failed, [%d] : %s",
                                errno, strerror_r(errno, buffer, sizeof(buffer)));
                goto ERROR;
        }
 
        memset(&g_interface, 0, sizeof(g_interface));
        if (onload(&g_interface) == false) {
-               DEBUG_ERR_MSG("onload failed");
+               NFC_ERR("onload failed");
                goto ERROR;
        }
 
        if (net_nfc_controller_support_nfc(&result) == false) {
-               DEBUG_ERR_MSG("net_nfc_controller_support_nfc failed, [%d]",
+               NFC_ERR("net_nfc_controller_support_nfc failed, [%d]",
                                result);
                goto ERROR;
        }
@@ -110,7 +108,7 @@ void *net_nfc_controller_onload()
        dirp = opendir(NFC_MANAGER_MODULEDIR);
        if (dirp == NULL)
        {
-               DEBUG_ERR_MSG("Can not open directory %s", NFC_MANAGER_MODULEDIR);
+               NFC_ERR("Can not open directory %s", NFC_MANAGER_MODULEDIR);
                return NULL;
        }
 
@@ -147,12 +145,12 @@ void *net_nfc_controller_onload()
 
        if (handle)
        {
-               DEBUG_SERVER_MSG("loaded default plugin : %s", NET_NFC_DEFAULT_PLUGIN);
+               NFC_DBG("loaded default plugin : %s", NET_NFC_DEFAULT_PLUGIN);
                return handle;
        }
        else
        {
-               DEBUG_ERR_MSG("can not load default plugin : %s", NET_NFC_DEFAULT_PLUGIN);
+               NFC_ERR("can not load default plugin : %s", NET_NFC_DEFAULT_PLUGIN);
                return NULL;
        }
 }
@@ -177,8 +175,8 @@ bool net_nfc_controller_init(net_nfc_error_e *result)
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -191,7 +189,7 @@ bool net_nfc_controller_deinit(void)
        }
        else
        {
-               DEBUG_SERVER_MSG("interface is null");
+               NFC_ERR("interface is null");
                return false;
        }
 }
@@ -208,8 +206,8 @@ bool net_nfc_controller_register_listener(
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -222,7 +220,7 @@ bool net_nfc_controller_unregister_listener()
        }
        else
        {
-               DEBUG_SERVER_MSG("interface is null");
+               NFC_ERR("interface is null");
                return false;
        }
 }
@@ -236,8 +234,8 @@ bool net_nfc_controller_get_firmware_version(data_s **data,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -250,8 +248,8 @@ bool net_nfc_controller_check_firmware_version(net_nfc_error_e *result)
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -264,8 +262,8 @@ bool net_nfc_controller_update_firmware(net_nfc_error_e *result)
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -279,8 +277,8 @@ bool net_nfc_controller_get_stack_information(
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -294,8 +292,8 @@ bool net_nfc_controller_configure_discovery(net_nfc_discovery_mode_e mode,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -311,8 +309,8 @@ bool net_nfc_controller_get_secure_element_list(
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -328,8 +326,8 @@ bool net_nfc_controller_set_secure_element_mode(
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -343,7 +341,7 @@ bool net_nfc_controller_secure_element_open(
 
        ret_val = pm_lock_state(LCD_NORMAL, GOTO_STATE_NOW, 0);
 
-       DEBUG_SERVER_MSG("pm_lock_state [%d]!!", ret_val);
+       NFC_DBG("pm_lock_state [%d]!!", ret_val);
 
        if (g_interface.secure_element_open != NULL)
        {
@@ -351,8 +349,8 @@ bool net_nfc_controller_secure_element_open(
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -366,8 +364,8 @@ bool net_nfc_controller_secure_element_get_atr(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -384,8 +382,8 @@ bool net_nfc_controller_secure_element_send_apdu(
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -396,7 +394,7 @@ bool net_nfc_controller_secure_element_close(net_nfc_target_handle_s *handle,
        int ret_val = 0;
 
        ret_val = pm_unlock_state(LCD_NORMAL, PM_RESET_TIMER);
-       DEBUG_SERVER_MSG("pm_unlock_state [%d]!!", ret_val);
+       NFC_DBG("pm_unlock_state [%d]!!", ret_val);
 
        if (g_interface.secure_element_close != NULL)
        {
@@ -404,8 +402,8 @@ bool net_nfc_controller_secure_element_close(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -419,8 +417,8 @@ bool net_nfc_controller_check_target_presence(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -432,7 +430,7 @@ bool net_nfc_controller_connect(net_nfc_target_handle_s *handle,
 
        ret_val = pm_lock_state(LCD_NORMAL, GOTO_STATE_NOW, 0);
 
-       DEBUG_SERVER_MSG("net_nfc_controller_connect pm_lock_state [%d]!!", ret_val);
+       NFC_DBG("net_nfc_controller_connect pm_lock_state [%d]!!", ret_val);
 
        if (g_interface.connect != NULL)
        {
@@ -440,8 +438,8 @@ bool net_nfc_controller_connect(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -453,7 +451,7 @@ bool net_nfc_controller_disconnect(net_nfc_target_handle_s *handle,
 
        ret_val = pm_unlock_state(LCD_NORMAL, PM_RESET_TIMER);
 
-       DEBUG_ERR_MSG("net_nfc_controller_disconnect pm_lock_state [%d]!!", ret_val);
+       NFC_ERR("net_nfc_controller_disconnect pm_lock_state [%d]!!", ret_val);
 
        if (g_interface.disconnect != NULL)
        {
@@ -463,8 +461,8 @@ bool net_nfc_controller_disconnect(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -482,8 +480,8 @@ bool net_nfc_controller_check_ndef(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -497,8 +495,8 @@ bool net_nfc_controller_read_ndef(net_nfc_target_handle_s *handle, data_s **data
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -512,8 +510,8 @@ bool net_nfc_controller_write_ndef(net_nfc_target_handle_s *handle, data_s *data
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -527,8 +525,8 @@ bool net_nfc_controller_make_read_only_ndef(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -542,8 +540,8 @@ bool net_nfc_controller_format_ndef(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -557,8 +555,8 @@ bool net_nfc_controller_transceive(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -571,7 +569,7 @@ bool net_nfc_controller_exception_handler()
        }
        else
        {
-               DEBUG_SERVER_MSG("interface is null");
+               NFC_ERR("interface is null");
                return false;
        }
 }
@@ -584,8 +582,8 @@ bool net_nfc_controller_is_ready(net_nfc_error_e *result)
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -599,8 +597,8 @@ bool net_nfc_controller_llcp_config(net_nfc_llcp_config_info_s *config,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -613,8 +611,8 @@ bool net_nfc_controller_llcp_check_llcp(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -627,8 +625,8 @@ bool net_nfc_controller_llcp_activate_llcp(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -720,7 +718,7 @@ bool net_nfc_controller_llcp_create_socket(net_nfc_llcp_socket_t *socket,
 
                info = _add_socket_info(-1);
                if (info == NULL) {
-                       DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+                       NFC_ERR("_net_nfc_util_alloc_mem failed");
                        *result = NET_NFC_ALLOC_FAIL;
                        return false;
                }
@@ -738,8 +736,8 @@ bool net_nfc_controller_llcp_create_socket(net_nfc_llcp_socket_t *socket,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -753,8 +751,8 @@ bool net_nfc_controller_llcp_bind(net_nfc_llcp_socket_t socket,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -771,7 +769,7 @@ void net_nfc_controller_llcp_incoming_cb(net_nfc_llcp_socket_t socket,
                                info->work_cb(socket, result, NULL, NULL, info->work_param);
                        }
                } else {
-                       DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+                       NFC_ERR("_net_nfc_util_alloc_mem failed");
                }
        }
 }
@@ -789,7 +787,7 @@ bool net_nfc_controller_llcp_listen(net_nfc_target_handle_s* handle,
 
                info = _get_socket_info(socket);
                if (info == NULL) {
-                       DEBUG_ERR_MSG("_get_socket_info failed");
+                       NFC_ERR("_get_socket_info failed");
                        *result = NET_NFC_INVALID_HANDLE;
                        return false;
                }
@@ -802,8 +800,8 @@ bool net_nfc_controller_llcp_listen(net_nfc_target_handle_s* handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -817,7 +815,7 @@ bool net_nfc_controller_llcp_accept(net_nfc_llcp_socket_t socket,
 
                info = _get_socket_info(socket);
                if (info == NULL) {
-                       DEBUG_ERR_MSG("_get_socket_info failed");
+                       NFC_ERR("_get_socket_info failed");
                        *result = NET_NFC_INVALID_HANDLE;
                        return false;
                }
@@ -829,8 +827,8 @@ bool net_nfc_controller_llcp_accept(net_nfc_llcp_socket_t socket,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -851,8 +849,8 @@ bool net_nfc_controller_llcp_reject(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -883,7 +881,7 @@ bool net_nfc_controller_llcp_connect_by_url(net_nfc_target_handle_s *handle,
 
        ret_val = pm_lock_state(LCD_NORMAL, GOTO_STATE_NOW, 0);
 
-       DEBUG_SERVER_MSG("pm_lock_state[%d]!!", ret_val);
+       NFC_DBG("pm_lock_state[%d]!!", ret_val);
 
        if (g_interface.connect_llcp_by_url != NULL)
        {
@@ -891,7 +889,7 @@ bool net_nfc_controller_llcp_connect_by_url(net_nfc_target_handle_s *handle,
 
                _net_nfc_util_alloc_mem(param, sizeof(*param));
                if (param == NULL) {
-                       DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+                       NFC_ERR("_net_nfc_util_alloc_mem failed");
                        *result = NET_NFC_ALLOC_FAIL;
                        return false;
                }
@@ -905,8 +903,8 @@ bool net_nfc_controller_llcp_connect_by_url(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -922,7 +920,7 @@ bool net_nfc_controller_llcp_connect(net_nfc_target_handle_s *handle,
 
        ret_val = pm_lock_state(LCD_NORMAL, GOTO_STATE_NOW, 0);
 
-       DEBUG_SERVER_MSG("net_nfc_controller_llcp_connect pm_lock_state [%d]!!", ret_val);
+       NFC_DBG("net_nfc_controller_llcp_connect pm_lock_state [%d]!!", ret_val);
 
        if (g_interface.connect_llcp != NULL)
        {
@@ -930,7 +928,7 @@ bool net_nfc_controller_llcp_connect(net_nfc_target_handle_s *handle,
 
                _net_nfc_util_alloc_mem(param, sizeof(*param));
                if (param == NULL) {
-                       DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+                       NFC_ERR("_net_nfc_util_alloc_mem failed");
                        *result = NET_NFC_ALLOC_FAIL;
                        return false;
                }
@@ -943,8 +941,8 @@ bool net_nfc_controller_llcp_connect(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -974,7 +972,7 @@ bool net_nfc_controller_llcp_disconnect(net_nfc_target_handle_s *handle,
 
        ret_val = pm_unlock_state(LCD_NORMAL, PM_RESET_TIMER);
 
-       DEBUG_SERVER_MSG("net_nfc_controller_llcp_disconnect pm_unlock_state [%d]!!", ret_val);
+       NFC_DBG("net_nfc_controller_llcp_disconnect pm_unlock_state [%d]!!", ret_val);
 
        if (g_interface.disconnect_llcp != NULL)
        {
@@ -982,7 +980,7 @@ bool net_nfc_controller_llcp_disconnect(net_nfc_target_handle_s *handle,
 
                _net_nfc_util_alloc_mem(param, sizeof(net_nfc_llcp_param_t));
                if (param == NULL) {
-                       DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+                       NFC_ERR("_net_nfc_util_alloc_mem failed");
                        *result = NET_NFC_ALLOC_FAIL;
                        return false;
                }
@@ -995,8 +993,8 @@ bool net_nfc_controller_llcp_disconnect(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -1010,8 +1008,8 @@ bool net_nfc_controller_llcp_socket_close(net_nfc_llcp_socket_t socket,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -1047,7 +1045,7 @@ bool net_nfc_controller_llcp_recv(net_nfc_target_handle_s *handle,
 
                _net_nfc_util_alloc_mem(param, sizeof(*param));
                if (param == NULL) {
-                       DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+                       NFC_ERR("_net_nfc_util_alloc_mem failed");
                        *result = NET_NFC_ALLOC_FAIL;
                        return false;
                }
@@ -1057,7 +1055,7 @@ bool net_nfc_controller_llcp_recv(net_nfc_target_handle_s *handle,
                if (max_len > 0) {
                        _net_nfc_util_alloc_mem(param->data.buffer, max_len);
                        if (param->data.buffer == NULL) {
-                               DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+                               NFC_ERR("_net_nfc_util_alloc_mem failed");
                                _net_nfc_util_free_mem(param);
                                *result = NET_NFC_ALLOC_FAIL;
                                return false;
@@ -1070,8 +1068,8 @@ bool net_nfc_controller_llcp_recv(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -1104,7 +1102,7 @@ bool net_nfc_controller_llcp_send(net_nfc_target_handle_s *handle,
 
                _net_nfc_util_alloc_mem(param, sizeof(*param));
                if (param == NULL) {
-                       DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+                       NFC_ERR("_net_nfc_util_alloc_mem failed");
                        *result = NET_NFC_ALLOC_FAIL;
                        return false;
                }
@@ -1117,8 +1115,8 @@ bool net_nfc_controller_llcp_send(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -1135,7 +1133,7 @@ bool net_nfc_controller_llcp_recv_from(net_nfc_target_handle_s *handle,
 
                _net_nfc_util_alloc_mem(param, sizeof(*param));
                if (param == NULL) {
-                       DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+                       NFC_ERR("_net_nfc_util_alloc_mem failed");
                        *result = NET_NFC_ALLOC_FAIL;
                        return false;
                }
@@ -1145,7 +1143,7 @@ bool net_nfc_controller_llcp_recv_from(net_nfc_target_handle_s *handle,
                if (max_len > 0) {
                        _net_nfc_util_alloc_mem(param->data.buffer, max_len);
                        if (param->data.buffer == NULL) {
-                               DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+                               NFC_ERR("_net_nfc_util_alloc_mem failed");
                                _net_nfc_util_free_mem(param);
                                *result = NET_NFC_ALLOC_FAIL;
                                return false;
@@ -1158,8 +1156,8 @@ bool net_nfc_controller_llcp_recv_from(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -1177,7 +1175,7 @@ bool net_nfc_controller_llcp_send_to(net_nfc_target_handle_s *handle,
 
                _net_nfc_util_alloc_mem(param, sizeof(*param));
                if (param == NULL) {
-                       DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+                       NFC_ERR("_net_nfc_util_alloc_mem failed");
                        *result = NET_NFC_ALLOC_FAIL;
                        return false;
                }
@@ -1191,8 +1189,8 @@ bool net_nfc_controller_llcp_send_to(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -1206,8 +1204,8 @@ bool net_nfc_controller_llcp_get_remote_config(net_nfc_target_handle_s *handle,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -1223,8 +1221,8 @@ bool net_nfc_controller_llcp_get_remote_socket_info(
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 
@@ -1238,8 +1236,8 @@ bool net_nfc_controller_sim_test(net_nfc_error_e *result)
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -1253,8 +1251,8 @@ bool net_nfc_controller_prbs_test(net_nfc_error_e *result, uint32_t tech,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -1267,8 +1265,8 @@ bool net_nfc_controller_test_mode_on(net_nfc_error_e *result)
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -1281,8 +1279,8 @@ bool net_nfc_controller_test_mode_off(net_nfc_error_e *result)
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -1295,8 +1293,8 @@ bool net_nfc_controller_support_nfc(net_nfc_error_e *result)
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
@@ -1310,8 +1308,8 @@ bool net_nfc_controller_eedata_register_set(net_nfc_error_e *result,
        }
        else
        {
+               NFC_ERR("interface is null");
                *result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
-               DEBUG_SERVER_MSG("interface is null");
                return false;
        }
 }
index 4f8091b..2a681bf 100644 (file)
@@ -70,7 +70,7 @@ static gboolean handover_handle_request(NetNfcGDbusHandover *hdover,
        HandoverRequestData *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -78,7 +78,7 @@ static gboolean handover_handle_request(NetNfcGDbusHandover *hdover,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -86,7 +86,7 @@ static gboolean handover_handle_request(NetNfcGDbusHandover *hdover,
        data = g_try_new0(HandoverRequestData,1);
        if(data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
index 7457fd6..519f992 100755 (executable)
@@ -74,7 +74,7 @@ int _net_nfc_handover_bss_convert_security_type(int value)
                retval = WIFI_SECURITY_TYPE_WPA_PSK;
                break;
        default:
-               DEBUG_ERR_MSG("Invalid security Type");
+               NFC_ERR("Invalid security Type");
                retval = 0;
        }
        return retval;
@@ -101,14 +101,13 @@ int _net_nfc_handover_bss_convert_encryption_type (int enc_type)
                retval = WIFI_ENCRYPTION_TYPE_TKIP_AES_MIXED;
                break;
        default:
-               DEBUG_ERR_MSG("Invalid Encryption type");
+               NFC_ERR("Invalid Encryption type");
                retval = 0;
        }
        return retval;
 }
 
-wifi_ap_h
-_net_nfc_handover_bss_create_ap(net_nfc_carrier_config_s *config)
+wifi_ap_h _net_nfc_handover_bss_create_ap(net_nfc_carrier_config_s *config)
 {
        wifi_ap_h ap_handle = NULL;
        data_s temp = { NULL, 0 };
@@ -117,11 +116,11 @@ _net_nfc_handover_bss_create_ap(net_nfc_carrier_config_s *config)
        // Sets SSID
        err = net_nfc_util_get_carrier_config_property(config,
                        NET_NFC_WIFI_ATTRIBUTE_SSID,(uint16_t *)&temp.length, &temp.buffer);
-       DEBUG_SERVER_MSG("SSID = [%s] err %d",temp.buffer, err);
+       NFC_DBG("SSID = [%s] err %d",temp.buffer, err);
        err = wifi_ap_create((char*)temp.buffer, &ap_handle);
        if(err != WIFI_ERROR_NONE)
        {
-               DEBUG_ERR_MSG("Failed to create AP information %d",err);
+               NFC_ERR("Failed to create AP information %d",err);
                goto error;
        }
 
@@ -131,18 +130,18 @@ _net_nfc_handover_bss_create_ap(net_nfc_carrier_config_s *config)
        if(temp.length == 2)
        {
                uint16_t securitytype = temp.buffer[0] <<8 | temp.buffer[1];
-               DEBUG_MSG("wifi_ap_set_security_type %x", securitytype);
+               NFC_DBG("wifi_ap_set_security_type %x", securitytype);
                err = wifi_ap_set_security_type(ap_handle,
                                _net_nfc_handover_bss_convert_security_type(securitytype));
                if(err != WIFI_ERROR_NONE)
                {
-                       DEBUG_ERR_MSG("set security type failed");
+                       NFC_ERR("set security type failed");
                        goto error;
                }
        }
        else
        {
-               DEBUG_ERR_MSG("Invalid authentication length");
+               NFC_ERR("Invalid authentication length");
                goto error;
        }
        net_nfc_util_get_carrier_config_property(config,
@@ -152,7 +151,7 @@ _net_nfc_handover_bss_create_ap(net_nfc_carrier_config_s *config)
        err = wifi_ap_set_passphrase(ap_handle,(char*)temp.buffer);
        if(err != WIFI_ERROR_NONE)
        {
-               DEBUG_ERR_MSG("Failed to set passphrase");
+               NFC_ERR("Failed to set passphrase");
                goto error;
        }
        // Sets encryption Type
@@ -161,13 +160,13 @@ _net_nfc_handover_bss_create_ap(net_nfc_carrier_config_s *config)
        if(temp.length == 2)
        {
                uint16_t enc_type = temp.buffer[0] <<8 | temp.buffer[1];
-               DEBUG_MSG("wifi_ap_set_encryption_type %x", enc_type);
+               NFC_DBG("wifi_ap_set_encryption_type %x", enc_type);
                err = wifi_ap_set_encryption_type(ap_handle,
                                _net_nfc_handover_bss_convert_encryption_type(enc_type));
        }
        else
        {
-               DEBUG_ERR_MSG("Invalid Encryption length");
+               NFC_ERR("Invalid Encryption length");
                goto error;
        }
        return ap_handle;
@@ -179,29 +178,28 @@ error:
        return NULL;
 }
 
-void
-_net_nfc_handover_bss_on_wifi_activated(wifi_error_e errorCode, void* user_data)
+void _net_nfc_handover_bss_on_wifi_activated(wifi_error_e errorCode,
+       void* user_data)
 {
        net_nfc_handover_bss_process_context_t *context = user_data;
        if(context == NULL)
        {
-               DEBUG_ERR_MSG("Invalid context");
+               NFC_ERR("Invalid context");
                return;
        }
        if (errorCode == WIFI_ERROR_NONE)
        {
-               DEBUG_ERR_MSG("WIFI activated succesfully");
+               NFC_ERR("WIFI activated succesfully");
                context->result = NET_NFC_OK;
        }
        else
        {
-               DEBUG_ERR_MSG("Failed to activate WIFI");
+               NFC_ERR("Failed to activate WIFI");
                context->result = NET_NFC_OPERATION_FAIL;
        }
 }
 
-bool
-_net_nfc_handover_bss_wifi_for_each_access_point_found(
+bool _net_nfc_handover_bss_wifi_for_each_access_point_found(
                wifi_ap_h ap_handle, void *user_data)
 {
        data_s temp_ssid = { NULL, 0 };
@@ -211,7 +209,7 @@ _net_nfc_handover_bss_wifi_for_each_access_point_found(
 
        if(context == NULL)
        {
-               DEBUG_ERR_MSG("Invalid context");
+               NFC_ERR("Invalid context");
                return false;
        }
 
@@ -222,16 +220,15 @@ _net_nfc_handover_bss_wifi_for_each_access_point_found(
 
        if(err != WIFI_ERROR_NONE)
        {
-               DEBUG_ERR_MSG("Wifi get carrier config failed");
+               NFC_ERR("Wifi get carrier config failed");
                context->result = NET_NFC_OPERATION_FAIL;
                context->step = NET_NFC_LLCP_STEP_RETURN;
-               g_idle_add(_net_nfc_handover_bss_process_carrier_record,
-                               context);
+               g_idle_add(_net_nfc_handover_bss_process_carrier_record, context);
                return false;
        }
 
        wifi_ap_get_essid(ap_handle, &essid);
-       DEBUG_MSG("Scan Result Ap essid [%s]",essid);
+       NFC_DBG("Scan Result Ap essid [%s]",essid);
        if(memcmp(temp_ssid.buffer, essid,temp_ssid.length) == 0)
        {
                return false;
@@ -244,21 +241,20 @@ _net_nfc_handover_bss_wifi_for_each_access_point_found(
        return true;
 }
 
-void
-_net_nfc_handover_bss_on_wifi_bgscan_completed(wifi_error_e error_code,
-               void* user_data)
+void _net_nfc_handover_bss_on_wifi_bgscan_completed(
+               wifi_error_e error_code, void* user_data)
 {
 
        net_nfc_handover_bss_process_context_t *context = user_data;
 
        if(context == NULL)
        {
-               DEBUG_ERR_MSG("Invalid context");
+               NFC_ERR("Invalid context");
                return;
        }
        if(error_code != WIFI_ERROR_NONE)
        {
-               DEBUG_ERR_MSG("Wifi scan failed");
+               NFC_ERR("Wifi scan failed");
                context->result = NET_NFC_OPERATION_FAIL;
                context->step = NET_NFC_LLCP_STEP_RETURN;
                g_idle_add(
@@ -273,8 +269,7 @@ _net_nfc_handover_bss_on_wifi_bgscan_completed(wifi_error_e error_code,
        }
 }
 
-void
-_net_nfc_handover_bss_on_wifi_scan_completed(wifi_error_e error_code,
+void _net_nfc_handover_bss_on_wifi_scan_completed(wifi_error_e error_code,
                void* user_data)
 {
        int err = WIFI_ERROR_NONE;
@@ -282,7 +277,7 @@ _net_nfc_handover_bss_on_wifi_scan_completed(wifi_error_e error_code,
 
        if(error_code != WIFI_ERROR_NONE)
        {
-               DEBUG_ERR_MSG("Wifi scan failed");
+               NFC_ERR("Wifi scan failed");
                context->result = NET_NFC_OPERATION_FAIL;
                context->step = NET_NFC_LLCP_STEP_RETURN;
                g_idle_add(
@@ -299,13 +294,10 @@ _net_nfc_handover_bss_on_wifi_scan_completed(wifi_error_e error_code,
                                context);
                if(err != WIFI_ERROR_NONE)
                {
-                       DEBUG_ERR_MSG("wifi_foreach_found_aps failed Err[%x]",err);
+                       NFC_ERR("wifi_foreach_found_aps failed Err[%x]",err);
                        context->result = NET_NFC_OPERATION_FAIL;
                        context->step = NET_NFC_LLCP_STEP_RETURN;
-                       g_idle_add(
-                                       _net_nfc_handover_bss_process_carrier_record,
-                                       context);
-
+                       g_idle_add(_net_nfc_handover_bss_process_carrier_record, context);
                }
                if(context->ap_handle == NULL)
                {
@@ -315,9 +307,9 @@ _net_nfc_handover_bss_on_wifi_scan_completed(wifi_error_e error_code,
                        context->ap_handle = _net_nfc_handover_bss_create_ap(
                                        context->config);
                        wifi_ap_get_encryption_type(context->ap_handle, &enc_type);
-                       DEBUG_MSG("Encryption type %x",enc_type);
+                       NFC_DBG("Encryption type %x",enc_type);
                        wifi_ap_get_security_type(context->ap_handle, &sec_type);
-                       DEBUG_MSG("Authentication type %x", sec_type);
+                       NFC_DBG("Authentication type %x", sec_type);
                }
                else
                {
@@ -329,68 +321,62 @@ _net_nfc_handover_bss_on_wifi_scan_completed(wifi_error_e error_code,
                                        NET_NFC_WIFI_ATTRIBUTE_NET_KEY,(uint16_t *)&temp.length,
                                        &temp.buffer);
 
-                       DEBUG_ERR_MSG("Network Key %s",temp.buffer);
+                       NFC_ERR("Network Key %s",temp.buffer);
                        // Sets Network Key
                        err = wifi_ap_set_passphrase(context->ap_handle,(char*)temp.buffer);
 
                        wifi_ap_get_encryption_type(context->ap_handle, &enc_type);
-                       DEBUG_MSG("Encryption type %x",enc_type);
+                       NFC_DBG("Encryption type %x",enc_type);
                        wifi_ap_get_security_type(context->ap_handle, &sec_type);
-                       DEBUG_MSG("Authentication type %x", sec_type);
+                       NFC_DBG("Authentication type %x", sec_type);
                }
                context->step = NET_NFC_LLCP_STEP_03;
-               g_idle_add(
-                               _net_nfc_handover_bss_process_carrier_record,
-                               context);
+               g_idle_add(_net_nfc_handover_bss_process_carrier_record, context);
 
        }
 
 }
 
-void
-_net_nfc_handover_bss_on_wifi_connected(wifi_error_e error_code, void* user_data)
+void _net_nfc_handover_bss_on_wifi_connected(wifi_error_e error_code, void* user_data)
 {
        net_nfc_handover_bss_process_context_t *context = user_data;
 
        if(context == NULL)
        {
-               DEBUG_ERR_MSG("Invalid context");
+               NFC_ERR("Invalid context");
                return;
        }
 
        if(error_code == WIFI_ERROR_NONE)
        {
-               DEBUG_ERR_MSG("WIFI Connected succesfully");
+               NFC_ERR("WIFI Connected succesfully");
                context->result = NET_NFC_OK;
        }
        else
        {
-               DEBUG_ERR_MSG("Failed to connect WIFI");
+               NFC_ERR("Failed to connect WIFI");
                context->result = NET_NFC_OPERATION_FAIL;
        }
        context->step = NET_NFC_LLCP_STEP_RETURN;
-       g_idle_add(
-                       _net_nfc_handover_bss_process_carrier_record,
-                       context);
+       g_idle_add(_net_nfc_handover_bss_process_carrier_record,context);
 }
 
-static gboolean _net_nfc_handover_bss_process_carrier_record(
-               gpointer user_data)
+static gboolean _net_nfc_handover_bss_process_carrier_record(gpointer user_data)
 {
-       LOGD("[%s:%d] START", __func__, __LINE__);
+       NFC_DBG("[%s:%d] START", __func__, __LINE__);
 
        net_nfc_handover_bss_process_context_t *context = user_data;
 
        if(context == NULL)
        {
-               DEBUG_ERR_MSG("Invalid context");
-               DEBUG_ERR_MSG("Handover Failed");
-               return 0;
+               NFC_ERR("Invalid context");
+               NFC_ERR("Handover Failed");
+               return FALSE;
        }
 
        if (context->result != NET_NFC_OK && context->result != NET_NFC_BUSY)
        {
-               DEBUG_ERR_MSG("context->result is error [%d]", context->result);
+               NFC_ERR("context->result is error [%d]", context->result);
                context->step = NET_NFC_LLCP_STEP_RETURN;
        }
 
@@ -399,7 +385,7 @@ static gboolean _net_nfc_handover_bss_process_carrier_record(
        case NET_NFC_LLCP_STEP_01:
                {
                        int err = WIFI_ERROR_NONE;
-                       DEBUG_MSG("STEP [1]");
+                       NFC_DBG("STEP [1]");
                        err = wifi_initialize();
                        /* WIFI returns WIFI_ERROR_INVALID_OPERATION in case already
                         *  initialized*/
@@ -421,21 +407,18 @@ static gboolean _net_nfc_handover_bss_process_carrier_record(
                                else
                                {
                                        /* do next step */
-                                       DEBUG_MSG("Wifi is enabled already, go next step");
+                                       NFC_DBG("Wifi is enabled already, go next step");
                                        context->result = NET_NFC_OK;
                                        context->step = NET_NFC_LLCP_STEP_02;
-                                       g_idle_add(_net_nfc_handover_bss_process_carrier_record,
-                                                       context);
+                                       g_idle_add(_net_nfc_handover_bss_process_carrier_record, context);
                                }
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("Wifi init failed");
+                               NFC_ERR("Wifi init failed");
                                context->result = NET_NFC_OPERATION_FAIL;
                                context->step = NET_NFC_LLCP_STEP_RETURN;
-                               g_idle_add(
-                                               _net_nfc_handover_bss_process_carrier_record,
-                                               context);
+                               g_idle_add(_net_nfc_handover_bss_process_carrier_record, context);
                        }
                }
                break;
@@ -444,48 +427,44 @@ static gboolean _net_nfc_handover_bss_process_carrier_record(
                {
 
                        int err = WIFI_ERROR_NONE;
-                       DEBUG_MSG("STEP [2]");
+                       NFC_DBG("STEP [2]");
                        err = wifi_scan(_net_nfc_handover_bss_on_wifi_scan_completed,
                                        context);
                        if(err != WIFI_ERROR_NONE)
                        {
-                               DEBUG_ERR_MSG("Wifi scan failed");
+                               NFC_ERR("Wifi scan failed");
                                context->result = NET_NFC_OPERATION_FAIL;
                                context->step = NET_NFC_LLCP_STEP_RETURN;
-                               g_idle_add(
-                                               _net_nfc_handover_bss_process_carrier_record,
-                                               context);
+                               g_idle_add(_net_nfc_handover_bss_process_carrier_record, context);
                        }
                }
 
                break;
        case NET_NFC_LLCP_STEP_03 :
                {
-                       DEBUG_MSG("Connect with WIFI");
+                       NFC_DBG("Connect with WIFI");
                        int err = wifi_connect(context->ap_handle,
                                        _net_nfc_handover_bss_on_wifi_connected, context);
-                       DEBUG_MSG("Connect with WIFI err [%x]",err);
+                       NFC_DBG("Connect with WIFI err [%x]",err);
                        if(err != WIFI_ERROR_NONE)
                        {
-                               DEBUG_ERR_MSG("Wifi Connect failed");
+                               NFC_ERR("Wifi Connect failed");
                                context->result = NET_NFC_OPERATION_FAIL;
                                context->step = NET_NFC_LLCP_STEP_RETURN;
-                               g_idle_add(
-                                               _net_nfc_handover_bss_process_carrier_record,
-                                               context);
+                               g_idle_add(_net_nfc_handover_bss_process_carrier_record, context);
                        }
                }
                break;
        case NET_NFC_LLCP_STEP_RETURN :
                {
-                       DEBUG_MSG("STEP return");
+                       NFC_DBG("STEP return");
                        if(context->result == NET_NFC_OK)
                        {
-                               DEBUG_MSG("Handover completed succesfully");
+                               NFC_DBG("Handover completed succesfully");
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("Handover Failed");
+                               NFC_ERR("Handover Failed");
                        }
                        wifi_deinitialize();
                        context->cb(context->result,
@@ -521,9 +500,7 @@ net_nfc_error_e net_nfc_server_handover_bss_process_carrier_record(
                net_nfc_util_create_record(record->TNF, &record->type_s,
                                &record->id_s, &record->payload_s, &context->carrier);
 
-               g_idle_add(
-                               _net_nfc_handover_bss_process_carrier_record,
-                               context);
+               g_idle_add(_net_nfc_handover_bss_process_carrier_record, context);
        }
        else
        {
@@ -540,11 +517,11 @@ _net_nfc_wifi_direct_power_changed(int err, wifi_direct_device_state_e device_st
        if(device_state == WIFI_DIRECT_DEVICE_STATE_ACTIVATED && err == WIFI_DIRECT_ERROR_NONE)
        {
                int err = wifi_direct_start_discovery(true, 0);
-               DEBUG_MSG("wifi direct is enabled %d",err);
+               NFC_DBG("wifi direct is enabled %d",err);
        }
        else
        {
-               DEBUG_ERR_MSG("wifi direct power state error");
+               NFC_ERR("wifi direct power state error");
                net_nfc_handover_bss_create_context_t* context =
                        (net_nfc_handover_bss_create_context_t*)user_data;
 
@@ -571,7 +548,7 @@ _net_nfc_wifi_scan_completed_cb(int err, wifi_direct_discovery_state_e discovery
        }
        else
        {
-               DEBUG_ERR_MSG("wifi scan error");
+               NFC_ERR("wifi scan error");
                context->step = NET_NFC_LLCP_STEP_RETURN;
                context->result = NET_NFC_OPERATION_FAIL;
                g_idle_add((GSourceFunc)
@@ -600,7 +577,7 @@ _net_nfc_wifi_direct_connection_changed(wifi_direct_error_e error_code,
        }
        else
        {
-               DEBUG_ERR_MSG("_net_nfc_wifi_direct_connection_changed failed"
+               NFC_ERR("_net_nfc_wifi_direct_connection_changed failed"
                                "[%d] [%d]",error_code,connection_state);
 
                context->step = NET_NFC_LLCP_STEP_RETURN;
@@ -621,12 +598,12 @@ static net_nfc_error_e _net_nfc_handover_bss_create_carrier_record(
        if ((result = net_nfc_util_create_handover_carrier_record(
                                        record)) == NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_util_create_ndef_record"
+               NFC_ERR("net_nfc_util_create_ndef_record"
                                "_with_carrier_config [%d]",result);
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_util_create_carrier_config failed "
+               NFC_ERR("net_nfc_util_create_carrier_config failed "
                                "[%d]", result);
        }
 
@@ -644,7 +621,7 @@ static int _net_nfc_handover_getpassword(uint8_t** password )
        ret_val = system("wpa_cli -g /var/run/wpa_supplicant/p2p-wlan0-0 p2p_get_passphrase "
                        "> /tmp/nfc_p2p_passphrase.txt");
 
-       DEBUG_MSG("system command returned with [%d]",ret_val);
+       NFC_DBG("system command returned with [%d]",ret_val);
 
        FILE *f = fopen("/tmp/nfc_p2p_passphrase.txt","r");
        if(f != NULL)
@@ -702,7 +679,7 @@ static net_nfc_error_e _net_nfc_handover_bss_create_config_record(
                                                        NET_NFC_WIFI_ATTRIBUTE_VERSION,
                                                        version_data.length, version_data.buffer)) != NET_NFC_OK)
                        {
-                               DEBUG_ERR_MSG("net_nfc_util_add_carrier_config_property failed"
+                               NFC_ERR("net_nfc_util_add_carrier_config_property failed"
                                                "[%d]", result);
                        }
                }
@@ -776,7 +753,7 @@ static net_nfc_error_e _net_nfc_handover_bss_create_config_record(
 
                pw_length = _net_nfc_handover_getpassword(&password);
 
-               DEBUG_ERR_MSG("_net_nfc_handover_getpassword[%s]", password);
+               NFC_ERR("_net_nfc_handover_getpassword[%s]", password);
 
                net_nfc_util_add_carrier_config_group_property(
                                cred_config,
@@ -798,7 +775,7 @@ static net_nfc_error_e _net_nfc_handover_bss_create_config_record(
                                                        NET_NFC_WIFI_ATTRIBUTE_MAC_ADDR,
                                                        mac_data.length, mac_data.buffer)) != NET_NFC_OK)
                        {
-                               DEBUG_ERR_MSG("net_nfc_util_add_carrier"
+                               NFC_ERR("net_nfc_util_add_carrier"
                                                "_config_property failed"
                                                "[%d]", result);
                        }
@@ -815,7 +792,7 @@ static net_nfc_error_e _net_nfc_handover_bss_create_config_record(
 
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_util_create_ndef_record"
+               NFC_ERR("net_nfc_util_create_ndef_record"
                                "_with_carrier_config failed"
                                "[%d]",result);
        }
@@ -835,7 +812,7 @@ static void _net_nfc_handover_bss_get_carrier_record(
 
                if (context->result != NET_NFC_OK && context->result != NET_NFC_BUSY)
                {
-                       DEBUG_ERR_MSG("context->result is error [%d]", context->result);
+                       NFC_ERR("context->result is error [%d]", context->result);
                }
 
                context->result = NET_NFC_OK;
@@ -847,7 +824,7 @@ static void _net_nfc_handover_bss_get_carrier_record(
                                &context->carrier);
                if (context->result!= NET_NFC_OK)
                {
-                       DEBUG_ERR_MSG("create_bss_config_record failed"
+                       NFC_ERR("create_bss_config_record failed"
                                        " [%d]", context->result);
                }
 
@@ -864,7 +841,7 @@ static void _net_nfc_handover_bss_get_carrier_record(
 #ifdef TARGET
 static void _net_nfc_wifi_process_error(int error)
 {
-       DEBUG_ERR_MSG("_net_nfc_wifi_process_error - [%d]",error);
+       NFC_ERR("_net_nfc_wifi_process_error - [%d]",error);
 
        context->step = NET_NFC_LLCP_STEP_RETURN;
        context->result = NET_NFC_OPERATION_FAIL;
@@ -883,7 +860,7 @@ static int _net_nfc_handover_process_wifi_direct_setup(
        err = wifi_direct_initialize();
        if(err != WIFI_DIRECT_ERROR_NONE)
        {
-               DEBUG_ERR_MSG("wifi_direct_initialize err value %d",err);
+               NFC_ERR("wifi_direct_initialize err value %d",err);
                return err;
        }
 
@@ -893,7 +870,7 @@ static int _net_nfc_handover_process_wifi_direct_setup(
 
        if(err != WIFI_DIRECT_ERROR_NONE)
        {
-               DEBUG_ERR_MSG("wifi_direct_set_device_state_changed_cb err value %d",err);
+               NFC_ERR("wifi_direct_set_device_state_changed_cb err value %d",err);
                return err;
        }
 
@@ -903,7 +880,7 @@ static int _net_nfc_handover_process_wifi_direct_setup(
 
        if(err != WIFI_DIRECT_ERROR_NONE)
        {
-               DEBUG_ERR_MSG("wifi_direct_set_discovery_state_changed_cb err value %d",err);
+               NFC_ERR("wifi_direct_set_discovery_state_changed_cb err value %d",err);
                return err;
        }
 
@@ -913,7 +890,7 @@ static int _net_nfc_handover_process_wifi_direct_setup(
 
        if (err != WIFI_DIRECT_ERROR_NONE)
        {
-               DEBUG_ERR_MSG("wifi_direct_set_connection_state_changed_cb err value %d",err);
+               NFC_ERR("wifi_direct_set_connection_state_changed_cb err value %d",err);
                return err;
        }
        else
@@ -924,7 +901,7 @@ static int _net_nfc_handover_process_wifi_direct_setup(
                wifi_direct_state_e status = WIFI_DIRECT_STATE_DEACTIVATED;
 
                err = wifi_direct_get_state(&status);
-               DEBUG_ERR_MSG("status value %d",status);
+               NFC_ERR("status value %d",status);
 
                if (status != WIFI_DIRECT_STATE_ACTIVATED)
                {
@@ -932,7 +909,7 @@ static int _net_nfc_handover_process_wifi_direct_setup(
                }
                else
                {
-                       DEBUG_MSG("wifi direct is enabled already");
+                       NFC_DBG("wifi direct is enabled already");
 
                        /* do next step */
                        g_idle_add((GSourceFunc)
@@ -951,7 +928,7 @@ static int _net_nfc_handover_process_wifi_group_setup(
        bool group_owner = false;
 
        err = wifi_direct_is_group_owner(&group_owner);
-       DEBUG_ERR_MSG("error value %d",err);
+       NFC_ERR("error value %d",err);
 
        context->step = NET_NFC_LLCP_STEP_03;
        context->result = NET_NFC_OK;
@@ -960,7 +937,7 @@ static int _net_nfc_handover_process_wifi_group_setup(
        {
                if(group_owner == true)
                {
-                       DEBUG_MSG("Already group owner, continue next step");
+                       NFC_DBG("Already group owner, continue next step");
                        g_idle_add((GSourceFunc)
                                        _net_nfc_handover_bss_wfd_get_carrier_record,
                                        (gpointer)context);
@@ -970,14 +947,14 @@ static int _net_nfc_handover_process_wifi_group_setup(
                        err = wifi_direct_create_group();
                        if (err != WIFI_DIRECT_ERROR_NONE)
                        {
-                               DEBUG_ERR_MSG("wifi_direct_create_group failed [%d]",err);
+                               NFC_ERR("wifi_direct_create_group failed [%d]",err);
                                return err;
                        }
                }
        }
        else
        {
-               DEBUG_ERR_MSG("wifi_direct_is_group_owner failed [%d]",err);
+               NFC_ERR("wifi_direct_is_group_owner failed [%d]",err);
                return err;
        }
 
@@ -989,7 +966,7 @@ static gboolean _net_nfc_handover_bss_wfd_get_carrier_record(
        LOGD("[%s:%d] START", __func__, __LINE__);
        if(context == NULL)
        {
-               DEBUG_ERR_MSG("Invalid context");
+               NFC_ERR("Invalid context");
                return FALSE;
        }
 
@@ -999,7 +976,7 @@ static gboolean _net_nfc_handover_bss_wfd_get_carrier_record(
 
                if (context->result != NET_NFC_OK && context->result != NET_NFC_BUSY)
                {
-                       DEBUG_ERR_MSG("context->result is error"
+                       NFC_ERR("context->result is error"
                                        " [%d]", context->result);
 
                        context->step = NET_NFC_LLCP_STEP_RETURN;
@@ -1008,25 +985,25 @@ static gboolean _net_nfc_handover_bss_wfd_get_carrier_record(
                switch (context->step)
                {
                case NET_NFC_LLCP_STEP_01 :
-                       DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_01");
+                       NFC_ERR("NET_NFC_LLCP_STEP_01");
                        err = _net_nfc_handover_process_wifi_direct_setup(context);
                        if(err != WIFI_DIRECT_ERROR_NONE)
                        {
-                               DEBUG_ERR_MSG("_net_nfc_handover_process_wifi_direct_setup failed");
+                               NFC_ERR("_net_nfc_handover_process_wifi_direct_setup failed");
                                _net_nfc_wifi_process_error(err);
                        }
                        break;
                case NET_NFC_LLCP_STEP_02:
-                       DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_02");
+                       NFC_ERR("NET_NFC_LLCP_STEP_02");
                        err = _net_nfc_handover_process_wifi_group_setup(context);
                        if(err != WIFI_DIRECT_ERROR_NONE)
                        {
-                               DEBUG_ERR_MSG("_net_nfc_handover_process_wifi_group_setup failed");
+                               NFC_ERR("_net_nfc_handover_process_wifi_group_setup failed");
                                _net_nfc_wifi_process_error(err);
                        }
                        break;
                case NET_NFC_LLCP_STEP_03 :
-                       DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_03");
+                       NFC_ERR("NET_NFC_LLCP_STEP_03");
                        context->step = NET_NFC_LLCP_STEP_RETURN;
 
                        /* append config to ndef message */
@@ -1034,7 +1011,7 @@ static gboolean _net_nfc_handover_bss_wfd_get_carrier_record(
                                        &context->carrier);
                        if (context->result != NET_NFC_OK)
                        {
-                               DEBUG_ERR_MSG("_net_nfc_handover_bss_create_config_record failed"
+                               NFC_ERR("_net_nfc_handover_bss_create_config_record failed"
                                                "[%d]", context->result);
                        }
 
@@ -1044,7 +1021,7 @@ static gboolean _net_nfc_handover_bss_wfd_get_carrier_record(
 
                        break;
                case NET_NFC_LLCP_STEP_RETURN :
-                       DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_RETURN");
+                       NFC_ERR("NET_NFC_LLCP_STEP_RETURN");
                        /* unregister current callback */
                        wifi_direct_unset_connection_state_changed_cb();
                        wifi_direct_unset_device_state_changed_cb();
index 2825f88..46dcc4d 100755 (executable)
@@ -80,7 +80,7 @@ static net_nfc_error_e _net_nfc_handover_bt_get_oob_data(
        {
                if (hash.length == 16)
                {
-                       DEBUG_MSG("hash.length == 16");
+                       NFC_DBG("hash.length == 16");
 
                        net_nfc_convert_byte_order(hash.buffer, 16);
 
@@ -89,7 +89,7 @@ static net_nfc_error_e _net_nfc_handover_bt_get_oob_data(
                }
                else
                {
-                       DEBUG_ERR_MSG("hash.length error : [%d] bytes", hash.length);
+                       NFC_ERR("hash.length error : [%d] bytes", hash.length);
                }
        }
 
@@ -101,7 +101,7 @@ static net_nfc_error_e _net_nfc_handover_bt_get_oob_data(
        {
                if (randomizer.length == 16)
                {
-                       DEBUG_MSG("randomizer.length == 16");
+                       NFC_DBG("randomizer.length == 16");
 
                        net_nfc_convert_byte_order(randomizer.buffer, 16);
 
@@ -110,7 +110,7 @@ static net_nfc_error_e _net_nfc_handover_bt_get_oob_data(
                }
                else
                {
-                       DEBUG_ERR_MSG("randomizer.length error :"
+                       NFC_ERR("randomizer.length error :"
                                        " [%d] bytes", randomizer.length);
                }
        }
@@ -120,44 +120,38 @@ static net_nfc_error_e _net_nfc_handover_bt_get_oob_data(
        return result;
 }
 
-static void _net_nfc_handover_bt_get_carrier_config_cb(
-               int event,
-               bluetooth_event_param_t *param,
-               void *user_data)
+static void _net_nfc_handover_bt_get_carrier_config_cb(int event,
+               bluetooth_event_param_t *param, void *user_data)
 {
        net_nfc_handover_bt_get_context_t *context =
                (net_nfc_handover_bt_get_context_t *)user_data;
 
-       LOGD("[%s] START", __func__);
-
        if (context == NULL)
        {
-               DEBUG_SERVER_MSG("user_data is null");
-               LOGD("[%s] END", __func__);
+               NFC_ERR("user_data is null");
                return;
        }
 
        switch (event)
        {
        case BLUETOOTH_EVENT_ENABLED :
-               DEBUG_SERVER_MSG("BLUETOOTH_EVENT_ENABLED");
+               NFC_DBG("BLUETOOTH_EVENT_ENABLED");
                if (context->step == NET_NFC_LLCP_STEP_02)
                {
                        _net_nfc_handover_bt_get_carrier_record(context);
                }
                else
                {
-                       DEBUG_SERVER_MSG("step is incorrect");
+                       NFC_ERR("step is incorrect");
                }
                break;
 
        case BLUETOOTH_EVENT_DISABLED :
-               DEBUG_SERVER_MSG("BLUETOOTH_EVENT_DISABLED");
+               NFC_DBG("BLUETOOTH_EVENT_DISABLED");
                break;
 
        default :
-               DEBUG_SERVER_MSG("unhandled bt event [%d],"
-                               "[0x%04x]", event, param->result);
+               NFC_ERR("unhandled bt event [%d],[0x%04x]", event, param->result);
                break;
        }
 
@@ -188,7 +182,7 @@ static net_nfc_error_e _net_nfc_handover_bt_create_config_record(
                                                        NET_NFC_BT_ATTRIBUTE_ADDRESS,
                                                        sizeof(bt_addr.addr), bt_addr.addr)) != NET_NFC_OK)
                        {
-                               DEBUG_ERR_MSG("net_nfc_util_add_carrier"
+                               NFC_ERR("net_nfc_util_add_carrier"
                                                "_config_property failed"
                                                "[%d]", result);
                        }
@@ -198,10 +192,8 @@ static net_nfc_error_e _net_nfc_handover_bt_create_config_record(
                        {
                                if (oob.hash_len == 16 && oob.randomizer_len == 16)
                                {
-                                       DEBUG_SERVER_MSG("oob.hash_len "
-                                                       "[%d]", oob.hash_len);
-                                       DEBUG_SERVER_MSG("oob.randomizer_len"
-                                                       " [%d]", oob.randomizer_len);
+                                       NFC_DBG("oob.hash_len [%d]", oob.hash_len);
+                                       NFC_DBG("oob.randomizer_len [%d]", oob.randomizer_len);
 
                                        net_nfc_convert_byte_order(oob.hash, 16);
 
@@ -211,7 +203,7 @@ static net_nfc_error_e _net_nfc_handover_bt_create_config_record(
                                                                        NET_NFC_BT_ATTRIBUTE_OOB_HASH_C,
                                                                        oob.hash_len, oob.hash)) != NET_NFC_OK)
                                        {
-                                               DEBUG_ERR_MSG("net_nfc_util_add_carrier"
+                                               NFC_ERR("net_nfc_util_add_carrier"
                                                                "_config_property failed"
                                                                " [%d]",result);
                                        }
@@ -224,14 +216,14 @@ static net_nfc_error_e _net_nfc_handover_bt_create_config_record(
                                                                        oob.randomizer_len,
                                                                        oob.randomizer)) != NET_NFC_OK)
                                        {
-                                               DEBUG_ERR_MSG("net_nfc_util_add_carrier"
+                                               NFC_ERR("net_nfc_util_add_carrier"
                                                                "_config_property failed"
                                                                " [%d]",result);
                                        }
                                }
                                else
                                {
-                                       DEBUG_ERR_MSG("abnormal oob data, skip... [%d]", result);
+                                       NFC_ERR("abnormal oob data, skip... [%d]", result);
                                }
                        }
 
@@ -239,7 +231,7 @@ static net_nfc_error_e _net_nfc_handover_bt_create_config_record(
                                                        record,
                                                        config)) != NET_NFC_OK)
                        {
-                               DEBUG_ERR_MSG("net_nfc_util_create_ndef_record"
+                               NFC_ERR("net_nfc_util_create_ndef_record"
                                                "_with_carrier_config failed"
                                                "[%d]",result);
                        }
@@ -248,13 +240,13 @@ static net_nfc_error_e _net_nfc_handover_bt_create_config_record(
                }
                else
                {
-                       DEBUG_ERR_MSG("net_nfc_util_create_carrier_config failed "
+                       NFC_ERR("net_nfc_util_create_carrier_config failed "
                                        "[%d]", result);
                }
        }
        else
        {
-               DEBUG_ERR_MSG("bluetooth_get_local_address failed"
+               NFC_ERR("bluetooth_get_local_address failed"
                                " [%d]", result);
                result = NET_NFC_OPERATION_FAIL;
        }
@@ -269,7 +261,7 @@ static int _net_nfc_handover_bt_get_carrier_record(
 
        if (context->result != NET_NFC_OK && context->result != NET_NFC_BUSY)
        {
-               DEBUG_ERR_MSG("context->result is error"
+               NFC_ERR("context->result is error"
                                " [%d]", context->result);
 
                context->step = NET_NFC_LLCP_STEP_RETURN;
@@ -278,7 +270,7 @@ static int _net_nfc_handover_bt_get_carrier_record(
        switch (context->step)
        {
        case NET_NFC_LLCP_STEP_01 :
-               DEBUG_MSG("STEP [1]");
+               NFC_DBG("STEP [1]");
 
                if (bluetooth_register_callback(
                                        _net_nfc_handover_bt_get_carrier_config_cb,
@@ -293,7 +285,7 @@ static int _net_nfc_handover_bt_get_carrier_record(
                        }
                        else
                        {
-                               DEBUG_MSG("bluetooth is enabled already");
+                               NFC_DBG("bluetooth is enabled already");
 
                                /* do next step */
                                g_idle_add((GSourceFunc)
@@ -303,7 +295,7 @@ static int _net_nfc_handover_bt_get_carrier_record(
                }
                else
                {
-                       DEBUG_ERR_MSG("bluetooth_register_callback failed");
+                       NFC_ERR("bluetooth_register_callback failed");
 
                        context->step = NET_NFC_LLCP_STEP_RETURN;
                        context->result = NET_NFC_OPERATION_FAIL;
@@ -315,7 +307,7 @@ static int _net_nfc_handover_bt_get_carrier_record(
                break;
 
        case NET_NFC_LLCP_STEP_02 :
-               DEBUG_MSG("STEP [2]");
+               NFC_DBG("STEP [2]");
 
                context->step = NET_NFC_LLCP_STEP_RETURN;
 
@@ -324,7 +316,7 @@ static int _net_nfc_handover_bt_get_carrier_record(
                                        _net_nfc_handover_bt_create_config_record(
                                                &context->carrier)) != NET_NFC_OK)
                {
-                       DEBUG_ERR_MSG("_ch_create_bt_config_record failed"
+                       NFC_ERR("_ch_create_bt_config_record failed"
                                        "[%d]", context->result);
                }
 
@@ -335,7 +327,7 @@ static int _net_nfc_handover_bt_get_carrier_record(
                break;
 
        case NET_NFC_LLCP_STEP_RETURN :
-               DEBUG_MSG("STEP return");
+               NFC_DBG("STEP return");
 
                /* unregister current callback */
                bluetooth_unregister_callback();
@@ -403,22 +395,18 @@ static bool _net_nfc_handover_bt_check_bond_device(
                int i;
                bluetooth_device_info_t *ptr;
 
-               DEBUG_SERVER_MSG("g pointer array count :"
-                               " [%d]", devinfo->len);
+               NFC_DBG("g pointer array count : [%d]", devinfo->len);
 
                for (i = 0; i < devinfo->len; i++)
                {
                        ptr = g_ptr_array_index(devinfo, i);
                        if (ptr != NULL)
                        {
-                               SECURE_LOGD("Name [%s]", ptr->device_name.name);
-                               DEBUG_SERVER_MSG("Major Class [%d]",
-                                               ptr->device_class.major_class);
-                               DEBUG_SERVER_MSG("Minor Class [%d]",
-                                               ptr->device_class.minor_class);
-                               DEBUG_SERVER_MSG("Service Class [%d]",
-                                               ptr->device_class.service_class);
-                               DEBUG_SERVER_MSG("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
+                               NFC_SECURE_DBG("Name [%s]", ptr->device_name.name);
+                               NFC_DBG("Major Class [%d]", ptr->device_class.major_class);
+                               NFC_DBG("Minor Class [%d]", ptr->device_class.minor_class);
+                               NFC_DBG("Service Class [%d]", ptr->device_class.service_class);
+                               NFC_DBG("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
                                                ptr->device_address.addr[0],
                                                ptr->device_address.addr[1],
                                                ptr->device_address.addr[2],
@@ -431,7 +419,7 @@ static bool _net_nfc_handover_bt_check_bond_device(
                                                        address,
                                                        sizeof(ptr->device_address)) == 0)
                                {
-                                       DEBUG_SERVER_MSG("Found!!!");
+                                       NFC_DBG("Found!!!");
                                        result = true;
                                        break;
                                }
@@ -440,7 +428,7 @@ static bool _net_nfc_handover_bt_check_bond_device(
        }
        else
        {
-               DEBUG_ERR_MSG("bluetooth_get_bonded_device_list failed with"
+               NFC_ERR("bluetooth_get_bonded_device_list failed with"
                                " [%d]", ret);
        }
 
@@ -460,41 +448,37 @@ static void _net_nfc_handover_bt_process_carrier_record_cb(
        net_nfc_handover_bt_process_context_t *context =
                (net_nfc_handover_bt_process_context_t *)user_data;
 
-       LOGD("[%s] START", __func__);
-
        if (context == NULL)
        {
-               DEBUG_SERVER_MSG("user_data is null");
-               LOGD("[%s] END", __func__);
+               NFC_ERR("user_data is null");
                return;
        }
 
        switch (event)
        {
        case BLUETOOTH_EVENT_ENABLED :
-               DEBUG_SERVER_MSG("BLUETOOTH_EVENT_ENABLED");
+               NFC_DBG("BLUETOOTH_EVENT_ENABLED");
                if (context->step == NET_NFC_LLCP_STEP_02)
                {
                        _net_nfc_handover_bt_process_carrier_record(context);
                }
                else
                {
-                       DEBUG_SERVER_MSG("step is incorrect");
+                       NFC_ERR("step is incorrect");
                }
                break;
 
        case BLUETOOTH_EVENT_DISABLED :
-               DEBUG_SERVER_MSG("BLUETOOTH_EVENT_DISABLED");
+               NFC_DBG("BLUETOOTH_EVENT_DISABLED");
                break;
 
        case BLUETOOTH_EVENT_BONDING_FINISHED :
-               DEBUG_SERVER_MSG("BLUETOOTH_EVENT_BONDING_FINISHED, result "
-                               "[0x%04x]", param->result);
+               NFC_DBG("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
                if (context->step == NET_NFC_LLCP_STEP_03)
                {
                        if (param->result < BLUETOOTH_ERROR_NONE)
                        {
-                               DEBUG_ERR_MSG("bond failed");
+                               NFC_ERR("bond failed");
                                context->result = NET_NFC_OPERATION_FAIL;
                        }
 
@@ -502,13 +486,12 @@ static void _net_nfc_handover_bt_process_carrier_record_cb(
                }
                else
                {
-                       DEBUG_SERVER_MSG("step is incorrect");
+                       NFC_ERR("step is incorrect");
                }
                break;
 
        default :
-               DEBUG_SERVER_MSG("unhandled bt event [%d],"
-                               "[0x%04x]", event, param->result);
+               NFC_ERR("unhandled bt event [%d],[0x%04x]", event, param->result);
                break;
        }
 
@@ -522,7 +505,7 @@ static int _net_nfc_handover_bt_process_carrier_record(
 
        if (context->result != NET_NFC_OK && context->result != NET_NFC_BUSY)
        {
-               DEBUG_ERR_MSG("context->result is error"
+               NFC_ERR("context->result is error"
                                " [%d]", context->result);
                context->step = NET_NFC_LLCP_STEP_RETURN;
        }
@@ -530,7 +513,7 @@ static int _net_nfc_handover_bt_process_carrier_record(
        switch (context->step)
        {
        case NET_NFC_LLCP_STEP_01 :
-               DEBUG_MSG("STEP [1]");
+               NFC_DBG("STEP [1]");
 
                if (bluetooth_register_callback(
                                        _net_nfc_handover_bt_process_carrier_record_cb,
@@ -547,7 +530,7 @@ static int _net_nfc_handover_bt_process_carrier_record(
                        else
                        {
                                /* do next step */
-                               DEBUG_MSG("BT is enabled already, go next step");
+                               NFC_DBG("BT is enabled already, go next step");
                                context->result = NET_NFC_OK;
 
                                g_idle_add((GSourceFunc)
@@ -557,7 +540,7 @@ static int _net_nfc_handover_bt_process_carrier_record(
                }
                else
                {
-                       DEBUG_ERR_MSG("bluetooth_register_callback failed");
+                       NFC_ERR("bluetooth_register_callback failed");
                        context->result = NET_NFC_OPERATION_FAIL;
 
                        g_idle_add(
@@ -571,7 +554,7 @@ static int _net_nfc_handover_bt_process_carrier_record(
                        net_nfc_carrier_config_s *config;
                        data_s temp = { NULL, 0 };
 
-                       DEBUG_MSG("STEP [2]");
+                       NFC_DBG("STEP [2]");
 
                        net_nfc_util_create_carrier_config_from_config_record(
                                        &config,
@@ -593,8 +576,7 @@ static int _net_nfc_handover_bt_process_carrier_record(
                                if (_net_nfc_handover_bt_check_bond_device
                                                (&context->addr) == true)
                                {
-                                       DEBUG_SERVER_MSG("already paired with"
-                                                       " [%02x:%02x:%02x:%02x:%02x:%02x]",
+                                       NFC_DBG("already paired with [%02x:%02x:%02x:%02x:%02x:%02x]",
                                                        context->addr.addr[0],
                                                        context->addr.addr[1],
                                                        context->addr.addr[2],
@@ -627,7 +609,7 @@ static int _net_nfc_handover_bt_process_carrier_record(
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("bluetooth address is invalid."
+                               NFC_ERR("bluetooth address is invalid."
                                                " [%d] bytes", temp.length);
 
                                context->step = NET_NFC_LLCP_STEP_RETURN;
@@ -644,7 +626,7 @@ static int _net_nfc_handover_bt_process_carrier_record(
 
        case NET_NFC_LLCP_STEP_RETURN :
                {
-                       DEBUG_MSG("STEP return");
+                       NFC_DBG("STEP return");
                        data_s data = { context->addr.addr,
                                sizeof(context->addr.addr) };
 
@@ -702,32 +684,28 @@ static void _net_nfc_handover_bt_post_process_cb(int event,
        net_nfc_handover_bt_process_context_t *context =
                (net_nfc_handover_bt_process_context_t *)user_data;
 
-       LOGD("[%s] START", __func__);
-
        if (context == NULL)
        {
-               DEBUG_SERVER_MSG("user_data is null");
-               LOGD("[%s] END", __func__);
+               NFC_ERR("user_data is null");
                return;
        }
 
        switch (event)
        {
        case BLUETOOTH_EVENT_ENABLED :
-               DEBUG_SERVER_MSG("BLUETOOTH_EVENT_ENABLED");
+               NFC_DBG("BLUETOOTH_EVENT_ENABLED");
                break;
 
        case BLUETOOTH_EVENT_DISABLED :
-               DEBUG_SERVER_MSG("BLUETOOTH_EVENT_DISABLED");
+               NFC_DBG("BLUETOOTH_EVENT_DISABLED");
                break;
 
        case BLUETOOTH_EVENT_BONDING_FINISHED :
-               DEBUG_SERVER_MSG("BLUETOOTH_EVENT_BONDING_FINISHED,"
-                               " result [0x%04x]",param->result);
+               NFC_DBG("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]",param->result);
 
                if (param->result < BLUETOOTH_ERROR_NONE)
                {
-                       DEBUG_ERR_MSG("bond failed");
+                       NFC_ERR("bond failed");
                        context->result = NET_NFC_OPERATION_FAIL;
                }
                else
@@ -742,8 +720,7 @@ static void _net_nfc_handover_bt_post_process_cb(int event,
                break;
 
        default :
-               DEBUG_SERVER_MSG("unhandled bt event"
-                               " [%d], [0x%04x]", event, param->result);
+               NFC_ERR("unhandled bt event [%d], [0x%04x]", event, param->result);
                break;
        }
 
index 8d85311..39a43ea 100644 (file)
@@ -430,9 +430,9 @@ static void llcp_socket_error_cb(net_nfc_llcp_socket_t socket,
                                        result),
                                &error) == false) {
                if (error != NULL && error->message != NULL) {
-                       DEBUG_ERR_MSG("g_dbus_connection_emit_signal failed : %s", error->message);
+                       NFC_ERR("g_dbus_connection_emit_signal failed : %s", error->message);
                } else {
-                       DEBUG_ERR_MSG("g_dbus_connection_emit_signal failed");
+                       NFC_ERR("g_dbus_connection_emit_signal failed");
                }
        }
 }
@@ -458,9 +458,9 @@ static void llcp_incoming_cb(net_nfc_llcp_socket_t socket,
                                        socket),
                                &error) == false) {
                if (error != NULL && error->message != NULL) {
-                       DEBUG_ERR_MSG("g_dbus_connection_emit_signal failed : %s", error->message);
+                       NFC_ERR("g_dbus_connection_emit_signal failed : %s", error->message);
                } else {
-                       DEBUG_ERR_MSG("g_dbus_connection_emit_signal failed");
+                       NFC_ERR("g_dbus_connection_emit_signal failed");
                }
        }
 }
@@ -705,7 +705,7 @@ static void llcp_handle_listen_thread_func(gpointer user_data)
                                llcp_socket_error_cb,
                                client_data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_create_socket failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_create_socket failed [%d]", result);
 
                goto ERROR;
        }
@@ -716,7 +716,7 @@ static void llcp_handle_listen_thread_func(gpointer user_data)
                                data->sap,
                                &result) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_bind failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_bind failed [%d]", result);
 
                goto ERROR;
        }
@@ -728,7 +728,7 @@ static void llcp_handle_listen_thread_func(gpointer user_data)
                                llcp_incoming_cb,
                                client_data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_listen failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_listen failed [%d]", result);
 
                goto ERROR;
        }
@@ -789,7 +789,7 @@ static void llcp_handle_accept_thread_func(gpointer user_data)
        if (net_nfc_controller_llcp_accept(data->client_socket, &result,
                                llcp_socket_error_cb,
                                client_data) == false) {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_accept failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_accept failed [%d]", result);
 
                goto ERROR;
        }
@@ -828,7 +828,7 @@ static void llcp_handle_reject_thread_func(gpointer user_data)
        if (net_nfc_controller_llcp_reject(GUINT_TO_POINTER(data->handle),
                                data->client_socket,
                                &result) == false) {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_reject failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_reject failed [%d]", result);
        }
 
        net_nfc_gdbus_llcp_complete_reject(data->llcp, data->invocation,
@@ -873,7 +873,7 @@ static void llcp_handle_connect_thread_func(gpointer user_data)
                                llcp_socket_error_cb,
                                client_data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_create_socket failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_create_socket failed [%d]", result);
 
                goto ERROR;
        }
@@ -888,7 +888,7 @@ static void llcp_handle_connect_thread_func(gpointer user_data)
                                llcp_connect_by_url_cb,
                                data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_listen failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_listen failed [%d]", result);
 
                goto ERROR;
        }
@@ -951,7 +951,7 @@ static void llcp_handle_connect_sap_thread_func(gpointer user_data)
                                llcp_socket_error_cb,
                                client_data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_create_socket failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_create_socket failed [%d]", result);
 
                goto ERROR;
        }
@@ -965,7 +965,7 @@ static void llcp_handle_connect_sap_thread_func(gpointer user_data)
                                llcp_connect_cb,
                                data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_listen failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_listen failed [%d]", result);
 
                goto ERROR;
        }
@@ -1009,7 +1009,7 @@ static void llcp_handle_send_thread_func(gpointer user_data)
                                llcp_send_cb,
                                data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_send failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_send failed [%d]", result);
 
                net_nfc_gdbus_llcp_complete_send(data->llcp,
                                data->invocation,
@@ -1042,7 +1042,7 @@ static void llcp_handle_send_to_thread_func(gpointer user_data)
                                llcp_send_to_cb,
                                data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_send_to failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_send_to failed [%d]", result);
 
                net_nfc_gdbus_llcp_complete_send_to(data->llcp,
                                data->invocation,
@@ -1074,7 +1074,7 @@ static void llcp_handle_receive_thread_func(gpointer user_data)
                                llcp_receive_cb,
                                data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_recv failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_recv failed [%d]", result);
 
                net_nfc_gdbus_llcp_complete_receive(data->llcp,
                                data->invocation,
@@ -1104,7 +1104,7 @@ static void llcp_handle_receive_from_thread_func(gpointer user_data)
                                llcp_receive_from_cb,
                                data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_recv_from failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_recv_from failed [%d]", result);
 
                net_nfc_gdbus_llcp_complete_receive_from(data->llcp,
                                data->invocation,
@@ -1151,8 +1151,7 @@ static void llcp_handle_disconnect_thread_func(gpointer user_data)
 
                net_nfc_server_free_target_info();
                ret_val = pm_unlock_state(LCD_NORMAL, PM_RESET_TIMER);
-               DEBUG_SERVER_MSG("net_nfc_controller_disconnect pm_unlock_state"
-                               "[%d]!!", ret_val);
+               NFC_DBG("net_nfc_controller_disconnect pm_unlock_state[%d]!!", ret_val);
        }
 
        if (net_nfc_controller_llcp_disconnect(GUINT_TO_POINTER(data->handle),
@@ -1161,7 +1160,7 @@ static void llcp_handle_disconnect_thread_func(gpointer user_data)
                                llcp_disconnect_cb,
                                data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_disconnect failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_disconnect failed [%d]", result);
 
                net_nfc_gdbus_llcp_complete_disconnect(data->llcp,
                                data->invocation,
@@ -1185,7 +1184,7 @@ static gboolean llcp_handle_config(NetNfcGDbusLlcp *llcp,
        gboolean result;
        LlcpConfigData *data;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1193,7 +1192,7 @@ static gboolean llcp_handle_config(NetNfcGDbusLlcp *llcp,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "w") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1250,7 +1249,7 @@ static gboolean llcp_handle_listen(NetNfcGDbusLlcp *llcp,
        gboolean result;
        LlcpListenData *data;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1258,7 +1257,7 @@ static gboolean llcp_handle_listen(NetNfcGDbusLlcp *llcp,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1312,7 +1311,7 @@ static gboolean llcp_handle_accept(NetNfcGDbusLlcp *llcp,
        gboolean result;
        LlcpAcceptData *data;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1320,7 +1319,7 @@ static gboolean llcp_handle_accept(NetNfcGDbusLlcp *llcp,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1367,7 +1366,7 @@ static gboolean llcp_handle_reject(NetNfcGDbusLlcp *llcp,
        gboolean result;
        LlcpAcceptData *data;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1375,7 +1374,7 @@ static gboolean llcp_handle_reject(NetNfcGDbusLlcp *llcp,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1426,7 +1425,7 @@ static gboolean llcp_handle_connect(NetNfcGDbusLlcp *llcp,
        gboolean result;
        LlcpConnectData *data;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1434,7 +1433,7 @@ static gboolean llcp_handle_connect(NetNfcGDbusLlcp *llcp,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1491,7 +1490,7 @@ static gboolean llcp_handle_connect_sap(NetNfcGDbusLlcp *llcp,
        gboolean result;
        LlcpConnectSapData *data;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1499,7 +1498,7 @@ static gboolean llcp_handle_connect_sap(NetNfcGDbusLlcp *llcp,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1551,7 +1550,7 @@ static gboolean llcp_handle_send(NetNfcGDbusLlcp *llcp,
        gboolean result;
        LlcpSendData *data;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1559,7 +1558,7 @@ static gboolean llcp_handle_send(NetNfcGDbusLlcp *llcp,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "w") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1612,7 +1611,7 @@ static gboolean llcp_handle_send_to(NetNfcGDbusLlcp *llcp,
        gboolean result;
        LlcpSendToData *data;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1620,7 +1619,7 @@ static gboolean llcp_handle_send_to(NetNfcGDbusLlcp *llcp,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1673,7 +1672,7 @@ static gboolean llcp_handle_receive(NetNfcGDbusLlcp *llcp,
        gboolean result;
        LlcpReceiveData *data;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1681,7 +1680,7 @@ static gboolean llcp_handle_receive(NetNfcGDbusLlcp *llcp,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "w") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1730,7 +1729,7 @@ static gboolean llcp_handle_receive_from(NetNfcGDbusLlcp *llcp,
        gboolean result;
        LlcpReceiveData *data;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1738,7 +1737,7 @@ static gboolean llcp_handle_receive_from(NetNfcGDbusLlcp *llcp,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "w") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1786,7 +1785,7 @@ static gboolean llcp_handle_close(NetNfcGDbusLlcp *llcp,
        gboolean result;
        LlcpCloseData *data;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1794,7 +1793,7 @@ static gboolean llcp_handle_close(NetNfcGDbusLlcp *llcp,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "w") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1841,7 +1840,7 @@ static gboolean llcp_handle_disconnect(NetNfcGDbusLlcp *llcp,
        gboolean result;
        LlcpDisconnectData *data;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1849,7 +1848,7 @@ static gboolean llcp_handle_disconnect(NetNfcGDbusLlcp *llcp,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "w") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1902,7 +1901,7 @@ void net_nfc_server_llcp_deactivated(gpointer user_data)
                        }
                        else
                        {
-                               DEBUG_SERVER_MSG("target was not connected.");
+                               NFC_ERR("target was not connected.");
                        }
                }
 
@@ -1910,7 +1909,7 @@ void net_nfc_server_llcp_deactivated(gpointer user_data)
        }
        else
        {
-               DEBUG_SERVER_MSG("the target was disconnected");
+               NFC_ERR("the target was disconnected");
        }
 
        /* send p2p detatch */
@@ -1950,7 +1949,7 @@ static void llcp_simple_listen_cb(net_nfc_llcp_socket_t socket,
        g_assert(simple_data != NULL);
 
        if (result != NET_NFC_OK) {
-               DEBUG_ERR_MSG("listen socket failed, [%d]", result);
+               NFC_ERR("listen socket failed, [%d]", result);
        }
 
        if (simple_data->callback)
@@ -1976,7 +1975,7 @@ static void llcp_simple_connect_cb(net_nfc_llcp_socket_t socket,
        g_assert(simple_data != NULL);
 
        if (result != NET_NFC_OK) {
-               DEBUG_ERR_MSG("connect socket failed, [%d]", result);
+               NFC_ERR("connect socket failed, [%d]", result);
        }
 
        if (simple_data->callback)
@@ -2186,14 +2185,14 @@ net_nfc_error_e net_nfc_server_llcp_simple_server(net_nfc_target_handle_s *handl
                                &config,
                                &result) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_get_remote_config failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_get_remote_config failed [%d]", result);
 
                goto ERROR;
        }
 
        simple_data = g_try_new0(LlcpSimpleData, 1);
        if (simple_data == NULL) {
-               DEBUG_ERR_MSG("g_try_new0 failed");
+               NFC_ERR("g_try_new0 failed");
 
                result = NET_NFC_ALLOC_FAIL;
 
@@ -2215,7 +2214,7 @@ net_nfc_error_e net_nfc_server_llcp_simple_server(net_nfc_target_handle_s *handl
                                llcp_simple_socket_error_cb,
                                simple_data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_create_socket failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_create_socket failed [%d]", result);
 
                goto ERROR;
        }
@@ -2226,7 +2225,7 @@ net_nfc_error_e net_nfc_server_llcp_simple_server(net_nfc_target_handle_s *handl
                                sap,
                                &result) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_bind failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_bind failed [%d]", result);
 
                goto ERROR;
        }
@@ -2238,12 +2237,12 @@ net_nfc_error_e net_nfc_server_llcp_simple_server(net_nfc_target_handle_s *handl
                                llcp_simple_listen_cb,
                                simple_data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_listen failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_listen failed [%d]", result);
 
                goto ERROR;
        }
 
-       DEBUG_SERVER_MSG("result [%d]", result);
+       NFC_DBG("result [%d]", result);
 
        if (result == NET_NFC_BUSY)
                result = NET_NFC_OK;
@@ -2284,14 +2283,14 @@ net_nfc_error_e net_nfc_server_llcp_simple_client(
                                &config,
                                &result) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_get_remote_config failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_get_remote_config failed [%d]", result);
 
                goto ERROR;
        }
 
        simple_data = g_try_new0(LlcpSimpleData, 1);
        if (simple_data == NULL) {
-               DEBUG_ERR_MSG("g_try_new0 failed");
+               NFC_ERR("g_try_new0 failed");
 
                result = NET_NFC_ALLOC_FAIL;
 
@@ -2313,7 +2312,7 @@ net_nfc_error_e net_nfc_server_llcp_simple_client(
                                llcp_simple_socket_error_cb,
                                simple_data) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_create_socket failed [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_create_socket failed [%d]", result);
 
                goto ERROR;
        }
@@ -2329,7 +2328,7 @@ net_nfc_error_e net_nfc_server_llcp_simple_client(
                                        llcp_simple_connect_cb,
                                        simple_data) == false)
                {
-                       DEBUG_ERR_MSG("net_nfc_controller_llcp_connect failed [%d]", result);
+                       NFC_ERR("net_nfc_controller_llcp_connect failed [%d]", result);
 
                        goto ERROR;
                }
@@ -2343,13 +2342,13 @@ net_nfc_error_e net_nfc_server_llcp_simple_client(
                                        llcp_simple_connect_cb,
                                        simple_data) == false)
                {
-                       DEBUG_ERR_MSG("net_nfc_controller_llcp_connect_by_url failed [%d]", result);
+                       NFC_ERR("net_nfc_controller_llcp_connect_by_url failed [%d]", result);
 
                        goto ERROR;
                }
        }
 
-       DEBUG_SERVER_MSG("result [%d]", result);
+       NFC_DBG("result [%d]", result);
 
        if (result == NET_NFC_BUSY)
                result = NET_NFC_OK;
@@ -2391,10 +2390,10 @@ net_nfc_error_e net_nfc_server_llcp_simple_accept(
                                        llcp_simple_socket_error_cb,
                                        simple_data) == false)
                {
-                       DEBUG_ERR_MSG("net_nfc_controller_llcp_accept failed [%d]", result);
+                       NFC_ERR("net_nfc_controller_llcp_accept failed [%d]", result);
                }
        } else {
-               DEBUG_ERR_MSG("g_try_new0 failed");
+               NFC_ERR("g_try_new0 failed");
 
                result = NET_NFC_ALLOC_FAIL;
        }
@@ -2429,11 +2428,11 @@ net_nfc_error_e net_nfc_server_llcp_simple_send(
                                        llcp_simple_send_cb,
                                        simple_data) == false)
                {
-                       DEBUG_ERR_MSG("net_nfc_controller_llcp_send failed [%d]",
+                       NFC_ERR("net_nfc_controller_llcp_send failed [%d]",
                                        result);
                }
        } else {
-               DEBUG_ERR_MSG("g_try_new0 failed");
+               NFC_ERR("g_try_new0 failed");
 
                result = NET_NFC_ALLOC_FAIL;
        }
@@ -2467,12 +2466,12 @@ net_nfc_error_e net_nfc_server_llcp_simple_receive(
                                        llcp_simple_receive_cb,
                                        simple_data) == false)
                {
-                       DEBUG_ERR_MSG("net_nfc_controller_llcp_recv failed [%d]", result);
+                       NFC_ERR("net_nfc_controller_llcp_recv failed [%d]", result);
 
                        g_free(simple_data);
                }
        } else {
-               DEBUG_ERR_MSG("g_try_new0 failed");
+               NFC_ERR("g_try_new0 failed");
 
                result = NET_NFC_ALLOC_FAIL;
        }
@@ -2514,7 +2513,7 @@ static net_nfc_error_e _llcp_add_service(const char *id, uint32_t sap,
        net_nfc_error_e result;
 
        if (cb == NULL) {
-               DEBUG_ERR_MSG("callback is mandatory");
+               NFC_ERR("callback is mandatory");
 
                return NET_NFC_NULL_PARAMETER;
        }
@@ -2522,7 +2521,7 @@ static net_nfc_error_e _llcp_add_service(const char *id, uint32_t sap,
        _llcp_init();
 
        if (_llcp_find_service(sap) == NULL) {
-               DEBUG_SERVER_MSG("new service, sap [%d]", sap);
+               NFC_DBG("new service, sap [%d]", sap);
 
                service = g_try_new0(service_t, 1);
                if (service != NULL) {
@@ -2541,12 +2540,12 @@ static net_nfc_error_e _llcp_add_service(const char *id, uint32_t sap,
 
                        result = NET_NFC_OK;
                } else {
-                       DEBUG_ERR_MSG("alloc failed");
+                       NFC_ERR("alloc failed");
 
                        result = NET_NFC_ALLOC_FAIL;
                }
        } else {
-               DEBUG_ERR_MSG("already registered");
+               NFC_ERR("already registered");
 
                result = NET_NFC_ALREADY_REGISTERED;
        }
@@ -2630,7 +2629,7 @@ net_nfc_error_e net_nfc_server_llcp_unregister_service(const char *id,
 
                result = NET_NFC_OK;
        } else {
-               DEBUG_ERR_MSG("service is not registered");
+               NFC_ERR("service is not registered");
 
                result = NET_NFC_NOT_REGISTERED;
        }
@@ -2693,29 +2692,24 @@ static void net_nfc_server_llcp_process(gpointer user_data)
 
        handle = target->handle;
 
-       DEBUG_SERVER_MSG("connection type = [%d]", handle->connection_type);
+       NFC_DBG("connection type = [%d]", handle->connection_type);
 #if 0
        dev_type = target->devType;
 
        if (dev_type == NET_NFC_NFCIP1_TARGET)
        {
-               DEBUG_SERVER_MSG("LLCP : target, try to connect");
+               NFC_DBG("LLCP : target, try to connect");
 
                if (net_nfc_controller_connect(handle, &result) == false)
                {
-                       DEBUG_SERVER_MSG("%s is failed, [%d]",
-                                       "net_nfc_controller_connect",
-                                       result);
+                       NFC_ERR("net_nfc_controller_connect is failed, [%d]", result);
 
                        if (net_nfc_controller_configure_discovery(
                                                NET_NFC_DISCOVERY_MODE_RESUME,
                                                NET_NFC_ALL_ENABLE,
                                                &result) == false)
                        {
-                               DEBUG_ERR_MSG("%s is failed [%d]",
-                                               "net_nfc_controller_configure_discovery",
-                                               result);
-
+                               NFC_ERR("net_nfc_controller_configure_discovery is failed [%d]", result);
                                net_nfc_controller_exception_handler();
                        }
 
@@ -2723,22 +2717,19 @@ static void net_nfc_server_llcp_process(gpointer user_data)
                }
        }
 
-       DEBUG_SERVER_MSG("check LLCP");
+       NFC_DBG("check LLCP");
 
        if (net_nfc_controller_llcp_check_llcp(handle, &result) == false)
        {
-               DEBUG_ERR_MSG("%s is failed [%d]",
-                               "net_nfc_controller_llcp_check_llcp",
-                               result);
-
+               NFC_ERR("net_nfc_controller_llcp_check_llcp is failed [%d]", result);
                return;
        }
 
-       DEBUG_SERVER_MSG("activate LLCP");
+       NFC_DBG("activate LLCP");
 
        if (net_nfc_controller_llcp_activate_llcp(handle, &result) == false)
        {
-               DEBUG_ERR_MSG("%s is failed [%d]",
+               NFC_ERR("%s is failed [%d]",
                                "net_nfc_controller_llcp_activate_llcp",
                                result);
 
@@ -2755,6 +2746,6 @@ void net_nfc_server_llcp_target_detected(void *info)
        if (net_nfc_server_controller_async_queue_push(
                                net_nfc_server_llcp_process, NULL) == FALSE)
        {
-               DEBUG_ERR_MSG("can not push to controller thread");
+               NFC_ERR("can not push to controller thread");
        }
 }
index f3bba02..9dd3566 100644 (file)
@@ -73,7 +73,7 @@ static net_nfc_error_e manager_active(void)
 
        if (net_nfc_controller_is_ready(&result) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_is_ready failed [%d]", result);
+               NFC_ERR("net_nfc_controller_is_ready failed [%d]", result);
 
                return result;
        }
@@ -82,7 +82,7 @@ static net_nfc_error_e manager_active(void)
        ret = vconf_get_int(VCONFKEY_NFC_SE_TYPE, &se_type);
        if (ret == 0)
        {
-               DEBUG_SERVER_MSG("manager_active  se_type [%d]",se_type);
+               NFC_DBG("manager_active  se_type [%d]",se_type);
                result = net_nfc_server_se_change_se(se_type);
        }
 
@@ -103,14 +103,14 @@ static net_nfc_error_e manager_active(void)
                /* vconf on */
                if (vconf_set_bool(VCONFKEY_NFC_STATE, TRUE) != 0)
                {
-                       DEBUG_ERR_MSG("vconf_set_bool is failed");
+                       NFC_ERR("vconf_set_bool is failed");
 
                        result = NET_NFC_OPERATION_FAIL;
                }
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_controller_configure_discovery is failed, [%d]", result);
+               NFC_ERR("net_nfc_controller_configure_discovery is failed, [%d]", result);
        }
 
        return result;
@@ -123,7 +123,7 @@ static net_nfc_error_e manager_deactive(void)
 
        if (net_nfc_controller_is_ready(&result) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_is_ready failed [%d]", result);
+               NFC_ERR("net_nfc_controller_is_ready failed [%d]", result);
 
                return result;
        }
@@ -142,14 +142,14 @@ static net_nfc_error_e manager_deactive(void)
                /* vconf off */
                if (vconf_set_bool(VCONFKEY_NFC_STATE, FALSE) != 0)
                {
-                       DEBUG_ERR_MSG("vconf_set_bool is failed");
+                       NFC_ERR("vconf_set_bool is failed");
 
                        result = NET_NFC_OPERATION_FAIL;
                }
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_controller_configure_discovery is failed, [%d]", result);
+               NFC_ERR("net_nfc_controller_configure_discovery is failed, [%d]", result);
        }
 
        return result;
@@ -174,13 +174,13 @@ static void manager_handle_active_thread_func(gpointer user_data)
                        result);
 
        if (result == NET_NFC_OK) {
-               INFO_MSG("nfc %s", data->is_active ?
+               NFC_INFO("nfc %s", data->is_active ?
                                "activated" : "deactivated");
 
                net_nfc_gdbus_manager_emit_activated(data->manager,
                                data->is_active);
        } else {
-               DEBUG_ERR_MSG("activation change failed, [%d]", result);
+               NFC_ERR("activation change failed, [%d]", result);
        }
 
        g_object_unref(data->invocation);
@@ -206,7 +206,7 @@ static gboolean manager_handle_set_active(NetNfcGDbusManager *manager,
        ManagerActivationData *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -214,17 +214,17 @@ static gboolean manager_handle_set_active(NetNfcGDbusManager *manager,
                                smack_privilege,
                                "nfc-manager::admin",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
 
-       DEBUG_SERVER_MSG("is_active %d", arg_is_active);
+       NFC_DBG("is_active %d", arg_is_active);
 
        data = g_try_new0(ManagerActivationData, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -259,7 +259,7 @@ static gboolean manager_handle_get_server_state(NetNfcGDbusManager *manager,
 {
        guint32 state;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -267,7 +267,7 @@ static gboolean manager_handle_get_server_state(NetNfcGDbusManager *manager,
                                smack_privilege,
                                "nfc-manager::admin",
                                "r") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -296,14 +296,14 @@ static void manager_active_thread_func(gpointer user_data)
                ret = manager_deactive();
        if (ret == NET_NFC_OK)
        {
-               INFO_MSG("nfc %s",
+               NFC_INFO("nfc %s",
                                data->is_active ? "activated" : "deactivated");
 
                net_nfc_gdbus_manager_emit_activated(data->manager, data->is_active);
        }
        else
        {
-               DEBUG_ERR_MSG("activation change failed, [%d]", ret);
+               NFC_ERR("activation change failed, [%d]", ret);
        }
 
        g_free(data);
@@ -334,7 +334,7 @@ gboolean net_nfc_server_manager_init(GDBusConnection *connection)
                                "/org/tizen/NetNfcService/Manager",
                                &error) == FALSE)
        {
-               DEBUG_ERR_MSG("Can not skeleton_export %s", error->message);
+               NFC_ERR("Can not skeleton_export %s", error->message);
 
                g_error_free(error);
 
@@ -361,17 +361,17 @@ void net_nfc_server_manager_set_active(gboolean is_active)
 
        if (manager_skeleton == NULL)
        {
-               DEBUG_ERR_MSG("net_nfc_server_manager is not initialized");
+               NFC_ERR("net_nfc_server_manager is not initialized");
 
                return;
        }
 
-       DEBUG_SERVER_MSG("is_active %d", is_active);
+       NFC_DBG("is_active %d", is_active);
 
        data = g_try_new0(ManagerActivationData, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
 
                return;
        }
@@ -383,7 +383,7 @@ void net_nfc_server_manager_set_active(gboolean is_active)
                                manager_active_thread_func,
                                data) == FALSE)
        {
-               DEBUG_ERR_MSG("can not push to controller thread");
+               NFC_ERR("can not push to controller thread");
 
                g_object_unref(data->manager);
                g_free(data);
index b67182d..e2252e9 100644 (file)
@@ -242,7 +242,7 @@ static gboolean ndef_handle_read(NetNfcGDbusNdef *ndef,
        ReadData *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -250,7 +250,7 @@ static gboolean ndef_handle_read(NetNfcGDbusNdef *ndef,
                                smack_privilege,
                                "nfc-manager::tag",
                                "r") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -258,7 +258,7 @@ static gboolean ndef_handle_read(NetNfcGDbusNdef *ndef,
        data = g_new0(ReadData, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -298,7 +298,7 @@ static gboolean ndef_handle_write(NetNfcGDbusNdef *ndef,
        WriteData *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -306,7 +306,7 @@ static gboolean ndef_handle_write(NetNfcGDbusNdef *ndef,
                                smack_privilege,
                                "nfc-manager::tag",
                                "w") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -314,7 +314,7 @@ static gboolean ndef_handle_write(NetNfcGDbusNdef *ndef,
        data = g_new0(WriteData, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -357,7 +357,7 @@ static gboolean ndef_handle_make_read_only(NetNfcGDbusNdef *ndef,
        MakeReadOnlyData *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -365,7 +365,7 @@ static gboolean ndef_handle_make_read_only(NetNfcGDbusNdef *ndef,
                                smack_privilege,
                                "nfc-manager::tag",
                                "w") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -373,7 +373,7 @@ static gboolean ndef_handle_make_read_only(NetNfcGDbusNdef *ndef,
        data = g_new0(MakeReadOnlyData, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -413,7 +413,7 @@ static gboolean ndef_handle_format(NetNfcGDbusNdef *ndef,
        FormatData *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -421,7 +421,7 @@ static gboolean ndef_handle_format(NetNfcGDbusNdef *ndef,
                                smack_privilege,
                                "nfc-manager::tag",
                                "w") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -429,7 +429,7 @@ static gboolean ndef_handle_format(NetNfcGDbusNdef *ndef,
        data = g_new0(FormatData, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
index 12f64ec..be4da2f 100644 (file)
@@ -89,7 +89,7 @@ static gboolean p2p_handle_send(NetNfcGDbusP2p *p2p,
        gboolean result;
        P2pSendData *data;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -97,7 +97,7 @@ static gboolean p2p_handle_send(NetNfcGDbusP2p *p2p,
                                smack_privilege,
                                "nfc-manager::p2p",
                                "w") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -105,7 +105,7 @@ static gboolean p2p_handle_send(NetNfcGDbusP2p *p2p,
        data = g_new0(P2pSendData, 1);
        if(data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -180,7 +180,7 @@ void net_nfc_server_p2p_deinit(void)
 
 void net_nfc_server_p2p_detached(void)
 {
-       INFO_MSG("====== p2p target detached ======");
+       NFC_INFO("====== p2p target detached ======");
 
        /* release target information */
        net_nfc_server_free_target_info();
@@ -193,11 +193,11 @@ void net_nfc_server_p2p_detached(void)
 
 void net_nfc_server_p2p_discovered(net_nfc_target_handle_h handle)
 {
-       INFO_MSG("====== p2p target discovered ======");
+       NFC_INFO("====== p2p target discovered ======");
 
        if (p2p_skeleton == NULL)
        {
-               DEBUG_ERR_MSG("p2p_skeleton is not initialized");
+               NFC_ERR("p2p_skeleton is not initialized");
 
                return;
        }
@@ -212,7 +212,7 @@ void net_nfc_server_p2p_received(data_h user_data)
 
        if (p2p_skeleton == NULL)
        {
-               DEBUG_ERR_MSG("p2p_skeleton is not initialized");
+               NFC_ERR("p2p_skeleton is not initialized");
 
                return;
        }
index c412597..8000700 100755 (executable)
@@ -76,8 +76,7 @@ typedef struct _net_nfc_server_handover_process_config_context_t
 
 
 
-static void _net_nfc_server_handover_send_response(
-               net_nfc_error_e result,
+static void _net_nfc_server_handover_send_response(net_nfc_error_e result,
                net_nfc_conn_handover_carrier_type_e carrier,
                data_s *ac_data,
                void *user_param);
@@ -237,14 +236,11 @@ static void _net_nfc_server_handover_bt_get_carrier_record_cb(
                                                record,
                                                cps)) == NET_NFC_OK)
                {
-                       DEBUG_SERVER_MSG("net_nfc_util_append_carrier"
-                                       "_config_record success");
+                       NFC_DBG("net_nfc_util_append_carrier_config_record success");
                }
                else
                {
-                       DEBUG_ERR_MSG("net_nfc_util_append_carrier"
-                                       "_config_record failed [%d]",
-                                       result);
+                       NFC_ERR("net_nfc_util_append_carrier_config_record failed [%d]", result);
                        net_nfc_util_free_record(record);
                }
 
@@ -282,12 +278,12 @@ static void _net_nfc_server_handover_bss_get_carrier_record_cb(
                                                record,
                                                cps)) == NET_NFC_OK)
                {
-                       DEBUG_SERVER_MSG("net_nfc_util_append_carrier"
+                       NFC_DBG("net_nfc_util_append_carrier"
                                        "_config_record success");
                }
                else
                {
-                       DEBUG_ERR_MSG("net_nfc_util_append_carrier"
+                       NFC_ERR("net_nfc_util_append_carrier"
                                        "_config_record failed [%d]",
                                        result);
                        net_nfc_util_free_record(record);
@@ -318,7 +314,7 @@ static void _net_nfc_server_handover_bt_process_carrier_record_cb(
        }
        else
        {
-               DEBUG_ERR_MSG("_handover_bt_process_carrier_record failed [%d]",
+               NFC_ERR("_handover_bt_process_carrier_record failed [%d]",
                                result);
        }
 
@@ -342,11 +338,12 @@ static void _net_nfc_server_handover_bss_process_carrier_record_cb(
                        context->cb(result, type, data, context->user_param);
                }
                else
-                       DEBUG_ERR_MSG("Invalid Callback");
+                       NFC_ERR("Invalid Callback");
 
                _net_nfc_util_free_mem(context);
        }
 }
+
 net_nfc_error_e
 net_nfc_server_handover_get_carrier_record_by_priority_order(
                ndef_message_s *request,
@@ -384,12 +381,8 @@ net_nfc_server_handover_get_carrier_record_by_priority_order(
                                                                &carrier_type)== NET_NFC_OK)
                                                && (carrier_type == priority))
                                {
-                                       DEBUG_SERVER_MSG("selected carrier type"
-                                                       " = [%d]", carrier_type);
-                                       net_nfc_util_get_carrier_config_record(
-                                                       request,
-                                                       idx,
-                                                       record);
+                                       NFC_DBG("selected carrier type = [%d]", carrier_type);
+                                       net_nfc_util_get_carrier_config_record(request, idx, record);
                                        result = NET_NFC_OK;
                                        break;
                                }
@@ -398,7 +391,7 @@ net_nfc_server_handover_get_carrier_record_by_priority_order(
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_util_get_alternative_carrier"
+               NFC_ERR("net_nfc_util_get_alternative_carrier"
                                "_record_count failed");
        }
 
@@ -433,7 +426,7 @@ static net_nfc_error_e _net_nfc_server_handover_create_requester_from_rawdata(
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("record is not valid or"
+                               NFC_ERR("record is not valid or"
                                                " is not available");
                                net_nfc_util_free_ndef_message(*requestor);
                                result = NET_NFC_INVALID_PARAM;
@@ -441,11 +434,11 @@ static net_nfc_error_e _net_nfc_server_handover_create_requester_from_rawdata(
                }
                else
                {
-                       DEBUG_ERR_MSG("_net_nfc_ndef_rawdata_to_ndef"
+                       NFC_ERR("_net_nfc_ndef_rawdata_to_ndef"
                                        "failed [%d]",result);
                }
        } else {
-               DEBUG_ERR_MSG("net_nfc_util_create_ndef_message failed [%d]",
+               NFC_ERR("net_nfc_util_create_ndef_message failed [%d]",
                                result);
        }
 
@@ -477,7 +470,7 @@ net_nfc_error_e net_nfc_server_handover_create_selector_from_rawdata(
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("record is not valid or is "
+                               NFC_ERR("record is not valid or is "
                                                "not available");
                                net_nfc_util_free_ndef_message(*selector);
                                result = NET_NFC_INVALID_PARAM;
@@ -485,13 +478,13 @@ net_nfc_error_e net_nfc_server_handover_create_selector_from_rawdata(
                }
                else
                {
-                       DEBUG_ERR_MSG("_net_nfc_ndef_rawdata_to_ndef"
+                       NFC_ERR("_net_nfc_ndef_rawdata_to_ndef"
                                        " failed [%d]",result);
                }
        }
        else
        {
-               DEBUG_ERR_MSG("_net_nfc_util_create_ndef_message"
+               NFC_ERR("_net_nfc_util_create_ndef_message"
                                " failed [%d]",result);
        }
 
@@ -514,21 +507,21 @@ static bool _net_nfc_server_handover_check_hr_record_validation(
        if (memcmp(rec->type_s.buffer, CH_REQ_RECORD_TYPE,
                                rec->type_s.length) != 0)
        {
-               DEBUG_ERR_MSG("This is not connection handover"
+               NFC_ERR("This is not connection handover"
                                " request message");
                goto ERROR;
        }
 
        if (rec->payload_s.buffer[0] != CH_VERSION)
        {
-               DEBUG_ERR_MSG("connection handover version is not matched");
+               NFC_ERR("connection handover version is not matched");
                goto ERROR;
        }
 
        if (net_nfc_util_get_alternative_carrier_record_count(message, &count)
                        != NET_NFC_OK || count == 0)
        {
-               DEBUG_ERR_MSG("there is no carrier reference");
+               NFC_ERR("there is no carrier reference");
                goto ERROR;
        }
 
@@ -558,7 +551,7 @@ static bool _net_nfc_server_handover_check_hs_record_validation(
        if (memcmp(rec->type_s.buffer, CH_SEL_RECORD_TYPE,
                                rec->type_s.length) != 0)
        {
-               DEBUG_ERR_MSG("This is not connection handover"
+               NFC_ERR("This is not connection handover"
                                " request message");
                goto ERROR;
        }
@@ -566,14 +559,14 @@ static bool _net_nfc_server_handover_check_hs_record_validation(
        if (net_nfc_util_get_alternative_carrier_record_count(
                                message,&count)!= NET_NFC_OK || count == 0)
        {
-               DEBUG_ERR_MSG("there is no carrrier reference");
+               NFC_ERR("there is no carrrier reference");
                goto ERROR;
        }
 
        /*      check version */
        if (rec->payload_s.buffer[0] != CH_VERSION)
        {
-               DEBUG_ERR_MSG("connection handover version"
+               NFC_ERR("connection handover version"
                                " is not matched");
                goto ERROR;
        }
@@ -641,7 +634,7 @@ static int _net_nfc_server_handover_iterate_carrier_configs_to_next(
        }
        else
        {
-               DEBUG_ERR_MSG("context->result is error [%d]", context->result);
+               NFC_ERR("context->result is error [%d]", context->result);
 
                g_idle_add(
                                (GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_step,
@@ -660,14 +653,14 @@ static int _net_nfc_server_handover_iterate_create_carrier_configs(
        switch (context->current_type)
        {
        case NET_NFC_CONN_HANDOVER_CARRIER_BT :
-               DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_BT]");
+               NFC_DBG("[NET_NFC_CONN_HANDOVER_CARRIER_BT]");
                net_nfc_server_handover_bt_get_carrier_record(
                                _net_nfc_server_handover_bt_get_carrier_record_cb,
                                context);
                break;
 
        case NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS :
-               DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS]");
+               NFC_DBG("[NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS]");
 
 #ifdef TARGET
                if(memcmp(context->ndef_message->records->type_s.buffer ,CH_SEL_RECORD_TYPE,
@@ -684,25 +677,25 @@ static int _net_nfc_server_handover_iterate_create_carrier_configs(
                                        _net_nfc_server_handover_bss_get_carrier_record_cb,
                                        context);
                }
-               DEBUG_MSG("[%d]",result);
+               NFC_DBG("[%d]",result);
                break;
 
                //      case NET_NFC_CONN_HANDOVER_CARRIER_WIFI_IBSS :
-               //              DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS]");
+               //              NFC_DBG("[NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS]");
                //              g_idle_add(
                //              (GSourceFunc)_net_nfc_server_handover_append_wifi_carrier_config,
                //                      context);
                //              break;
 
        case NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN :
-               DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN]");
+               NFC_DBG("[NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN]");
                g_idle_add(
                                (GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_step,
                                (gpointer)context);
                break;
 
        default :
-               DEBUG_MSG("[unknown : %d]", context->current_type);
+               NFC_DBG("[unknown : %d]", context->current_type);
                g_idle_add(
                                (GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_step,
                                (gpointer)context);
@@ -749,7 +742,7 @@ _net_nfc_server_handover_create_requester_carrier_configs(
        }
        else
        {
-               DEBUG_ERR_MSG("alloc failed");
+               NFC_ERR("alloc failed");
                result = NET_NFC_ALLOC_FAIL;
        }
 
@@ -769,14 +762,12 @@ _net_nfc_server_handover_create_selector_carrier_configs(
 
        LOGD("[%s:%d] START", __func__, __LINE__);
 
-       _net_nfc_util_alloc_mem(context, sizeof(net_nfc_server_handover_create_config_context_t));
+       _net_nfc_util_alloc_mem(context, sizeof(*context));
        if (context != NULL)
        {
                context->type = type;
                if (type == NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN)
-               {
                        context->current_type = NET_NFC_CONN_HANDOVER_CARRIER_BT;
-               }
                else
                        context->current_type = context->type;
 
@@ -792,7 +783,7 @@ _net_nfc_server_handover_create_selector_carrier_configs(
        }
        else
        {
-               DEBUG_ERR_MSG("alloc failed");
+               NFC_ERR("alloc failed");
                result = NET_NFC_ALLOC_FAIL;
        }
 
@@ -827,7 +818,7 @@ net_nfc_error_e net_nfc_server_handover_process_carrier_record(
                switch (type)
                {
                case NET_NFC_CONN_HANDOVER_CARRIER_BT :
-                       DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_BT]");
+                       NFC_DBG("[NET_NFC_CONN_HANDOVER_CARRIER_BT]");
                        net_nfc_server_handover_bt_process_carrier_record(
                                        carrier,
                                        _net_nfc_server_handover_bt_process_carrier_record_cb,
@@ -835,7 +826,7 @@ net_nfc_error_e net_nfc_server_handover_process_carrier_record(
                        break;
 
                case NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS :
-                       DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS]");
+                       NFC_DBG("[NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS]");
                        net_nfc_server_handover_bss_process_carrier_record(
                                        carrier,
                                        _net_nfc_server_handover_bss_process_carrier_record_cb,
@@ -843,19 +834,19 @@ net_nfc_error_e net_nfc_server_handover_process_carrier_record(
                        break;
 
                case NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN :
-                       DEBUG_MSG("[NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN]");
+                       NFC_DBG("[NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN]");
                        _net_nfc_util_free_mem(context);
                        break;
 
                default :
-                       DEBUG_MSG("[unknown]");
+                       NFC_DBG("[unknown]");
                        _net_nfc_util_free_mem(context);
                        break;
                }
        }
        else
        {
-               DEBUG_ERR_MSG("alloc failed");
+               NFC_ERR("alloc failed");
                result = NET_NFC_ALLOC_FAIL;
        }
 
@@ -901,13 +892,13 @@ static net_nfc_error_e _net_nfc_server_handover_select_carrier_record(
                                }
                                else
                                {
-                                       DEBUG_ERR_MSG("net_nfc_util_get_alternative"
+                                       NFC_ERR("net_nfc_util_get_alternative"
                                                        "_carrier_type_from_record failed [%d]", result);
                                }
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("_handover_get_carrier_record"
+                               NFC_ERR("_handover_get_carrier_record"
                                                "_by_priority_order failed [%d]", result);
                        }
                }
@@ -918,7 +909,7 @@ static net_nfc_error_e _net_nfc_server_handover_select_carrier_record(
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_util_get_alternative_carrier_record_count "
+               NFC_ERR("net_nfc_util_get_alternative_carrier_record_count "
                                "failed [%d]", result);
        }
 
@@ -933,8 +924,8 @@ static void _net_nfc_server_handover_create_carrier_configs_2_cb(
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_handover_server_create_carrier_config_cb"
-                       "result [%d]",result);
+       NFC_DBG("_net_nfc_server_handover_server_create_carrier_config_cb result [%d]",
+               result);
 
        if (context == NULL)
        {
@@ -948,14 +939,13 @@ static void _net_nfc_server_handover_create_carrier_configs_2_cb(
                                selector,
                                &context->data);
 
-               DEBUG_SERVER_MSG("selector message created, length [%d]",
-                               context->data.length);
+               NFC_DBG("selector message created, length [%d]", context->data.length);
 
                context->state = NET_NFC_LLCP_STEP_03;
        }
        else
        {
-               DEBUG_ERR_MSG("_net_nfc_server_handover_create_selector_msg failed [%d]",
+               NFC_ERR("_net_nfc_server_handover_create_selector_msg failed [%d]",
                                result);
                context->state = NET_NFC_MESSAGE_LLCP_ERROR;
        }
@@ -972,8 +962,8 @@ static void _net_nfc_server_handover_process_carrier_record_2_cb(
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_handover_server_process_carrier_record_cb"
-                       "result [%d]",result);
+       NFC_DBG("_net_nfc_server_handover_server_process_carrier_record_cb result [%d]",
+               result);
 
        context->result = result;
        if (result == NET_NFC_OK)
@@ -1006,7 +996,7 @@ static void _net_nfc_server_handover_get_response_process(
        switch (context->state)
        {
        case NET_NFC_LLCP_STEP_02 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
+               NFC_DBG("NET_NFC_LLCP_STEP_02");
 
                result = _net_nfc_server_handover_create_selector_carrier_configs(
                                context->type,
@@ -1015,13 +1005,13 @@ static void _net_nfc_server_handover_get_response_process(
 
                if (result != NET_NFC_OK)
                {
-                       DEBUG_ERR_MSG("_net_nfc_server_handover_create_"
+                       NFC_ERR("_net_nfc_server_handover_create_"
                                        "selector_carrier_config failed [%d]",result);
                }
                break;
 
        case NET_NFC_LLCP_STEP_03 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_03");
+               NFC_DBG("NET_NFC_LLCP_STEP_03");
 
                result = net_nfc_server_handover_process_carrier_record(
                                context->record,
@@ -1030,13 +1020,13 @@ static void _net_nfc_server_handover_get_response_process(
 
                if (result != NET_NFC_OK)
                {
-                       DEBUG_ERR_MSG("net_nfc_server_handover_process_carrier_record"
+                       NFC_ERR("net_nfc_server_handover_process_carrier_record"
                                        "failed [%d]",result);
                }
                break;
 
        case NET_NFC_LLCP_STEP_04 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_04");
+               NFC_DBG("NET_NFC_LLCP_STEP_04");
 
                /* response select message */
                result = net_nfc_server_snep_server_send_get_response(
@@ -1045,11 +1035,11 @@ static void _net_nfc_server_handover_get_response_process(
                break;
 
        case NET_NFC_STATE_ERROR :
-               DEBUG_SERVER_MSG("NET_NFC_STATE_ERROR");
+               NFC_DBG("NET_NFC_STATE_ERROR");
                break;
 
        default :
-               DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_??");
+               NFC_ERR("NET_NFC_LLCP_STEP_??");
                /* TODO */
                break;
        }
@@ -1065,8 +1055,7 @@ static bool _net_nfc_server_handover_get_response_cb(
        net_nfc_error_e result;
        ndef_message_s *request;
 
-       DEBUG_SERVER_MSG("type [%d], data [%p], user_param [%p]",
-                       type, data, user_param);
+       NFC_DBG("type [%d], data [%p], user_param [%p]", type, data, user_param);
 
        if (data == NULL || data->buffer == NULL)
        {
@@ -1110,7 +1099,7 @@ static bool _net_nfc_server_handover_get_response_cb(
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+                               NFC_ERR("_net_nfc_util_alloc_mem failed");
                                result = NET_NFC_ALLOC_FAIL;
                        }
                }
@@ -1123,8 +1112,7 @@ static bool _net_nfc_server_handover_get_response_cb(
        }
        else
        {
-               DEBUG_SERVER_MSG("it is not handover requester message, [%d]",
-                               result);
+               NFC_ERR("it is not handover requester message, [%d]", result);
        }
 
        return (result == NET_NFC_OK);
@@ -1140,8 +1128,8 @@ static void _net_nfc_server_handover_server_process_carrier_record_cb(
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_handover_server_process"
-                       "_carrier_record_cb result [%d]",result);
+       NFC_DBG("_net_nfc_server_handover_server_process_carrier_record_cb result [%d]",
+               result);
 
        context->result = result;
 
@@ -1161,8 +1149,8 @@ static void _net_nfc_server_handover_server_create_carrier_config_cb(
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_handover_server_create"
-                       "_carrier_config_cb,result [%d]",result);
+       NFC_DBG("_net_nfc_server_handover_server_create_carrier_config_cb,result [%d]",
+               result);
 
        if (context == NULL)
        {
@@ -1181,8 +1169,7 @@ static void _net_nfc_server_handover_server_create_carrier_config_cb(
                result = _net_nfc_server_handover_convert_ndef_message_to_data(
                                selector,
                                &context->data);
-               DEBUG_SERVER_MSG("selector message created, length [%d]",
-                               context->data.length);
+               NFC_DBG("selector message created, length [%d]", context->data.length);
                if(type == NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS)
                        context->state = NET_NFC_LLCP_STEP_04;
                else
@@ -1190,7 +1177,7 @@ static void _net_nfc_server_handover_server_create_carrier_config_cb(
        }
        else
        {
-               DEBUG_ERR_MSG("_net_nfc_server_handover_create_selector_msg"
+               NFC_ERR("_net_nfc_server_handover_create_selector_msg"
                                " failed [%d]", result);
                context->state = NET_NFC_MESSAGE_LLCP_ERROR;
        }
@@ -1209,8 +1196,8 @@ static void _net_nfc_server_handover_server_recv_cb(
                (net_nfc_handover_context_t *)user_param;
        ndef_message_s *request;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_handover_server_recv_cb,"
-                       " socket [%x], result [%d]", socket, result);
+       NFC_DBG("_net_nfc_server_handover_server_recv_cb, socket [%x], result [%d]",
+               socket, result);
 
        context->result = result;
 
@@ -1246,14 +1233,14 @@ static void _net_nfc_server_handover_server_recv_cb(
                }
                else
                {
-                       DEBUG_ERR_MSG("_net_nfc_server_handover_create"
+                       NFC_ERR("_net_nfc_server_handover_create"
                                        "_requester_from_rawdata failed [%d]",result);
                        context->state = NET_NFC_MESSAGE_LLCP_ERROR;
                }
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_server_llcp_simple_receive failed [%d]",
+               NFC_ERR("net_nfc_server_llcp_simple_receive failed [%d]",
                                result);
                context->state = NET_NFC_MESSAGE_LLCP_ERROR;
        }
@@ -1270,8 +1257,8 @@ static void _net_nfc_server_handover_server_send_cb(net_nfc_error_e result,
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_handover_server_send_cb"
-                       " socket [%x], result [%d]", socket, result);
+       NFC_DBG("_net_nfc_server_handover_server_send_cb socket[%x], result[%d]",
+               socket, result);
 
        context->result = result;
 
@@ -1284,7 +1271,7 @@ static void _net_nfc_server_handover_server_send_cb(net_nfc_error_e result,
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_server_llcp_simple_send failed [%d]",
+               NFC_ERR("net_nfc_server_llcp_simple_send failed [%d]",
                                result);
                context->state = NET_NFC_MESSAGE_LLCP_ERROR;
        }
@@ -1303,7 +1290,7 @@ static void _net_nfc_server_handover_server_process(
        switch (context->state)
        {
        case NET_NFC_LLCP_STEP_01 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_01");
+               NFC_DBG("NET_NFC_LLCP_STEP_01");
 
                /* receive request message */
                net_nfc_server_llcp_simple_receive(context->handle,
@@ -1313,7 +1300,7 @@ static void _net_nfc_server_handover_server_process(
                break;
 
        case NET_NFC_LLCP_STEP_02 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
+               NFC_DBG("NET_NFC_LLCP_STEP_02");
 
                context->result = _net_nfc_server_handover_create_selector_carrier_configs(
                                context->type,
@@ -1322,13 +1309,13 @@ static void _net_nfc_server_handover_server_process(
 
                if (context->result != NET_NFC_OK)
                {
-                       DEBUG_ERR_MSG("_net_nfc_server_handover_create_selector"
+                       NFC_ERR("_net_nfc_server_handover_create_selector"
                                        "_carrier_configs failed [%d]", context->result);
                }
                break;
 
        case NET_NFC_LLCP_STEP_03 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_03");
+               NFC_DBG("NET_NFC_LLCP_STEP_03");
 
                context->result = net_nfc_server_handover_process_carrier_record(
                                context->record,
@@ -1336,13 +1323,13 @@ static void _net_nfc_server_handover_server_process(
                                context);
                if (context->result != NET_NFC_OK)
                {
-                       DEBUG_ERR_MSG("_net_nfc_server_handover_process_carrier_"
+                       NFC_ERR("_net_nfc_server_handover_process_carrier_"
                                        "record failed [%d]",context->result);
                }
                break;
 
        case NET_NFC_LLCP_STEP_04 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_04");
+               NFC_DBG("NET_NFC_LLCP_STEP_04");
 
                /* send select message */
                net_nfc_server_llcp_simple_send(
@@ -1354,17 +1341,17 @@ static void _net_nfc_server_handover_server_process(
                break;
 
        case NET_NFC_STATE_ERROR :
-               DEBUG_SERVER_MSG("NET_NFC_STATE_ERROR");
+               NFC_DBG("NET_NFC_STATE_ERROR");
 
                /* error, invoke callback */
-               DEBUG_ERR_MSG("handover_server failed, [%d]",
+               NFC_ERR("handover_server failed, [%d]",
                                context->result);
 
                /* restart?? */
                break;
 
        default :
-               DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_??");
+               NFC_ERR("NET_NFC_LLCP_STEP_??");
                /* TODO */
                break;
        }
@@ -1380,7 +1367,7 @@ static void _net_nfc_server_handover_server_error_cb(
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
 
-       DEBUG_ERR_MSG("result [%d], socket [%x], user_param [%p]",
+       NFC_ERR("result [%d], socket [%x], user_param [%p]",
                        result, socket, user_param);
 
        if (context == NULL)
@@ -1402,15 +1389,14 @@ static void _net_nfc_server_handover_server_incomming_cb(
                data_s *data,
                void *user_param)
 {
-       DEBUG_SERVER_MSG("result [%d], socket [%x], user_param [%p]",
-                       result, socket, user_param);
+       NFC_DBG("result[%d], socket[%x], user_param[%p]", result, socket, user_param);
 
        net_nfc_handover_context_t *accept_context = NULL;
 
        _net_nfc_util_alloc_mem(accept_context, sizeof(*accept_context));
        if (accept_context == NULL)
        {
-               DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+               NFC_ERR("_net_nfc_util_alloc_mem failed");
 
                result = NET_NFC_ALLOC_FAIL;
                goto ERROR;
@@ -1428,7 +1414,7 @@ static void _net_nfc_server_handover_server_incomming_cb(
 
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_server_llcp_simple_accept failed, [%d]",
+               NFC_ERR("net_nfc_server_llcp_simple_accept failed, [%d]",
                                result);
 
                goto ERROR;
@@ -1470,15 +1456,9 @@ net_nfc_error_e net_nfc_server_handover_default_server_start(
                        NULL);
 
        if (result == NET_NFC_OK)
-       {
-               DEBUG_SERVER_MSG("start handover server, san [%s], sap [%d]",
-                               CH_SAN,CH_SAP);
-       }
+               NFC_DBG("start handover server, san[%s], sap[%d]", CH_SAN, CH_SAP);
        else
-       {
-               DEBUG_ERR_MSG("net_nfc_server_llcp_simple_server failed, [%d]",
-                               result);
-       }
+               NFC_ERR("net_nfc_server_llcp_simple_server failed, [%d]", result);
 
        return result;
 }
@@ -1488,8 +1468,7 @@ static void _handover_default_activate_cb(int event,
 {
        net_nfc_error_e result;
 
-       DEBUG_SERVER_MSG("event [%d], handle [%p], sap [%d], san [%s]",
-                       event, handle, sap, san);
+       NFC_DBG("event [%d], handle [%p], sap [%d], san [%s]", event, handle, sap, san);
 
        if (event == NET_NFC_LLCP_START) {
                /* start default handover server using snep */
@@ -1502,13 +1481,11 @@ static void _handover_default_activate_cb(int event,
                                _net_nfc_server_handover_server_incomming_cb,
                                _net_nfc_server_handover_server_error_cb, NULL);
 
-               if (result == NET_NFC_OK) {
-                       DEBUG_SERVER_MSG("start handover server, san [%s], sap [%d]",
-                                       CH_SAN, CH_SAP);
-               } else {
-                       DEBUG_ERR_MSG("net_nfc_service_llcp_server failed, [%d]",
-                                       result);
-               }
+               if (result == NET_NFC_OK)
+                       NFC_DBG("start handover server, san [%s], sap [%d]", CH_SAN, CH_SAP);
+               else
+                       NFC_ERR("net_nfc_service_llcp_server failed, [%d]", result);
+
        } else if (event == NET_NFC_LLCP_UNREGISTERED) {
                /* unregister server, do nothing */
        }
@@ -1572,8 +1549,8 @@ static void _net_nfc_server_handover_client_process_carrier_record_cb(
        net_nfc_handover_context_t *context =
                (net_nfc_handover_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_handover_server_process"
-                       "_carrier_record_cb,result [%d]",result);
+       NFC_DBG("_net_nfc_server_handover_server_process_carrier_record_cb, result[%d]",
+               result);
 
        context->result = result;
 
@@ -1599,8 +1576,7 @@ static void _net_nfc_server_handover_client_process_carrier_record_cb(
        _net_nfc_server_handover_client_process(context);
 }
 
-static void _net_nfc_server_handover_client_recv_cb(
-               net_nfc_error_e result,
+static void _net_nfc_server_handover_client_recv_cb(net_nfc_error_e result,
                net_nfc_target_handle_s *handle,
                net_nfc_llcp_socket_t socket,
                data_s *data,
@@ -1644,21 +1620,21 @@ static void _net_nfc_server_handover_client_recv_cb(
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("_get_carrier_record_by_priority_order"
+                               NFC_ERR("_get_carrier_record_by_priority_order"
                                                " failed, [%d]",result);
                                context->state = NET_NFC_STATE_ERROR;
                        }
                }
                else
                {
-                       DEBUG_ERR_MSG("_net_nfc_server_handover_create"
+                       NFC_ERR("_net_nfc_server_handover_create"
                                        "_selector_from_rawdata failed, [%d]",result);
                        context->state = NET_NFC_STATE_ERROR;
                }
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_server_llcp_simple_receive failed, [%d]",
+               NFC_ERR("net_nfc_server_llcp_simple_receive failed, [%d]",
                                result);
                context->state = NET_NFC_STATE_ERROR;
        }
@@ -1666,8 +1642,7 @@ static void _net_nfc_server_handover_client_recv_cb(
        _net_nfc_server_handover_client_process(context);
 }
 
-static void _net_nfc_server_handover_client_send_cb(
-               net_nfc_error_e result,
+static void _net_nfc_server_handover_client_send_cb(net_nfc_error_e result,
                net_nfc_target_handle_s *handle,
                net_nfc_llcp_socket_t socket,
                data_s *data,
@@ -1691,7 +1666,7 @@ static void _net_nfc_server_handover_client_send_cb(
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_server_llcp_simple_client failed, [%d]",
+               NFC_ERR("net_nfc_server_llcp_simple_client failed, [%d]",
                                result);
                context->state = NET_NFC_STATE_ERROR;
        }
@@ -1724,7 +1699,7 @@ static void _net_nfc_server_handover_client_create_carrier_configs_cb(
                }
                else
                {
-                       DEBUG_ERR_MSG("_net_nfc_server_handover_convert_ndef_"
+                       NFC_ERR("_net_nfc_server_handover_convert_ndef_"
                                        "message_to_data failed [%d]",result);
                        context->state = NET_NFC_STATE_ERROR;
                        context->result = result;
@@ -1732,7 +1707,7 @@ static void _net_nfc_server_handover_client_create_carrier_configs_cb(
        }
        else
        {
-               DEBUG_ERR_MSG("null param, [%d]", result);
+               NFC_ERR("null param, [%d]", result);
                context->state = NET_NFC_STATE_ERROR;
                context->result = result;
        }
@@ -1755,20 +1730,20 @@ static void _net_nfc_server_handover_client_process(
        switch (context->state)
        {
        case NET_NFC_LLCP_STEP_01 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_01");
+               NFC_DBG("NET_NFC_LLCP_STEP_01");
 
                if ((result = _net_nfc_server_handover_create_requester_carrier_configs(
                                                context->type,
                                                _net_nfc_server_handover_client_create_carrier_configs_cb,
                                                context)) != NET_NFC_OK)
                {
-                       DEBUG_ERR_MSG("_net_nfc_server_handover_create_requester"
+                       NFC_ERR("_net_nfc_server_handover_create_requester"
                                        "_carrier_configs failed [%d]",result);
                }
                break;
 
        case NET_NFC_LLCP_STEP_02 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
+               NFC_DBG("NET_NFC_LLCP_STEP_02");
 
                /* send request */
                net_nfc_server_llcp_simple_send(
@@ -1780,7 +1755,7 @@ static void _net_nfc_server_handover_client_process(
                break;
 
        case NET_NFC_LLCP_STEP_03 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_03");
+               NFC_DBG("NET_NFC_LLCP_STEP_03");
 
                /* receive response */
                net_nfc_server_llcp_simple_receive(context->handle,
@@ -1790,7 +1765,7 @@ static void _net_nfc_server_handover_client_process(
                break;
 
        case NET_NFC_LLCP_STEP_04 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_04");
+               NFC_DBG("NET_NFC_LLCP_STEP_04");
 
                result = net_nfc_server_handover_process_carrier_record(
                                context->record,
@@ -1799,13 +1774,12 @@ static void _net_nfc_server_handover_client_process(
 
                if (result != NET_NFC_OK)
                {
-                       DEBUG_ERR_MSG("net_nfc_server_handover_process_carrier_record"
-                                       "failed [%d]",result);
+                       NFC_ERR("net_nfc_server_handover_process_carrier_record failed [%d]",result);
                }
                break;
 
        case NET_NFC_LLCP_STEP_05 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_05");
+               NFC_DBG("NET_NFC_LLCP_STEP_05");
 
                /* start post process */
                if (context->type == NET_NFC_CONN_HANDOVER_CARRIER_BT)
@@ -1817,12 +1791,12 @@ static void _net_nfc_server_handover_client_process(
                }
                else
                {
-                       DEBUG_ERR_MSG("not supported...");
+                       NFC_ERR("not supported...");
                }
                break;
 
        case NET_NFC_LLCP_STEP_RETURN :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_RETURN");
+               NFC_DBG("NET_NFC_LLCP_STEP_RETURN");
 
                /* complete and invoke callback */
                _net_nfc_server_handover_send_response(
@@ -1838,7 +1812,7 @@ static void _net_nfc_server_handover_client_process(
 
        case NET_NFC_STATE_ERROR :
        default :
-               DEBUG_ERR_MSG("NET_NFC_STATE_ERROR");
+               NFC_ERR("NET_NFC_STATE_ERROR");
 
                _net_nfc_server_handover_send_response(
                                context->result,
@@ -1858,8 +1832,7 @@ static void _net_nfc_server_handover_client_connected_cb(
                data_s *data,
                void *user_param)
 {
-       DEBUG_SERVER_MSG("result [%d], socket [%x], user_param [%p]",
-                       result, socket, user_param);
+       NFC_DBG("result [%d], socket [%x], user_param [%p]", result, socket, user_param);
 
        HandoverRequestData *handover_data = NULL;
        handover_data = (HandoverRequestData *)user_param;
@@ -1879,13 +1852,13 @@ static void _net_nfc_server_handover_client_connected_cb(
                }
                else
                {
-                       DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+                       NFC_ERR("_net_nfc_util_alloc_mem failed");
                        result = NET_NFC_ALLOC_FAIL;
                }
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_server_llcp_simple_client"
+               NFC_ERR("net_nfc_server_llcp_simple_client"
                                " failed, [%d]", result);
        }
 }
@@ -1898,7 +1871,7 @@ static void _net_nfc_server_handover_client_error_cb(
                void *user_param)
 {
 
-       DEBUG_ERR_MSG("result [%d], socket [%x], user_param [%p]",
+       NFC_ERR("result [%d], socket [%x], user_param [%p]",
                        result, socket, user_param);
 
        if (false)
@@ -1929,7 +1902,7 @@ net_nfc_error_e net_nfc_server_handover_default_client_start(
 
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_server_llcp_simple_client"
+               NFC_ERR("net_nfc_server_llcp_simple_client"
                                " failed, [%d]",result);
        }
 
index c6c156d..ff41f02 100755 (executable)
@@ -15,7 +15,7 @@
  */
 #ifndef __NET_NFC_SERVER_PROCESS_HANDOVER_H__
 #define __NET_NFC_SERVER_PROCESS_HANDOVER_H__
-#include "net_nfc_server_handover_bt.h"
+
 #include "net_nfc_typedef_internal.h"
 
 net_nfc_error_e net_nfc_server_handover_default_server_start(
@@ -31,8 +31,7 @@ net_nfc_error_e net_nfc_server_handover_default_server_unregister();
 net_nfc_error_e net_nfc_server_handover_create_selector_from_rawdata(
                ndef_message_s **selector,data_s *data);
 
-net_nfc_error_e
-net_nfc_server_handover_get_carrier_record_by_priority_order(
+net_nfc_error_e net_nfc_server_handover_get_carrier_record_by_priority_order(
                ndef_message_s *request,ndef_record_s **record);
 
 net_nfc_error_e net_nfc_server_handover_process_carrier_record(
index 13e9893..642bf7d 100644 (file)
@@ -135,7 +135,7 @@ static net_nfc_error_e npp_create_message(data_s *data, data_s *message)
        {
                net_nfc_npp_entity_t *entity;
 
-               DEBUG_SERVER_MSG("data->length [%d]", data->length);
+               NFC_DBG("data->length [%d]", data->length);
 
                msg->entity_count = htonl(1);
 
@@ -178,7 +178,7 @@ static void npp_server_receive_cb(net_nfc_error_e result,
 
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("error [%d]", result);
+               NFC_ERR("error [%d]", result);
 
                if(npp_data->callback)
                        npp_data->callback(result, NULL, npp_data->user_data);
@@ -189,7 +189,7 @@ static void npp_server_receive_cb(net_nfc_error_e result,
 
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("data is NULL");
+               NFC_ERR("data is NULL");
 
                if(npp_data->callback)
                {
@@ -204,7 +204,7 @@ static void npp_server_receive_cb(net_nfc_error_e result,
 
        if (data->buffer == NULL || data->length == 0)
        {
-               DEBUG_ERR_MSG("Wrong data");
+               NFC_ERR("Wrong data");
 
                if(npp_data->callback)
                {
@@ -221,7 +221,7 @@ static void npp_server_receive_cb(net_nfc_error_e result,
 
        if (data->length < NPP_HEADER_LEN)
        {
-               DEBUG_ERR_MSG("too short data, length [%d]",
+               NFC_ERR("too short data, length [%d]",
                                data->length);
                /* FIXME!!! what should I do. */
                if(npp_data->callback)
@@ -238,7 +238,7 @@ static void npp_server_receive_cb(net_nfc_error_e result,
        if (GET_MAJOR_VER(message->version) > NPP_MAJOR_VER ||
                        GET_MINOR_VER(message->version > NPP_MINOR_VER))
        {
-               DEBUG_ERR_MSG("not supported version, version [0x%02x]",
+               NFC_ERR("not supported version, version [0x%02x]",
                                message->version);
 
                if(npp_data->callback)
@@ -256,7 +256,7 @@ static void npp_server_receive_cb(net_nfc_error_e result,
 
        if (entity_count > NPP_NDEF_ENTRY)
        {
-               DEBUG_ERR_MSG("too many entities, [%d]",
+               NFC_ERR("too many entities, [%d]",
                                message->entity_count);
 
                if(npp_data->callback)
@@ -275,7 +275,7 @@ static void npp_server_receive_cb(net_nfc_error_e result,
                entity = (message->entity + i);
 
                if (entity->op != NPP_ACTION_CODE) {
-                       DEBUG_ERR_MSG("not supported action code, [0x%02x]",
+                       NFC_ERR("not supported action code, [0x%02x]",
                                        entity->op);
 
                        if(npp_data->callback)
@@ -291,8 +291,7 @@ static void npp_server_receive_cb(net_nfc_error_e result,
 
                length = htonl(entity->length);
 
-               DEBUG_SERVER_MSG("action code [0x%02x], length [%d]",
-                               entity->op, length);
+               NFC_DBG("action code [0x%02x], length [%d]", entity->op, length);
 
                if (length > 0)
                {
@@ -342,12 +341,11 @@ static void npp_listen_cb(net_nfc_error_e result, net_nfc_target_handle_s *handl
        if (npp_data == NULL)
                return;
 
-       DEBUG_SERVER_MSG("npp_listen_cb, incoming socket [%#x], result [%d]",
-                       socket, result);
+       NFC_DBG("npp_listen_cb, incoming socket [%#x], result [%d]", socket, result);
 
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("listen failed [%d]", result);
+               NFC_ERR("listen failed [%d]", result);
 
                if (npp_data->callback)
                        npp_data->callback(result, NULL, npp_data->user_data);
@@ -370,7 +368,7 @@ static void npp_listen_cb(net_nfc_error_e result, net_nfc_target_handle_s *handl
                        accept_data);
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("%s failed",
+               NFC_ERR("%s failed",
                                "net_nfc_server_llcp_simple_accept");
 
                if (npp_data->callback)
@@ -382,8 +380,7 @@ static void npp_listen_cb(net_nfc_error_e result, net_nfc_target_handle_s *handl
                return;
        }
 
-       DEBUG_SERVER_MSG("socket [%x] accepted.. waiting for request message",
-                       socket);
+       NFC_DBG("socket [%x] accepted.. waiting for request message", socket);
 
        npp_server_process(accept_data);
        g_free(npp_data);
@@ -396,7 +393,7 @@ static void npp_client_disconnected_cb(net_nfc_llcp_socket_t socket,
                void *extra,
                void *user_param)
 {
-       DEBUG_SERVER_MSG("disconnected! [%d]", result);
+       NFC_INFO("disconnected! [%d]", result);
 }
 
 static void npp_client_send_cb(net_nfc_error_e result,
@@ -411,7 +408,7 @@ static void npp_client_send_cb(net_nfc_error_e result,
        if (npp_data == NULL)
                return;
 
-       DEBUG_SERVER_MSG("send complete... [%d]", result);
+       NFC_DBG("send complete... [%d]", result);
 
        if (npp_data->callback)
        {
@@ -440,7 +437,7 @@ static void npp_client_process(NppData *npp_data)
        result = npp_create_message(&npp_data->data, &data);
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("%s failed [%d]", "npp_create_message", result);
+               NFC_ERR("%s failed [%d]", "npp_create_message", result);
 
                if (npp_data->callback)
                        npp_data->callback(result, NULL, npp_data->user_data);
@@ -459,7 +456,7 @@ static void npp_client_process(NppData *npp_data)
                        npp_data);
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("%s failed [%d]",
+               NFC_ERR("%s failed [%d]",
                                "net_nfc_server_llcp_simple_send",
                                result);
 
@@ -488,7 +485,7 @@ static void npp_connected_cb(net_nfc_error_e result,
 
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("connect socket failed, [%d]", result);
+               NFC_ERR("connect socket failed, [%d]", result);
 
                if (npp_data->callback)
                        npp_data->callback(result, NULL, npp_data->user_data);
@@ -500,8 +497,7 @@ static void npp_connected_cb(net_nfc_error_e result,
        }
 
        /*start npp client */
-       DEBUG_SERVER_MSG("socket [%x] connected, send request message.",
-                       socket);
+       NFC_DBG("socket [%x] connected, send request message.", socket);
        npp_data->socket = socket;
 
        npp_client_process(npp_data);
@@ -516,7 +512,7 @@ static void npp_socket_error_cb(net_nfc_error_e result,
 {
        NppData *npp_data;
 
-       DEBUG_SERVER_MSG("socket [%x], result [%d]", socket, result);
+       NFC_DBG("socket [%x], result [%d]", socket, result);
 
        npp_data = (NppData *)user_data;
        if (npp_data == NULL)
@@ -533,18 +529,17 @@ static void npp_default_server_cb(net_nfc_error_e result,
                data_s *data,
                gpointer user_data)
 {
-       DEBUG_SERVER_MSG("result [%d], data [%p], user_data [%p]",
-                       result, data, user_data);
+       NFC_DBG("result [%d], data [%p], user_data [%p]", result, data, user_data);
 
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("npp server receive failed, [%d]", result);
+               NFC_ERR("npp server receive failed, [%d]", result);
                return;
        }
 
        if (data->buffer == NULL)
        {
-               DEBUG_ERR_MSG("npp server receive failed, [%d]", result);
+               NFC_ERR("npp server receive failed, [%d]", result);
                return;
        }
 
@@ -558,8 +553,7 @@ static void npp_default_client_cb(net_nfc_error_e result,
 {
        NppClientStartData *npp_client_data;
 
-       DEBUG_SERVER_MSG("result [%d], data [%p], user_data [%p]",
-                       result, data, user_data);
+       NFC_DBG("result [%d], data [%p], user_data [%p]", result, data, user_data);
 
        if (user_data == NULL)
                return;
@@ -581,13 +575,13 @@ net_nfc_error_e net_nfc_server_npp_server(net_nfc_target_handle_s *handle,
 
        if (handle == NULL)
        {
-               DEBUG_ERR_MSG("handle is NULL");
+               NFC_ERR("handle is NULL");
                return FALSE;
        }
 
        if (san == NULL)
        {
-               DEBUG_ERR_MSG("san is NULL");
+               NFC_ERR("san is NULL");
                return FALSE;
        }
 
@@ -605,7 +599,7 @@ net_nfc_error_e net_nfc_server_npp_server(net_nfc_target_handle_s *handle,
                        npp_data);
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("%s failed",
+               NFC_ERR("%s failed",
                                "net_nfc_server_llcp_simple_server");
 
                if (npp_data->callback)
@@ -616,7 +610,7 @@ net_nfc_error_e net_nfc_server_npp_server(net_nfc_target_handle_s *handle,
                return FALSE;
        }
 
-       DEBUG_SERVER_MSG("start npp server, san [%s], sap [%d]", san, sap);
+       NFC_DBG("start npp server, san [%s], sap [%d]", san, sap);
 
        return result;
 }
@@ -635,7 +629,7 @@ net_nfc_error_e net_nfc_server_npp_client(net_nfc_target_handle_s *handle,
 
        if (handle == NULL)
        {
-               DEBUG_ERR_MSG("handle is NULL");
+               NFC_ERR("handle is NULL");
                return NET_NFC_NULL_PARAMETER;
        }
 
@@ -643,7 +637,7 @@ net_nfc_error_e net_nfc_server_npp_client(net_nfc_target_handle_s *handle,
                                &config,
                                &result) == false)
        {
-               DEBUG_ERR_MSG("%s failed [%d]",
+               NFC_ERR("%s failed [%d]",
                                "net_nfc_controller_llcp_get_remote_config",
                                result);
 
@@ -653,7 +647,7 @@ net_nfc_error_e net_nfc_server_npp_client(net_nfc_target_handle_s *handle,
        if (config.miu <
                        data->length + NPP_HEADER_LEN + NPP_ENTITY_HEADER_LEN)
        {
-               DEBUG_ERR_MSG("too large message, max [%d], request [%d]",
+               NFC_ERR("too large message, max [%d], request [%d]",
                                config.miu - (NPP_HEADER_LEN + NPP_ENTITY_HEADER_LEN),
                                data->length);
 
@@ -677,7 +671,7 @@ net_nfc_error_e net_nfc_server_npp_client(net_nfc_target_handle_s *handle,
                        npp_data);
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("%s failed",
+               NFC_ERR("%s failed",
                                "net_nfc_server_llcp_simple_client");
 
                if (npp_data->callback)
@@ -694,15 +688,9 @@ net_nfc_error_e net_nfc_server_npp_client(net_nfc_target_handle_s *handle,
        }
 
        if (san != NULL)
-       {
-               DEBUG_SERVER_MSG("start npp client, san [%s], result [%d]",
-                               san, result);
-       }
+               NFC_DBG("start npp client, san [%s], result [%d]", san, result);
        else
-       {
-               DEBUG_SERVER_MSG("start npp client, sap [%d], result [%d]",
-                               sap, result);
-       }
+               NFC_DBG("start npp client, sap [%d], result [%d]", sap, result);
 
        return result;
 }
@@ -723,15 +711,14 @@ static void _npp_default_activate_cb(int event, net_nfc_target_handle_s *handle,
 {
        net_nfc_error_e result;
 
-       DEBUG_SERVER_MSG("event [%d], handle [%p], sap [%d], san [%s]",
-                       event, handle, sap, san);
+       NFC_DBG("event [%d], handle [%p], sap [%d], san [%s]", event, handle, sap, san);
 
        if (event == NET_NFC_LLCP_START) {
                /* start default npp server */
                result = net_nfc_server_npp_server(handle, (char *)san, sap,
                                npp_default_server_cb, user_param);
                if (result != NET_NFC_OK) {
-                       DEBUG_ERR_MSG("net_nfc_server_npp_server failed, [%d]",
+                       NFC_ERR("net_nfc_server_npp_server failed, [%d]",
                                        result);
                }
        } else if (event == NET_NFC_LLCP_UNREGISTERED) {
@@ -776,19 +763,19 @@ net_nfc_error_e net_nfc_server_npp_default_client_start(
 
        if (handle == NULL)
        {
-               DEBUG_ERR_MSG("handle is NULL");
+               NFC_ERR("handle is NULL");
                return NET_NFC_NULL_PARAMETER;
        }
 
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("data is NULL");
+               NFC_ERR("data is NULL");
                return NET_NFC_NULL_PARAMETER;
        }
 
        if (data->buffer == NULL)
        {
-               DEBUG_ERR_MSG("data->buffer is NULL");
+               NFC_ERR("data->buffer is NULL");
                return NET_NFC_NULL_PARAMETER;
        }
 
@@ -807,7 +794,7 @@ net_nfc_error_e net_nfc_server_npp_default_client_start(
 
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_server_client failed");
+               NFC_ERR("net_nfc_server_client failed");
                g_free(npp_client_data);
        }
 
index df4c071..7b08634 100644 (file)
@@ -184,12 +184,12 @@ static bool _net_nfc_server_snep_add_get_response_cb(
                }
                else
                {
-                       DEBUG_ERR_MSG("g_list_append failed");
+                       NFC_ERR("g_list_append failed");
                }
        }
        else
        {
-               DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+               NFC_ERR("_net_nfc_util_alloc_mem failed");
        }
 
        return result;
@@ -232,7 +232,7 @@ static bool _net_nfc_server_snep_process_get_response_cb(
 
                if (cb_data->cb != NULL)
                {
-                       DEBUG_SERVER_MSG("invoke callback [%p]", cb_data->cb);
+                       NFC_DBG("invoke callback [%p]", cb_data->cb);
                        if (cb_data->cb(handle,
                                                SNEP_REQ_GET,
                                                max_len,
@@ -262,7 +262,7 @@ static net_nfc_server_snep_op_context_t* _net_nfc_server_snep_create_send_contex
        if (net_nfc_controller_llcp_get_remote_config(handle,
                                &config, &result) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_get_remote_config failed, [%d]",
+               NFC_ERR("net_nfc_controller_llcp_get_remote_config failed, [%d]",
                                result);
 
                return NULL;
@@ -317,7 +317,7 @@ static net_nfc_server_snep_op_context_t* _net_nfc_server_snep_create_send_contex
 
                if (data != NULL && data->buffer != NULL)
                {
-                       DEBUG_SERVER_MSG("data->length [%d]", data->length);
+                       NFC_DBG("data->length [%d]", data->length);
 
                        /* copy ndef information to response msg */
                        memcpy(buffer, data->buffer, data->length);
@@ -349,7 +349,7 @@ static net_nfc_server_snep_op_context_t* _net_nfc_server_snep_create_recv_contex
                                &config,
                                &result) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_get_remote_config failed, [%d]",
+               NFC_ERR("net_nfc_controller_llcp_get_remote_config failed, [%d]",
                                result);
                return NULL;
        }
@@ -393,8 +393,7 @@ static void _net_nfc_server_recv_fragment_cb(
        uint8_t *buffer;
        uint32_t length;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_recv_fragment_cb,"
-                       " socket [%x], result [%d]",socket, result);
+       NFC_DBG("_net_nfc_server_recv_fragment_cb, socket[%x], result[%d]", socket, result);
 
        if (context == NULL)
                return;
@@ -403,14 +402,14 @@ static void _net_nfc_server_recv_fragment_cb(
 
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("error [%d]", result);
+               NFC_ERR("error [%d]", result);
                context->state = NET_NFC_STATE_ERROR;
                goto END;
        }
 
        if (data == NULL || data->buffer == NULL || data->length == 0)
        {
-               DEBUG_ERR_MSG("invalid response");
+               NFC_ERR("invalid response");
                context->state = NET_NFC_STATE_ERROR;
                goto END;
        }
@@ -422,7 +421,7 @@ static void _net_nfc_server_recv_fragment_cb(
 
                if (data->length < SNEP_HEADER_LEN)
                {
-                       DEBUG_ERR_MSG("too short data, length [%d]",
+                       NFC_ERR("too short data, length [%d]",
                                        data->length);
                        /* FIXME!!! what should I do. */
                        context->type = SNEP_RESP_BAD_REQ;
@@ -435,7 +434,7 @@ static void _net_nfc_server_recv_fragment_cb(
 
                if (length > SNEP_MAX_LEN)
                {
-                       DEBUG_ERR_MSG("too long snep message, length [%d]",
+                       NFC_ERR("too long snep message, length [%d]",
                                        length);
                        if (IS_SNEP_REQ(msg->op))
                        {
@@ -453,7 +452,7 @@ static void _net_nfc_server_recv_fragment_cb(
                if (IS_SNEP_REQ(msg->op) &&
                                GET_MAJOR_VER(msg->version) > SNEP_MAJOR_VER)
                {
-                       DEBUG_ERR_MSG("not supported version, version [0x%02x]",
+                       NFC_ERR("not supported version, version [0x%02x]",
                                        msg->version);
                        context->type = SNEP_RESP_UNSUPPORTED_VER;
                        context->state = NET_NFC_LLCP_STEP_04;
@@ -467,7 +466,7 @@ static void _net_nfc_server_recv_fragment_cb(
                        net_nfc_util_alloc_data(&context->data, length);
                        if (context->data.buffer == NULL)
                        {
-                               DEBUG_ERR_MSG("net_nfc_util_alloc_data failed");
+                               NFC_ERR("net_nfc_util_alloc_data failed");
                                if (IS_SNEP_REQ(msg->op))
                                {
                                        context->type = SNEP_RESP_REJECT;
@@ -482,8 +481,7 @@ static void _net_nfc_server_recv_fragment_cb(
                        }
                }
 
-               DEBUG_SERVER_MSG("incoming message, type [0x%02x], length [%d]",
-                               msg->op, length);
+               NFC_DBG("incoming message, type [0x%02x], length [%d]", msg->op, length);
 
                context->type = msg->op;
                buffer = msg->data;
@@ -504,8 +502,7 @@ static void _net_nfc_server_recv_fragment_cb(
                                buffer, length);
                context->offset += length;
 
-               DEBUG_SERVER_MSG("receive progress... [%d|%d]",
-                               context->offset, context->data.length);
+               NFC_DBG("receive progress... [%d|%d]", context->offset, context->data.length);
 
                if (context->offset >= context->data.length)
                        context->state = NET_NFC_LLCP_STEP_RETURN;
@@ -513,7 +510,7 @@ static void _net_nfc_server_recv_fragment_cb(
        }
        else
        {
-               DEBUG_SERVER_MSG("receive complete... [no ndef message]");
+               NFC_DBG("receive complete... [no ndef message]");
                context->state = NET_NFC_LLCP_STEP_RETURN;
        }
 
@@ -527,7 +524,7 @@ static void _net_nfc_server_recv_fragment(
 {
        net_nfc_error_e result;
 
-       DEBUG_SERVER_MSG("socket [%x] waiting data.....", context->socket);
+       NFC_DBG("socket [%x] waiting data.....", context->socket);
 
        if (net_nfc_controller_llcp_recv(
                                context->handle,
@@ -537,7 +534,7 @@ static void _net_nfc_server_recv_fragment(
                                _net_nfc_server_recv_fragment_cb,
                                context) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_recv failed, [%d]", result);
+               NFC_ERR("net_nfc_controller_llcp_recv failed, [%d]", result);
                context->state = NET_NFC_STATE_ERROR;
                context->result = result;
                _net_nfc_server_snep_recv(context);
@@ -554,7 +551,7 @@ void _net_nfc_server_snep_recv_send_cb(
        net_nfc_server_snep_op_context_t *context =
                (net_nfc_server_snep_op_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_snep_recv_send_cb, result [%d]", result);
+       NFC_DBG("_net_nfc_server_snep_recv_send_cb, result [%d]", result);
 
        if (context == NULL)/* TODO */
                return;
@@ -563,7 +560,7 @@ void _net_nfc_server_snep_recv_send_cb(
                context->state = NET_NFC_LLCP_STEP_03;
        else
        {
-               DEBUG_ERR_MSG("net_nfc_server_snep_send failed, [0x%x][%d]",
+               NFC_ERR("net_nfc_server_snep_send failed, [0x%x][%d]",
                                type, result);
                context->state = NET_NFC_STATE_ERROR;
                context->result = result;
@@ -581,8 +578,7 @@ void _net_nfc_server_snep_recv_send_reject_cb(
        net_nfc_server_snep_op_context_t *context =
                (net_nfc_server_snep_op_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_snep_recv_send_reject_cb,"
-                       " result [%d]", result);
+       NFC_DBG("_net_nfc_server_snep_recv_send_reject_cb, result [%d]", result);
 
        if (context == NULL)/* TODO */
                return;
@@ -591,7 +587,7 @@ void _net_nfc_server_snep_recv_send_reject_cb(
 
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_server_snep_send failed, [0x%x][%d]",
+               NFC_ERR("net_nfc_server_snep_send failed, [0x%x][%d]",
                                type, result);
        }
 
@@ -608,8 +604,7 @@ static void _net_nfc_server_snep_recv(
        {
        case NET_NFC_LLCP_STEP_01 :
        case NET_NFC_LLCP_STEP_03 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_%02d",
-                               context->state - NET_NFC_LLCP_STEP_01 + 1);
+               NFC_DBG("NET_NFC_LLCP_STEP_%02d", context->state - NET_NFC_LLCP_STEP_01 + 1);
 
                /* receive fragment */
                _net_nfc_server_recv_fragment(context);
@@ -619,7 +614,7 @@ static void _net_nfc_server_snep_recv(
                {
                        uint8_t op = context->type;
 
-                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
+                       NFC_DBG("NET_NFC_LLCP_STEP_02");
 
                        /* make correct request/response code */
                        op = SNEP_MAKE_PAIR_OP(op, SNEP_REQ_CONTINUE);
@@ -636,7 +631,7 @@ static void _net_nfc_server_snep_recv(
 
        case NET_NFC_LLCP_STEP_04 :
                {
-                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_04");
+                       NFC_DBG("NET_NFC_LLCP_STEP_04");
 
                        /* send response */
                        net_nfc_server_snep_send(
@@ -649,7 +644,7 @@ static void _net_nfc_server_snep_recv(
 
        case NET_NFC_LLCP_STEP_RETURN :
                {
-                       DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_RETURN");
+                       NFC_DBG("NET_NFC_LLCP_STEP_RETURN");
 
                        /* complete and invoke callback */
                        context->cb(
@@ -664,10 +659,10 @@ static void _net_nfc_server_snep_recv(
 
        case NET_NFC_STATE_ERROR :
        default :
-               DEBUG_ERR_MSG("NET_NFC_STATE_ERROR");
+               NFC_ERR("NET_NFC_STATE_ERROR");
 
                /* error, invoke callback */
-               DEBUG_ERR_MSG("net_nfc_server_snep_recv failed, [%d]",
+               NFC_ERR("net_nfc_server_snep_recv failed, [%d]",
                                context->result);
 
                context->cb(
@@ -715,8 +710,7 @@ static void _net_nfc_server_send_fragment_cb(
        net_nfc_server_snep_op_context_t *context =
                (net_nfc_server_snep_op_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_send_fragment_cb,"
-                       " socket [%x], result [%d]",socket, result);
+       NFC_DBG("_net_nfc_server_send_fragment_cb, socket[%x], result[%d]", socket, result);
 
        if (context == NULL)
                return;
@@ -725,8 +719,7 @@ static void _net_nfc_server_send_fragment_cb(
 
        if (result == NET_NFC_OK)
        {
-               DEBUG_SERVER_MSG("send progress... [%d|%d]",
-                               context->offset, context->data.length);
+               NFC_DBG("send progress... [%d|%d]", context->offset, context->data.length);
                if (context->offset < context->data.length)
                {
                        if (context->state == NET_NFC_LLCP_STEP_01)
@@ -746,7 +739,7 @@ static void _net_nfc_server_send_fragment_cb(
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_send failed, [%d]",
+               NFC_ERR("net_nfc_controller_llcp_send failed, [%d]",
                                result);
                context->state = NET_NFC_STATE_ERROR;
        }
@@ -769,9 +762,8 @@ static void _net_nfc_server_send_fragment(
        req_msg.length = (remain_len < context->miu) ? remain_len : context->miu;
        req_msg.buffer = context->data.buffer + context->offset;
 
-       DEBUG_SERVER_MSG("try to send data, socket [%x], offset [%d],"
-                       " current [%d], remain [%d]",context->socket, context->offset,
-                       req_msg.length, remain_len - req_msg.length);
+       NFC_DBG("try to send data, socket [%x], offset [%d], current [%d], remain [%d]",
+                       context->socket, context->offset, req_msg.length, remain_len-req_msg.length);
 
        context->offset += req_msg.length;
 
@@ -782,7 +774,7 @@ static void _net_nfc_server_send_fragment(
                                _net_nfc_server_send_fragment_cb,
                                context) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_llcp_send failed, [%d]",
+               NFC_ERR("net_nfc_controller_llcp_send failed, [%d]",
                                result);
                context->state = NET_NFC_STATE_ERROR;
                context->result = result;
@@ -799,13 +791,12 @@ void _net_nfc_server_snep_send_recv_cb(
        net_nfc_server_snep_op_context_t *context =
                (net_nfc_server_snep_op_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_snep_send_recv_cb,"
-                       " result [%d]", result);
+       NFC_DBG("_net_nfc_server_snep_send_recv_cb, result [%d]", result);
 
        if (context == NULL)/* TODO */
                return;
 
-       DEBUG_SERVER_MSG("received message, type [%d]", type);
+       NFC_DBG("received message, type [%d]", type);
 
        context->result = result;
        context->type = type;
@@ -865,15 +856,14 @@ static void _net_nfc_server_snep_send(
        {
        case NET_NFC_LLCP_STEP_01 :
        case NET_NFC_LLCP_STEP_03 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_%02d",
-                               context->state - NET_NFC_LLCP_STEP_01 + 1);
+               NFC_DBG("NET_NFC_LLCP_STEP_%02d", context->state - NET_NFC_LLCP_STEP_01 + 1);
 
                /* send fragment */
                _net_nfc_server_send_fragment(context);
                break;
 
        case NET_NFC_LLCP_STEP_02 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
+               NFC_DBG("NET_NFC_LLCP_STEP_02");
 
                /* receive response */
                net_nfc_server_snep_recv(
@@ -884,7 +874,7 @@ static void _net_nfc_server_snep_send(
                break;
 
        case NET_NFC_LLCP_STEP_RETURN :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_RETURN");
+               NFC_DBG("NET_NFC_LLCP_STEP_RETURN");
 
                /* complete and invoke callback */
                context->cb(
@@ -897,10 +887,10 @@ static void _net_nfc_server_snep_send(
                break;
 
        case NET_NFC_STATE_ERROR :
-               DEBUG_ERR_MSG("NET_NFC_STATE_ERROR");
+               NFC_ERR("NET_NFC_STATE_ERROR");
 
                /* error, invoke callback */
-               DEBUG_ERR_MSG("net_nfc_server_snep_send failed, [%d]",
+               NFC_ERR("net_nfc_server_snep_send failed, [%d]",
                                context->result);
 
                context->cb(
@@ -913,7 +903,7 @@ static void _net_nfc_server_snep_send(
                break;
 
        default :
-               DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_??");
+               NFC_ERR("NET_NFC_LLCP_STEP_??");
 
                context->cb(NET_NFC_OPERATION_FAIL,
                                context->type,
@@ -966,8 +956,7 @@ static void _net_nfc_server_snep_server_recv_cb(
        net_nfc_server_snep_context_t *context =
                (net_nfc_server_snep_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_snep_server_recv_cb"
-                       "result [%d]", result);
+       NFC_DBG("_net_nfc_server_snep_server_recv_cb result [%d]", result);
 
        if (context == NULL)
        {
@@ -980,8 +969,7 @@ static void _net_nfc_server_snep_server_recv_cb(
 
        if (result == NET_NFC_OK && data != NULL && data->buffer != NULL)
        {
-               DEBUG_SERVER_MSG("received message, type [%d], length [%d]",
-                               type, data->length);
+               NFC_DBG("received message, type [%d], length [%d]", type, data->length);
 
                net_nfc_util_alloc_data(&context->data, data->length);
                if (context->data.buffer != NULL)
@@ -1000,7 +988,7 @@ static void _net_nfc_server_snep_server_recv_cb(
                                break;
 
                        default :
-                               DEBUG_ERR_MSG("invalid request, [%d]", type);
+                               NFC_ERR("invalid request, [%d]", type);
                                context->state = NET_NFC_STATE_ERROR;
                                context->result = NET_NFC_NOT_ALLOWED_OPERATION;
                                break;
@@ -1008,7 +996,7 @@ static void _net_nfc_server_snep_server_recv_cb(
                }
                else
                {
-                       DEBUG_ERR_MSG("net_nfc_util_alloc_data failed");
+                       NFC_ERR("net_nfc_util_alloc_data failed");
                        /* TODO */
                        context->state = NET_NFC_STATE_ERROR;
                        context->result = NET_NFC_ALLOC_FAIL;
@@ -1016,7 +1004,7 @@ static void _net_nfc_server_snep_server_recv_cb(
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_server_snep_recv failed, [%d]", result);
+               NFC_ERR("net_nfc_server_snep_recv failed, [%d]", result);
                context->type = type;
                context->state = NET_NFC_STATE_ERROR;
        }
@@ -1033,8 +1021,7 @@ static void _net_nfc_server_snep_server_send_cb(net_nfc_error_e result,
        net_nfc_server_snep_context_t *context =
                (net_nfc_server_snep_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_snep_server_send_cb"
-                       ", result [%d]", result);
+       NFC_DBG("_net_nfc_server_snep_server_send_cb, result [%d]", result);
 
        if (context == NULL)/* TODO */
                return;
@@ -1043,7 +1030,7 @@ static void _net_nfc_server_snep_server_send_cb(net_nfc_error_e result,
 
        if (result == NET_NFC_OK)
        {
-               DEBUG_SERVER_MSG("server process success. and restart....");
+               NFC_DBG("server process success. and restart....");
 
                /* restart */
                net_nfc_util_free_data(&context->data);
@@ -1051,7 +1038,7 @@ static void _net_nfc_server_snep_server_send_cb(net_nfc_error_e result,
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_server_snep_send failed, [%d]", result);
+               NFC_ERR("net_nfc_server_snep_send failed, [%d]", result);
                context->state = NET_NFC_STATE_ERROR;
        }
 
@@ -1068,7 +1055,7 @@ static void _net_nfc_server_snep_server_process(
        switch (context->state)
        {
        case NET_NFC_LLCP_STEP_01 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_01");
+               NFC_DBG("NET_NFC_LLCP_STEP_01");
 
                /* receive request */
                net_nfc_server_snep_recv(
@@ -1079,7 +1066,7 @@ static void _net_nfc_server_snep_server_process(
                break;
 
        case NET_NFC_LLCP_STEP_02 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
+               NFC_DBG("NET_NFC_LLCP_STEP_02");
 
                context->state = NET_NFC_LLCP_STEP_03;
 
@@ -1091,7 +1078,7 @@ static void _net_nfc_server_snep_server_process(
                                        context->user_param) != NET_NFC_OK)
                {
                        /* there is no response for GET request */
-                       DEBUG_ERR_MSG("there is no response for GET request");
+                       NFC_ERR("there is no response for GET request");
 
                        /* receive request */
                        net_nfc_server_snep_send(context->handle,
@@ -1104,7 +1091,7 @@ static void _net_nfc_server_snep_server_process(
                break;
 
        case NET_NFC_LLCP_STEP_03 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_03");
+               NFC_DBG("NET_NFC_LLCP_STEP_03");
 
                /* receive request */
                net_nfc_server_snep_send(context->handle,
@@ -1116,7 +1103,7 @@ static void _net_nfc_server_snep_server_process(
                break;
 
        case NET_NFC_LLCP_STEP_04 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_04");
+               NFC_DBG("NET_NFC_LLCP_STEP_04");
 
                if (context->cb != NULL)
                {
@@ -1145,10 +1132,10 @@ static void _net_nfc_server_snep_server_process(
                break;
 
        case NET_NFC_STATE_ERROR :
-               DEBUG_SERVER_MSG("NET_NFC_STATE_ERROR");
+               NFC_DBG("NET_NFC_STATE_ERROR");
 
                /* error, invoke callback */
-               DEBUG_ERR_MSG("_snep_server_recv failed, [%d]",
+               NFC_ERR("_snep_server_recv failed, [%d]",
                                context->result);
 
                if (context->cb != NULL)
@@ -1164,7 +1151,7 @@ static void _net_nfc_server_snep_server_process(
                break;
 
        default :
-               DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_??");
+               NFC_ERR("NET_NFC_LLCP_STEP_??");
                /* TODO */
                break;
        }
@@ -1206,8 +1193,8 @@ static void _net_nfc_server_snep_incomming_socket_error_cb(
        net_nfc_server_snep_context_t *context =
                (net_nfc_server_snep_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_snep_incomming_socket_error_cb,"
-                       " socket [%x], result [%d]",socket, result);
+       NFC_DBG("_net_nfc_server_snep_incomming_socket_error_cb, socket [%x], result [%d]",
+                       socket, result);
 
        if (context == NULL)
        {
@@ -1236,8 +1223,8 @@ static void _net_nfc_server_snep_socket_error_cb(net_nfc_error_e result,
        net_nfc_server_snep_context_t *context =
                (net_nfc_server_snep_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("_net_nfc_server_snep_socket_error_cb"
-                       " socket [%x], result [%d]",socket, result);
+       NFC_DBG("_net_nfc_server_snep_socket_error_cb socket [%x], result [%d]",
+                       socket, result);
 
        if (context == NULL)
        {
@@ -1283,12 +1270,12 @@ static void _net_nfc_server_snep_incoming_cb(net_nfc_error_e result,
                return;
        }
 
-       DEBUG_SERVER_MSG("_net_nfc_server_snep_incoming_cb,"
-                       " incoming socket [%x], result [%d]",socket, result);
+       NFC_DBG("_net_nfc_server_snep_incoming_cb, incoming socket [%x], result [%d]",
+                       socket, result);
 
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("listen socket failed, [%d]", result);
+               NFC_ERR("listen socket failed, [%d]", result);
 
                goto ERROR;
        }
@@ -1298,7 +1285,7 @@ static void _net_nfc_server_snep_incoming_cb(net_nfc_error_e result,
 
        if (accept_context == NULL)
        {
-               DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+               NFC_ERR("_net_nfc_util_alloc_mem failed");
                result = NET_NFC_ALLOC_FAIL;
 
                goto ERROR;
@@ -1317,13 +1304,12 @@ static void _net_nfc_server_snep_incoming_cb(net_nfc_error_e result,
 
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_server_llcp_simple_accept failed, [%d]",
+               NFC_ERR("net_nfc_server_llcp_simple_accept failed, [%d]",
                                result);
                goto ERROR;
        }
 
-       DEBUG_SERVER_MSG("socket [%x] accepted.. waiting for request message",
-                       socket);
+       NFC_DBG("socket [%x] accepted.. waiting for request message", socket);
 
        _net_nfc_server_snep_server_process(accept_context);
 
@@ -1360,7 +1346,7 @@ net_nfc_error_e net_nfc_server_snep_server(       net_nfc_target_handle_s *handle,
 
        if (context == NULL)
        {
-               DEBUG_ERR_MSG("_create_snep_context failed");
+               NFC_ERR("_create_snep_context failed");
                result = NET_NFC_ALLOC_FAIL;
                goto ERROR;
        }
@@ -1378,13 +1364,12 @@ net_nfc_error_e net_nfc_server_snep_server(     net_nfc_target_handle_s *handle,
 
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_server_llcp_simple_server failed, [%d]",
+               NFC_ERR("net_nfc_server_llcp_simple_server failed, [%d]",
                                result);
                goto ERROR;
        }
 
-       DEBUG_SERVER_MSG("start snep server, san [%s], sap [%d]",
-                       san, sap);
+       NFC_DBG("start snep server, san [%s], sap [%d]", san, sap);
        return result;
 
 ERROR :
@@ -1403,11 +1388,11 @@ net_nfc_error_e net_nfc_server_snep_server_send_get_response(
 
        if (context == NULL/* && check valid handle */)
        {
-               DEBUG_ERR_MSG("invalid handle");
+               NFC_ERR("invalid handle");
                return NET_NFC_INVALID_PARAM;
        }
 
-       DEBUG_SERVER_MSG("send get response, socket [%x]", context->socket);
+       NFC_DBG("send get response, socket [%x]", context->socket);
 
        /* check correct status */
        if (context->type == SNEP_REQ_GET)
@@ -1426,7 +1411,7 @@ net_nfc_error_e net_nfc_server_snep_server_send_get_response(
                        }
                        else
                        {
-                               DEBUG_ERR_MSG("net_nfc_util_alloc_data failed");
+                               NFC_ERR("net_nfc_util_alloc_data failed");
                                result = NET_NFC_ALLOC_FAIL;
                        }
                }
@@ -1440,7 +1425,7 @@ net_nfc_error_e net_nfc_server_snep_server_send_get_response(
        }
        else
        {
-               DEBUG_ERR_MSG("incorrect handle state");
+               NFC_ERR("incorrect handle state");
                result = NET_NFC_INVALID_STATE;
        }
 
@@ -1470,7 +1455,7 @@ static void _net_nfc_server_snep_client_send_cb(net_nfc_error_e result,
        }
        else
        {
-               DEBUG_ERR_MSG("net_nfc_server_snep_send failed, [%d]", result);
+               NFC_ERR("net_nfc_server_snep_send failed, [%d]", result);
                job->state = NET_NFC_STATE_ERROR;
        }
 
@@ -1507,7 +1492,7 @@ static void _net_nfc_server_snep_client_recv_cb(net_nfc_error_e result,
                                }
                                else
                                {
-                                       DEBUG_ERR_MSG("net_nfc_util_alloc_data failed");
+                                       NFC_ERR("net_nfc_util_alloc_data failed");
                                        job->state = NET_NFC_STATE_ERROR;
                                        job->result = NET_NFC_ALLOC_FAIL;
                                }
@@ -1516,7 +1501,7 @@ static void _net_nfc_server_snep_client_recv_cb(net_nfc_error_e result,
                else
                {
                        /* TODO */
-                       DEBUG_ERR_MSG("invalid request, [0x%x]", type);
+                       NFC_ERR("invalid request, [0x%x]", type);
                        job->state = NET_NFC_STATE_ERROR;
                        job->result = NET_NFC_NOT_ALLOWED_OPERATION;
                }
@@ -1524,7 +1509,7 @@ static void _net_nfc_server_snep_client_recv_cb(net_nfc_error_e result,
        else
        {
 
-               DEBUG_ERR_MSG("net_nfc_server_snep_recv failed, [%d]", result);
+               NFC_ERR("net_nfc_server_snep_recv failed, [%d]", result);
                job->state = NET_NFC_STATE_ERROR;
        }
 
@@ -1561,7 +1546,7 @@ static void _net_nfc_server_snep_client_process(
        switch (job->state)
        {
        case NET_NFC_LLCP_STEP_01 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_01");
+               NFC_DBG("NET_NFC_LLCP_STEP_01");
 
                /* send request */
                net_nfc_server_snep_send(job->handle,
@@ -1573,7 +1558,7 @@ static void _net_nfc_server_snep_client_process(
                break;
 
        case NET_NFC_LLCP_STEP_02 :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_02");
+               NFC_DBG("NET_NFC_LLCP_STEP_02");
 
                /* receive response */
                net_nfc_server_snep_recv(job->handle,
@@ -1583,7 +1568,7 @@ static void _net_nfc_server_snep_client_process(
                break;
 
        case NET_NFC_LLCP_STEP_RETURN :
-               DEBUG_SERVER_MSG("NET_NFC_LLCP_STEP_RETURN");
+               NFC_DBG("NET_NFC_LLCP_STEP_RETURN");
 
                /* complete and invoke callback */
                if (job->cb != NULL)
@@ -1601,10 +1586,10 @@ static void _net_nfc_server_snep_client_process(
 
        case NET_NFC_STATE_ERROR :
        default :
-               DEBUG_ERR_MSG("NET_NFC_STATE_ERROR");
+               NFC_ERR("NET_NFC_STATE_ERROR");
 
                /* error, invoke callback */
-               DEBUG_ERR_MSG("_snep_server_send failed, [%d]",
+               NFC_ERR("_snep_server_send failed, [%d]",
                                job->result);
                if (job->cb != NULL)
                {
@@ -1656,12 +1641,11 @@ static void _net_nfc_server_snep_connected_cb(net_nfc_error_e result,
        if (result == NET_NFC_OK)
        {
                /* start snep client */
-               DEBUG_SERVER_MSG("socket [%x] connected. send message",
-                               socket);
+               NFC_DBG("socket [%x] connected. send message", socket);
        }
        else
        {
-               DEBUG_ERR_MSG("connect socket failed, [%d]", result);
+               NFC_ERR("connect socket failed, [%d]", result);
        }
 
        if (context->cb != NULL)
@@ -1688,7 +1672,7 @@ net_nfc_error_e net_nfc_server_snep_client(net_nfc_target_handle_s *handle,
        _net_nfc_util_alloc_mem(context, sizeof(*context));
        if (context == NULL)
        {
-               DEBUG_ERR_MSG("_net_nfc_util_alloc_mem failed");
+               NFC_ERR("_net_nfc_util_alloc_mem failed");
                result = NET_NFC_ALLOC_FAIL;
 
                goto ERROR;
@@ -1706,17 +1690,14 @@ net_nfc_error_e net_nfc_server_snep_client(net_nfc_target_handle_s *handle,
 
        if (result != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_server_llcp_simple_client failed, [%d]",
-                               result);
+               NFC_ERR("net_nfc_server_llcp_simple_client failed, [%d]", result);
 
                goto ERROR;
        }
        if (san != NULL)
-               DEBUG_SERVER_MSG("start snep client, san [%s]",
-                               san);
+               NFC_DBG("start snep client, san [%s]", san);
        else
-               DEBUG_SERVER_MSG("start snep client, sap [%d]",
-                               sap);
+               NFC_DBG("start snep client, sap [%d]", sap);
 
        return result;
 
@@ -1770,14 +1751,14 @@ net_nfc_error_e net_nfc_server_snep_client_request(net_nfc_snep_handle_h snep,
                return NET_NFC_ALLOC_FAIL;
        }
 
-       INFO_MSG("enqueued jobs [%d]", g_queue_get_length(&context->queue));
+       NFC_INFO("enqueued jobs [%d]", g_queue_get_length(&context->queue));
 
        /* if client is idle, starts sending request */
        if (context->state == NET_NFC_LLCP_IDLE)
        {
                _net_nfc_server_snep_client_do_job(context);
        } else {
-               INFO_MSG("client is working. this job will be enqueued");
+               NFC_INFO("client is working. this job will be enqueued");
        }
 
        return result;
@@ -1790,7 +1771,7 @@ static net_nfc_error_e _net_nfc_server_default_server_cb_(
                data_s *data,
                void *user_param)
 {
-       DEBUG_SERVER_MSG("type [%d], result [%d], data [%p], user_param [%p]",
+       NFC_DBG("type [%d], result [%d], data [%p], user_param [%p]",
                        type, result, data, user_param);
 
        if (result != NET_NFC_OK || data == NULL || data->buffer == NULL)
@@ -1810,7 +1791,7 @@ static net_nfc_error_e _net_nfc_server_default_server_cb_(
                        uint32_t max_len = htonl(msg->length);
                        data_s get_msg = { msg->data,data->length - sizeof(msg->length)};
 
-                       DEBUG_SERVER_MSG("GET : acceptable max_len [%d], message [%d]",
+                       NFC_DBG("GET : acceptable max_len [%d], message [%d]",
                                        max_len, data->length - sizeof(msg->length));
 
 
@@ -1835,7 +1816,7 @@ static net_nfc_error_e _net_nfc_server_default_server_cb_(
                break;
 
        default :
-               DEBUG_ERR_MSG("error [%d]", result);
+               NFC_ERR("error [%d]", result);
                break;
        }
 
@@ -1853,8 +1834,7 @@ static net_nfc_error_e _net_nfc_server_default_client_cb_(
        _net_nfc_server_snep_service_context_t *context =
                (_net_nfc_server_snep_service_context_t*)user_param;
 
-       DEBUG_SERVER_MSG("type [%d], result [%d], data [%p]",
-                       type, result, data);
+       NFC_DBG("type [%d], result [%d], data [%p]", type, result, data);
 
        if (user_param == NULL)
                return NET_NFC_NULL_PARAMETER;;
@@ -1875,7 +1855,7 @@ static net_nfc_error_e _net_nfc_server_default_client_cb_(
                break;
 
        default :
-               DEBUG_ERR_MSG("error [%d]", result);
+               NFC_ERR("error [%d]", result);
                break;
        }
 
@@ -1893,7 +1873,7 @@ static net_nfc_error_e _net_nfc_server_default_client_connected_cb_(
        _net_nfc_server_snep_service_context_t *context =
                (_net_nfc_server_snep_service_context_t *)user_param;
 
-       DEBUG_SERVER_MSG("type [%d], result [%d], data [%p], user_param [%p]",
+       NFC_DBG("type [%d], result [%d], data [%p], user_param [%p]",
                        type, result, data, user_param);
 
        if (context == NULL)
@@ -2004,7 +1984,7 @@ net_nfc_error_e net_nfc_server_snep_default_server_send_get_response(
 
        if (context == NULL/* && check valid handle */)
        {
-               DEBUG_ERR_MSG("invalid handle");
+               NFC_ERR("invalid handle");
                return NET_NFC_INVALID_PARAM;
        }
 
@@ -2016,7 +1996,7 @@ net_nfc_error_e net_nfc_server_snep_default_server_send_get_response(
        }
        else
        {
-               DEBUG_ERR_MSG("incorrect handle state");
+               NFC_ERR("incorrect handle state");
                result = NET_NFC_INVALID_STATE;
        }
 
@@ -2028,15 +2008,14 @@ static void _snep_default_activate_cb(int event, net_nfc_target_handle_s *handle
 {
        net_nfc_error_e result;
 
-       DEBUG_SERVER_MSG("event [%d], handle [%p], sap [%d], san [%s]",
-                       event, handle, sap, san);
+       NFC_DBG("event [%d], handle [%p], sap [%d], san [%s]", event, handle, sap, san);
 
        if (event == NET_NFC_LLCP_START) {
                /* start snep server */
                result = net_nfc_server_snep_server(handle, (char *)san, sap,
                                _net_nfc_server_default_server_cb_, user_param);
                if (result != NET_NFC_OK) {
-                       DEBUG_ERR_MSG("net_nfc_service_snep_server failed, [%d]",
+                       NFC_ERR("net_nfc_service_snep_server failed, [%d]",
                                        result);
                }
        } else if (event == NET_NFC_LLCP_UNREGISTERED) {
@@ -2089,7 +2068,7 @@ net_nfc_error_e net_nfc_server_snep_parse_get_request(data_s *request,
        message->buffer = msg->data;
        message->length = request->length - sizeof(msg->length);
 
-       DEBUG_SERVER_MSG("GET : acceptable max_len [%d], message [%d]",
+       NFC_DBG("GET : acceptable max_len [%d], message [%d]",
                        *max_len, request->length - sizeof(msg->length));
 
        return NET_NFC_OK;
index cfe80c6..1dbf4e5 100644 (file)
@@ -195,11 +195,11 @@ static net_nfc_target_handle_s *net_nfc_server_se_open_ese()
                {
                        net_nfc_server_se_set_current_ese_handle(handle);
 
-                       DEBUG_SERVER_MSG("handle [%p]", handle);
+                       NFC_DBG("handle [%p]", handle);
                }
                else
                {
-                       DEBUG_ERR_MSG("net_nfc_controller_secure_element_open failed [%d]",
+                       NFC_ERR("net_nfc_controller_secure_element_open failed [%d]",
                                        result);
                }
        }
@@ -241,17 +241,17 @@ static void _se_uicc_enable_card_emulation()
                        SECURE_ELEMENT_VIRTUAL_MODE,
                        &result);
        if (result == NET_NFC_OK) {
-               INFO_MSG("card emulation changed to SECURE_ELEMENT_TYPE_UICC");
+               NFC_INFO("card emulation changed to SECURE_ELEMENT_TYPE_UICC");
 
                net_nfc_server_se_set_se_type(SECURE_ELEMENT_TYPE_UICC);
                net_nfc_server_se_set_se_mode(SECURE_ELEMENT_VIRTUAL_MODE);
 
                if (vconf_set_int(VCONFKEY_NFC_SE_TYPE,
                                        VCONFKEY_NFC_SE_TYPE_UICC) < 0) {
-                       DEBUG_ERR_MSG("vconf_set_int failed");
+                       NFC_ERR("vconf_set_int failed");
                }
        } else {
-               DEBUG_ERR_MSG("net_nfc_controller_set_secure_element_mode failed, [%d]",
+               NFC_ERR("net_nfc_controller_set_secure_element_mode failed, [%d]",
                                result);
        }
 }
@@ -265,10 +265,10 @@ static void _se_uicc_prepare(void)
                gdbus_uicc_handle = tel_init(cpList[0]);
                if (gdbus_uicc_handle != NULL) {
                } else {
-                       DEBUG_ERR_MSG("tel_init() failed");
+                       NFC_ERR("tel_init() failed");
                }
        } else {
-               DEBUG_ERR_MSG("tel_get_cp_name_list() failed");
+               NFC_ERR("tel_get_cp_name_list() failed");
        }
 }
 
@@ -279,7 +279,7 @@ static void _se_uicc_status_noti_cb(TapiHandle *handle,
 {
        TelSimCardStatus_t *status = (TelSimCardStatus_t *)data;
 
-       DEBUG_SERVER_MSG("_se_uicc_status_noti_cb");
+       NFC_DBG("_se_uicc_status_noti_cb");
 
        switch (*status) {
        case TAPI_SIM_STATUS_SIM_INIT_COMPLETED :
@@ -297,7 +297,7 @@ static void _se_uicc_status_noti_cb(TapiHandle *handle,
                break;
 
        case TAPI_SIM_STATUS_CARD_REMOVED :
-               DEBUG_SERVER_MSG("TAPI_SIM_STATUS_CARD_REMOVED");
+               NFC_DBG("TAPI_SIM_STATUS_CARD_REMOVED");
                gdbus_uicc_ready = SE_UICC_UNAVAILABLE;
 
                if (net_nfc_server_se_get_se_type() == SECURE_ELEMENT_TYPE_UICC) {
@@ -395,7 +395,7 @@ net_nfc_error_e net_nfc_server_se_change_se(uint8_t type)
                        if (gdbus_uicc_ready == SE_UICC_READY) {
                                _se_uicc_enable_card_emulation();
                        } else if (gdbus_uicc_ready == SE_UICC_ON_PROGRESS) {
-                               INFO_MSG("waiting for uicc initializing complete...");
+                               NFC_INFO("waiting for uicc initializing complete...");
 
                                net_nfc_server_se_set_se_type(SECURE_ELEMENT_TYPE_UICC);
                                net_nfc_server_se_set_se_mode(SECURE_ELEMENT_VIRTUAL_MODE);
@@ -405,7 +405,7 @@ net_nfc_error_e net_nfc_server_se_change_se(uint8_t type)
                                result = NET_NFC_NOT_SUPPORTED;
                        }
                } else {
-                       DEBUG_SERVER_MSG("Previous request is processing.");
+                       NFC_DBG("Previous request is processing.");
 
                        result = NET_NFC_BUSY;
                }
@@ -425,28 +425,28 @@ net_nfc_error_e net_nfc_server_se_change_se(uint8_t type)
                                &result);
 
                if (result == NET_NFC_OK) {
-                       INFO_MSG("card emulation changed to SECURE_ELEMENT_TYPE_ESE");
+                       NFC_INFO("card emulation changed to SECURE_ELEMENT_TYPE_ESE");
 
                        net_nfc_server_se_set_se_type(SECURE_ELEMENT_TYPE_ESE);
                        net_nfc_server_se_set_se_mode(SECURE_ELEMENT_VIRTUAL_MODE);
 
                        if (vconf_set_int(VCONFKEY_NFC_SE_TYPE,
                                                VCONFKEY_NFC_SE_TYPE_ESE) != 0) {
-                               DEBUG_ERR_MSG("vconf_set_int failed");
+                               NFC_ERR("vconf_set_int failed");
                        }
                } else {
-                       DEBUG_ERR_MSG("net_nfc_controller_set_secure_element_mode failed, [%d]", result);
+                       NFC_ERR("net_nfc_controller_set_secure_element_mode failed, [%d]", result);
                }
                break;
 
        default:
                result = net_nfc_server_se_disable_card_emulation();
                if (result == NET_NFC_OK){
-                       INFO_MSG("card emulation turned off");
+                       NFC_INFO("card emulation turned off");
 
                        if (vconf_set_int(VCONFKEY_NFC_SE_TYPE,
                                                VCONFKEY_NFC_SE_TYPE_NONE) != 0) {
-                               DEBUG_ERR_MSG("vconf_set_int failed");
+                               NFC_ERR("vconf_set_int failed");
                        }
                }
                break;
@@ -519,7 +519,7 @@ static gboolean se_handle_close_secure_element(
        SeDataHandle *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -527,7 +527,7 @@ static gboolean se_handle_close_secure_element(
                                smack_privilege,
                                "nfc-manager",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -535,7 +535,7 @@ static gboolean se_handle_close_secure_element(
        data = g_try_new0(SeDataHandle, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -586,7 +586,7 @@ static void se_get_atr_thread_func(gpointer user_data)
        }
        else
        {
-               DEBUG_ERR_MSG("invalid se handle");
+               NFC_ERR("invalid se handle");
 
                result = NET_NFC_INVALID_HANDLE;
        }
@@ -619,7 +619,7 @@ static gboolean se_handle_get_atr(
        SeDataHandle *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -627,7 +627,7 @@ static gboolean se_handle_get_atr(
                                smack_privilege,
                                "nfc-manager",
                                "r") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -635,7 +635,7 @@ static gboolean se_handle_get_atr(
        data = g_try_new0(SeDataHandle, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -724,7 +724,7 @@ static void se_open_secure_element_thread_func(gpointer user_data)
 
                        net_nfc_server_se_set_current_ese_handle(handle);
 #endif
-                       DEBUG_SERVER_MSG("handle [%p]", handle);
+                       NFC_DBG("handle [%p]", handle);
 
                        /* increase client reference count */
                        net_nfc_server_gdbus_increase_se_count(
@@ -764,7 +764,7 @@ static gboolean se_handle_open_secure_element(
        SeDataSeType *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -772,7 +772,7 @@ static gboolean se_handle_open_secure_element(
                                smack_privilege,
                                "nfc-manager",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -780,7 +780,7 @@ static gboolean se_handle_open_secure_element(
        data = g_try_new0(SeDataSeType, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -871,7 +871,7 @@ static gboolean se_handle_send_apdu(
        SeDataApdu *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -879,7 +879,7 @@ static gboolean se_handle_send_apdu(
                                smack_privilege,
                                "nfc-manager",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -887,7 +887,7 @@ static gboolean se_handle_send_apdu(
        data = g_try_new0(SeDataApdu, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -936,14 +936,14 @@ static void _se_set_card_emulation_thread_func(gpointer user_data)
                                &result);
                if (result == NET_NFC_OK)
                {
-                       DEBUG_SERVER_MSG("changed to CARD EMULATION ON");
+                       NFC_DBG("changed to CARD EMULATION ON");
 
                        net_nfc_server_se_set_se_mode(
                                        SECURE_ELEMENT_VIRTUAL_MODE);
                }
                else
                {
-                       DEBUG_ERR_MSG("CARD EMULATION ON fail [%d]", result);
+                       NFC_ERR("CARD EMULATION ON fail [%d]", result);
                }
        }
        else if (data->mode == NET_NFC_CARD_EMULATION_DISABLE)
@@ -954,13 +954,13 @@ static void _se_set_card_emulation_thread_func(gpointer user_data)
                                &result);
                if (result == NET_NFC_OK)
                {
-                       DEBUG_SERVER_MSG("changed to CARD EMULATION OFF");
+                       NFC_DBG("changed to CARD EMULATION OFF");
 
                        net_nfc_server_se_set_se_mode(SECURE_ELEMENT_OFF_MODE);
                }
                else
                {
-                       DEBUG_ERR_MSG("CARD EMULATION OFF fail [%d]", result);
+                       NFC_ERR("CARD EMULATION OFF fail [%d]", result);
                }
        }
        else
@@ -986,7 +986,7 @@ static gboolean _se_handle_set_card_emulation(
        SeSetCardEmul *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -994,7 +994,7 @@ static gboolean _se_handle_set_card_emulation(
                                smack_privilege,
                                "nfc-manager",
                                "w") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1002,7 +1002,7 @@ static gboolean _se_handle_set_card_emulation(
        data = g_try_new0(SeSetCardEmul, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -1069,7 +1069,7 @@ static gboolean se_handle_set(
        SeDataSeType *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1077,7 +1077,7 @@ static gboolean se_handle_set(
                                smack_privilege,
                                "nfc-manager",
                                "w") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1085,7 +1085,7 @@ static gboolean se_handle_set(
        data = g_try_new0(SeDataSeType, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -1142,7 +1142,7 @@ static gboolean se_handle_get(
        SeDataSeType *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -1150,7 +1150,7 @@ static gboolean se_handle_get(
                                smack_privilege,
                                "nfc-manager",
                                "r") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -1158,7 +1158,7 @@ static gboolean se_handle_get(
        data = g_try_new0(SeDataSeType, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -1241,7 +1241,7 @@ gboolean net_nfc_server_se_init(GDBusConnection *connection)
                        &error);
        if (result == FALSE)
        {
-               DEBUG_ERR_MSG("can not skeleton_export %s", error->message);
+               NFC_ERR("can not skeleton_export %s", error->message);
 
                g_error_free(error);
 
@@ -1274,7 +1274,7 @@ static void se_detected_thread_func(gpointer user_data)
 
        if (se_skeleton == NULL)
        {
-               DEBUG_ERR_MSG("se skeleton is not initialized");
+               NFC_ERR("se skeleton is not initialized");
 
                g_variant_unref((GVariant *)user_data);
 
@@ -1289,11 +1289,11 @@ static void se_detected_thread_func(gpointer user_data)
 
        net_nfc_server_se_set_current_ese_handle(handle);
 
-       DEBUG_SERVER_MSG("trying to connect to ESE = [0x%p]", handle);
+       NFC_DBG("trying to connect to ESE = [0x%p]", handle);
 
        if (!net_nfc_controller_connect(handle, &result))
        {
-               DEBUG_SERVER_MSG("connect failed = [%d]", result);
+               NFC_DBG("connect failed = [%d]", result);
        }
 
        net_nfc_gdbus_secure_element_emit_ese_detected(
@@ -1313,7 +1313,7 @@ static void se_transcation_thread_func(gpointer user_data)
 
        if (detail->event == NET_NFC_MESSAGE_SE_START_TRANSACTION)
        {
-               DEBUG_SERVER_MSG("launch se app");
+               NFC_DBG("launch se app");
 
                net_nfc_app_util_launch_se_transaction_app(
                                detail->aid.buffer,
@@ -1321,7 +1321,7 @@ static void se_transcation_thread_func(gpointer user_data)
                                detail->param.buffer,
                                detail->param.length);
 
-               DEBUG_SERVER_MSG("launch se app end");
+               NFC_DBG("launch se app end");
        }
 
        net_nfc_util_free_data(&detail->param);
@@ -1349,12 +1349,12 @@ void net_nfc_server_se_detected(void *info)
                if (net_nfc_server_controller_async_queue_push(
                                        se_detected_thread_func,
                                        parameter) == FALSE) {
-                       DEBUG_ERR_MSG("can not push to controller thread");
+                       NFC_ERR("can not push to controller thread");
 
                        g_variant_unref(parameter);
                }
        } else {
-               DEBUG_ERR_MSG("g_variant_new failed");
+               NFC_ERR("g_variant_new failed");
        }
 
        /* FIXME : should be removed when plugins would be fixed*/
@@ -1391,7 +1391,7 @@ void net_nfc_server_se_transaction_received(void *info)
 
                if (net_nfc_server_controller_async_queue_push(
                                        se_transcation_thread_func, detail) == FALSE) {
-                       DEBUG_ERR_MSG("can not push to controller thread");
+                       NFC_ERR("can not push to controller thread");
 
                        net_nfc_util_free_data(&detail->param);
                        net_nfc_util_free_data(&detail->aid);
@@ -1399,7 +1399,7 @@ void net_nfc_server_se_transaction_received(void *info)
                        g_free(detail);
                }
        } else {
-               DEBUG_ERR_MSG("g_new0 failed");
+               NFC_ERR("g_new0 failed");
        }
 
        /* FIXME : should be removed when plugins would be fixed*/
index 5ca93e4..d476801 100644 (file)
@@ -102,9 +102,9 @@ static void _emit_snep_event_signal(GVariant *parameter,
                                &error) == false)
        {
                if (error != NULL && error->message != NULL) {
-                       DEBUG_ERR_MSG("g_dbus_connection_emit_signal failed : %s", error->message);
+                       NFC_ERR("g_dbus_connection_emit_signal failed : %s", error->message);
                } else {
-                       DEBUG_ERR_MSG("g_dbus_connection_emit_signal failed");
+                       NFC_ERR("g_dbus_connection_emit_signal failed");
                }
        }
 
@@ -121,7 +121,7 @@ static net_nfc_error_e _snep_server_cb(net_nfc_snep_handle_h handle,
 
        data_s *temp = data;
 
-       DEBUG_SERVER_MSG("type [%d], result [%d], data [%p], user_param [%p]",
+       NFC_DBG("type [%d], result [%d], data [%p], user_param [%p]",
                        type, result, data, user_param);
 
        switch (type)
@@ -139,7 +139,7 @@ static net_nfc_error_e _snep_server_cb(net_nfc_snep_handle_h handle,
                break;
 
        default :
-               DEBUG_ERR_MSG("error [%d]", result);
+               NFC_ERR("error [%d]", result);
                break;
        }
 
@@ -172,7 +172,7 @@ static void snep_server_start_thread_func(gpointer user_data)
 
        if (user_data == NULL)
        {
-               DEBUG_ERR_MSG("cannot get SNEP client data");
+               NFC_ERR("cannot get SNEP client data");
 
                return;
        }
@@ -202,14 +202,14 @@ static void snep_server_start_thread_func(gpointer user_data)
                                _snep_server_cb,
                                parameter);
                if (result != NET_NFC_OK) {
-                       DEBUG_ERR_MSG("net_nfc_server_snep_server failed, [%d]",
+                       NFC_ERR("net_nfc_server_snep_server failed, [%d]",
                                        result);
                        g_object_unref(connection);
 
                        g_variant_unref(parameter);
                }
        } else {
-               DEBUG_ERR_MSG("g_variant_new failed");
+               NFC_ERR("g_variant_new failed");
 
                g_object_unref(connection);
 
@@ -235,7 +235,7 @@ static gboolean _handle_start_server(
        GVariant *parameter;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -243,7 +243,7 @@ static gboolean _handle_start_server(
                                arg_privilege,
                                "nfc-manager::p2p",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -261,7 +261,7 @@ static gboolean _handle_start_server(
                if ((result = net_nfc_server_controller_async_queue_push(
                                                snep_server_start_thread_func, parameter)) == FALSE)
                {
-                       DEBUG_ERR_MSG("net_nfc_server_controller_async_queue_push failed");
+                       NFC_ERR("net_nfc_server_controller_async_queue_push failed");
 
                        g_dbus_method_invocation_return_dbus_error(invocation,
                                        "org.tizen.NetNfcService.Snep.ThreadError",
@@ -275,7 +275,7 @@ static gboolean _handle_start_server(
        }
        else
        {
-               DEBUG_ERR_MSG("g_variant_new failed");
+               NFC_ERR("g_variant_new failed");
 
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.Snep.MemoryError",
@@ -296,7 +296,7 @@ static net_nfc_error_e _snep_start_client_cb(
 {
        GVariant *parameter = (GVariant *)user_param;
 
-       DEBUG_SERVER_MSG("type [%d], result [%d], data [%p], user_param [%p]",
+       NFC_DBG("type [%d], result [%d], data [%p], user_param [%p]",
                        type, result, data, user_param);
 
        _emit_snep_event_signal(parameter, handle, result, type, data);
@@ -323,7 +323,7 @@ static void snep_client_start_thread_func(gpointer user_data)
 
        if (user_data == NULL)
        {
-               DEBUG_ERR_MSG("cannot get SNEP client data");
+               NFC_ERR("cannot get SNEP client data");
 
                return;
        }
@@ -353,14 +353,14 @@ static void snep_client_start_thread_func(gpointer user_data)
                                _snep_start_client_cb,
                                parameter);
                if (result != NET_NFC_OK) {
-                       DEBUG_ERR_MSG("net_nfc_server_snep_client failed, [%d]",
+                       NFC_ERR("net_nfc_server_snep_client failed, [%d]",
                                        result);
                        g_object_unref(connection);
 
                        g_variant_unref(parameter);
                }
        } else {
-               DEBUG_ERR_MSG("g_variant_new failed");
+               NFC_ERR("g_variant_new failed");
 
                g_object_unref(connection);
 
@@ -386,7 +386,7 @@ static gboolean _handle_start_client(
        GVariant *parameter;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -394,7 +394,7 @@ static gboolean _handle_start_client(
                                arg_privilege,
                                "nfc-manager::p2p",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -412,7 +412,7 @@ static gboolean _handle_start_client(
                if ((result = net_nfc_server_controller_async_queue_push(
                                                snep_client_start_thread_func, parameter)) == FALSE)
                {
-                       DEBUG_ERR_MSG("net_nfc_server_controller_async_queue_push failed");
+                       NFC_ERR("net_nfc_server_controller_async_queue_push failed");
 
                        g_dbus_method_invocation_return_dbus_error(invocation,
                                        "org.tizen.NetNfcService.Snep.ThreadError",
@@ -426,7 +426,7 @@ static gboolean _handle_start_client(
        }
        else
        {
-               DEBUG_ERR_MSG("g_variant_new failed");
+               NFC_ERR("g_variant_new failed");
 
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.Snep.MemoryError",
@@ -447,7 +447,7 @@ static net_nfc_error_e _snep_client_request_cb(
 {
        GVariant *parameter = (GVariant *)user_param;
 
-       DEBUG_SERVER_MSG("type [%d], result [%d], data [%p], user_param [%p]",
+       NFC_DBG("type [%d], result [%d], data [%p], user_param [%p]",
                        type, result, data, user_param);
 
        if (parameter != NULL) {
@@ -505,7 +505,7 @@ static void snep_client_send_request_thread_func(gpointer user_data)
 
        if (user_data == NULL)
        {
-               DEBUG_ERR_MSG("cannot get SNEP client data");
+               NFC_ERR("cannot get SNEP client data");
 
                return;
        }
@@ -532,7 +532,7 @@ static void snep_client_send_request_thread_func(gpointer user_data)
        {
                GVariant *resp;
 
-               DEBUG_ERR_MSG("net_nfc_server_snep_client_request  "
+               NFC_ERR("net_nfc_server_snep_client_request  "
                                "failed, [%d]",result);
 
                resp = net_nfc_util_gdbus_buffer_to_variant(NULL, 0);
@@ -562,7 +562,7 @@ static gboolean _handle_client_send_request(
        GVariant *parameter;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -570,7 +570,7 @@ static gboolean _handle_client_send_request(
                                arg_privilege,
                                "nfc-manager::p2p",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -587,7 +587,7 @@ static gboolean _handle_client_send_request(
                if ((result = net_nfc_server_controller_async_queue_push(
                                                snep_client_send_request_thread_func, parameter)) == FALSE)
                {
-                       DEBUG_ERR_MSG("net_nfc_server_controller_async_queue_push failed");
+                       NFC_ERR("net_nfc_server_controller_async_queue_push failed");
 
                        g_dbus_method_invocation_return_dbus_error(invocation,
                                        "org.tizen.NetNfcService.Snep.ThreadError",
@@ -601,7 +601,7 @@ static gboolean _handle_client_send_request(
        }
        else
        {
-               DEBUG_ERR_MSG("g_variant_new failed");
+               NFC_ERR("g_variant_new failed");
 
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.Snep.MemoryError",
@@ -622,7 +622,7 @@ static void snep_stop_service_thread_func(gpointer user_data)
 
        if (user_data == NULL)
        {
-               DEBUG_ERR_MSG("cannot get SNEP client data");
+               NFC_ERR("cannot get SNEP client data");
 
                return;
        }
@@ -664,7 +664,7 @@ static gboolean _handle_stop_snep(
        GVariant *parameter;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -672,7 +672,7 @@ static gboolean _handle_stop_snep(
                                arg_privilege,
                                "nfc-manager::p2p",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -688,7 +688,7 @@ static gboolean _handle_stop_snep(
                if ((result = net_nfc_server_controller_async_queue_push(
                                                snep_stop_service_thread_func, parameter)) == FALSE)
                {
-                       DEBUG_ERR_MSG("net_nfc_server_controller_async_queue_push failed");
+                       NFC_ERR("net_nfc_server_controller_async_queue_push failed");
 
                        g_dbus_method_invocation_return_dbus_error(invocation,
                                        "org.tizen.NetNfcService.Snep.ThreadError",
@@ -702,7 +702,7 @@ static gboolean _handle_stop_snep(
        }
        else
        {
-               DEBUG_ERR_MSG("g_variant_new failed");
+               NFC_ERR("g_variant_new failed");
 
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.Snep.MemoryError",
@@ -720,7 +720,7 @@ static void _snep_activate_cb(int event, net_nfc_target_handle_s *handle,
        GVariant *parameter = (GVariant *)user_param;
        net_nfc_error_e result = NET_NFC_OK;
 
-       DEBUG_SERVER_MSG("event [%d], handle [%p], sap [%d], san [%s]",
+       NFC_DBG("event [%d], handle [%p], sap [%d], san [%s]",
                        event, handle, sap, san);
 
        if (event == NET_NFC_LLCP_START) {
@@ -748,7 +748,7 @@ static void _snep_activate_cb(int event, net_nfc_target_handle_s *handle,
                        _emit_snep_event_signal(parameter, handle,
                                        result, event, NULL);
                } else {
-                       DEBUG_ERR_MSG("net_nfc_server_snep_server failed, [%d]",
+                       NFC_ERR("net_nfc_server_snep_server failed, [%d]",
                                        result);
 
                        g_variant_unref(param);
@@ -802,7 +802,7 @@ static void snep_register_server_thread_func(gpointer user_data)
                                _snep_activate_cb,
                                parameter);
                if (result != NET_NFC_OK) {
-                       DEBUG_ERR_MSG("net_nfc_service_llcp_register_service failed, [%d]", result);
+                       NFC_ERR("net_nfc_service_llcp_register_service failed, [%d]", result);
                        g_object_unref(connection);
                        g_variant_unref(parameter);
                }
@@ -834,7 +834,7 @@ static gboolean _handle_register_server(
        GVariant *parameter;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -842,7 +842,7 @@ static gboolean _handle_register_server(
                                arg_privilege,
                                "nfc-manager::p2p",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -859,7 +859,7 @@ static gboolean _handle_register_server(
                if ((result = net_nfc_server_controller_async_queue_push(
                                                snep_register_server_thread_func, parameter)) == FALSE)
                {
-                       DEBUG_ERR_MSG("net_nfc_server_controller_async_queue_push failed");
+                       NFC_ERR("net_nfc_server_controller_async_queue_push failed");
 
                        g_dbus_method_invocation_return_dbus_error(invocation,
                                        "org.tizen.NetNfcService.Snep.ThreadError",
@@ -873,7 +873,7 @@ static gboolean _handle_register_server(
        }
        else
        {
-               DEBUG_ERR_MSG("g_variant_new failed");
+               NFC_ERR("g_variant_new failed");
 
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.Snep.MemoryError",
@@ -933,7 +933,7 @@ static gboolean _handle_unregister_server(
        GVariant *parameter;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -941,7 +941,7 @@ static gboolean _handle_unregister_server(
                                arg_privilege,
                                "nfc-manager::p2p",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -957,7 +957,7 @@ static gboolean _handle_unregister_server(
                if ((result = net_nfc_server_controller_async_queue_push(
                                                snep_unregister_server_thread_func, parameter)) == FALSE)
                {
-                       DEBUG_ERR_MSG("net_nfc_server_controller_async_queue_push failed");
+                       NFC_ERR("net_nfc_server_controller_async_queue_push failed");
 
                        g_dbus_method_invocation_return_dbus_error(invocation,
                                        "org.tizen.NetNfcService.Snep.ThreadError",
@@ -971,7 +971,7 @@ static gboolean _handle_unregister_server(
        }
        else
        {
-               DEBUG_ERR_MSG("g_variant_new failed");
+               NFC_ERR("g_variant_new failed");
 
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.Snep.MemoryError",
index 24aa98a..32fa5ee 100644 (file)
@@ -41,7 +41,7 @@ static gboolean popup_handle_set(NetNfcGDbusPopup *popup_manager,
                GVariant *smack_privilege,
                gpointer user_data)
 {
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -49,7 +49,7 @@ static gboolean popup_handle_set(NetNfcGDbusPopup *popup_manager,
                                smack_privilege,
                                "nfc-manager",
                                "w") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -70,7 +70,7 @@ static gboolean popup_handle_get(NetNfcGDbusPopup *popup_manager,
 {
        gboolean state;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -78,7 +78,7 @@ static gboolean popup_handle_get(NetNfcGDbusPopup *popup_manager,
                                smack_privilege,
                                "nfc-manager",
                                "r") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -103,7 +103,7 @@ gboolean net_nfc_server_system_handler_init(GDBusConnection *connection)
        popup_skeleton = net_nfc_gdbus_popup_skeleton_new();
        if (popup_skeleton == NULL)
        {
-               DEBUG_ERR_MSG("Failed to allocate popup skeleton");
+               NFC_ERR("Failed to allocate popup skeleton");
 
                return FALSE;
        }
@@ -125,7 +125,7 @@ gboolean net_nfc_server_system_handler_init(GDBusConnection *connection)
                        &error);
        if (result == FALSE)
        {
-               DEBUG_ERR_MSG("Can not skeleton_export %s", error->message);
+               NFC_ERR("Can not skeleton_export %s", error->message);
 
                g_error_free(error);
 
index a7a7598..dfae7a7 100644 (file)
@@ -96,7 +96,7 @@ static gboolean tag_is_isp_dep_ndef_formatable(net_nfc_target_handle_s *handle,
                                &response,
                                &error) == false)
        {
-               DEBUG_ERR_MSG("net_nfc_controller_transceive is failed");
+               NFC_ERR("net_nfc_controller_transceive is failed");
 
                return result;
        }
@@ -115,7 +115,7 @@ static gboolean tag_is_isp_dep_ndef_formatable(net_nfc_target_handle_s *handle,
        }
        else
        {
-               DEBUG_ERR_MSG("response is NULL");
+               NFC_ERR("response is NULL");
        }
 
        return result;
@@ -139,16 +139,16 @@ static gboolean tag_read_ndef_message(net_nfc_target_handle_s *handle,
        {
                if (tag_is_isp_dep_ndef_formatable(handle, dev_type) == FALSE)
                {
-                       DEBUG_ERR_MSG(
+                       NFC_ERR(
                                        "DESFIRE : ISO-DEP ndef not formatable");
                        return FALSE;
                }
 
-               DEBUG_SERVER_MSG("DESFIRE : ISO-DEP ndef formatable");
+               NFC_DBG("DESFIRE : ISO-DEP ndef formatable");
 
                if (net_nfc_controller_connect(handle, &result) == false)
                {
-                       DEBUG_ERR_MSG("%s failed, & retry polling!!",
+                       NFC_ERR("%s failed, & retry polling!!",
                                        "net_nfc_controller_connect");
 
                        if (net_nfc_controller_configure_discovery(
@@ -164,19 +164,17 @@ static gboolean tag_read_ndef_message(net_nfc_target_handle_s *handle,
 
        if (net_nfc_controller_read_ndef(handle, &temp, &result) == false)
        {
-               DEBUG_ERR_MSG("%s failed",
-                               "net_nfc_controller_read_ndef");
+               NFC_ERR("net_nfc_controller_read_ndef failed");
                return FALSE;
        }
 
-       DEBUG_SERVER_MSG("%s success",
-                       "net_nfc_controller_read_ndef");
+       NFC_DBG("net_nfc_controller_read_ndef success");
 
        if (dev_type == NET_NFC_MIFARE_DESFIRE_PICC)
        {
                if (net_nfc_controller_connect(handle, &result) == false)
                {
-                       DEBUG_ERR_MSG("%s failed, & retry polling!!",
+                       NFC_ERR("%s failed, & retry polling!!",
                                        "net_nfc_controller_connect");
 
                        if (net_nfc_controller_configure_discovery(
@@ -211,13 +209,13 @@ static void tag_watchdog_thread_func(gpointer user_data)
 
        if (watch_dog == NULL)
        {
-               DEBUG_ERR_MSG("can not get WatchDogData");
+               NFC_ERR("can not get WatchDogData");
                return;
        }
 
        if (watch_dog->handle == NULL)
        {
-               DEBUG_ERR_MSG("can not get WatchDogData->handle");
+               NFC_ERR("can not get WatchDogData->handle");
                return;
        }
 
@@ -240,7 +238,7 @@ static void tag_watchdog_thread_func(gpointer user_data)
                                        tag_watchdog_thread_func,
                                        watch_dog) == FALSE)
                {
-                       DEBUG_ERR_MSG("can not create watch dog");
+                       NFC_ERR("can not create watch dog");
                        g_free(watch_dog);
                }
                return;
@@ -251,8 +249,7 @@ static void tag_watchdog_thread_func(gpointer user_data)
        {
                if(net_nfc_controller_disconnect(handle, &result) == false)
                {
-                       DEBUG_SERVER_MSG("try to disconnect result = [%d]",
-                                       result);
+                       NFC_ERR("try to disconnect result = [%d]", result);
                        net_nfc_controller_exception_handler();
                }
        }
@@ -315,8 +312,7 @@ static void tag_get_current_tag_info_thread_func(gpointer user_data)
                        if (net_nfc_controller_read_ndef(target_info->handle,
                                                &raw_data, &result) == true)
                        {
-                               DEBUG_SERVER_MSG("%s is success",
-                                               "net_nfc_controller_read_ndef");
+                               NFC_DBG("net_nfc_controller_read_ndef is success");
                        }
                }
        }
@@ -367,14 +363,14 @@ static void tag_slave_target_detected_thread_func(gpointer user_data)
 
        if (tag_skeleton == NULL)
        {
-               DEBUG_ERR_MSG("tag skeleton is not initialized");
+               NFC_ERR("tag skeleton is not initialized");
 
                return;
        }
 
        if (net_nfc_controller_connect(target->handle, &result) == false)
        {
-               DEBUG_ERR_MSG("connect failed & Retry Polling!!");
+               NFC_ERR("connect failed & Retry Polling!!");
 
                if (net_nfc_controller_configure_discovery(
                                        NET_NFC_DISCOVERY_MODE_RESUME,
@@ -389,7 +385,7 @@ static void tag_slave_target_detected_thread_func(gpointer user_data)
 
        net_nfc_server_set_state(NET_NFC_TAG_CONNECTED);
 
-       DEBUG_SERVER_MSG("tag is connected");
+       NFC_DBG("tag is connected");
 
        target_info_values = net_nfc_util_gdbus_buffer_to_variant(
                        target->target_info_values.buffer,
@@ -408,7 +404,7 @@ static void tag_slave_target_detected_thread_func(gpointer user_data)
        {
                data_s *recv_data = NULL;
 
-               DEBUG_SERVER_MSG("support NDEF");
+               NFC_DBG("support NDEF");
 
                if (tag_read_ndef_message(target->handle,
                                        target->devType,
@@ -440,7 +436,7 @@ static void tag_slave_target_detected_thread_func(gpointer user_data)
                                }
                                else
                                {
-                                       DEBUG_ERR_MSG("_get_carrier_record_by_priority_order"
+                                       NFC_ERR("_get_carrier_record_by_priority_order"
                                                        " failed, [%d]",result);
                                }
                        }
@@ -452,7 +448,7 @@ static void tag_slave_target_detected_thread_func(gpointer user_data)
                }
                else
                {
-                       DEBUG_ERR_MSG("net_nfc_controller_read_ndef failed");
+                       NFC_ERR("net_nfc_controller_read_ndef failed");
                        raw_data = net_nfc_util_gdbus_buffer_to_variant(NULL, 0);
                }
        }
@@ -462,7 +458,7 @@ static void tag_slave_target_detected_thread_func(gpointer user_data)
                uint8_t empty[] = { 0xd0, 0x00, 0x00 };
                data_s empty_data = { empty, sizeof(empty) };
 
-               DEBUG_SERVER_MSG("not support NDEF");
+               NFC_DBG("not support NDEF");
 
                net_nfc_app_util_process_ndef(&empty_data);
                raw_data = net_nfc_util_gdbus_data_to_variant(&empty_data);
@@ -484,12 +480,12 @@ static void tag_slave_target_detected_thread_func(gpointer user_data)
        }
 
        /* turn on watch dog */
-       DEBUG_SERVER_MSG("turn on watch dog");
+       NFC_DBG("turn on watch dog");
 
        watch_dog = g_new0(WatchDogData, 1);
        if(watch_dog == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                return;
        }
 
@@ -500,7 +496,7 @@ static void tag_slave_target_detected_thread_func(gpointer user_data)
                                tag_watchdog_thread_func,
                                watch_dog) == FALSE)
        {
-               DEBUG_ERR_MSG("can not create watch dog");
+               NFC_ERR("can not create watch dog");
                g_free(watch_dog);
                return;
        }
@@ -517,7 +513,7 @@ static gboolean tag_handle_is_tag_connected(NetNfcGDbusTag *tag,
        net_nfc_target_type_e dev_type = NET_NFC_UNKNOWN_TARGET;
        gboolean is_connected = FALSE;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -525,7 +521,7 @@ static gboolean tag_handle_is_tag_connected(NetNfcGDbusTag *tag,
                                smack_privilege,
                                "nfc-manager::tag",
                                "r") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -553,7 +549,7 @@ static gboolean tag_handle_get_current_tag_info(NetNfcGDbusTag *tag,
        CurrentTagInfoData *info_data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -561,7 +557,7 @@ static gboolean tag_handle_get_current_tag_info(NetNfcGDbusTag *tag,
                                smack_privilege,
                                "nfc-manager::tag",
                                "r") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -569,7 +565,7 @@ static gboolean tag_handle_get_current_tag_info(NetNfcGDbusTag *tag,
        info_data = g_new0(CurrentTagInfoData, 1);
        if (info_data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -608,7 +604,7 @@ static gboolean tag_handle_get_current_target_handle(NetNfcGDbusTag *tag,
        net_nfc_target_handle_s *handle = NULL;
        uint32_t devType = NET_NFC_UNKNOWN_TARGET;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -616,7 +612,7 @@ static gboolean tag_handle_get_current_target_handle(NetNfcGDbusTag *tag,
                                smack_privilege,
                                "nfc-manager::tag",
                                "r") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -670,7 +666,7 @@ gboolean net_nfc_server_tag_init(GDBusConnection *connection)
                        &error);
        if (result == FALSE)
        {
-               DEBUG_ERR_MSG("can not skeleton_export %s", error->message);
+               NFC_ERR("can not skeleton_export %s", error->message);
 
                g_error_free(error);
 
@@ -746,6 +742,6 @@ void net_nfc_server_tag_target_detected(void *info)
                                tag_slave_target_detected_thread_func,
                                NULL) == FALSE)
        {
-               DEBUG_ERR_MSG("can not push to controller thread");
+               NFC_ERR("can not push to controller thread");
        }
 }
index 54a52a0..e09dce8 100644 (file)
@@ -75,7 +75,7 @@ static void transceive_data_thread_func(gpointer user_data)
 
        if (net_nfc_server_target_connected(handle) == true)
        {
-               DEBUG_SERVER_MSG("call transceive");
+               NFC_DBG("call transceive");
 
                if (net_nfc_controller_transceive(handle,
                                        &transceive_data->transceive_info,
@@ -83,10 +83,7 @@ static void transceive_data_thread_func(gpointer user_data)
                                        &result) == true)
                {
                        if (data != NULL)
-                       {
-                               DEBUG_SERVER_MSG("Transceive data received [%d]",
-                                               data->length);
-                       }
+                               NFC_DBG("Transceive data received [%d]", data->length);
                }
        }
        else
@@ -94,7 +91,7 @@ static void transceive_data_thread_func(gpointer user_data)
                result = NET_NFC_TARGET_IS_MOVED_AWAY;
        }
 
-       DEBUG_SERVER_MSG("transceive result : %d", result);
+       NFC_DBG("transceive result : %d", result);
 
        resp_data = net_nfc_util_gdbus_data_to_variant(data);
 
@@ -129,7 +126,7 @@ static gboolean transceive_data_handle(NetNfcGDbusTransceive *transceive,
        TransceiveSendData *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -137,7 +134,7 @@ static gboolean transceive_data_handle(NetNfcGDbusTransceive *transceive,
                                smack_privilege,
                                "nfc-manager",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -145,7 +142,7 @@ static gboolean transceive_data_handle(NetNfcGDbusTransceive *transceive,
        data = g_new0(TransceiveSendData, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
@@ -194,7 +191,7 @@ static void transceive_thread_func(gpointer user_data)
 
        if (net_nfc_server_target_connected(handle) == true)
        {
-               DEBUG_MSG("call transceive");
+               NFC_DBG("call transceive");
 
                if (net_nfc_controller_transceive(handle,
                                        &transceive_data->transceive_info,
@@ -203,9 +200,7 @@ static void transceive_thread_func(gpointer user_data)
                {
                        if (data != NULL)
                        {
-                               DEBUG_SERVER_MSG(
-                                               "Transceive data received [%d]",
-                                               data->length);
+                               NFC_DBG("Transceive data received [%d]", data->length);
 
                                /* free resource because it doesn't need */
                                g_free(data->buffer);
@@ -215,12 +210,12 @@ static void transceive_thread_func(gpointer user_data)
        }
        else
        {
-               DEBUG_SERVER_MSG("target is not connected");
+               NFC_ERR("target is not connected");
 
                result = NET_NFC_TARGET_IS_MOVED_AWAY;
        }
 
-       DEBUG_SERVER_MSG("transceive result : %d", result);
+       NFC_DBG("transceive result : %d", result);
 
        net_nfc_gdbus_transceive_complete_transceive(
                        transceive_data->transceive,
@@ -246,7 +241,7 @@ static gboolean transceive_handle(NetNfcGDbusTransceive *transceive,
        TransceiveSendData *data;
        gboolean result;
 
-       INFO_MSG(">>> REQUEST from [%s]",
+       NFC_INFO(">>> REQUEST from [%s]",
                        g_dbus_method_invocation_get_sender(invocation));
 
        /* check privilege and update client context */
@@ -254,7 +249,7 @@ static gboolean transceive_handle(NetNfcGDbusTransceive *transceive,
                                smack_privilege,
                                "nfc-manager",
                                "rw") == false) {
-               DEBUG_ERR_MSG("permission denied, and finished request");
+               NFC_ERR("permission denied, and finished request");
 
                return FALSE;
        }
@@ -262,7 +257,7 @@ static gboolean transceive_handle(NetNfcGDbusTransceive *transceive,
        data = g_new0(TransceiveSendData, 1);
        if (data == NULL)
        {
-               DEBUG_ERR_MSG("Memory allocation failed");
+               NFC_ERR("Memory allocation failed");
                g_dbus_method_invocation_return_dbus_error(invocation,
                                "org.tizen.NetNfcService.AllocationError",
                                "Can not allocate memory");
index c816910..5cacd2d 100644 (file)
@@ -88,14 +88,14 @@ static inline int _mkdir_recursive(char *path, mode_t mode)
                                        if (-1 == ret)
                                        {
                                                char buf[1024];
-                                               DEBUG_ERR_MSG("mkdir() Failed(%s)", strerror_r(errno, buf, sizeof(buf)));
+                                               NFC_ERR("mkdir() Failed(%s)", strerror_r(errno, buf, sizeof(buf)));
                                                return -1;
                                        }
                                }
                                else
                                {
                                        char buf[1024];
-                                       DEBUG_ERR_MSG("opendir() Failed(%s)", strerror_r(errno, buf, sizeof(buf)));
+                                       NFC_ERR("opendir() Failed(%s)", strerror_r(errno, buf, sizeof(buf)));
                                        return -1;
                                }
                        }
@@ -161,7 +161,7 @@ static bool _net_nfc_app_util_change_file_owner_permission(FILE *file)
        {
                if (fchown(fileno(file), pw_inhouse->pw_uid, gr_inhouse->gr_gid) < 0)
                {
-                       DEBUG_ERR_MSG("failed to change owner");
+                       NFC_ERR("failed to change owner");
                }
        }
 
@@ -187,7 +187,7 @@ static net_nfc_error_e net_nfc_app_util_store_ndef_message(data_s *data)
        ret = _mkdir_recursive(file_name, 0755);
        if (-1 == ret)
        {
-               DEBUG_ERR_MSG("_mkdir_recursive() Failed");
+               NFC_ERR("_mkdir_recursive() Failed");
                return NET_NFC_UNKNOWN_ERROR;
        }
 
@@ -204,7 +204,7 @@ static net_nfc_error_e net_nfc_app_util_store_ndef_message(data_s *data)
 
                if ((length = fwrite(data->buffer, 1, data->length, fp)) > 0)
                {
-                       DEBUG_SERVER_MSG("[%d] bytes is written", length);
+                       NFC_DBG("[%d] bytes is written", length);
 
                        _net_nfc_app_util_change_file_owner_permission(fp);
 
@@ -215,7 +215,7 @@ static net_nfc_error_e net_nfc_app_util_store_ndef_message(data_s *data)
                }
                else
                {
-                       DEBUG_ERR_MSG("write is failed = [%d]", data->length);
+                       NFC_ERR("write is failed = [%d]", data->length);
                        result = NET_NFC_UNKNOWN_ERROR;
                }
 
@@ -304,7 +304,7 @@ static bool _net_nfc_app_util_get_mime_from_record(ndef_record_s *record, char *
                        if (record->type_s.buffer == NULL || record->type_s.length == 0 ||
                                        record->payload_s.buffer == NULL || record->payload_s.length == 0)
                        {
-                               DEBUG_ERR_MSG("Broken NDEF Message [NET_NFC_RECORD_WELL_KNOWN_TYPE]");
+                               NFC_ERR("Broken NDEF Message [NET_NFC_RECORD_WELL_KNOWN_TYPE]");
                                break;
                        }
 
@@ -321,8 +321,6 @@ static bool _net_nfc_app_util_get_mime_from_record(ndef_record_s *record, char *
                                mime[record->type_s.length + 2] = '\0';
                        }
 
-                       //DEBUG_SERVER_MSG("mime [%s]", mime);
-
                        result = true;
                }
                break;
@@ -335,7 +333,7 @@ static bool _net_nfc_app_util_get_mime_from_record(ndef_record_s *record, char *
 
                        if (record->type_s.buffer == NULL || record->type_s.length == 0)
                        {
-                               DEBUG_ERR_MSG("Broken NDEF Message [NET_NFC_RECORD_MIME_TYPE]");
+                               NFC_ERR("Broken NDEF Message [NET_NFC_RECORD_MIME_TYPE]");
                                break;
                        }
 
@@ -343,17 +341,14 @@ static bool _net_nfc_app_util_get_mime_from_record(ndef_record_s *record, char *
                        _net_nfc_util_alloc_mem(buffer, record->type_s.length + 1);
                        if (buffer == NULL)
                        {
-                               DEBUG_ERR_MSG("_net_nfc_manager_util_alloc_mem return NULL");
+                               NFC_ERR("_net_nfc_manager_util_alloc_mem return NULL");
                                break;
                        }
                        memcpy(buffer, record->type_s.buffer, record->type_s.length);
 
-                       //DEBUG_SERVER_MSG("NET_NFC_RECORD_MIME_TYPE type [%s]", buffer);
-
                        token = strchr(buffer, ';');
                        if (token != NULL)
                        {
-                               //DEBUG_SERVER_MSG("token = strchr(buffer, ';') != NULL, len [%d]", token - buffer);
                                len = MIN(token - buffer, length - 1);
                        }
                        else
@@ -361,15 +356,11 @@ static bool _net_nfc_app_util_get_mime_from_record(ndef_record_s *record, char *
                                len = MIN(strlen(buffer), length - 1);
                        }
 
-                       //DEBUG_SERVER_MSG("len [%d]", len);
-
                        strncpy(mime, buffer, len);
                        mime[len] = '\0';
 
                        _to_lower(0, mime);
 
-                       //DEBUG_SERVER_MSG("mime [%s]", mime);
-
                        _net_nfc_util_free_mem(buffer);
 
                        result = true;
@@ -411,7 +402,6 @@ static bool _net_nfc_app_util_get_uri_from_record(ndef_record_s *record, char *d
                        if (net_nfc_util_create_uri_string_from_uri_record(record, &uri) == NET_NFC_OK &&
                                        uri != NULL)
                        {
-                               //DEBUG_SERVER_MSG("uri record : %s", uri);
                                snprintf(data, length, "%s", uri);
 
                                _net_nfc_util_free_mem(uri);
@@ -439,7 +429,7 @@ static bool _net_nfc_app_util_get_uri_from_record(ndef_record_s *record, char *d
                                        /* to lower case!! */
                                        strlwr(buffer);
 
-                                       DEBUG_SERVER_MSG("uri record : %s", buffer);
+                                       NFC_DBG("uri record : %s", buffer);
                                        snprintf(data, length, "%s", buffer);
 
                                        _net_nfc_util_free_mem(buffer);
@@ -452,7 +442,6 @@ static bool _net_nfc_app_util_get_uri_from_record(ndef_record_s *record, char *d
                                /* to lower case!! */
                                _to_lower(0, data);
 
-                               //DEBUG_SERVER_MSG("uri record : %s", data);
                                result = true;
 #endif
                        }
@@ -490,7 +479,7 @@ static bool _net_nfc_app_util_get_data_from_record(ndef_record_s *record, char *
                        if (record->type_s.buffer == NULL || record->type_s.length == 0
                                        || record->payload_s.buffer == NULL || record->payload_s.length == 0)
                        {
-                               DEBUG_ERR_MSG("Broken NDEF Message [NET_NFC_RECORD_WELL_KNOWN_TYPE]");
+                               NFC_ERR("Broken NDEF Message [NET_NFC_RECORD_WELL_KNOWN_TYPE]");
                                break;
                        }
 
@@ -505,8 +494,6 @@ static bool _net_nfc_app_util_get_data_from_record(ndef_record_s *record, char *
                                memcpy(data, &(buffer_temp[index]), MIN(text_length, length));
                        }
 
-                       //DEBUG_SERVER_MSG("data [%s]", data);
-
                        result = true;
                }
                break;
@@ -541,55 +528,55 @@ net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data)
 
        if (data == NULL || data->buffer == NULL || data->length == 0)
        {
-               DEBUG_ERR_MSG("net_nfc_app_util_process_ndef NET_NFC_NULL_PARAMETER");
+               NFC_ERR("net_nfc_app_util_process_ndef NET_NFC_NULL_PARAMETER");
                return NET_NFC_NULL_PARAMETER;
        }
 
        /* create file */
        if ((result = net_nfc_app_util_store_ndef_message(data)) != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_app_util_store_ndef_message failed [%d]", result);
+               NFC_ERR("net_nfc_app_util_store_ndef_message failed [%d]", result);
                return result;
        }
 
        /* check state of launch popup */
        if(net_nfc_app_util_check_launch_state() == TRUE)
        {
-               DEBUG_SERVER_MSG("skip launch popup!!!");
+               NFC_DBG("skip launch popup!!!");
                result = NET_NFC_OK;
                return result;
        }
 
        if (net_nfc_util_create_ndef_message(&msg) != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("memory alloc fail..");
+               NFC_ERR("memory alloc fail..");
                return NET_NFC_ALLOC_FAIL;
        }
 
        /* parse ndef message and fill appsvc data */
        if ((result = net_nfc_util_convert_rawdata_to_ndef_message(data, msg)) != NET_NFC_OK)
        {
-               DEBUG_ERR_MSG("net_nfc_app_util_store_ndef_message failed [%d]", result);
+               NFC_ERR("net_nfc_app_util_store_ndef_message failed [%d]", result);
                goto ERROR;
        }
 
        if (_net_nfc_app_util_get_operation_from_record(msg->records, operation, sizeof(operation)) == FALSE)
        {
-               DEBUG_ERR_MSG("_net_nfc_app_util_get_operation_from_record failed [%d]", result);
+               NFC_ERR("_net_nfc_app_util_get_operation_from_record failed [%d]", result);
                result = NET_NFC_UNKNOWN_ERROR;
                goto ERROR;
        }
 
        if (_net_nfc_app_util_get_mime_from_record(msg->records, mime, sizeof(mime)) == FALSE)
        {
-               DEBUG_ERR_MSG("_net_nfc_app_util_get_mime_from_record failed [%d]", result);
+               NFC_ERR("_net_nfc_app_util_get_mime_from_record failed [%d]", result);
                result = NET_NFC_UNKNOWN_ERROR;
                goto ERROR;
        }
 #ifdef USE_FULL_URI
        if (_net_nfc_app_util_get_uri_from_record(msg->records, uri, sizeof(uri)) == FALSE)
        {
-               DEBUG_ERR_MSG("_net_nfc_app_util_get_uri_from_record failed [%d]", result);
+               NFC_ERR("_net_nfc_app_util_get_uri_from_record failed [%d]", result);
                result = NET_NFC_UNKNOWN_ERROR;
                goto ERROR;
        }
@@ -597,7 +584,7 @@ net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data)
        /* launch appsvc */
        if (_net_nfc_app_util_get_data_from_record(msg->records, text, sizeof(text)) == FALSE)
        {
-               DEBUG_ERR_MSG("_net_nfc_app_util_get_data_from_record failed [%d]", result);
+               NFC_ERR("_net_nfc_app_util_get_data_from_record failed [%d]", result);
                result = NET_NFC_UNKNOWN_ERROR;
                goto ERROR;
        }
@@ -611,7 +598,7 @@ net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data)
        }
 #endif
 
-       DEBUG_SERVER_MSG("net_nfc_app_util_appsvc_launch return %d", ret);
+       NFC_DBG("net_nfc_app_util_appsvc_launch return %d", ret);
 
        result = NET_NFC_OK;
 
@@ -687,22 +674,22 @@ void net_nfc_app_util_aul_launch_app(char* package_name, bundle* kb)
                switch(result)
                {
                case AUL_R_EINVAL:
-                       DEBUG_SERVER_MSG("aul launch error : AUL_R_EINVAL");
+                       NFC_ERR("aul launch error : AUL_R_EINVAL");
                        break;
                case AUL_R_ECOMM:
-                       DEBUG_SERVER_MSG("aul launch error : AUL_R_ECOM");
+                       NFC_ERR("aul launch error : AUL_R_ECOM");
                        break;
                case AUL_R_ERROR:
-                       DEBUG_SERVER_MSG("aul launch error : AUL_R_ERROR");
+                       NFC_ERR("aul launch error : AUL_R_ERROR");
                        break;
                default:
-                       DEBUG_SERVER_MSG("aul launch error : unknown ERROR");
+                       NFC_ERR("aul launch error : unknown ERROR");
                        break;
                }
        }
        else
        {
-               DEBUG_SERVER_MSG("success to launch [%s]", package_name);
+               NFC_DBG("success to launch [%s]", package_name);
        }
 }
 
@@ -718,25 +705,25 @@ int net_nfc_app_util_appsvc_launch(const char *operation, const char *uri, const
 
        if (operation != NULL && strlen(operation) > 0)
        {
-               DEBUG_SERVER_MSG("operation : %s", operation);
+               NFC_DBG("operation : %s", operation);
                appsvc_set_operation(bd, operation);
        }
 
        if (uri != NULL && strlen(uri) > 0)
        {
-               DEBUG_SERVER_MSG("uri : %s", uri);
+               NFC_DBG("uri : %s", uri);
                appsvc_set_uri(bd, uri);
        }
 
        if (mime != NULL && strlen(mime) > 0)
        {
-               DEBUG_SERVER_MSG("mime : %s", mime);
+               NFC_DBG("mime : %s", mime);
                appsvc_set_mime(bd, mime);
        }
 
        if (data != NULL && strlen(data) > 0)
        {
-               DEBUG_SERVER_MSG("data : %s", data);
+               NFC_DBG("data : %s", data);
                appsvc_add_data(bd, "data", data);
        }
 
@@ -772,7 +759,7 @@ void _string_to_binary(const char *input, uint8_t *output, uint32_t *length)
        if (input == NULL || *length == 0 || output == NULL)
                return;
 
-       DEBUG_SERVER_MSG("_string_to_binary ");
+       NFC_DBG("_string_to_binary ");
 
        /* strlen("nfc://secure/aid/") = 17 */
 
@@ -817,7 +804,7 @@ int net_nfc_app_util_launch_se_transaction_app(uint8_t *aid, uint32_t aid_len, u
 
                _binary_to_string(aid, aid_len, temp_string, sizeof(temp_string));
                snprintf(aid_string, sizeof(aid_string), "nfc://secure/aid/%s", temp_string);
-               DEBUG_SERVER_MSG("aid_string : %s", aid_string);
+               NFC_DBG("aid_string : %s", aid_string);
                appsvc_set_uri(bd, aid_string);
        }
 
@@ -826,7 +813,7 @@ int net_nfc_app_util_launch_se_transaction_app(uint8_t *aid, uint32_t aid_len, u
                char param_string[1024] = { 0, };
 
                _binary_to_string(param, param_len, param_string, sizeof(param_string));
-               DEBUG_SERVER_MSG("param_string : %s", param_string);
+               NFC_DBG("param_string : %s", param_string);
                appsvc_add_data(bd, "data", param_string);
        }
 
@@ -899,7 +886,7 @@ int net_nfc_app_util_decode_base64(const char *buffer, uint32_t buf_len, uint8_t
        }
        else
        {
-               DEBUG_ERR_MSG("alloc failed");
+               NFC_ERR("alloc failed");
        }
 
        return ret;
@@ -937,11 +924,11 @@ bool net_nfc_app_util_check_launch_state()
 
 static void _play_sound_callback(int id, void *data)
 {
-       DEBUG_MSG("_play_sound_callback");
+       NFC_DBG("_play_sound_callback");
 
        if (WAV_PLAYER_ERROR_NONE != wav_player_stop(id))
        {
-               DEBUG_MSG("wav_player_stop failed");
+               NFC_ERR("wav_player_stop failed");
        }
 }
 
@@ -952,19 +939,19 @@ void net_nfc_manager_util_play_sound(net_nfc_sound_type_e sound_type)
 
        if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &bSoundOn) != 0)
        {
-               DEBUG_MSG("vconf_get_bool failed for Sound");
+               NFC_ERR("vconf_get_bool failed for Sound");
                return;
        }
 
        if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &bVibrationOn) != 0)
        {
-               DEBUG_MSG("vconf_get_bool failed for Vibration");
+               NFC_ERR("vconf_get_bool failed for Vibration");
                return;
        }
 
        if ((sound_type > NET_NFC_TASK_ERROR) || (sound_type < NET_NFC_TASK_START))
        {
-               DEBUG_MSG("Invalid Sound Type");
+               NFC_ERR("Invalid Sound Type");
                return;
        }
 
@@ -972,13 +959,13 @@ void net_nfc_manager_util_play_sound(net_nfc_sound_type_e sound_type)
        {
                int svi_handle = -1;
 
-               DEBUG_MSG("Play Vibration");
+               NFC_DBG("Play Vibration");
 
                if (SVI_SUCCESS == svi_init(&svi_handle))
                {
                        if (SVI_SUCCESS == svi_play_vib(svi_handle, SVI_VIB_TOUCH_SIP))
                        {
-                               DEBUG_MSG("svi_play_vib success");
+                               NFC_DBG("svi_play_vib success");
                        }
 
                        svi_fini(svi_handle);
@@ -989,7 +976,7 @@ void net_nfc_manager_util_play_sound(net_nfc_sound_type_e sound_type)
        {
                char *sound_path = NULL;
 
-               DEBUG_MSG("Play Sound");
+               NFC_DBG("Play Sound");
 
                switch (sound_type)
                {
@@ -1008,14 +995,14 @@ void net_nfc_manager_util_play_sound(net_nfc_sound_type_e sound_type)
                {
                        if (WAV_PLAYER_ERROR_NONE == wav_player_start(sound_path, SOUND_TYPE_MEDIA, _play_sound_callback, NULL, NULL))
                        {
-                               DEBUG_MSG("wav_player_start success");
+                               NFC_DBG("wav_player_start success");
                        }
 
                        _net_nfc_util_free_mem(sound_path);
                }
                else
                {
-                       DEBUG_ERR_MSG("Invalid Sound Path");
+                       NFC_ERR("Invalid Sound Path");
                }
        }
 }
index 174ea9a..3b1ffe3 100644 (file)
@@ -44,7 +44,7 @@ static void vconf_set_flight_mode(int boolval)
        result = vconf_set_bool(VCONFKEY_NFC_PREDEFINED_ITEM_STATE, boolval);
        if (result != 0)
        {
-               DEBUG_ERR_MSG("can not set to %d: %s",
+               NFC_ERR("can not set to %d: %s",
                                boolval,
                                "VCONKEY_NFC_PREDEFINED_ITEM_STATE");
        }
@@ -59,19 +59,19 @@ static void net_nfc_server_vconf_pm_state_changed(keynode_t *key,
 
        result = vconf_get_bool(VCONFKEY_NFC_STATE, &state);
        if (result != 0)
-               DEBUG_ERR_MSG("can not get %s", "VCONFKEY_NFC_STATE");
+               NFC_ERR("can not get %s", "VCONFKEY_NFC_STATE");
 
        if (state == false)
        {
-               DEBUG_MSG("NFC off");
+               NFC_DBG("NFC off");
                return;
        }
 
        result = vconf_get_int(VCONFKEY_PM_STATE, &pm_state);
        if (result != 0)
-               DEBUG_ERR_MSG("can not get %s", "VCONFKEY_PM_STATE");
+               NFC_ERR("can not get %s", "VCONFKEY_PM_STATE");
 
-       DEBUG_SERVER_MSG("pm_state : %d", pm_state);
+       NFC_DBG("pm_state : %d", pm_state);
 
        if (pm_state == VCONFKEY_PM_STATE_NORMAL ||
                        pm_state == VCONFKEY_PM_STATE_LCDOFF)
@@ -91,22 +91,21 @@ static void net_nfc_server_vconf_flight_mode_changed(keynode_t *key,
        result = vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &flight_mode);
        if (result != 0)
        {
-               DEBUG_ERR_MSG("Can not get %s",
+               NFC_ERR("Can not get %s",
                                "VCONFKEY_TELEPHONY_FLIGHT_MODE");
        }
 
-       DEBUG_SERVER_MSG("flight mode %d", flight_mode);
+       NFC_DBG("flight mode %d", flight_mode);
 
        result = vconf_get_bool(VCONFKEY_NFC_STATE, &nfc_state);
        if (result != 0)
        {
-               DEBUG_ERR_MSG("Can not get %s",
+               NFC_ERR("Can not get %s",
                                "VCONFKEY_NET_STATE");
        }
 
-       DEBUG_SERVER_MSG("nfc_state %d", nfc_state);
-       DEBUG_SERVER_MSG("powerd_off_by_flightmode %d",
-                       powered_off_by_flightmode);
+       NFC_DBG("nfc_state %d", nfc_state);
+       NFC_DBG("powerd_off_by_flightmode %d", powered_off_by_flightmode);
 
        if (flight_mode) /* turn on flight mode */
        {
@@ -114,7 +113,7 @@ static void net_nfc_server_vconf_flight_mode_changed(keynode_t *key,
                if (nfc_state == VCONFKEY_NFC_STATE_OFF)
                        return;
 
-               DEBUG_SERVER_MSG("Turning NFC off");
+               NFC_INFO("Turning NFC off");
                net_nfc_server_manager_set_active(FALSE);
 
                powered_off_by_flightmode = TRUE;
@@ -130,7 +129,7 @@ static void net_nfc_server_vconf_flight_mode_changed(keynode_t *key,
                if (powered_off_by_flightmode == FALSE)
                        return;
 
-               DEBUG_SERVER_MSG("Turning NFC on");
+               NFC_INFO("Turning NFC on");
                net_nfc_server_manager_set_active(TRUE);
 
                powered_off_by_flightmode = FALSE;