From: mansankar Date: Tue, 25 Sep 2018 10:15:42 +0000 (+0530) Subject: [ITC][capi-network-bluetooth][ACR-1289][Add BLE 5.0 APIs] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6ece88e226ce79ab3fed3b1121710d2dc44bce4b;p=test%2Ftct%2Fnative%2Fapi.git [ITC][capi-network-bluetooth][ACR-1289][Add BLE 5.0 APIs] Change-Id: Ie614c811a17fc9764c3457d1ff5592583b6a4627 Signed-off-by: mansankar --- diff --git a/src/itc/bluetooth/ITs-bluetooth-common.h b/src/itc/bluetooth/ITs-bluetooth-common.h index 23da5c2fb..a59be9640 100755 --- a/src/itc/bluetooth/ITs-bluetooth-common.h +++ b/src/itc/bluetooth/ITs-bluetooth-common.h @@ -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; diff --git a/src/itc/bluetooth/ITs-bluetooth-le-adapter.c b/src/itc/bluetooth/ITs-bluetooth-le-adapter.c index b587019e1..3c2c4f85f 100755 --- a/src/itc/bluetooth/ITs-bluetooth-le-adapter.c +++ b/src/itc/bluetooth/ITs-bluetooth-le-adapter.c @@ -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; +} /** @} */ /** @} */ diff --git a/src/itc/bluetooth/tct-bluetooth-native_mobile.h b/src/itc/bluetooth/tct-bluetooth-native_mobile.h index 2ba2373ff..f9f41a64b 100755 --- a/src/itc/bluetooth/tct-bluetooth-native_mobile.h +++ b/src/itc/bluetooth/tct-bluetooth-native_mobile.h @@ -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} }; diff --git a/src/itc/bluetooth/tct-bluetooth-native_tizeniot.h b/src/itc/bluetooth/tct-bluetooth-native_tizeniot.h index 2ba2373ff..f9f41a64b 100755 --- a/src/itc/bluetooth/tct-bluetooth-native_tizeniot.h +++ b/src/itc/bluetooth/tct-bluetooth-native_tizeniot.h @@ -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} }; diff --git a/src/itc/bluetooth/tct-bluetooth-native_wearable.h b/src/itc/bluetooth/tct-bluetooth-native_wearable.h index f16163844..bdf2c40ee 100755 --- a/src/itc/bluetooth/tct-bluetooth-native_wearable.h +++ b/src/itc/bluetooth/tct-bluetooth-native_wearable.h @@ -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} };