2 * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <glib-object.h>
20 #include "net_nfc_test_sys_handler.h"
21 #include "net_nfc_typedef_internal.h"
22 #include "net_nfc_client_system_handler.h"
23 #include "net_nfc_target_info.h"
26 /*************************** utility Calls ******************************/
28 static void run_next_callback(gpointer user_data);
30 static void run_next_callback(gpointer user_data)
36 callback = (GCallback)(user_data);
41 static void sys_handler_cb(net_nfc_error_e result,
44 g_print("sys_handler_cb Set popup state completed %d\n", result);
46 run_next_callback(user_data);
49 /********************** Function Calls ******************************/
50 void net_nfc_test_sys_handler_set_launch_popup_state(gpointer data,
53 net_nfc_error_e result;
56 result = net_nfc_client_sys_handler_set_state(enable,sys_handler_cb,user_data);
58 if(result != NET_NFC_OK)
60 g_print("System handler set launch popup state failed: %d\n", result);
64 g_print("System handler set launch popup state success: %d\n", result);
68 void net_nfc_test_sys_handler_set_launch_popup_state_sync(gpointer data,
71 net_nfc_error_e result;
73 result = net_nfc_client_sys_handler_set_state_sync(NET_NFC_LAUNCH_APP_SELECT);
75 if(result != NET_NFC_OK)
77 g_print("System handler set launch popup state failed: %d\n", result);
82 g_print("System handler set launch popup state success: %d\n", result);
85 run_next_callback(user_data);
88 void net_nfc_test_sys_handler_set_launch_popup_state_force(gpointer data,
91 net_nfc_error_e result;
94 result = net_nfc_client_sys_handler_set_state_force(enable,sys_handler_cb,user_data);
96 if(result != NET_NFC_OK)
98 g_print("net_nfc_test_sys_handler_set_launch_popup_state_force failed: %d\n", result);
102 g_print("net_nfc_test_sys_handler_set_launch_popup_state_force success: %d\n", result);
106 void net_nfc_test_sys_handler_set_launch_popup_state_force_sync(gpointer data,
109 net_nfc_error_e result;
111 result = net_nfc_client_sys_handler_set_state_force_sync(NET_NFC_LAUNCH_APP_SELECT);
113 if(result != NET_NFC_OK)
115 g_print("System handler set launch popup state failed: %d\n", result);
120 g_print("System handler set launch popup state success: %d\n", result);
123 run_next_callback(user_data);
127 void net_nfc_test_sys_handler_get_launch_popup_state(gpointer data,
130 net_nfc_error_e result;
133 result = net_nfc_client_sys_handler_get_launch_popup_state(&state);
135 if(result != NET_NFC_OK)
137 g_print("System handler get launch popup state failed: %d\n", result);
141 g_print("System handler get launch popup state success: %d\n", result);
142 g_print("System handler get launch popup state value: %d\n", state);
145 run_next_callback(user_data);