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_client.h"
21 #include "net_nfc_client_context.h"
22 #include "net_nfc_test_client.h"
23 #include "net_nfc_typedef_internal.h"
26 static void run_next_callback(gpointer user_data);
28 static void run_next_callback(gpointer user_data)
34 callback = (GCallback)(user_data);
39 void net_nfc_test_initialize(gpointer data, gpointer user_data)
41 net_nfc_error_e result = NET_NFC_OK;
43 result = net_nfc_client_initialize();
45 if(result != NET_NFC_OK)
47 g_print("Client Initialization failed & Result is %d\n", result);
51 g_print("Client Initialization Completed & Result is %d\n", result);
53 run_next_callback(user_data);
56 void net_nfc_test_deinitialize(gpointer data, gpointer user_data)
58 net_nfc_error_e result = NET_NFC_OK;
60 result = net_nfc_client_deinitialize();
62 g_print("Client Deinitialization Completed & Result is %d\n", result);
65 void net_nfc_test_is_nfc_supported(gpointer data, gpointer user_data)
68 net_nfc_error_e result = NET_NFC_OK;
70 result = net_nfc_client_is_nfc_supported(&feature);
72 if((result != NET_NFC_OK) || (feature != 1))
74 g_print("Client is_nfc_supported failed & result is %d\n", result);
75 g_print("Client is_nfc_supported failed & feature value is %d\n", feature);
79 g_print("Client is_nfc_supported completed & feature value is %d\n", feature);
80 g_print("Client is_nfc_supported completed & result is %d\n", result);
82 run_next_callback(user_data);
85 void net_nfc_test_get_nfc_state(gpointer data, gpointer user_data)
88 net_nfc_error_e result = NET_NFC_OK;
90 result = net_nfc_client_get_nfc_state(&state);
92 if((result != NET_NFC_OK) || (state != 1))
94 g_print("Client get_nfc_state failed & result is %d\n", result);
95 g_print("Client get_nfc_state failed & state value is %d\n", state);
99 g_print("Client get_nfc_state completed & state value is %d\n", state);
100 g_print("Client get_nfc_state completed & result is %d\n", result);
102 run_next_callback(user_data);