summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJihoon Jung <jh8801.jung@samsung.com>2016-03-14 17:02:14 +0900
committerJihoon Jung <jh8801.jung@samsung.com>2016-03-14 17:02:55 +0900
commit074d5b8d7ff3da8653e11f4ead8a256bc55fd826 (patch)
tree9015c191c5f38cb7a928b92c92b2249165f36ebc
parent53e7ec78c014dea966d8de6af998c9723569c853 (diff)
downloadnfc-manager-neard-accepted/tizen_tv.tar.gz
nfc-manager-neard-accepted/tizen_tv.tar.bz2
nfc-manager-neard-accepted/tizen_tv.zip
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com> Change-Id: Ib66b8eb1e0a105840f2b1cd011dfcadc702a3ac0
-rw-r--r--client/include/net_nfc_client_util.h2
-rw-r--r--client/net_nfc_client_handover.c40
-rw-r--r--client/net_nfc_client_llcp.c31
-rw-r--r--client/net_nfc_client_manager.c57
-rw-r--r--client/net_nfc_client_ndef.c72
-rw-r--r--client/net_nfc_client_p2p.c33
-rw-r--r--client/net_nfc_client_se.c15
-rw-r--r--client/net_nfc_client_transceive.c2
-rwxr-xr-xclient/net_nfc_client_util.c7
-rw-r--r--client/net_nfc_neard.c5
-rw-r--r--daemon/net_nfc_server.c224
-rw-r--r--daemon/net_nfc_server_llcp.c1
-rwxr-xr-xdaemon/net_nfc_server_process_handover.c74
-rw-r--r--daemon/net_nfc_server_se.c2
-rwxr-xr-xdaemon/net_nfc_server_util.c5
-rw-r--r--daemon/net_nfc_server_util.h2
-rw-r--r--src/manager/include/net_nfc_app_util_private.h2
-rwxr-xr-xtests/net_nfc_test_llcp.c18
-rw-r--r--tests/net_nfc_test_se.c4
19 files changed, 13 insertions, 583 deletions
diff --git a/client/include/net_nfc_client_util.h b/client/include/net_nfc_client_util.h
index a0b7249..b18ba8e 100644
--- a/client/include/net_nfc_client_util.h
+++ b/client/include/net_nfc_client_util.h
@@ -38,7 +38,7 @@ void net_nfc_manager_util_play_sound(net_nfc_sound_type_e sound_type);
net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data);
void net_nfc_app_util_aul_launch_app(char* package_name, bundle* kb);
-void net_nfc_app_util_clean_storage(char* src_path);
+void net_nfc_app_util_clean_storage(const char* src_path);
int net_nfc_app_util_appsvc_launch(const char *operation, const char *uri, const char *mime, const char *data);
int net_nfc_app_util_launch_se_transaction_app(net_nfc_secure_element_type_e se_type,
uint8_t *aid, uint32_t aid_len, uint8_t *param, uint32_t param_len);
diff --git a/client/net_nfc_client_handover.c b/client/net_nfc_client_handover.c
index 6fc95cd..388d5b6 100644
--- a/client/net_nfc_client_handover.c
+++ b/client/net_nfc_client_handover.c
@@ -29,46 +29,6 @@
static NetNfcGDbusHandover *handover_proxy = NULL;
-static void p2p_connection_handover(GObject *source_object,
- GAsyncResult *res, gpointer user_data)
-{
- gboolean ret;
- data_s arg_data;
- GError *error = NULL;
- GVariant *data = NULL;
- net_nfc_error_e result;
- NetNfcCallback *func_data = user_data;
- net_nfc_p2p_connection_handover_completed_cb callback;
- net_nfc_conn_handover_carrier_type_e type = NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;
-
- g_assert(user_data != NULL);
-
- ret = net_nfc_gdbus_handover_call_request_finish(handover_proxy,
- (gint *)&result, (gint *)&type, &data, res, &error);
-
- if (FALSE == ret)
- {
- NFC_ERR("Can not finish connection handover: %s", error->message);
- g_error_free(error);
-
- result = NET_NFC_IPC_FAIL;
- }
-
- if (func_data->callback != NULL)
- {
- callback = (net_nfc_p2p_connection_handover_completed_cb)func_data->callback;
-
- net_nfc_util_gdbus_variant_to_data_s(data, &arg_data);
-
- callback(result, type, &arg_data, func_data->user_data);
-
- net_nfc_util_free_data(&arg_data);
- }
-
- g_free(func_data);
-}
-
-
API net_nfc_error_e net_nfc_client_handover_free_alternative_carrier_data(
net_nfc_connection_handover_info_s *info)
{
diff --git a/client/net_nfc_client_llcp.c b/client/net_nfc_client_llcp.c
index 96a91b9..a70a982 100644
--- a/client/net_nfc_client_llcp.c
+++ b/client/net_nfc_client_llcp.c
@@ -95,37 +95,6 @@ net_nfc_llcp_internal_socket_s *llcp_socket_data_find(net_nfc_llcp_socket_t sock
return pos->data;
}
-/* aysnc callback */
-static void llcp_call_config(GObject *source_object, GAsyncResult *res,
- gpointer user_data)
-{
- gboolean ret;
- GError *error = NULL;
- net_nfc_error_e result;
- LlcpFuncData *func_data = user_data;
-
- g_assert(func_data != NULL);
-
- ret = net_nfc_gdbus_llcp_call_config_finish(NET_NFC_GDBUS_LLCP(source_object),
- &result, res, &error);
- if (FALSE == ret)
- {
- NFC_ERR("Can not finish config: %s", error->message);
- g_error_free(error);
- result = NET_NFC_IPC_FAIL;
- }
-
- if (func_data->callback != NULL)
- {
- net_nfc_client_llcp_config_completed callback =
- (net_nfc_client_llcp_config_completed)func_data->callback;
-
- callback(result, func_data->user_data);
- }
-
- g_free(func_data);
-}
-
static void llcp_call_listen(GObject *source_object, GAsyncResult *res,
gpointer user_data)
{
diff --git a/client/net_nfc_client_manager.c b/client/net_nfc_client_manager.c
index 8d85654..1821718 100644
--- a/client/net_nfc_client_manager.c
+++ b/client/net_nfc_client_manager.c
@@ -34,67 +34,10 @@ struct _ManagerFuncData
};
static NetNfcGDbusManager *manager_proxy = NULL;
-static gboolean activation_is_running = FALSE;
static ManagerFuncData activated_func_data;
static int is_activated = -1;
static guint timeout_id[2];
-static gboolean _set_activate_time_elapsed_callback(gpointer user_data)
-{
- net_nfc_client_manager_set_active_completed callback;
- ManagerFuncData *func_data = user_data;
-
- g_assert(func_data != NULL);
-
- timeout_id[0] = 0;
-
- callback = (net_nfc_client_manager_set_active_completed)func_data->callback;
-
- callback(func_data->result, func_data->user_data);
-
- g_free(func_data);
-
- return false;
-}
-
-static void manager_call_set_active_callback(GObject *source_object,
- GAsyncResult *res, gpointer user_data)
-{
- gboolean ret;
- GError *error = NULL;
- net_nfc_error_e result;
- ManagerFuncData *func_data = user_data;
-
- g_assert(user_data != NULL);
-
- activation_is_running = FALSE;
-
- ret = net_nfc_gdbus_manager_call_set_active_finish(
- NET_NFC_GDBUS_MANAGER(source_object), &result, res, &error);
-
- if (FALSE == ret)
- {
- NFC_ERR("Can not finish call_set_active: %s", error->message);
- g_error_free(error);
-
- result = NET_NFC_IPC_FAIL;
- }
-
- func_data->result = result;
- net_nfc_client_get_nfc_state(&is_activated);
-
- if (is_activated == false)
- {
- //TODO : wait several times
- timeout_id[0] = g_timeout_add(DEACTIVATE_DELAY, _set_activate_time_elapsed_callback,
- func_data);
- }
- else
- {
- g_main_context_invoke(NULL, _set_activate_time_elapsed_callback, func_data);
- }
-}
-
static void manager_call_get_server_state_callback(GObject *source_object,
GAsyncResult *res, gpointer user_data)
{
diff --git a/client/net_nfc_client_ndef.c b/client/net_nfc_client_ndef.c
index 65e4439..40e7ab0 100644
--- a/client/net_nfc_client_ndef.c
+++ b/client/net_nfc_client_ndef.c
@@ -57,78 +57,6 @@ static gboolean ndef_is_supported_tag(void)
}
}
-static void ndef_call_read(GObject *source_object,
- GAsyncResult *res, gpointer user_data)
-{
- gboolean ret;
- GError *error = NULL;
- GVariant *out_data = NULL;
- net_nfc_error_e out_result;
- NetNfcCallback *func_data = user_data;
- net_nfc_client_ndef_read_completed callback;
-
- g_assert(user_data != NULL);
-
- ret = net_nfc_gdbus_ndef_call_read_finish(NET_NFC_GDBUS_NDEF(source_object),
- (gint *)&out_result, &out_data, res, &error);
-
- if (FALSE == ret)
- {
-
- NFC_ERR("Can not finish read: %s", error->message);
- g_error_free(error);
-
- out_result = NET_NFC_IPC_FAIL;
- }
-
- if (func_data->callback != NULL)
- {
- ndef_message_s *message;
-
- callback = (net_nfc_client_ndef_read_completed)func_data->callback;
-
- message = net_nfc_util_gdbus_variant_to_ndef_message(out_data);
-
- callback(out_result, message, func_data->user_data);
-
- net_nfc_util_free_ndef_message(message);
- }
-
- g_free(func_data);
-}
-
-static void ndef_call_write(GObject *source_object,
- GAsyncResult *res, gpointer user_data)
-{
- gboolean ret;
- GError *error = NULL;
- net_nfc_error_e out_result;
- NetNfcCallback *func_data = user_data;
- net_nfc_client_ndef_write_completed callback;
-
- g_assert(user_data != NULL);
-
- ret = net_nfc_gdbus_ndef_call_write_finish(NET_NFC_GDBUS_NDEF(source_object),
- (gint *)&out_result, res, &error);
-
- if (FALSE == ret)
- {
- NFC_ERR("Can not finish write: %s", error->message);
- g_error_free(error);
-
- out_result = NET_NFC_IPC_FAIL;
- }
-
- if (func_data->callback != NULL)
- {
- callback = (net_nfc_client_ndef_write_completed)func_data->callback;
-
- callback(out_result, func_data->user_data);
- }
-
- g_free(func_data);
-}
-
static void ndef_call_make_read_only(GObject *source_object,
GAsyncResult *res, gpointer user_data)
{
diff --git a/client/net_nfc_client_p2p.c b/client/net_nfc_client_p2p.c
index 94b15eb..c3c1e63 100644
--- a/client/net_nfc_client_p2p.c
+++ b/client/net_nfc_client_p2p.c
@@ -91,39 +91,6 @@ static void p2p_device_data_received(GObject *source_object, GVariant *arg_data,
net_nfc_util_free_data(&p2p_data);
}
-static void p2p_call_send(GObject *source_object, GAsyncResult *res,
- gpointer user_data)
-{
- gboolean ret;
- GError *error = NULL;
- net_nfc_error_e out_result;
- NetNfcCallback *func_data = user_data;
- net_nfc_client_p2p_send_completed callback;
-
- g_assert(user_data != NULL);
-
- ret = net_nfc_gdbus_p2p_call_send_finish(NET_NFC_GDBUS_P2P(source_object),
- (gint *)&out_result, res, &error);
-
- if (FALSE == ret)
- {
- out_result = NET_NFC_IPC_FAIL;
-
- NFC_ERR("Can not finish p2p send: %s", error->message);
- g_error_free(error);
- }
-
- if (func_data->callback != NULL)
- {
- callback = (net_nfc_client_p2p_send_completed)func_data->callback;
-
- callback(out_result, func_data->user_data);
- }
-
- g_free(func_data);
-}
-
-
API net_nfc_error_e net_nfc_client_p2p_send(net_nfc_target_handle_s *handle,
data_s *data, net_nfc_client_p2p_send_completed callback, void *user_data)
{
diff --git a/client/net_nfc_client_se.c b/client/net_nfc_client_se.c
index a4f80eb..4cec3b3 100644
--- a/client/net_nfc_client_se.c
+++ b/client/net_nfc_client_se.c
@@ -110,10 +110,8 @@ static void se_transaction_event(GObject *source_object,
gint fg_dispatch,
gint focus_app_pid)
{
- void *user_data = NULL;
data_s aid = { NULL, 0 };
data_s param = { NULL, 0 };
- net_nfc_client_se_transaction_event callback;
NFC_INFO(">>> SIGNAL arrived");
@@ -129,19 +127,6 @@ static void se_transaction_event(GObject *source_object,
net_nfc_util_gdbus_variant_to_data_s(arg_aid, &aid);
net_nfc_util_gdbus_variant_to_data_s(arg_param, &param);
- if(arg_se_type == NET_NFC_SE_TYPE_ESE)
- {
- callback = se_transeventhandler.eSE_transaction_event_cb;
- user_data = se_transeventhandler.eSE_transaction_event_data;
- }
- else if(arg_se_type == NET_NFC_SE_TYPE_UICC)
- {
- callback = se_transeventhandler.UICC_transaction_event_cb;
- user_data = se_transeventhandler.UICC_transaction_event_data;
- }
-
- callback(arg_se_type, &aid, &param, user_data);
-
net_nfc_util_free_data(&param);
net_nfc_util_free_data(&aid);
}
diff --git a/client/net_nfc_client_transceive.c b/client/net_nfc_client_transceive.c
index 600e966..ef3d7d8 100644
--- a/client/net_nfc_client_transceive.c
+++ b/client/net_nfc_client_transceive.c
@@ -84,10 +84,8 @@ static void transceive_data_call(GObject *source_object,
{
gboolean ret;
GError *error = NULL;
- data_s resp = { NULL, };
GVariant *out_data = NULL;
net_nfc_error_e out_result;
- nfc_transceive_data_callback callback;
NetNfcCallback *func_data = user_data;
g_assert(user_data != NULL);
diff --git a/client/net_nfc_client_util.c b/client/net_nfc_client_util.c
index d0be306..dafe7d1 100755
--- a/client/net_nfc_client_util.c
+++ b/client/net_nfc_client_util.c
@@ -554,7 +554,7 @@ net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data)
RETV_IF(NULL == data, NET_NFC_NULL_PARAMETER);
RETV_IF(NULL == data->buffer, NET_NFC_NULL_PARAMETER);
- RETV_IF(NULL == data->length, NET_NFC_NULL_PARAMETER);
+ RETV_IF(0 == data->length, NET_NFC_NULL_PARAMETER);
/* create file */
if ((result = net_nfc_app_util_store_ndef_message(data)) != NET_NFC_OK)
@@ -647,7 +647,7 @@ static bool net_nfc_app_util_is_dir(const char* path_name)
return false;
}
-void net_nfc_app_util_clean_storage(char* src_path)
+void net_nfc_app_util_clean_storage(const char* src_path)
{
DIR* dir = NULL;
char path[1024] = { 0 };
@@ -946,7 +946,6 @@ int net_nfc_app_util_decode_base64(const char *buffer, uint32_t buf_len, uint8_t
pid_t net_nfc_app_util_get_focus_app_pid()
{
- pid_t pid;
#ifdef USE_X11
Ecore_X_Window focus;
@@ -964,10 +963,8 @@ pid_t net_nfc_app_util_get_focus_app_pid()
bool net_nfc_app_util_check_launch_state()
{
- pid_t focus_app_pid;
int state;
- focus_app_pid = net_nfc_app_util_get_focus_app_pid();
net_nfc_client_sys_handler_get_launch_popup_state(&state);
return state;
diff --git a/client/net_nfc_neard.c b/client/net_nfc_neard.c
index 174b9e0..6ca834a 100644
--- a/client/net_nfc_neard.c
+++ b/client/net_nfc_neard.c
@@ -136,6 +136,8 @@ static const char *carrier2string(net_nfc_conn_handover_carrier_type_e type)
return "bluetooth";
case NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS:
return "wifi";
+ default:
+ return "unknown";
}
return NULL;
@@ -354,7 +356,7 @@ static void _tag_lost_cb(const char *tagName, void *user_data)
static void _create_target_info(data_s *data)
{
uint8_t ndefCardstate;
- int actualDataSize, maxDataSize;
+ int actualDataSize, maxDataSize = 0;
bool ndef_support;
if (target_info == NULL)
@@ -536,7 +538,6 @@ static void _p2p_received_cb(GVariant *ret, void *user_data)
{
gconstpointer value;
gsize length;
- ndef_message_s *ndef = NULL;
NFC_DBG("p2p received cb adapter path %s", nfc_adapter_path);
if (nfc_adapter_path == NULL)
diff --git a/daemon/net_nfc_server.c b/daemon/net_nfc_server.c
index b6d0734..06c63f5 100644
--- a/daemon/net_nfc_server.c
+++ b/daemon/net_nfc_server.c
@@ -44,7 +44,6 @@ static gboolean use_daemon = FALSE;
static GMainLoop *loop = NULL;
static GDBusConnection *connection = NULL;
-static guint subscribe_id;
GOptionEntry option_entries[] = {
{ "daemon", 'd', 0, G_OPTION_ARG_NONE, &use_daemon,
@@ -79,186 +78,6 @@ pid_t net_nfc_server_gdbus_get_pid(const char *name)
return pid;
}
-static void _name_owner_changed(GDBusProxy *proxy,
- const gchar *name, const gchar *old_owner,
- const gchar *new_owner, void *user_data)
-{
- RET_IF(NULL == name);
- RET_IF(NULL == old_owner);
- RET_IF(NULL == new_owner);
-
- if (strlen(new_owner) == 0)
- {
- if (net_nfc_server_gdbus_check_client_is_running(old_owner))
- {
- /* unregister service */
- net_nfc_server_llcp_unregister_services(old_owner);
-
- /* remove client context */
- net_nfc_server_gdbus_cleanup_client_context(old_owner);
- }
- }
-}
-
-static void _on_name_owner_changed(GDBusConnection *connection,
- const gchar *sender_name,
- const gchar *object_path,
- const gchar *interface_name,
- const gchar *signal_name,
- GVariant *parameters,
- gpointer user_data)
-{
- gchar *name;
- gchar *old_owner;
- gchar *new_owner;
-
- g_variant_get(parameters, "(sss)", &name, &old_owner, &new_owner);
-
- _name_owner_changed((GDBusProxy *)connection, name, old_owner, new_owner, user_data);
-}
-
-static void _subscribe_name_owner_changed_event()
-{
- RET_IF(NULL == connection);
-
- /* subscribe signal */
- subscribe_id = g_dbus_connection_signal_subscribe(connection,
- "org.freedesktop.DBus", /* bus name */
- "org.freedesktop.DBus", /* interface */
- "NameOwnerChanged", /* member */
- "/org/freedesktop/DBus", /* path */
- NULL, /* arg0 */
- G_DBUS_SIGNAL_FLAGS_NONE,
- _on_name_owner_changed,
- NULL, NULL);
-}
-
-static void _unsubscribe_name_owner_changed_event()
-{
- RET_IF(NULL == connection);
-
- /* subscribe signal */
- if (subscribe_id > 0)
- g_dbus_connection_signal_unsubscribe(connection, subscribe_id);
-}
-
-static void net_nfc_server_gdbus_init(void)
-{
- GError *error = NULL;
-
- if (connection)
- g_object_unref(connection);
-
- connection = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
- if (NULL == connection)
- {
- NFC_ERR("Can not get connection %s", error->message);
- g_error_free (error);
- return;
- }
-
- net_nfc_server_gdbus_init_client_context();
-
- if (net_nfc_server_manager_init(connection) == FALSE)
- {
- NFC_ERR("Can not init manager");
- return;
- }
-
- if (net_nfc_server_tag_init(connection) == FALSE)
- {
- NFC_ERR("Can not init tag");
- return;
- }
-
- if (net_nfc_server_ndef_init(connection) == FALSE)
- {
- NFC_ERR("Can not init ndef");
- return;
- }
-
- if (net_nfc_server_llcp_init(connection) == FALSE)
- {
- NFC_ERR("Can not init llcp");
- return;
- }
-
- if (net_nfc_server_p2p_init(connection) == FALSE)
- {
- NFC_ERR("Can not init p2p");
- return;
- }
-
- if (net_nfc_server_transceive_init(connection) == FALSE)
- {
- NFC_ERR("Can not initialize transceive");
- return;
- }
-
- if (net_nfc_server_handover_init(connection) == FALSE)
- {
- NFC_ERR("Can not initialize handover");
- return;
- }
-
- if (net_nfc_server_se_init(connection) == FALSE)
- {
- NFC_ERR("Can not init se");
- return;
- }
-
- if (net_nfc_server_snep_init(connection) == FALSE)
- {
- NFC_ERR("Can not init snep");
- return;
- }
-
- if (net_nfc_server_system_handler_init(connection) == FALSE)
- {
- NFC_ERR("Can not init system handler");
- return;
- }
-
- if (net_nfc_server_phdc_init(connection) == FALSE)
- {
- NFC_ERR("Can not init phdc");
- return;
- }
-
- if (net_nfc_server_controller_thread_init() == FALSE)
- {
- NFC_ERR("Can not init controller thread");
- return;
- }
-
- _subscribe_name_owner_changed_event();
-}
-
-static void net_nfc_server_gdbus_deinit(void)
-{
- _unsubscribe_name_owner_changed_event();
-
- net_nfc_server_manager_deinit();
- net_nfc_server_tag_deinit();
- net_nfc_server_ndef_deinit();
- net_nfc_server_llcp_deinit();
- net_nfc_server_transceive_deinit();
- net_nfc_server_handover_deinit();
- net_nfc_server_se_deinit();
- net_nfc_server_snep_deinit();
- net_nfc_server_system_handler_deinit();
- net_nfc_server_phdc_deinit();
- net_nfc_server_gdbus_deinit_client_context();
-
- net_nfc_server_controller_thread_deinit();
-
- if (connection)
- {
- g_object_unref(connection);
- connection = NULL;
- }
-}
-
void net_nfc_manager_quit()
{
NFC_DBG("net_nfc_manager_quit kill the nfc-manager daemon!!");
@@ -267,49 +86,6 @@ void net_nfc_manager_quit()
g_main_loop_quit(loop);
}
-static void on_bus_acquired(GDBusConnection *connection, const gchar *path,
- gpointer user_data)
-{
- gint state;
-
- NFC_DBG("bus path : %s", path);
-
- net_nfc_server_gdbus_init();
-
- net_nfc_server_controller_init();
-
- if (vconf_get_bool(VCONFKEY_NFC_STATE, &state) != 0)
- {
- NFC_DBG("VCONFKEY_NFC_STATE is not exist");
- net_nfc_manager_quit();
-
- return;
- }
-
- net_nfc_server_vconf_init();
-
- if (state == 1)
- net_nfc_server_manager_set_active(TRUE);
-#ifndef ESE_ALWAYS_ON
- else if (use_daemon == TRUE)
- net_nfc_server_controller_deinit();
-#endif
-}
-
-static void on_name_acquired(GDBusConnection *connection, const gchar *name,
- gpointer user_data)
-{
- NFC_INFO("name : %s", name);
-}
-
-static void on_name_lost(GDBusConnection *connnection, const gchar *name,
- gpointer user_data)
-{
- NFC_INFO("name : %s", name);
-
- net_nfc_manager_quit();
-}
-
static void _adapter_property_changed_cb(char *name, char *property,
void *value, void *user_data)
{
diff --git a/daemon/net_nfc_server_llcp.c b/daemon/net_nfc_server_llcp.c
index 7b386fb..4148407 100644
--- a/daemon/net_nfc_server_llcp.c
+++ b/daemon/net_nfc_server_llcp.c
@@ -2247,7 +2247,6 @@ net_nfc_error_e net_nfc_server_llcp_start_registered_services(
static void net_nfc_server_llcp_process(gpointer user_data)
{
- bool ret;
net_nfc_target_handle_s *handle;
net_nfc_current_target_info_s *target;
#if 0
diff --git a/daemon/net_nfc_server_process_handover.c b/daemon/net_nfc_server_process_handover.c
index b494ea4..4c5e0a0 100755
--- a/daemon/net_nfc_server_process_handover.c
+++ b/daemon/net_nfc_server_process_handover.c
@@ -216,44 +216,6 @@ static net_nfc_error_e _net_nfc_server_handover_convert_ndef_message_to_data(
return result;
}
-static void _net_nfc_server_handover_bt_get_carrier_record_cb(
- net_nfc_error_e result,
- net_nfc_conn_handover_carrier_state_e cps,
- ndef_record_s *carrier,
- uint32_t aux_data_count,
- ndef_record_s *aux_data,
- void *user_param)
-{
- net_nfc_server_handover_create_config_context_t *context = user_param;
-
- /* append record to ndef message */
- if (NET_NFC_OK == result)
- {
- ndef_record_s *record;
-
- /* FIXME : copy record and append */
- net_nfc_util_create_record(carrier->TNF, &carrier->type_s, &carrier->id_s,
- &carrier->payload_s, &record);
-
- result = net_nfc_util_append_carrier_config_record(context->ndef_message,
- record, cps);
-
- if (NET_NFC_OK == result)
- {
- NFC_DBG("net_nfc_util_append_carrier_config_record success");
- }
- else
- {
- NFC_ERR("net_nfc_util_append_carrier_config_record failed [%d]", result);
- net_nfc_util_free_record(record);
- }
-
- g_idle_add((GSourceFunc)_net_nfc_server_handover_iterate_carrier_configs_to_next,
- (gpointer)context);
- }
-
- /* don't free context */
-}
static void _net_nfc_server_handover_bss_get_carrier_record_cb(
net_nfc_error_e result,
net_nfc_conn_handover_carrier_state_e cps,
@@ -291,27 +253,6 @@ static void _net_nfc_server_handover_bss_get_carrier_record_cb(
/* don't free context */
}
-static void _net_nfc_server_handover_bt_process_carrier_record_cb(
- net_nfc_error_e result,
- net_nfc_conn_handover_carrier_type_e type,
- data_s *data,
- void *user_param)
-{
- net_nfc_server_handover_process_config_context_t *context = user_param;
-
- if (NET_NFC_OK == result)
- {
- if (context->cb != NULL)
- context->cb(result, type, data, context->user_param);
- }
- else
- {
- NFC_ERR("_handover_bt_process_carrier_record failed [%d]", result);
- }
-
- _net_nfc_util_free_mem(context);
-}
-
static void _net_nfc_server_handover_bss_process_carrier_record_cb(
net_nfc_error_e result,
net_nfc_conn_handover_carrier_type_e type,
@@ -1377,21 +1318,6 @@ net_nfc_error_e net_nfc_server_handover_default_server_unregister()
////////////////////////////////////////////////////////////////////////////////
-static void _net_nfc_server_handover_client_post_process_cb(
- net_nfc_error_e result,
- net_nfc_conn_handover_carrier_type_e type,
- data_s *data,
- void *user_param)
-{
- net_nfc_handover_context_t *context = user_param;
-
- RET_IF(NULL == context);
-
- context->state = NET_NFC_LLCP_STEP_RETURN;
-
- _net_nfc_server_handover_client_process(context);
-}
-
static void _net_nfc_server_handover_client_process_carrier_record_cb(
net_nfc_error_e result,
net_nfc_conn_handover_carrier_type_e type,
diff --git a/daemon/net_nfc_server_se.c b/daemon/net_nfc_server_se.c
index 8992d97..ac3b5f6 100644
--- a/daemon/net_nfc_server_se.c
+++ b/daemon/net_nfc_server_se.c
@@ -1182,7 +1182,7 @@ static gboolean se_handle_change_card_emulation_mode(
return FALSE;
}
- data = g_try_new0(ChangeCardEmulMode, 1);
+ data = g_try_new0(SeSetCardEmul, 1);
if (NULL == data)
{
NFC_ERR("Memory allocation failed");
diff --git a/daemon/net_nfc_server_util.c b/daemon/net_nfc_server_util.c
index d317619..a7e8d32 100755
--- a/daemon/net_nfc_server_util.c
+++ b/daemon/net_nfc_server_util.c
@@ -557,7 +557,7 @@ net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data)
RETV_IF(NULL == data, NET_NFC_NULL_PARAMETER);
RETV_IF(NULL == data->buffer, NET_NFC_NULL_PARAMETER);
- RETV_IF(NULL == data->length, NET_NFC_NULL_PARAMETER);
+ RETV_IF(0 == data->length, NET_NFC_NULL_PARAMETER);
/* create file */
if ((result = net_nfc_app_util_store_ndef_message(data)) != NET_NFC_OK)
@@ -650,7 +650,7 @@ static bool net_nfc_app_util_is_dir(const char* path_name)
return false;
}
-void net_nfc_app_util_clean_storage(char* src_path)
+void net_nfc_app_util_clean_storage(const char* src_path)
{
DIR* dir = NULL;
char path[1024] = { 0 };
@@ -949,7 +949,6 @@ int net_nfc_app_util_decode_base64(const char *buffer, uint32_t buf_len, uint8_t
pid_t net_nfc_app_util_get_focus_app_pid()
{
- pid_t pid;
#ifdef USE_X11
Ecore_X_Window focus;
diff --git a/daemon/net_nfc_server_util.h b/daemon/net_nfc_server_util.h
index 119aa78..02614df 100644
--- a/daemon/net_nfc_server_util.h
+++ b/daemon/net_nfc_server_util.h
@@ -39,7 +39,7 @@ void net_nfc_manager_util_play_sound(net_nfc_sound_type_e sound_type);
net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data);
void net_nfc_app_util_aul_launch_app(char* package_name, bundle* kb);
-void net_nfc_app_util_clean_storage(char* src_path);
+void net_nfc_app_util_clean_storage(const char* src_path);
int net_nfc_app_util_appsvc_launch(const char *operation, const char *uri, const char *mime, const char *data);
int net_nfc_app_util_launch_se_transaction_app(net_nfc_secure_element_type_e se_type,
uint8_t *aid, uint32_t aid_len, uint8_t *param, uint32_t param_len);
diff --git a/src/manager/include/net_nfc_app_util_private.h b/src/manager/include/net_nfc_app_util_private.h
index 7c8c102..bd07ef1 100644
--- a/src/manager/include/net_nfc_app_util_private.h
+++ b/src/manager/include/net_nfc_app_util_private.h
@@ -32,7 +32,7 @@
net_nfc_error_e net_nfc_app_util_store_ndef_message(data_s *data);
net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data);
void net_nfc_app_util_aul_launch_app(char* package_name, bundle* kb);
-void net_nfc_app_util_clean_storage(char* src_path);
+void net_nfc_app_util_clean_storage(const char* src_path);
bool net_nfc_app_util_is_dir(const char* path_name);
int net_nfc_app_util_appsvc_launch(const char *operation, const char *uri, const char *mime, const char *data);
int net_nfc_app_util_launch_se_transaction_app(net_nfc_secure_element_type_e se_type,
diff --git a/tests/net_nfc_test_llcp.c b/tests/net_nfc_test_llcp.c
index fe84ebe..bdee798 100755
--- a/tests/net_nfc_test_llcp.c
+++ b/tests/net_nfc_test_llcp.c
@@ -27,10 +27,6 @@ static net_nfc_llcp_socket_t server_test_socket;
static net_nfc_llcp_socket_t client_test_socket;
static net_nfc_llcp_config_info_s *llcp_config = NULL;
-static net_nfc_llcp_config_info_s *llcp_config_sync = NULL;
-static net_nfc_llcp_config_info_s *llcp_config_default = NULL;
-static net_nfc_llcp_config_info_s *llcp_config_default_sync = NULL;
-
/*********************************** utility Calls *************************************/
@@ -47,20 +43,6 @@ static void run_next_callback(gpointer user_data)
/*********************************** Callbacks *************************************/
-static void llcp_default_config_cb(net_nfc_error_e result, void *user_data)
-{
- g_print(" llcp_default_config_cb Completed %d\n", result);
-
- run_next_callback(user_data);
-}
-
-static void llcp_custom_config_cb(net_nfc_error_e result, void *user_data)
-{
- g_print("llcp_custom_config_cb Completed %d\n", result);
-
- run_next_callback(user_data);
-}
-
static void llcp_listen_socket_cb(net_nfc_error_e result,
net_nfc_llcp_socket_t client_socket, void *user_data)
{
diff --git a/tests/net_nfc_test_se.c b/tests/net_nfc_test_se.c
index 816f281..a7834cc 100644
--- a/tests/net_nfc_test_se.c
+++ b/tests/net_nfc_test_se.c
@@ -44,7 +44,7 @@ static void se_set_event_cb(net_nfc_message_e event, void *user_data);
static void se_ese_detection_cb(net_nfc_target_handle_s *handle, int dev_type,
data_s *data, void *user_data);
-static void se_set_transaction_cb(data_s *aid, data_s *param, void *user_data);
+static void se_set_transaction_cb(net_nfc_se_type_e se_type, data_s *aid, data_s *param, void *user_data);
/*This handle would be intialized by open secure element callback function*/
static net_nfc_target_handle_s *global_handle = NULL;
@@ -113,7 +113,7 @@ static void se_ese_detection_cb(net_nfc_target_handle_s *handle, int dev_type,
print_received_data(data);
}
-static void se_set_transaction_cb(data_s *aid, data_s *param, void *user_data)
+static void se_set_transaction_cb(net_nfc_se_type_e se_type, data_s *aid, data_s *param, void *user_data)
{
g_print("Set transaction callback successfully\n");
g_print("*****displaying Aid data****\n");