Disable DO_NOT_AUTO_START Flag and modify test program 60/288060/1 accepted/tizen_8.0_unified accepted/tizen_unified accepted/tizen/8.0/unified/20231005.092807 accepted/tizen/unified/20230213.170710 tizen_8.0_m2_release
authorJihoon Jung <jh8801.jung@samsung.com>
Tue, 7 Feb 2023 08:20:12 +0000 (17:20 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Tue, 7 Feb 2023 08:20:12 +0000 (17:20 +0900)
Change-Id: Id67df22898a783e718bda408fa10ebfae4a72c7e
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
13 files changed:
src/net_nfc_client_handover.c
src/net_nfc_client_hce.c
src/net_nfc_client_llcp.c
src/net_nfc_client_manager.c
src/net_nfc_client_ndef.c
src/net_nfc_client_p2p.c
src/net_nfc_client_se.c
src/net_nfc_client_snep.c
src/net_nfc_client_system_handler.c
src/net_nfc_client_tag.c
src/net_nfc_client_test.c
src/net_nfc_client_transceive.c
test/nfc_unit_test.c

index aa80b67..370a709 100755 (executable)
@@ -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,
index aca6a7e..7cbc817 100755 (executable)
@@ -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,
index e20366a..83eac19 100755 (executable)
@@ -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,
index 67ee9fc..91a6ced 100755 (executable)
@@ -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,
index 150b2e1..f803e9f 100755 (executable)
@@ -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,
index 92a60ab..5760beb 100755 (executable)
@@ -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,
index 7c0bcd8..fb460c9 100755 (executable)
@@ -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,
index d637c84..3a9a47a 100755 (executable)
@@ -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,
index a90dd45..b0db9cc 100755 (executable)
@@ -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,
index 4e87316..b6d735c 100755 (executable)
@@ -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,
index 3730663..72a64a6 100755 (executable)
@@ -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,
index db80caf..d26c1a7 100755 (executable)
@@ -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,
index a0f188f..23d2012 100755 (executable)
@@ -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;
@@ -187,19 +198,33 @@ 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(&current_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);