{
NetNfcCallback *func_data = (NetNfcCallback *)user_data;
GVariant *data = NULL;
- net_nfc_error_e result = NET_NFC_OK;
+ net_nfc_error_e result;
net_nfc_conn_handover_carrier_type_e type =
NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;
GError *error = NULL;
gboolean ret;
GError *error = NULL;
net_nfc_error_e result;
- guint32 out_client_socket;
+ guint32 out_client_socket = -1;
LlcpFuncData *func_data = user_data;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
gboolean ret;
GError *error = NULL;
net_nfc_error_e result;
- guint32 out_client_socket;
+ guint32 out_client_socket = -1;
LlcpFuncData *func_data = user_data;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
gboolean ret;
GError *error = NULL;
net_nfc_error_e result;
- guint32 out_client_socket;
+ guint32 out_client_socket = -1;
LlcpFuncData *func_data = user_data;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
gboolean ret;
GError *error = NULL;
net_nfc_error_e result;
- guint32 out_client_socket;
+ guint32 out_client_socket = -1;
LlcpFuncData *func_data = user_data;
g_assert(func_data != NULL);
gboolean ret;
GError *error = NULL;
net_nfc_error_e result;
- guint32 out_client_socket;
+ guint32 out_client_socket = -1;
LlcpFuncData *func_data = user_data;
g_assert(func_data != NULL);
static void llcp_call_receive_from(GObject *source_object, GAsyncResult *res,
gpointer user_data)
{
- sap_t sap;
gboolean ret;
- GVariant *variant;
+ sap_t sap = 0;
GError *error = NULL;
net_nfc_error_e result;
+ GVariant *variant = NULL;
LlcpFuncData *func_data = user_data;
g_assert(func_data != NULL);
gboolean ret;
GError *error = NULL;
net_nfc_error_e result;
- guint32 out_client_socket;
+ guint32 out_client_socket = -1;
LlcpFuncData *func_data = user_data;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
gboolean ret;
GError *error = NULL;
net_nfc_error_e result;
- guint32 out_client_socket;
+ guint32 out_client_socket = -1;
LlcpFuncData *func_data = user_data;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
gpointer user_data)
{
ManagerFuncData *func_data = (ManagerFuncData *)user_data;
- net_nfc_error_e result = NET_NFC_OK;
+ net_nfc_error_e result;
GError *error = NULL;
g_assert(user_data != NULL);
gpointer user_data)
{
NetNfcCallback *func_data = (NetNfcCallback *)user_data;
- net_nfc_error_e result = NET_NFC_OK;
+ net_nfc_error_e result;
guint out_state = 0;
GError *error = NULL;
GAsyncResult *res,
gpointer user_data);
-
static gboolean ndef_is_supported_tag(void)
{
net_nfc_target_info_s *target_info = NULL;
target_info = net_nfc_client_tag_get_client_target_info();
-
if (target_info == NULL)
{
NFC_ERR("target_info does not exist");
gpointer user_data)
{
NetNfcCallback *func_data = (NetNfcCallback *)user_data;
-
- net_nfc_error_e out_result = NET_NFC_OK;
+ net_nfc_error_e out_result;
GVariant *out_data = NULL;
GError *error = NULL;
gpointer user_data)
{
NetNfcCallback *func_data = (NetNfcCallback *)user_data;
-
- net_nfc_error_e out_result = NET_NFC_OK;
+ net_nfc_error_e out_result;
GError *error = NULL;
g_assert(user_data != NULL);
res,
&error) == FALSE)
{
-
NFC_ERR("Can not finish write: %s", error->message);
g_error_free(error);
gpointer user_data)
{
NetNfcCallback *func_data = (NetNfcCallback *)user_data;
-
- net_nfc_error_e out_result = NET_NFC_OK;
+ net_nfc_error_e out_result;
GError *error = NULL;
g_assert(user_data != NULL);
res,
&error) == FALSE)
{
-
- NFC_ERR("Can not finish make read only: %s",
- error->message);
+ NFC_ERR("Can not finish make read only: %s", error->message);
g_error_free(error);
out_result = NET_NFC_IPC_FAIL;
gpointer user_data)
{
NetNfcCallback *func_data = (NetNfcCallback *)user_data;
-
- net_nfc_error_e out_result = NET_NFC_OK;
+ net_nfc_error_e out_result;
GError *error = NULL;
g_assert(user_data != NULL);
res,
&error) == FALSE)
{
-
NFC_ERR("Can not finish format: %s", error->message);
g_error_free(error);
return NET_NFC_INVALID_STATE;
}
-
if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_NOT_CONNECTED;
return NET_NFC_INVALID_STATE;
}
-
if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_NOT_CONNECTED;
func_data->callback = (gpointer)callback;
func_data->user_data = user_data;
+
arg_data = net_nfc_util_gdbus_data_to_variant((data_s *)key);
net_nfc_gdbus_ndef_call_format(ndef_proxy,
arg_data = net_nfc_util_gdbus_data_to_variant((data_s *)key);
-
if (net_nfc_gdbus_ndef_call_format_sync(ndef_proxy ,
GPOINTER_TO_UINT(handle),
arg_data,
"/org/tizen/NetNfcService/Ndef",
NULL,
&error);
-
if (ndef_proxy == NULL)
{
NFC_ERR("Can not create proxy : %s", error->message);
gpointer user_data)
{
SeFuncData *func_data = (SeFuncData *)user_data;
- net_nfc_error_e result = NET_NFC_OK;
+ net_nfc_error_e result;
GError *error = NULL;
g_assert(user_data != NULL);
res,
&error) == FALSE)
{
- result = NET_NFC_IPC_FAIL;
-
- NFC_ERR("Could not set secure element: %s",
- error->message);
-
+ NFC_ERR("Could not set secure element: %s", error->message);
g_error_free(error);
+
+ result = NET_NFC_IPC_FAIL;
}
if (func_data->se_callback != NULL)
gpointer user_data)
{
NetNfcCallback *func_data = (NetNfcCallback *)user_data;
- net_nfc_error_e result = NET_NFC_OK;
+ net_nfc_error_e result;
gint type = 0;
GError *error = NULL;
res,
&error) == FALSE)
{
- NFC_ERR("Could not set secure element: %s",
- error->message);
-
+ NFC_ERR("Could not set secure element: %s", error->message);
g_error_free(error);
result = NET_NFC_IPC_FAIL;
gpointer user_data)
{
NetNfcCallback *func_data = (NetNfcCallback *)user_data;
- net_nfc_error_e result = NET_NFC_OK;
+ net_nfc_error_e result;
GError *error = NULL;
g_assert(user_data != NULL);
res,
&error) == FALSE)
{
- NFC_ERR("Could not set card emulation: %s",
- error->message);
-
+ NFC_ERR("Could not set card emulation: %s", error->message);
g_error_free(error);
result = NET_NFC_IPC_FAIL;
gpointer user_data)
{
SeFuncData *func_data = (SeFuncData *)user_data;
- net_nfc_error_e result = NET_NFC_OK;
+ net_nfc_error_e result;
guint out_handle = 0;
GError *error = NULL;
res,
&error) == FALSE)
{
- result = NET_NFC_IPC_FAIL;
-
- NFC_ERR("Could not open secure element: %s",
- error->message);
-
+ NFC_ERR("Could not open secure element: %s", error->message);
g_error_free(error);
+
+ result = NET_NFC_IPC_FAIL;
}
if (func_data->se_callback != NULL)
gpointer user_data)
{
SeFuncData *func_data = (SeFuncData *)user_data;
- net_nfc_error_e result = NET_NFC_OK;
+ net_nfc_error_e result;
GError *error = NULL;
g_assert(user_data != NULL);
res,
&error) == FALSE)
{
- result = NET_NFC_IPC_FAIL;
-
NFC_ERR("Could not close secure element: %s", error->message);
-
g_error_free(error);
+ result = NET_NFC_IPC_FAIL;
}
if (func_data->se_callback != NULL)
gpointer user_data)
{
SeFuncData *func_data = (SeFuncData *)user_data;
- net_nfc_error_e result = NET_NFC_OK;
+ net_nfc_error_e result;
GVariant *out_response = NULL;
GError *error = NULL;
res,
&error) == FALSE)
{
- result = NET_NFC_IPC_FAIL;
-
NFC_ERR("Could not send apdu: %s", error->message);
-
g_error_free(error);
+ result = NET_NFC_IPC_FAIL;
}
if (func_data->se_callback != NULL)
gpointer user_data)
{
SeFuncData *func_data = (SeFuncData *)user_data;
- net_nfc_error_e result = NET_NFC_OK;
+ net_nfc_error_e result;
GVariant *out_atr = NULL;
GError *error = NULL;
res,
&error) == FALSE)
{
- result = NET_NFC_IPC_FAIL;
-
NFC_ERR("Could not get atr: %s", error->message);
-
g_error_free(error);
+ result = NET_NFC_IPC_FAIL;
}
if (func_data->se_callback != NULL)
&error) == FALSE)
{
NFC_ERR("Set secure element failed: %s", error->message);
-
g_error_free(error);
-
result = NET_NFC_IPC_FAIL;
}
&error) == FALSE)
{
NFC_ERR("Set card emulation failed: %s", error->message);
-
g_error_free(error);
-
result = NET_NFC_IPC_FAIL;
}
NULL,
&error) == FALSE)
{
- NFC_ERR("close internal secure element failed: %s",
- error->message);
+ NFC_ERR("close internal secure element failed: %s", error->message);
g_error_free(error);
-
result = NET_NFC_IPC_FAIL;
}
} else {
NFC_ERR("Get attributes failed: %s", error->message);
g_error_free(error);
-
result = NET_NFC_IPC_FAIL;
}
&error) == true) {
*response = net_nfc_util_gdbus_variant_to_data(out_data);
} else {
- NFC_ERR("Send APDU failed: %s",
- error->message);
+ NFC_ERR("Send APDU failed: %s", error->message);
g_error_free(error);
-
result = NET_NFC_IPC_FAIL;
}
/*******************************************************************/
-
static void snep_send_client_request(GObject *source_object,
GAsyncResult *res,
gpointer user_data);
/*********************************************************************/
-
static void snep_send_client_request(GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
GVariant *parameter = (GVariant *)user_data;
net_nfc_error_e out_result;
- net_nfc_snep_type_t out_type;
- GVariant *out_data;
+ net_nfc_snep_type_t out_type = NET_NFC_SNEP_GET;
+ GVariant *out_data = NULL;
GError *error = NULL;
net_nfc_client_snep_event_cb callback;
void *user_param;
(guint *)&handle);
if (callback != NULL) {
- ndef_message_h message = NULL;
+ ndef_message_h message;
message = net_nfc_util_gdbus_variant_to_ndef_message(out_data);
callback(handle, out_type, out_result,
message, user_param);
+
net_nfc_free_ndef_message(message);
}
gpointer user_data)
{
NetNfcCallback *func_data = (NetNfcCallback *)user_data;
- net_nfc_error_e result = NET_NFC_OK;
+ net_nfc_error_e result;
GError *error = NULL;
g_assert(user_data != NULL);
gpointer user_data)
{
NetNfcCallback *func_data = (NetNfcCallback *)user_data;
- net_nfc_error_e out_result = NET_NFC_OK;
+ net_nfc_error_e out_result;
gboolean out_is_connected = false;
net_nfc_target_type_e out_dev_type = NET_NFC_UNKNOWN_TARGET;
GError *error = NULL;
client_target_info = NULL;
}
-/* internal funcion */
+/* internal function */
gboolean net_nfc_client_tag_is_connected(void)
{
if (client_target_info == NULL)
return client_target_info;
}
+/* public APIs */
#if 0
API net_nfc_error_e net_nfc_client_tag_is_tag_connected(
net_nfc_client_tag_is_tag_connected_completed callback,
memcpy(transceive_info.buffer,
data->buffer,
data->length);
+
net_nfc_util_compute_CRC(CRC_B,
transceive_info.buffer,
transceive_info.length);
GAsyncResult *res, gpointer user_data)
{
NetNfcCallback *func_data = (NetNfcCallback *)user_data;
- net_nfc_error_e out_result = NET_NFC_OK;
+ net_nfc_error_e out_result;
GVariant *out_data = NULL;
GError *error = NULL;
GAsyncResult *res, gpointer user_data)
{
NetNfcCallback *func_data = (NetNfcCallback *)user_data;
- net_nfc_error_e out_result = NET_NFC_OK;
+ net_nfc_error_e out_result;
GError *error = NULL;
g_assert(user_data != NULL);