Add EMULATOR definition for emulator environment implementation 36/78036/2 accepted/tizen/common/20160704.150000 accepted/tizen/ivi/20160704.091229 accepted/tizen/mobile/20160704.091240 accepted/tizen/tv/20160704.091158 accepted/tizen/wearable/20160704.091219 submit/tizen/20160704.051425
authorJihoon Jung <jh8801.jung@samsung.com>
Mon, 4 Jul 2016 04:47:54 +0000 (13:47 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Mon, 4 Jul 2016 04:55:58 +0000 (13:55 +0900)
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Change-Id: I6cb92573f7820fa771d1e2642a56e91a55f928cb

packaging/nfc-manager.spec
src/manager/CMakeLists.txt
src/manager/net_nfc_server_p2p.c

index 4c7952782842dc4eb2174493cbfaef09e538beca..6e7b14e605e840cf2c15351ea601a7e1682a7cba 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       nfc-manager
 Summary:    NFC framework manager
-Version:    0.1.148
+Version:    0.1.149
 Release:    0
 Group:      Network & Connectivity/NFC
 License:    Flora-1.1
@@ -85,6 +85,9 @@ LDFLAGS="$LDFLAGS" cmake . \
 %ifarch aarch64 x86_64
                -DTIZEN_ARCH_64=1 \
 %endif
+%ifarch %{ix86} x86_64
+               -DTIZEN_EMULATOR=1 \
+%endif
 
 %install
 %make_install
index fee8451f6119c2c3122aff55c8759427000ea093..24a1761105df177fc984fc111df21219a2fab59c 100755 (executable)
@@ -24,6 +24,11 @@ IF (TIZEN_TELEPHONY_ENABLED)
        ADD_DEFINITIONS(-DENABLE_TELEPHONY)
 ENDIF (TIZEN_TELEPHONY_ENABLED)
 
+IF (TIZEN_EMULATOR)
+       MESSAGE("-DTIZEN_EMULATOR")
+       ADD_DEFINITIONS(-DTIZEN_EMULATOR)
+ENDIF(TIZEN_EMULATOR)
+
 INCLUDE(FindPkgConfig)
 pkg_check_modules(manager_pkges REQUIRED ${dependents})
 
index 2e7c70818ebdde24ff77aa95f5244aada46f5796..cf8a1f1de3cb8c8ac1939d71e576d4c5c035c22a 100755 (executable)
@@ -62,6 +62,17 @@ static void p2p_send_data_thread_func(gpointer user_data)
 
        handle = GUINT_TO_POINTER(p2p_data->p2p_handle);
 
+#if TIZEN_EMULATOR
+       net_nfc_gdbus_p2p_complete_send(p2p_data->p2p,
+               p2p_data->invocation,
+               NET_NFC_OK);
+       net_nfc_util_clear_data(&p2p_data->data);
+
+       g_object_unref(p2p_data->invocation);
+       g_object_unref(p2p_data->p2p);
+
+       g_free(p2p_data);
+#else
        result = net_nfc_server_snep_default_client_start(
                handle,
                SNEP_REQ_PUT,
@@ -81,6 +92,7 @@ static void p2p_send_data_thread_func(gpointer user_data)
 
                g_free(p2p_data);
        }
+#endif
 }
 
 static gboolean p2p_handle_send(NetNfcGDbusP2p *p2p,