Added Wifi also as an alternative carrier type 98/10198/3
authorShriya Sahu <s.shriya@samsung.com>
Tue, 24 Sep 2013 07:06:37 +0000 (12:36 +0530)
committerShriya Sahu <s.shriya@samsung.com>
Thu, 26 Sep 2013 11:01:34 +0000 (16:31 +0530)
Changed accordingly for WIFI and BT

Change-Id: Ie3ad8c5750faeab4728c3594be0317b8da89bcd9

tests/main.c
tests/net_nfc_test_handover.c
tests/net_nfc_test_handover.h

index 7e68833..3a0f0d5 100644 (file)
@@ -235,9 +235,18 @@ static TestData test_data[] = {
 
        {
                "Handover",
-               "Request",
-               net_nfc_test_p2p_connection_handover,
-               net_nfc_test_p2p_connection_handover_sync,
+               "BTRequest",
+               net_nfc_test_p2p_connection_handover_with_BT,
+               net_nfc_test_p2p_connection_handover_with_BT_sync,
+               "Handover Request Call"
+
+       },
+
+       {
+               "Handover",
+               "WIFIRequest",
+               net_nfc_test_p2p_connection_handover_with_WIFI,
+               net_nfc_test_p2p_connection_handover_with_WIFI_sync,
                "Handover Request Call"
 
        },
index 4a1cf44..9cad066 100644 (file)
@@ -66,33 +66,30 @@ static void p2p_connection_handover_cb(net_nfc_error_e result,
        run_next_callback(user_data);
 }
 
-void net_nfc_test_p2p_connection_handover(gpointer data,
-               gpointer user_data)
+static void _p2p_connection_handover(
+               net_nfc_conn_handover_carrier_type_e type, gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
-       net_nfc_conn_handover_carrier_type_e type = NET_NFC_CONN_HANDOVER_CARRIER_BT;
        net_nfc_target_handle_h handle = NULL;
 
        handle = net_nfc_test_device_get_target_handle();
 
-       g_print("handle for handover  : %p \n", handle);
+       g_print("handle for handover : %p \n", handle);
 
        result = net_nfc_client_p2p_connection_handover(
-                       handle,
-                       type,
-                       p2p_connection_handover_cb,
-                       user_data);
+               handle,
+               type,
+               p2p_connection_handover_cb,
+               user_data);
        g_print("net_nfc_client_p2p_connection_handover() : %d\n", result);
 }
 
-void  net_nfc_test_p2p_connection_handover_sync(gpointer data,
-               gpointer user_data)
+static void _p2p_connection_handover_sync(
+               net_nfc_conn_handover_carrier_type_e type, gpointer user_data)
 {
        net_nfc_error_e result = NET_NFC_OK;
-       net_nfc_conn_handover_carrier_type_e type;
        net_nfc_conn_handover_carrier_type_e out_carrier;
        data_h out_data = NULL;
-       type = NET_NFC_CONN_HANDOVER_CARRIER_BT;
        net_nfc_target_handle_h handle = NULL;
 
        handle = net_nfc_test_device_get_target_handle();
@@ -109,6 +106,30 @@ void  net_nfc_test_p2p_connection_handover_sync(gpointer data,
        run_next_callback(user_data);
 }
 
+void net_nfc_test_p2p_connection_handover_with_BT(gpointer data,
+               gpointer user_data)
+{
+       _p2p_connection_handover(NET_NFC_CONN_HANDOVER_CARRIER_BT, user_data);
+}
+
+void net_nfc_test_p2p_connection_handover_with_WIFI(gpointer data,
+               gpointer user_data)
+{
+       _p2p_connection_handover(NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS, user_data);
+}
+
+void net_nfc_test_p2p_connection_handover_with_BT_sync(gpointer data,
+               gpointer user_data)
+{
+       _p2p_connection_handover_sync(NET_NFC_CONN_HANDOVER_CARRIER_BT, user_data);
+}
+
+void net_nfc_test_p2p_connection_handover_with_WIFI_sync(gpointer data,
+               gpointer user_data)
+{
+       _p2p_connection_handover_sync(NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS, user_data);
+}
+
 void net_nfc_test_handover_get_alternative_carrier_type(gpointer data,
                gpointer user_data)
 {
index 8c51e58..bacd7f0 100644 (file)
 #include <glib.h>
 
 
-void net_nfc_test_p2p_connection_handover(gpointer data,
-                               gpointer user_data);
+void net_nfc_test_p2p_connection_handover_with_BT(gpointer data,
+               gpointer user_data);
 
-void net_nfc_test_p2p_connection_handover_sync(gpointer data,
-                               gpointer user_data);
+void net_nfc_test_p2p_connection_handover_with_BT_sync(gpointer data,
+               gpointer user_data);
 
-/*
-void net_nfc_test_handover_get_alternative_carrier_data(gpointer data,
-                                               gpointer user_data);
-*/
+void net_nfc_test_p2p_connection_handover_with_WIFI(gpointer data,
+               gpointer user_data);
+
+void net_nfc_test_p2p_connection_handover_with_WIFI_sync(gpointer data,
+               gpointer user_data);
 
 void net_nfc_test_handover_handle_alternative_carrier_data(gpointer data,
-                                                       gpointer user_datarrierData);
+               gpointer user_data);
 
 void net_nfc_test_handover_get_alternative_carrier_type(gpointer data,
-                                               gpointer user_data);
+               gpointer user_data);
 
 
 #endif //__NET_NFC_TEST_HANDOVER_H__