[ITC][capi-network-bluetooth][ACR-1289][Add BLE 5.0 APIs]
authormansankar <karanam.s@samsung.com>
Tue, 25 Sep 2018 10:15:42 +0000 (15:45 +0530)
committerAmritanshu Pandia <a.pandia1@samsung.com>
Wed, 26 Sep 2018 06:42:49 +0000 (06:42 +0000)
Change-Id: Ie614c811a17fc9764c3457d1ff5592583b6a4627
Signed-off-by: mansankar <karanam.s@samsung.com>
src/itc/bluetooth/ITs-bluetooth-common.h
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 23da5c2fbe3fbe6de6febb5f0cba110f366fa9d2..a59be9640756a4097f719b870de78f623e730297 100755 (executable)
@@ -48,6 +48,7 @@
 #define BLUETOOTH_AUDIOCALL_FEATURE            "http://tizen.org/feature/network.bluetooth.audio.call"
 #define BLUETOOTH_LE_FEATURE                   "http://tizen.org/feature/network.bluetooth.le"
 #define BLUETOOTH_OOB_FEATURE                  "http://tizen.org/feature/network.bluetooth.oob"
+#define BLUETOOTH_LE5_FEATURE                  "http://tizen.org/feature/network.bluetooth.le.5_0"
 
 
 bool g_bBluetoothInit;
index b587019e1fbcca7db50ea78d040e22b9ea2ee4d4..3c2c4f85f273a1f8053d34d50cc0b3c28a81d30c 100755 (executable)
@@ -1892,5 +1892,81 @@ int ITc_bt_adapter_le_scan_filter_set_device_address_p(void)
        return 0;
 }
 
+
+//& purpose: To check if LE 2M PHY feature is supported or not.
+//& type: auto
+/**
+ * @testcase                    ITc_bt_adapter_le_is_2m_phy_supported_p
+ * @since_tizen                 5.0
+ * @author                      SRID(karanam.s)
+ * @reviewer                    SRID(nibha.sharma)
+ * @type                        Positive
+ * @description                 To check if LE 2M PHY feature is supported or not
+ * @scenario                    Call bt_adapter_le_is_2m_phy_supported_p
+ * @apicovered                  bt_adapter_le_is_2m_phy_supported_p
+ * @passcase                    If target API bt_adapter_le_is_2m_phy_supported_p   return 0
+ * @failcase                    If target API bt_adapter_le_is_2m_phy_supported_p   return non-zero
+ * @precondition                Bluetooth must be initialized
+ * @postcondition               Bluetooth must be deinitialized
+ */
+int ITc_bt_adapter_le_is_2m_phy_supported_p(void)
+{
+       START_TEST;
+
+       bool bIsSupported = false;
+       bool bBluetoothLE5IsSupported = false;
+       if ( TCTCheckSystemInfoFeatureSupported(BLUETOOTH_LE5_FEATURE, API_NAMESPACE) )
+       {
+               bBluetoothLE5IsSupported = true;
+       }
+
+       int nRet = bt_adapter_le_is_2m_phy_supported(&bIsSupported);
+       if ( !bBluetoothLE5IsSupported )
+       {
+               PRINT_RESULT(BT_ERROR_NOT_SUPPORTED, nRet, "bt_adapter_le_is_2m_phy_supported", BluetoothGetError(nRet));
+               return 0;
+       }
+
+       PRINT_RESULT(BT_ERROR_NONE, nRet, "bt_adapter_le_is_2m_phy_supported", BluetoothGetError(nRet));
+       return 0;
+}
+
+//& purpose: To check if LE CODED PHY feature is supported or not.
+//& type: auto
+/**
+ * @testcase                    ITc_bt_adapter_le_is_coded_phy_supported_p
+ * @since_tizen                 5.0
+ * @author                      SRID(karanam.s)
+ * @reviewer                    SRID(nibha.sharma)
+ * @type                        Positive
+ * @description                 To check if LE CODED PHY feature is supported or not
+ * @scenario                    Call bt_adapter_le_is_coded_phy_supported
+ * @apicovered                  bt_adapter_le_is_coded_phy_supported
+ * @passcase                    If target API bt_adapter_le_is_coded_phy_supported   return 0
+ * @failcase                    If target API bt_adapter_le_is_coded_phy_supported   return non-zero
+ * @precondition                Bluetooth must be initialized
+ * @postcondition               Bluetooth must be deinitialized
+ */
+int ITc_bt_adapter_le_is_coded_phy_supported_p(void)
+{
+       START_TEST;
+
+       bool bIsSupported = false;
+       bool bBluetoothLE5IsSupported = false;
+       if ( TCTCheckSystemInfoFeatureSupported(BLUETOOTH_LE5_FEATURE, API_NAMESPACE) )
+       {
+               bBluetoothLE5IsSupported = true;
+       }
+
+       int nRet = bt_adapter_le_is_coded_phy_supported(&bIsSupported);
+       if ( !bBluetoothLE5IsSupported )
+       {
+               PRINT_RESULT(BT_ERROR_NOT_SUPPORTED, nRet, "bt_adapter_le_is_coded_phy_supported", BluetoothGetError(nRet));
+               return 0;
+       }
+       PRINT_RESULT(BT_ERROR_NONE, nRet, "bt_adapter_le_is_coded_phy_supported", BluetoothGetError(nRet));
+
+       return 0;
+}
 /** @} */
 /** @} */
