From ea3bf613e847aa6fcac1887e21007f734f50b588 Mon Sep 17 00:00:00 2001 From: Shriya Sahu Date: Tue, 24 Sep 2013 12:36:37 +0530 Subject: [PATCH] Added Wifi also as an alternative carrier type Changed accordingly for WIFI and BT Change-Id: Ie3ad8c5750faeab4728c3594be0317b8da89bcd9 --- tests/main.c | 15 ++++++++++++--- tests/net_nfc_test_handover.c | 45 +++++++++++++++++++++++++++++++------------ tests/net_nfc_test_handover.h | 21 ++++++++++---------- 3 files changed, 56 insertions(+), 25 deletions(-) diff --git a/tests/main.c b/tests/main.c index 7e68833..3a0f0d5 100644 --- a/tests/main.c +++ b/tests/main.c @@ -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" }, diff --git a/tests/net_nfc_test_handover.c b/tests/net_nfc_test_handover.c index 4a1cf44..9cad066 100644 --- a/tests/net_nfc_test_handover.c +++ b/tests/net_nfc_test_handover.c @@ -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) { diff --git a/tests/net_nfc_test_handover.h b/tests/net_nfc_test_handover.h index 8c51e58..bacd7f0 100644 --- a/tests/net_nfc_test_handover.h +++ b/tests/net_nfc_test_handover.h @@ -20,22 +20,23 @@ #include -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__ -- 2.7.4