[ITC][bluetooth][ACR-1780] Added TC for setting advertisement flags 18/296518/1
authorTarun Kumar <tarun1.kumar@samsung.com>
Mon, 31 Jul 2023 06:10:12 +0000 (11:40 +0530)
committerTarun Kumar <tarun1.kumar@samsung.com>
Mon, 31 Jul 2023 06:10:12 +0000 (11:40 +0530)
Change-Id: I3ebd347120724b0a9b6573badd64dfa15cc9c616
Signed-off-by: Tarun Kumar <tarun1.kumar@samsung.com>
src/itc/bluetooth/ITs-bluetooth-le-adapter.c
src/itc/bluetooth/tct-bluetooth-native_mobile.h
src/itc/bluetooth/tct-bluetooth-native_tizeniot.h
src/itc/bluetooth/tct-bluetooth-native_wearable.h

index a8f0927dae1b4796f43f187f9c0f188225237ffd..b424e5045b6dcdaa000a2b4d62e019bb30770169 100755 (executable)
@@ -2028,5 +2028,46 @@ int ITc_bt_adapter_le_is_discovering_p(void)
 
        return 0;
 }
+
+//& purpose: To test bt_adapter_le_set_advertising_flags
+//& type: auto
+/**
+ * @testcase                   ITc_bt_adapter_le_set_advertising_flags
+ * @since_tizen                        8.0
+ * @author                             SRID(tarun1.kumar)
+ * @reviewer                   SRID(shobhit.v)
+ * @type                               Positive
+ * @description                        To test bt_adapter_le_set_advertising_flags
+ * @scenario                   Call bt_adapter_le_set_advertising_flags
+ * @apicovered                 bt_adapter_le_set_advertising_flags , bt_adapter_le_create_advertiser
+ * @passcase                   If target API bt_adapter_le_set_advertising_flags           return 0
+ * @failcase                   If target API bt_adapter_le_set_advertising_flags           return 1
+ * @precondition               Bluetooth must be initialized
+ * @postcondition              Bluetooth must be deinitialized
+ */
+int ITc_bt_adapter_le_set_advertising_flags_p(void)
+{
+       START_TEST;
+
+       bt_advertiser_h advertiser = NULL;
+       int nRet = bt_adapter_le_create_advertiser(&advertiser);
+
+       if ( !g_bBluetoothIsLESupported )
+       {
+               PRINT_RESULT(BT_ERROR_NOT_SUPPORTED, nRet, "bt_adapter_le_create_advertiser", BluetoothGetError(nRet));
+               return 0;
+       }
+
+       PRINT_RESULT(BT_ERROR_NONE, nRet, "bt_adapter_le_create_advertiser", BluetoothGetError(nRet));
+
+       nRet = bt_adapter_le_set_advertising_flags(advertiser,BT_ADAPTER_LE_ADVERTISING_FLAGS_GEN_DISC | BT_ADAPTER_LE_ADVERTISING_FLAGS_BREDR_UNSUP);
+       PRINT_RESULT_CLEANUP(BT_ERROR_NONE, nRet, "bt_adapter_le_set_advertising_flags", BluetoothGetError(nRet),bt_adapter_le_destroy_advertiser(advertiser));
+
+       nRet = bt_adapter_le_destroy_advertiser(advertiser);
+       PRINT_RESULT(BT_ERROR_NONE, nRet, "bt_adapter_le_destroy_advertiser", BluetoothGetError(nRet));
+       return 0;
+}
+
+
 /** @} */
 /** @} */
index ed5af2f0f946b0b54802d21e06c9ef769722d63b..a1c3265b611511c3cc48dbe3e14eb6c778ae0981 100755 (executable)
@@ -57,6 +57,7 @@ extern int ITc_bt_adapter_le_set_advertising_connectable_p(void);
 extern int ITc_bt_adapter_le_stop_advertising_p(void);
 extern int ITc_bt_adapter_le_clear_advertising_data_p(void);
 extern int ITc_bt_adapter_le_set_scan_mode_p(void);
+extern int ITc_bt_adapter_le_set_advertising_flags_p(void);
 extern int ITc_bluetooth_adapter_bt_adapter_set_get_name_p(void);
 extern int ITc_bluetooth_adapter_bt_adapter_set_unset_name_changed_cb_p(void);
 extern int ITc_bluetooth_adapter_bt_adapter_get_visibility_p(void);