index 2ba2373ff0e8b9c8d46fa83ad7d1d301212d663b..f9f41a64bccd9c4322d76d72b9258b45a89ad03f 100755 (executable)
@@ -95,6 +95,8 @@ extern int ITc_bt_adapter_le_scan_filter_set_service_data_p(void);
 extern int ITc_bt_adapter_le_scan_filter_set_service_data_with_mask_p(void);
 extern int ITc_bt_adapter_le_scan_filter_set_manufacturer_data_p(void);
 extern int ITc_bt_adapter_le_scan_filter_set_manufacturer_data_with_mask_p(void);
+extern int ITc_bt_adapter_le_is_2m_phy_supported_p(void);
+extern int ITc_bt_adapter_le_is_coded_phy_supported_p(void);
 
 testcase tc_array[] = {
 {"ITc_bluetooth_audio_bt_audio_initialize_deinitialize_p",ITc_bluetooth_audio_bt_audio_initialize_deinitialize_p,ITs_bluetooth_audio_startup,ITs_bluetooth_audio_cleanup},
@@ -160,6 +162,8 @@ testcase tc_array[] = {
        {"ITc_bt_adapter_le_scan_filter_set_service_data_with_mask_p", ITc_bt_adapter_le_scan_filter_set_service_data_with_mask_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
        {"ITc_bt_adapter_le_scan_filter_set_manufacturer_data_p", ITc_bt_adapter_le_scan_filter_set_manufacturer_data_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
        {"ITc_bt_adapter_le_scan_filter_set_manufacturer_data_with_mask_p", ITc_bt_adapter_le_scan_filter_set_manufacturer_data_with_mask_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
+       {"ITc_bt_adapter_le_is_2m_phy_supported_p", ITc_bt_adapter_le_is_2m_phy_supported_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
+       {"ITc_bt_adapter_le_is_coded_phy_supported_p", ITc_bt_adapter_le_is_coded_phy_supported_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
        {NULL, NULL}
 };
 
index 2ba2373ff0e8b9c8d46fa83ad7d1d301212d663b..f9f41a64bccd9c4322d76d72b9258b45a89ad03f 100755 (executable)
@@ -95,6 +95,8 @@ extern int ITc_bt_adapter_le_scan_filter_set_service_data_p(void);
 extern int ITc_bt_adapter_le_scan_filter_set_service_data_with_mask_p(void);
 extern int ITc_bt_adapter_le_scan_filter_set_manufacturer_data_p(void);
 extern int ITc_bt_adapter_le_scan_filter_set_manufacturer_data_with_mask_p(void);
+extern int ITc_bt_adapter_le_is_2m_phy_supported_p(void);
+extern int ITc_bt_adapter_le_is_coded_phy_supported_p(void);
 
 testcase tc_array[] = {
 {"ITc_bluetooth_audio_bt_audio_initialize_deinitialize_p",ITc_bluetooth_audio_bt_audio_initialize_deinitialize_p,ITs_bluetooth_audio_startup,ITs_bluetooth_audio_cleanup},
@@ -160,6 +162,8 @@ testcase tc_array[] = {
        {"ITc_bt_adapter_le_scan_filter_set_service_data_with_mask_p", ITc_bt_adapter_le_scan_filter_set_service_data_with_mask_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
        {"ITc_bt_adapter_le_scan_filter_set_manufacturer_data_p", ITc_bt_adapter_le_scan_filter_set_manufacturer_data_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
        {"ITc_bt_adapter_le_scan_filter_set_manufacturer_data_with_mask_p", ITc_bt_adapter_le_scan_filter_set_manufacturer_data_with_mask_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
+       {"ITc_bt_adapter_le_is_2m_phy_supported_p", ITc_bt_adapter_le_is_2m_phy_supported_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
+       {"ITc_bt_adapter_le_is_coded_phy_supported_p", ITc_bt_adapter_le_is_coded_phy_supported_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
        {NULL, NULL}
 };
 
index f16163844ae806b355388acc67f949d1e5775503..bdf2c40eee6aae457c399f1e9a5813e3c89d1fd7 100755 (executable)
@@ -95,6 +95,8 @@ extern int ITc_bt_adapter_le_scan_filter_set_service_data_p(void);
 extern int ITc_bt_adapter_le_scan_filter_set_service_data_with_mask_p(void);
 extern int ITc_bt_adapter_le_scan_filter_set_manufacturer_data_p(void);
 extern int ITc_bt_adapter_le_scan_filter_set_manufacturer_data_with_mask_p(void);
+extern int ITc_bt_adapter_le_is_2m_phy_supported_p(void);
+extern int ITc_bt_adapter_le_is_coded_phy_supported_p(void);
 
 testcase tc_array[] = {
        {"ITc_bluetooth_audio_bt_audio_initialize_deinitialize_p",ITc_bluetooth_audio_bt_audio_initialize_deinitialize_p,ITs_bluetooth_audio_startup,ITs_bluetooth_audio_cleanup},
@@ -160,6 +162,8 @@ testcase tc_array[] = {
        {"ITc_bt_adapter_le_scan_filter_set_service_data_with_mask_p", ITc_bt_adapter_le_scan_filter_set_service_data_with_mask_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
        {"ITc_bt_adapter_le_scan_filter_set_manufacturer_data_p", ITc_bt_adapter_le_scan_filter_set_manufacturer_data_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
        {"ITc_bt_adapter_le_scan_filter_set_manufacturer_data_with_mask_p", ITc_bt_adapter_le_scan_filter_set_manufacturer_data_with_mask_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
+       {"ITc_bt_adapter_le_is_2m_phy_supported_p", ITc_bt_adapter_le_is_2m_phy_supported_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
+       {"ITc_bt_adapter_le_is_coded_phy_supported_p", ITc_bt_adapter_le_is_coded_phy_supported_p, ITs_bluetooth_adapter_le_startup, ITs_bluetooth_adapter_le_cleanup},
        {NULL, NULL}
 };