From: Jihoon Jung Date: Tue, 7 Feb 2023 08:20:12 +0000 (+0900) Subject: Disable DO_NOT_AUTO_START Flag and modify test program X-Git-Tag: accepted/tizen/unified/20230213.170710^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_8.0_unified;p=platform%2Fcore%2Fapi%2Fnfc.git Disable DO_NOT_AUTO_START Flag and modify test program Change-Id: Id67df22898a783e718bda408fa10ebfae4a72c7e Signed-off-by: Jihoon Jung --- diff --git a/src/net_nfc_client_handover.c b/src/net_nfc_client_handover.c index aa80b67..370a709 100755 --- a/src/net_nfc_client_handover.c +++ b/src/net_nfc_client_handover.c @@ -321,7 +321,7 @@ net_nfc_error_e net_nfc_client_handover_init(void) handover_proxy = net_nfc_gdbus_handover_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + G_DBUS_PROXY_FLAGS_NONE, "org.tizen.NetNfcService", "/org/tizen/NetNfcService/Handover", NULL, diff --git a/src/net_nfc_client_hce.c b/src/net_nfc_client_hce.c index aca6a7e..7cbc817 100755 --- a/src/net_nfc_client_hce.c +++ b/src/net_nfc_client_hce.c @@ -257,7 +257,7 @@ net_nfc_error_e net_nfc_client_hce_init(void) hce_proxy = net_nfc_gdbus_hce_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + G_DBUS_PROXY_FLAGS_NONE, "org.tizen.NetNfcService", "/org/tizen/NetNfcService/Hce", NULL, diff --git a/src/net_nfc_client_llcp.c b/src/net_nfc_client_llcp.c index e20366a..83eac19 100755 --- a/src/net_nfc_client_llcp.c +++ b/src/net_nfc_client_llcp.c @@ -2046,7 +2046,7 @@ net_nfc_error_e net_nfc_client_llcp_init(void) llcp_proxy = net_nfc_gdbus_llcp_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + G_DBUS_PROXY_FLAGS_NONE, "org.tizen.NetNfcService", "/org/tizen/NetNfcService/Llcp", NULL, diff --git a/src/net_nfc_client_manager.c b/src/net_nfc_client_manager.c index 67ee9fc..91a6ced 100755 --- a/src/net_nfc_client_manager.c +++ b/src/net_nfc_client_manager.c @@ -436,7 +436,7 @@ net_nfc_error_e net_nfc_client_manager_init(void) manager_proxy = net_nfc_gdbus_manager_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + G_DBUS_PROXY_FLAGS_NONE, "org.tizen.NetNfcService", "/org/tizen/NetNfcService/Manager", NULL, diff --git a/src/net_nfc_client_ndef.c b/src/net_nfc_client_ndef.c index 150b2e1..f803e9f 100755 --- a/src/net_nfc_client_ndef.c +++ b/src/net_nfc_client_ndef.c @@ -586,7 +586,7 @@ net_nfc_error_e net_nfc_client_ndef_init(void) ndef_proxy = net_nfc_gdbus_ndef_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + G_DBUS_PROXY_FLAGS_NONE, "org.tizen.NetNfcService", "/org/tizen/NetNfcService/Ndef", NULL, diff --git a/src/net_nfc_client_p2p.c b/src/net_nfc_client_p2p.c index 92a60ab..5760beb 100755 --- a/src/net_nfc_client_p2p.c +++ b/src/net_nfc_client_p2p.c @@ -324,7 +324,7 @@ net_nfc_error_e net_nfc_client_p2p_init(void) p2p_proxy = net_nfc_gdbus_p2p_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + G_DBUS_PROXY_FLAGS_NONE, "org.tizen.NetNfcService", "/org/tizen/NetNfcService/P2p", NULL, diff --git a/src/net_nfc_client_se.c b/src/net_nfc_client_se.c index 7c0bcd8..fb460c9 100755 --- a/src/net_nfc_client_se.c +++ b/src/net_nfc_client_se.c @@ -1539,7 +1539,7 @@ net_nfc_error_e net_nfc_client_se_init(void) se_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + G_DBUS_PROXY_FLAGS_NONE, "org.tizen.NetNfcService", "/org/tizen/NetNfcService/SecureElement", NULL, diff --git a/src/net_nfc_client_snep.c b/src/net_nfc_client_snep.c index d637c84..3a9a47a 100755 --- a/src/net_nfc_client_snep.c +++ b/src/net_nfc_client_snep.c @@ -468,7 +468,7 @@ net_nfc_error_e net_nfc_client_snep_init(void) snep_proxy = net_nfc_gdbus_snep_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + G_DBUS_PROXY_FLAGS_NONE, "org.tizen.NetNfcService", "/org/tizen/NetNfcService/Snep", NULL, diff --git a/src/net_nfc_client_system_handler.c b/src/net_nfc_client_system_handler.c index a90dd45..b0db9cc 100755 --- a/src/net_nfc_client_system_handler.c +++ b/src/net_nfc_client_system_handler.c @@ -280,7 +280,7 @@ net_nfc_error_e net_nfc_client_sys_handler_init(void) popup_proxy = net_nfc_gdbus_popup_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + G_DBUS_PROXY_FLAGS_NONE, "org.tizen.NetNfcService", "/org/tizen/NetNfcService/Popup", NULL, diff --git a/src/net_nfc_client_tag.c b/src/net_nfc_client_tag.c index 4e87316..b6d735c 100755 --- a/src/net_nfc_client_tag.c +++ b/src/net_nfc_client_tag.c @@ -831,7 +831,7 @@ net_nfc_error_e net_nfc_client_tag_init(void) tag_proxy = net_nfc_gdbus_tag_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + G_DBUS_PROXY_FLAGS_NONE, "org.tizen.NetNfcService", "/org/tizen/NetNfcService/Tag", NULL, diff --git a/src/net_nfc_client_test.c b/src/net_nfc_client_test.c index 3730663..72a64a6 100755 --- a/src/net_nfc_client_test.c +++ b/src/net_nfc_client_test.c @@ -732,7 +732,7 @@ net_nfc_error_e net_nfc_client_test_init(void) test_proxy = net_nfc_gdbus_test_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + G_DBUS_PROXY_FLAGS_NONE, "org.tizen.NetNfcService", "/org/tizen/NetNfcService/Test", NULL, diff --git a/src/net_nfc_client_transceive.c b/src/net_nfc_client_transceive.c index db80caf..d26c1a7 100755 --- a/src/net_nfc_client_transceive.c +++ b/src/net_nfc_client_transceive.c @@ -422,7 +422,7 @@ net_nfc_error_e net_nfc_client_transceive_init(void) transceive_proxy = net_nfc_gdbus_transceive_proxy_new_for_bus_sync( G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, + G_DBUS_PROXY_FLAGS_NONE, "org.tizen.NetNfcService", "/org/tizen/NetNfcService/Transceive", NULL, diff --git a/test/nfc_unit_test.c b/test/nfc_unit_test.c index a0f188f..23d2012 100755 --- a/test/nfc_unit_test.c +++ b/test/nfc_unit_test.c @@ -22,14 +22,17 @@ typedef struct tc_table_t tc_table[] = { /* manage api*/ {"NFC Initialize Test", 1}, - {"NFC Configure discovery (CE only) Test", 2}, - {"NFC Configure discovery (Tag only) Test", 3}, - {"NFC Tag NDEF Read", 4}, - {"NFC Test Mode ON", 5}, - {"NFC Test Mode OFF", 6}, - {"NFC Deinitialize Test", 7}, - {"NFC Configure discovery (ALL enable) Test", 8}, - {"NFC Configure discovery (ALL disable) Test", 9}, + {"NFC Enable Test", 2}, + {"NFC Disable Test", 3}, + {"NFC Configure discovery (CE only) Test", 4}, + {"NFC Configure discovery (Tag only) Test", 5}, + {"NFC Tag NDEF Read", 6}, + {"NFC Tag NDEF Write", 7}, + {"NFC Test Mode ON", 8}, + {"NFC Test Mode OFF", 9}, + {"NFC Deinitialize Test", 10}, + {"NFC Configure discovery (ALL enable) Test", 11}, + {"NFC Configure discovery (ALL disable) Test", 12}, /* -----------*/ {"Finish", 0x00ff}, @@ -161,6 +164,14 @@ nfc_ndef_message_h __create_ndef_message() return msg; } +void _nfc_activation_completed_cb(nfc_error_e error, void *user_data) +{ + if (error == NFC_ERROR_NONE) + TC_PRT("Set Activation Successful"); + else + TC_PRT("Set Activation Failed. Result : %d", error); +} + int test_input_callback(void *data) { int ret = 0; @@ -186,20 +197,34 @@ int test_input_callback(void *data) } break; case 2: + { + TC_PRT("nfc enable start"); + ret = nfc_manager_set_activation(true, _nfc_activation_completed_cb, NULL); + TC_PRT("nfc_manager_set_activation end : %d", ret); + } + break; + case 3: + { + TC_PRT("nfc disable start"); + ret = nfc_manager_set_activation(false, _nfc_activation_completed_cb, NULL); + TC_PRT("nfc_manager_set_activation end : %d", ret); + } + break; + case 4: { TC_PRT("nfc configure discovery : CE only start"); ret = nfc_manager_configure_discovery(NFC_DISCOVERY_MODE_CONFIG_LISTENING); TC_PRT("nfc configure discovery : CE only end : %d", ret); } break; - case 3: + case 5: { TC_PRT("nfc configure discovery : Tag only start"); ret = nfc_manager_configure_discovery(NFC_DISCOVERY_MODE_CONFIG_POLLING); TC_PRT("nfc configure discovery : Tag only end : %d", ret); } break; - case 4: + case 6: { TC_PRT("Tag read start"); nfc_tag_h current_tag = NULL; @@ -213,19 +238,42 @@ int test_input_callback(void *data) TC_PRT("Tag read end"); } break; - case 5: + case 7: + { + TC_PRT("Tag write start"); + + nfc_tag_h current_tag = NULL; + nfc_manager_get_connected_tag(¤t_tag); + nfc_ndef_message_h msg = __create_ndef_message(); + + if (msg != NULL) + { + if (current_tag != NULL) + ret = nfc_tag_write_ndef(current_tag, msg, __tag_write_completed, NULL); + else + TC_PRT("Tag Not Connected."); + } + else + { + TC_PRT("NDEF Message create is failed."); + } + + TC_PRT("Tag write end"); + } + break; + case 8: { TC_PRT("Test Mode ON"); nfc_manager_test_mode_on(); } break; - case 6: + case 9: { TC_PRT("Test Mode OFF"); nfc_manager_test_mode_off(); } break; - case 7: + case 10: { TC_PRT("nfc deinitialize start"); @@ -238,14 +286,14 @@ int test_input_callback(void *data) TC_PRT("nfc deinitialize end"); } break; - case 8: + case 11: { TC_PRT("nfc configure discovery : All enable start"); ret = nfc_manager_configure_discovery(NFC_DISCOVERY_MODE_RESUME); TC_PRT("nfc configure discovery : All enable end : %d", ret); } break; - case 9: + case 12: { TC_PRT("nfc configure discovery : All disable start"); ret = nfc_manager_configure_discovery(NFC_DISCOVERY_MODE_STOP);