@@ -180,6 +181,7 @@ testcase tc_array[] = {
        {"ITc_bluetooth_bt_socket_listen_l2cap_channel_p", ITc_bluetooth_bt_socket_listen_l2cap_channel_p, ITs_bluetooth_l2cap_channel_startup, ITs_bluetooth_l2cap_channel_cleanup},
        {"ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_requested_cb_p", ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_requested_cb_p, ITs_bluetooth_l2cap_channel_startup, ITs_bluetooth_l2cap_channel_cleanup},
        {"ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_state_changed_cb_p", ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_state_changed_cb_p, ITs_bluetooth_l2cap_channel_startup, ITs_bluetooth_l2cap_channel_cleanup},
+       {"ITc_bt_adapter_le_set_advertising_flags_p", ITc_bt_adapter_le_set_advertising_flags_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
        {NULL, NULL}
 };
 
index a9c836ac40d93a54c1cd97c606bf3b935d795bab..a1c3265b611511c3cc48dbe3e14eb6c778ae0981 100755 (executable)
@@ -57,6 +57,7 @@ extern int ITc_bt_adapter_le_set_advertising_connectable_p(void);
 extern int ITc_bt_adapter_le_stop_advertising_p(void);
 extern int ITc_bt_adapter_le_clear_advertising_data_p(void);
 extern int ITc_bt_adapter_le_set_scan_mode_p(void);
+extern int ITc_bt_adapter_le_set_advertising_flags_p(void);
 extern int ITc_bluetooth_adapter_bt_adapter_set_get_name_p(void);
 extern int ITc_bluetooth_adapter_bt_adapter_set_unset_name_changed_cb_p(void);
 extern int ITc_bluetooth_adapter_bt_adapter_get_visibility_p(void);
@@ -179,7 +180,8 @@ testcase tc_array[] = {
        {"ITc_bluetooth_bt_socket_get_l2cap_psm_p", ITc_bluetooth_bt_socket_get_l2cap_psm_p, ITs_bluetooth_l2cap_channel_startup, ITs_bluetooth_l2cap_channel_cleanup},
        {"ITc_bluetooth_bt_socket_listen_l2cap_channel_p", ITc_bluetooth_bt_socket_listen_l2cap_channel_p, ITs_bluetooth_l2cap_channel_startup, ITs_bluetooth_l2cap_channel_cleanup},
        {"ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_requested_cb_p", ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_requested_cb_p, ITs_bluetooth_l2cap_channel_startup, ITs_bluetooth_l2cap_channel_cleanup},
-       {"ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_state_changed_cb_p", ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_state_changed_cb_p, ITs_bluetooth_l2cap_channel_startup, ITs_bluetooth_l2cap_channel_cleanup},     
+       {"ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_state_changed_cb_p", ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_state_changed_cb_p, ITs_bluetooth_l2cap_channel_startup, ITs_bluetooth_l2cap_channel_cleanup},
+       {"ITc_bt_adapter_le_set_advertising_flags_p", ITc_bt_adapter_le_set_advertising_flags_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
        {NULL, NULL}
 };
 
index 641d1cb6c1fa5e0afad2af30a104568edf3e7e4c..714be238adae0b93a16c64b7637264d847b82f1f 100755 (executable)
@@ -57,6 +57,7 @@ extern int ITc_bt_adapter_le_set_advertising_connectable_p(void);
 extern int ITc_bt_adapter_le_stop_advertising_p(void);
 extern int ITc_bt_adapter_le_clear_advertising_data_p(void);
 extern int ITc_bt_adapter_le_set_scan_mode_p(void);
+extern int ITc_bt_adapter_le_set_advertising_flags_p(void);
 extern int ITc_bluetooth_adapter_bt_adapter_set_get_name_p(void);
 extern int ITc_bluetooth_adapter_bt_adapter_set_unset_name_changed_cb_p(void);
 extern int ITc_bluetooth_adapter_bt_adapter_get_visibility_p(void);
@@ -180,6 +181,7 @@ testcase tc_array[] = {
        {"ITc_bluetooth_bt_socket_listen_l2cap_channel_p", ITc_bluetooth_bt_socket_listen_l2cap_channel_p, ITs_bluetooth_l2cap_channel_startup, ITs_bluetooth_l2cap_channel_cleanup},
        {"ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_requested_cb_p", ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_requested_cb_p, ITs_bluetooth_l2cap_channel_startup, ITs_bluetooth_l2cap_channel_cleanup},
        {"ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_state_changed_cb_p", ITc_bluetooth_bt_socket_set_unset_l2cap_channel_connection_state_changed_cb_p, ITs_bluetooth_l2cap_channel_startup, ITs_bluetooth_l2cap_channel_cleanup},
+       {"ITc_bt_adapter_le_set_advertising_flags_p", ITc_bt_adapter_le_set_advertising_flags_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
        {NULL, NULL}
 };