res,
&error) == FALSE)
{
- DEBUG_ERR_MSG("Can not finish"
+ NFC_ERR("Can not finish"
" connection handover: %s", error->message);
g_error_free(error);
if (handover_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get handover Proxy");
+ NFC_ERR("Can not get handover Proxy");
return NET_NFC_NOT_INITIALIZED;
}
if (handover_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get handover Proxy");
+ NFC_ERR("Can not get handover Proxy");
return NET_NFC_NOT_INITIALIZED;
}
*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;
if (handover_proxy)
{
- DEBUG_CLIENT_MSG("Already initialized");
+ NFC_WARN("Already initialized");
return NET_NFC_OK;
}
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;
}
res,
&error) == FALSE)
{
- DEBUG_ERR_MSG("Can not finish config: %s",
+ NFC_ERR("Can not finish config: %s",
error->message);
g_error_free(error);
res,
&error) == FALSE)
{
- DEBUG_ERR_MSG("Can not finish listen: %s",
+ NFC_ERR("Can not finish listen: %s",
error->message);
g_error_free(error);
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;
}
res,
&error) == FALSE)
{
- DEBUG_ERR_MSG("Can not finish accept: %s",
+ NFC_ERR("Can not finish accept: %s",
error->message);
g_error_free(error);
res,
&error) == FALSE)
{
- DEBUG_ERR_MSG("Can not finish reject: %s",
+ NFC_ERR("Can not finish reject: %s",
error->message);
g_error_free(error);
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);
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;
}
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;
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;
}
res,
&error) == FALSE)
{
- DEBUG_ERR_MSG("Can not finish send: %s",
+ NFC_ERR("Can not finish send: %s",
error->message);
g_error_free(error);
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);
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);
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);
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);
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;
}
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);
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;
}
gint error,
gpointer user_data)
{
- INFO_MSG(">>> SIGNAL arrived");
+ NFC_INFO(">>> SIGNAL arrived");
}
static void llcp_incoming(NetNfcGDbusLlcp *object,
guint incoming_socket,
gpointer user_data)
{
- INFO_MSG(">>> SIGNAL arrived");
+ NFC_INFO(">>> SIGNAL arrived");
}
/* Public APIs */
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) {
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;
}
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) {
NULL,
&error) == FALSE)
{
- DEBUG_ERR_MSG("can not config: %s", error->message);
+ NFC_ERR("can not config: %s", error->message);
g_error_free(error);
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;
}
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;
}
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;
}
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;
}
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;
}
{
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) {
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;
}
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) {
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;
}
{
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) {
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;
}
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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;
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
&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);
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;
}
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;
}
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;
}
*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);
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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);
{
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;
if (llcp_proxy)
{
- DEBUG_CLIENT_MSG("Already initialized");
+ NFC_WARN("Already initialized");
return NET_NFC_OK;
}
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;
}
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;
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);
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;
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;
}
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;
if (manager_proxy)
{
- DEBUG_CLIENT_MSG("Already initialized");
-
+ NFC_WARN("Already initialized");
return NET_NFC_OK;
}
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;
if (target_info == NULL)
{
- DEBUG_ERR_MSG("target_info does not exist");
+ NFC_ERR("target_info does not exist");
return FALSE;
}
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;
}
}
&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;
&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;
&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);
&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;
}
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;
if (ndef_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get NdefProxy");
+ NFC_ERR("Can not get NdefProxy");
return NET_NFC_NOT_INITIALIZED;
}
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) {
if (ndef_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get NdefProxy");
+ NFC_ERR("Can not get NdefProxy");
return NET_NFC_NOT_INITIALIZED;
}
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),
&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;
if (ndef_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get NdefProxy");
+ NFC_ERR("Can not get NdefProxy");
return NET_NFC_NOT_INITIALIZED;
}
if (ndef_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get NdefProxy");
+ NFC_ERR("Can not get NdefProxy");
return NET_NFC_NOT_INITIALIZED;
}
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;
if (ndef_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get NdefProxy");
+ NFC_ERR("Can not get NdefProxy");
return NET_NFC_NOT_INITIALIZED;
}
if (ndef_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get NdefProxy");
+ NFC_ERR("Can not get NdefProxy");
return NET_NFC_NOT_INITIALIZED;
}
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;
if (ndef_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get NdefProxy");
+ NFC_ERR("Can not get NdefProxy");
return NET_NFC_NOT_INITIALIZED;
}
if (ndef_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get NdefProxy");
+ NFC_ERR("Can not get NdefProxy");
return NET_NFC_NOT_INITIALIZED;
}
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;
if (ndef_proxy)
{
- DEBUG_CLIENT_MSG("Already initialized");
+ NFC_WARN("Already initialized");
return NET_NFC_OK;
}
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;
}
size = ftell(fp);
fseek(fp, 0, SEEK_SET);
- DEBUG_CLIENT_MSG("message length = [%ld]", size);
+ NFC_DBG("message length = [%ld]", size);
if (size > 0)
{
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);
}
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;
}
if (temp != NULL)
{
memcpy(temp, &(buffer_temp[index]), text_length);
-
- DEBUG_CLIENT_MSG("text = [%s]", temp);
+ NFC_DBG("text = [%s]", temp);
*buffer = temp;
}
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;
}
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;
}
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;
}
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);*/
{
net_nfc_target_handle_s *handle_info = NULL;
- INFO_MSG(">>> SIGNAL arrived");
+ NFC_INFO(">>> SIGNAL arrived");
handle_info = GUINT_TO_POINTER(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)
{
{
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);
}
if (p2p_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get P2pProxy");
+ NFC_ERR("Can not get P2pProxy");
return NET_NFC_NOT_INITIALIZED;
}
if (p2p_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get P2pProxy");
+ NFC_ERR("Can not get P2pProxy");
return NET_NFC_NOT_INITIALIZED;
}
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);
if (p2p_proxy)
{
- DEBUG_CLIENT_MSG("Already initialized");
-
+ NFC_WARN("Already initialized");
return NET_NFC_OK;
}
&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;
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 };
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)
{
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 =
{
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);
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);
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);
{
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);
{
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);
}
{
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);
}
{
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);
}
if (se_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get se_proxy");
+ NFC_ERR("Can not get se_proxy");
return NET_NFC_NOT_INITIALIZED;
}
if (se_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get se_proxy");
+ NFC_ERR("Can not get se_proxy");
return NET_NFC_NOT_INITIALIZED;
}
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);
if (se_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get se_proxy");
+ NFC_ERR("Can not get se_proxy");
return NET_NFC_NOT_INITIALIZED;
}
#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;
}
&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);
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;
}
if (se_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get se_proxy");
+ NFC_ERR("Can not get se_proxy");
return NET_NFC_NOT_INITIALIZED;
}
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);
if (se_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get se_proxy");
+ NFC_ERR("Can not get se_proxy");
return NET_NFC_NOT_INITIALIZED;
}
if (se_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get se_proxy");
+ NFC_ERR("Can not get se_proxy");
return NET_NFC_NOT_INITIALIZED;
}
&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;
if (se_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get se_proxy");
+ NFC_ERR("Can not get se_proxy");
return NET_NFC_NOT_INITIALIZED;
}
if (se_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get se_proxy");
+ NFC_ERR("Can not get se_proxy");
return NET_NFC_NOT_INITIALIZED;
}
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);
if (se_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get se_proxy");
+ NFC_ERR("Can not get se_proxy");
return NET_NFC_NOT_INITIALIZED;
}
if (se_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get se_proxy");
+ NFC_ERR("Can not get se_proxy");
return NET_NFC_NOT_INITIALIZED;
}
&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;
if (se_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get se_proxy");
+ NFC_ERR("Can not get se_proxy");
return NET_NFC_NOT_INITIALIZED;
}
if (se_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get se_proxy");
+ NFC_ERR("Can not get se_proxy");
return NET_NFC_NOT_INITIALIZED;
}
&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);
if (se_proxy)
{
- DEBUG_CLIENT_MSG("Already initialized");
-
+ NFC_WARN("Already initialized");
return NET_NFC_OK;
}
&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);
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);
if (snep_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get Snep Proxy");
+ NFC_ERR("Can not get Snep Proxy");
return NET_NFC_NOT_INITIALIZED;
}
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);
if (snep_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get Snep Proxy");
+ NFC_ERR("Can not get Snep Proxy");
return NET_NFC_NOT_INITIALIZED;
}
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);
if (snep_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get Snep Proxy");
+ NFC_ERR("Can not get Snep Proxy");
return NET_NFC_NOT_INITIALIZED;
}
if (snep_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get Snep Proxy");
+ NFC_ERR("Can not get Snep Proxy");
return NET_NFC_NOT_INITIALIZED;
}
}
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);
if (snep_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get Snep Proxy");
+ NFC_ERR("Can not get Snep Proxy");
return NET_NFC_NOT_INITIALIZED;
}
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);
{
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,
if (snep_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get Snep Proxy");
+ NFC_ERR("Can not get Snep Proxy");
return NET_NFC_NOT_INITIALIZED;
}
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);
if (snep_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get Snep Proxy");
+ NFC_ERR("Can not get Snep Proxy");
return NET_NFC_NOT_INITIALIZED;
}
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);
if (snep_proxy)
{
- DEBUG_CLIENT_MSG("Already initialized");
-
+ NFC_WARN("Already initialized");
return NET_NFC_OK;
}
&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;
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);
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;
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;
*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;
}
*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);
if (popup_proxy)
{
- DEBUG_CLIENT_MSG("Already initialized");
-
+ NFC_WARN("Already initialized");
return NET_NFC_OK;
}
&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;
{
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)
str = g_new0(gchar, length + 1);
memcpy(str, pos, length);
- DEBUG_CLIENT_MSG("key = [%s]", str);
+ NFC_DBG("key = [%s]", str);
pos += length;
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);
{
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);
}
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;
}
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);
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;
}
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) {
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);
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);
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);
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;
}
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);
if (tag_proxy)
{
- DEBUG_CLIENT_MSG("Alrady initialized");
+ NFC_WARN("Alrady initialized");
return NET_NFC_OK;
}
&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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
*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;
if (data == NULL)
{
- DEBUG_ERR_MSG("data is empty");
+ NFC_ERR("data is empty");
return NULL;
}
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;
}
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;
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;
if (transceive_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get TransceiveProxy");
+ NFC_ERR("Can not get TransceiveProxy");
return NET_NFC_NOT_INITIALIZED;
}
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);
if (transceive_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get TransceiveProxy");
+ NFC_ERR("Can not get TransceiveProxy");
return NET_NFC_NOT_INITIALIZED;
}
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);
if (transceive_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get TransceiveProxy");
+ NFC_ERR("Can not get TransceiveProxy");
return NET_NFC_NOT_INITIALIZED;
}
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);
NULL,
&error) == FALSE)
{
- DEBUG_ERR_MSG("Transceive (sync call) failed: %s",
+ NFC_ERR("Transceive (sync call) failed: %s",
error->message);
g_error_free(error);
if (transceive_proxy == NULL)
{
- DEBUG_ERR_MSG("Can not get TransceiveProxy");
+ NFC_ERR("Can not get TransceiveProxy");
return NET_NFC_NOT_INITIALIZED;
}
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);
NULL,
&error) == FALSE)
{
- DEBUG_ERR_MSG("Transceive (sync call) failed: %s",
+ NFC_ERR("Transceive (sync call) failed: %s",
error->message);
g_error_free(error);
if (transceive_proxy)
{
- DEBUG_CLIENT_MSG("Already initialized");
-
+ NFC_WARN("Already initialized");
return NET_NFC_OK;
}
&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;
#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__
/* for log tag */
static const char *log_tag = LOG_CLIENT_TAG;
-FILE *nfc_log_file;
const char *net_nfc_get_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)
{
&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);
&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);
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;
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);
}
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);
}
{
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)
{
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;
}
{
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)
{
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;
}
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;
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;
}
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;
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;
}
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);
}
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);
}
}
else
{
- DEBUG_MSG("Record type is not config type");
+ NFC_DBG("Record type is not config type");
return NET_NFC_INVALID_FORMAT;
}
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;
}
&& 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;
}
}
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;
}
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;
}
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);
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);
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
{
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];
{
*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 */
}
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;
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)
{
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))
{
}
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;
}
} 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 */
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");
}
}
error:
- DEBUG_ERR_MSG("parser error");
+ NFC_ERR("parser error");
if (newRec)
{
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
{
}
// 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)
{
}
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");
}
}
else
{
- DEBUG_ERR_MSG("invalid payload in record");
+ NFC_ERR("invalid payload in record");
}
}
else if (record->TNF == NET_NFC_RECORD_URI)
}
else
{
- DEBUG_ERR_MSG("no uri record");
+ NFC_ERR("no uri record");
result = NET_NFC_NDEF_RECORD_IS_NOT_EXPECTED_TYPE;
}
}
else
{
- DEBUG_ERR_MSG("X509_LOOKUP_load_file failed");
+ NFC_ERR("X509_LOOKUP_load_file failed");
}
return x509;
// }
// 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;
}
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;
}
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;
}
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;
if (file == NULL)
{
- DEBUG_ERR_MSG("no keyfile specified\n");
+ NFC_ERR("no keyfile specified\n");
return pkey;
}
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
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;
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");
}
}
if (file == NULL)
{
- DEBUG_ERR_MSG("no keyfile specified");
+ NFC_ERR("no keyfile specified");
return pkey;
}
}
else
{
- DEBUG_ERR_MSG("no engine specified");
+ NFC_ERR("no engine specified");
}
}
else
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");
}
}
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;
}
}
}
- 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);
}
else
{
- DEBUG_ERR_MSG("PEM_X509_INFO_read_bio failed");
+ NFC_ERR("PEM_X509_INFO_read_bio failed");
}
}
}
}
- 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);
}
else
{
- DEBUG_ERR_MSG("PEM_X509_INFO_read_bio failed");
+ NFC_ERR("PEM_X509_INFO_read_bio failed");
}
}
}
else
{
- DEBUG_ERR_MSG("not enough result buffer");
+ NFC_ERR("not enough result buffer");
}
BIO_free_all(b64);
}
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;
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);
}
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;
/* 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;
}
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);
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);
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);
}
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);
{
_net_nfc_util_free_mem(buffer);
}
- DEBUG_ERR_MSG("_get_records_data_buffer failed");
+ NFC_ERR("_get_records_data_buffer failed");
}
return result;
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);
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 */
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;
}
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;
}
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;
}
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);
{
gint state;
- DEBUG_MSG("bus path : %s", path);
+ NFC_DBG("bus path : %s", path);
net_nfc_server_gdbus_init();
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;
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();
}
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",
net_nfc_controller_unload(handle);
- net_nfc_manager_fini_log();
-
g_option_context_free(option_context);
return 0;
if (req_msg == NULL)
{
- DEBUG_ERR_MSG("can not get llcp_event info");
+ NFC_ERR("can not get llcp_event info");
return;
}
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");
}
}
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
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();
}
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)
{
NET_NFC_ALL_ENABLE,
&result) == true)
{
- DEBUG_SERVER_MSG("polling enable");
+ NFC_DBG("polling enable");
}
return;
NET_NFC_ALL_DISABLE,
&result) == true)
{
- DEBUG_SERVER_MSG("polling disabled");
+ NFC_DBG("polling disabled");
}
return;
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;
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);
controller_init_thread_func,
NULL)==FALSE)
{
- DEBUG_ERR_MSG("Failed to push onto the queue");
+ NFC_ERR("Failed to push onto the queue");
}
}
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
if(controller_async_queue == NULL)
{
- DEBUG_ERR_MSG("controller_async_queue is not initialized");
+ NFC_ERR("controller_async_queue is not initialized");
return FALSE;
}
restart_polling_loop_thread_func,
NULL) == FALSE)
{
- DEBUG_ERR_MSG("Failed to push onto the queue");
+ NFC_ERR("Failed to push onto the queue");
}
}
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");
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;
(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");
}
}
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 */
#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,
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;
}
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;
}
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;
}
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;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
- DEBUG_SERVER_MSG("interface is null");
+ NFC_ERR("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
- DEBUG_SERVER_MSG("interface is null");
+ NFC_ERR("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
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)
{
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
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)
{
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
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)
{
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
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)
{
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
- DEBUG_SERVER_MSG("interface is null");
+ NFC_ERR("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
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;
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
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");
}
}
}
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;
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
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;
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
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)
{
_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;
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
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)
{
_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;
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
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)
{
_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;
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
_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;
}
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;
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
_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;
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
_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;
}
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;
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
_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;
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
}
else
{
+ NFC_ERR("interface is null");
*result = NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC;
- DEBUG_SERVER_MSG("interface is null");
return false;
}
}
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 */
smack_privilege,
"nfc-manager::p2p",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
retval = WIFI_SECURITY_TYPE_WPA_PSK;
break;
default:
- DEBUG_ERR_MSG("Invalid security Type");
+ NFC_ERR("Invalid security Type");
retval = 0;
}
return retval;
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 };
// 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;
}
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,
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
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;
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 };
if(context == NULL)
{
- DEBUG_ERR_MSG("Invalid context");
+ NFC_ERR("Invalid context");
return false;
}
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;
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(
}
}
-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;
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(
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)
{
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
{
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;
}
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*/
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;
{
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,
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
{
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;
}
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)
}
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;
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);
}
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)
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);
}
}
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,
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);
}
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);
}
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;
&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);
}
#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;
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;
}
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;
}
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;
}
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
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)
{
}
else
{
- DEBUG_MSG("wifi direct is enabled already");
+ NFC_DBG("wifi direct is enabled already");
/* do next step */
g_idle_add((GSourceFunc)
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;
{
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);
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;
}
LOGD("[%s:%d] START", __func__, __LINE__);
if(context == NULL)
{
- DEBUG_ERR_MSG("Invalid context");
+ NFC_ERR("Invalid context");
return FALSE;
}
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;
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 */
&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);
}
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();
{
if (hash.length == 16)
{
- DEBUG_MSG("hash.length == 16");
+ NFC_DBG("hash.length == 16");
net_nfc_convert_byte_order(hash.buffer, 16);
}
else
{
- DEBUG_ERR_MSG("hash.length error : [%d] bytes", hash.length);
+ NFC_ERR("hash.length error : [%d] bytes", hash.length);
}
}
{
if (randomizer.length == 16)
{
- DEBUG_MSG("randomizer.length == 16");
+ NFC_DBG("randomizer.length == 16");
net_nfc_convert_byte_order(randomizer.buffer, 16);
}
else
{
- DEBUG_ERR_MSG("randomizer.length error :"
+ NFC_ERR("randomizer.length error :"
" [%d] bytes", randomizer.length);
}
}
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;
}
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);
}
{
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);
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);
}
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);
}
}
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);
}
}
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;
}
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;
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,
}
else
{
- DEBUG_MSG("bluetooth is enabled already");
+ NFC_DBG("bluetooth is enabled already");
/* do next step */
g_idle_add((GSourceFunc)
}
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;
break;
case NET_NFC_LLCP_STEP_02 :
- DEBUG_MSG("STEP [2]");
+ NFC_DBG("STEP [2]");
context->step = NET_NFC_LLCP_STEP_RETURN;
_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);
}
break;
case NET_NFC_LLCP_STEP_RETURN :
- DEBUG_MSG("STEP return");
+ NFC_DBG("STEP return");
/* unregister current callback */
bluetooth_unregister_callback();
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],
address,
sizeof(ptr->device_address)) == 0)
{
- DEBUG_SERVER_MSG("Found!!!");
+ NFC_DBG("Found!!!");
result = true;
break;
}
}
else
{
- DEBUG_ERR_MSG("bluetooth_get_bonded_device_list failed with"
+ NFC_ERR("bluetooth_get_bonded_device_list failed with"
" [%d]", ret);
}
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;
}
}
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;
}
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;
}
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,
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)
}
else
{
- DEBUG_ERR_MSG("bluetooth_register_callback failed");
+ NFC_ERR("bluetooth_register_callback failed");
context->result = NET_NFC_OPERATION_FAIL;
g_idle_add(
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,
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],
}
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;
case NET_NFC_LLCP_STEP_RETURN :
{
- DEBUG_MSG("STEP return");
+ NFC_DBG("STEP return");
data_s data = { context->addr.addr,
sizeof(context->addr.addr) };
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
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;
}
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");
}
}
}
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");
}
}
}
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;
}
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;
}
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;
}
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;
}
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,
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;
}
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;
}
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;
}
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;
}
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,
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,
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,
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,
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),
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,
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 */
smack_privilege,
"nfc-manager::p2p",
"w") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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 */
smack_privilege,
"nfc-manager::p2p",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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 */
smack_privilege,
"nfc-manager::p2p",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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 */
smack_privilege,
"nfc-manager::p2p",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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 */
smack_privilege,
"nfc-manager::p2p",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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 */
smack_privilege,
"nfc-manager::p2p",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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 */
smack_privilege,
"nfc-manager::p2p",
"w") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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 */
smack_privilege,
"nfc-manager::p2p",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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 */
smack_privilege,
"nfc-manager::p2p",
"w") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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 */
smack_privilege,
"nfc-manager::p2p",
"w") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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 */
smack_privilege,
"nfc-manager::p2p",
"w") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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 */
smack_privilege,
"nfc-manager::p2p",
"w") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
}
else
{
- DEBUG_SERVER_MSG("target was not connected.");
+ NFC_ERR("target was not connected.");
}
}
}
else
{
- DEBUG_SERVER_MSG("the target was disconnected");
+ NFC_ERR("the target was disconnected");
}
/* send p2p detatch */
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)
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)
&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;
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;
}
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;
}
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;
&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;
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;
}
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;
}
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;
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;
}
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;
}
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;
}
net_nfc_error_e result;
if (cb == NULL) {
- DEBUG_ERR_MSG("callback is mandatory");
+ NFC_ERR("callback is mandatory");
return NET_NFC_NULL_PARAMETER;
}
_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) {
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;
}
result = NET_NFC_OK;
} else {
- DEBUG_ERR_MSG("service is not registered");
+ NFC_ERR("service is not registered");
result = NET_NFC_NOT_REGISTERED;
}
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();
}
}
}
- 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);
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");
}
}
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;
}
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);
}
/* 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;
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;
}
/* 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;
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);
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 */
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");
{
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 */
smack_privilege,
"nfc-manager::admin",
"r") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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);
"/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);
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;
}
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);
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 */
smack_privilege,
"nfc-manager::tag",
"r") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
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 */
smack_privilege,
"nfc-manager::tag",
"w") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
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 */
smack_privilege,
"nfc-manager::tag",
"w") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
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 */
smack_privilege,
"nfc-manager::tag",
"w") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
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 */
smack_privilege,
"nfc-manager::p2p",
"w") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
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();
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;
}
if (p2p_skeleton == NULL)
{
- DEBUG_ERR_MSG("p2p_skeleton is not initialized");
+ NFC_ERR("p2p_skeleton is not initialized");
return;
}
-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);
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);
}
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);
}
else
{
- DEBUG_ERR_MSG("_handover_bt_process_carrier_record failed [%d]",
+ NFC_ERR("_handover_bt_process_carrier_record failed [%d]",
result);
}
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,
&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;
}
}
else
{
- DEBUG_ERR_MSG("net_nfc_util_get_alternative_carrier"
+ NFC_ERR("net_nfc_util_get_alternative_carrier"
"_record_count failed");
}
}
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;
}
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);
}
}
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;
}
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);
}
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;
}
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;
}
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;
}
}
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,
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,
_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);
}
else
{
- DEBUG_ERR_MSG("alloc failed");
+ NFC_ERR("alloc failed");
result = NET_NFC_ALLOC_FAIL;
}
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;
}
else
{
- DEBUG_ERR_MSG("alloc failed");
+ NFC_ERR("alloc failed");
result = NET_NFC_ALLOC_FAIL;
}
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,
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,
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;
}
}
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);
}
}
}
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);
}
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)
{
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;
}
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)
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,
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,
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(
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;
}
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)
{
}
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_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);
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;
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)
{
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
}
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;
}
(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;
}
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;
}
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;
}
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;
}
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,
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,
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,
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(
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;
}
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)
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;
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;
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;
}
{
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 */
_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 */
}
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;
_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,
}
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;
}
_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,
}
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;
}
}
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;
}
else
{
- DEBUG_ERR_MSG("null param, [%d]", result);
+ NFC_ERR("null param, [%d]", result);
context->state = NET_NFC_STATE_ERROR;
context->result = result;
}
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(
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,
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,
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)
}
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(
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,
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;
}
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);
}
}
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)
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);
}
*/
#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(
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(
{
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);
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);
if (data == NULL)
{
- DEBUG_ERR_MSG("data is NULL");
+ NFC_ERR("data is NULL");
if(npp_data->callback)
{
if (data->buffer == NULL || data->length == 0)
{
- DEBUG_ERR_MSG("Wrong data");
+ NFC_ERR("Wrong data");
if(npp_data->callback)
{
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)
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)
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)
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)
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)
{
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);
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)
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);
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,
if (npp_data == NULL)
return;
- DEBUG_SERVER_MSG("send complete... [%d]", result);
+ NFC_DBG("send complete... [%d]", result);
if (npp_data->callback)
{
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);
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);
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);
}
/*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);
{
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)
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;
}
{
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;
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;
}
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)
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;
}
if (handle == NULL)
{
- DEBUG_ERR_MSG("handle is NULL");
+ NFC_ERR("handle is NULL");
return NET_NFC_NULL_PARAMETER;
}
&config,
&result) == false)
{
- DEBUG_ERR_MSG("%s failed [%d]",
+ NFC_ERR("%s failed [%d]",
"net_nfc_controller_llcp_get_remote_config",
result);
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);
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)
}
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;
}
{
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) {
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;
}
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);
}
}
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;
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,
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;
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);
&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;
}
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;
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;
}
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;
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))
{
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;
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;
}
}
- 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;
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;
}
else
{
- DEBUG_SERVER_MSG("receive complete... [no ndef message]");
+ NFC_DBG("receive complete... [no ndef message]");
context->state = NET_NFC_LLCP_STEP_RETURN;
}
{
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,
_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);
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;
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;
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;
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);
}
{
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);
{
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);
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(
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(
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(
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;
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)
}
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;
}
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;
_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;
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;
{
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(
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(
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(
break;
default :
- DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_??");
+ NFC_ERR("NET_NFC_LLCP_STEP_??");
context->cb(NET_NFC_OPERATION_FAIL,
context->type,
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)
{
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)
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;
}
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;
}
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;
}
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;
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);
}
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;
}
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(
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;
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,
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,
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)
{
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)
break;
default :
- DEBUG_ERR_MSG("NET_NFC_LLCP_STEP_??");
+ NFC_ERR("NET_NFC_LLCP_STEP_??");
/* TODO */
break;
}
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)
{
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)
{
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;
}
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;
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);
if (context == NULL)
{
- DEBUG_ERR_MSG("_create_snep_context failed");
+ NFC_ERR("_create_snep_context failed");
result = NET_NFC_ALLOC_FAIL;
goto ERROR;
}
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 :
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)
}
else
{
- DEBUG_ERR_MSG("net_nfc_util_alloc_data failed");
+ NFC_ERR("net_nfc_util_alloc_data failed");
result = NET_NFC_ALLOC_FAIL;
}
}
}
else
{
- DEBUG_ERR_MSG("incorrect handle state");
+ NFC_ERR("incorrect handle state");
result = NET_NFC_INVALID_STATE;
}
}
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;
}
}
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;
}
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;
}
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;
}
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,
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,
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)
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)
{
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)
_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;
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;
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;
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)
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));
break;
default :
- DEBUG_ERR_MSG("error [%d]", result);
+ NFC_ERR("error [%d]", result);
break;
}
_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;;
break;
default :
- DEBUG_ERR_MSG("error [%d]", result);
+ NFC_ERR("error [%d]", result);
break;
}
_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)
if (context == NULL/* && check valid handle */)
{
- DEBUG_ERR_MSG("invalid handle");
+ NFC_ERR("invalid handle");
return NET_NFC_INVALID_PARAM;
}
}
else
{
- DEBUG_ERR_MSG("incorrect handle state");
+ NFC_ERR("incorrect handle state");
result = NET_NFC_INVALID_STATE;
}
{
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) {
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;
{
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);
}
}
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);
}
}
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");
}
}
{
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 :
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) {
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);
result = NET_NFC_NOT_SUPPORTED;
}
} else {
- DEBUG_SERVER_MSG("Previous request is processing.");
+ NFC_DBG("Previous request is processing.");
result = NET_NFC_BUSY;
}
&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;
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 */
smack_privilege,
"nfc-manager",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
}
else
{
- DEBUG_ERR_MSG("invalid se handle");
+ NFC_ERR("invalid se handle");
result = NET_NFC_INVALID_HANDLE;
}
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 */
smack_privilege,
"nfc-manager",
"r") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
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(
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 */
smack_privilege,
"nfc-manager",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
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 */
smack_privilege,
"nfc-manager",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
&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)
&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
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 */
smack_privilege,
"nfc-manager",
"w") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
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 */
smack_privilege,
"nfc-manager",
"w") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
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 */
smack_privilege,
"nfc-manager",
"r") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
&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);
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);
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(
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,
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);
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*/
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);
g_free(detail);
}
} else {
- DEBUG_ERR_MSG("g_new0 failed");
+ NFC_ERR("g_new0 failed");
}
/* FIXME : should be removed when plugins would be fixed*/
&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");
}
}
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)
break;
default :
- DEBUG_ERR_MSG("error [%d]", result);
+ NFC_ERR("error [%d]", result);
break;
}
if (user_data == NULL)
{
- DEBUG_ERR_MSG("cannot get SNEP client data");
+ NFC_ERR("cannot get SNEP client data");
return;
}
_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);
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 */
arg_privilege,
"nfc-manager::p2p",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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",
}
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",
{
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);
if (user_data == NULL)
{
- DEBUG_ERR_MSG("cannot get SNEP client data");
+ NFC_ERR("cannot get SNEP client data");
return;
}
_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);
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 */
arg_privilege,
"nfc-manager::p2p",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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",
}
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",
{
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) {
if (user_data == NULL)
{
- DEBUG_ERR_MSG("cannot get SNEP client data");
+ NFC_ERR("cannot get SNEP client data");
return;
}
{
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);
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 */
arg_privilege,
"nfc-manager::p2p",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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",
}
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",
if (user_data == NULL)
{
- DEBUG_ERR_MSG("cannot get SNEP client data");
+ NFC_ERR("cannot get SNEP client data");
return;
}
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 */
arg_privilege,
"nfc-manager::p2p",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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",
}
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",
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) {
_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);
_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);
}
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 */
arg_privilege,
"nfc-manager::p2p",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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",
}
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",
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 */
arg_privilege,
"nfc-manager::p2p",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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",
}
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",
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 */
smack_privilege,
"nfc-manager",
"w") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
{
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 */
smack_privilege,
"nfc-manager",
"r") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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;
}
&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);
&response,
&error) == false)
{
- DEBUG_ERR_MSG("net_nfc_controller_transceive is failed");
+ NFC_ERR("net_nfc_controller_transceive is failed");
return result;
}
}
else
{
- DEBUG_ERR_MSG("response is NULL");
+ NFC_ERR("response is NULL");
}
return result;
{
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(
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(
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;
}
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;
{
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();
}
}
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");
}
}
}
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,
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,
{
data_s *recv_data = NULL;
- DEBUG_SERVER_MSG("support NDEF");
+ NFC_DBG("support NDEF");
if (tag_read_ndef_message(target->handle,
target->devType,
}
else
{
- DEBUG_ERR_MSG("_get_carrier_record_by_priority_order"
+ NFC_ERR("_get_carrier_record_by_priority_order"
" failed, [%d]",result);
}
}
}
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);
}
}
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);
}
/* 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;
}
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;
}
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 */
smack_privilege,
"nfc-manager::tag",
"r") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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 */
smack_privilege,
"nfc-manager::tag",
"r") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
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 */
smack_privilege,
"nfc-manager::tag",
"r") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
&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);
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");
}
}
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,
&result) == true)
{
if (data != NULL)
- {
- DEBUG_SERVER_MSG("Transceive data received [%d]",
- data->length);
- }
+ NFC_DBG("Transceive data received [%d]", data->length);
}
}
else
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);
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 */
smack_privilege,
"nfc-manager",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
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,
{
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);
}
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,
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 */
smack_privilege,
"nfc-manager",
"rw") == false) {
- DEBUG_ERR_MSG("permission denied, and finished request");
+ NFC_ERR("permission denied, and finished request");
return FALSE;
}
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");
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;
}
}
{
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");
}
}
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;
}
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);
}
else
{
- DEBUG_ERR_MSG("write is failed = [%d]", data->length);
+ NFC_ERR("write is failed = [%d]", data->length);
result = NET_NFC_UNKNOWN_ERROR;
}
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;
}
mime[record->type_s.length + 2] = '\0';
}
- //DEBUG_SERVER_MSG("mime [%s]", mime);
-
result = true;
}
break;
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;
}
_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
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;
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);
/* 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);
/* to lower case!! */
_to_lower(0, data);
- //DEBUG_SERVER_MSG("uri record : %s", data);
result = true;
#endif
}
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;
}
memcpy(data, &(buffer_temp[index]), MIN(text_length, length));
}
- //DEBUG_SERVER_MSG("data [%s]", data);
-
result = true;
}
break;
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;
}
/* 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;
}
}
#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;
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);
}
}
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);
}
if (input == NULL || *length == 0 || output == NULL)
return;
- DEBUG_SERVER_MSG("_string_to_binary ");
+ NFC_DBG("_string_to_binary ");
/* strlen("nfc://secure/aid/") = 17 */
_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);
}
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);
}
}
else
{
- DEBUG_ERR_MSG("alloc failed");
+ NFC_ERR("alloc failed");
}
return ret;
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");
}
}
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;
}
{
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);
{
char *sound_path = NULL;
- DEBUG_MSG("Play Sound");
+ NFC_DBG("Play Sound");
switch (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");
}
}
}
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");
}
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)
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 */
{
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;
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;