int bt_adapter_le_unset_state_changed_cb(void);
/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Sets Bluetooth LE scan type
+ * @since_tizen 5.5
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/bluetooth.admin
+ * @param[in] scan_type The scan type
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
+ * @retval #BT_ERROR_INVALID_PARAMETER Parameter is invalid
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ */
+int bt_adapter_le_set_scan_type(bt_adapter_le_scan_type_e scan_type);
+
+/**
* @internal
* @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
* @brief add address to whitelist for accepting scanning request.
}
/* LCOV_EXCL_START */
+int bt_adapter_le_set_scan_type(bt_adapter_le_scan_type_e scan_type)
+{
+ int ret = BT_ERROR_NONE;
+
+ BT_CHECK_LE_SUPPORT();
+ BT_CHECK_INIT_STATUS();
+
+ ret = _bt_get_error_code(bluetooth_set_scan_type(scan_type));
+ if (ret != BT_ERROR_NONE) { /* LCOV_EXCL_LINE */
+ BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret),
+ ret); /* LCOV_EXCL_LINE */
+ } /* LCOV_EXCL_LINE */
+ return ret;
+}
+/* LCOV_EXCL_STOP */
+
+/* LCOV_EXCL_START */
int bt_adapter_le_set_customized_scan_mode(float scan_interval, float scan_window)
{
int ret = BT_ERROR_NONE;
, BT_UNIT_TEST_FUNCTION_ADAPTER_LE_DISABLE},
{"bt_adapter_le_set_scan_mode"
, BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_SCAN_MODE},
+ {"bt_adapter_le_set_scan_type"
+ , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_SCAN_TYPE},
{"bt_adapter_le_start_scan"
, BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_SCAN},
{"bt_adapter_le_stop_scan"
param_count = 1;
TC_PRT("Scan mode\n (0 : Balanced (5000/2000 ms), 1: Low Latency (5000/5000 ms), 2 : Low Energy (5000/500 ms)");
break;
+ case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_SCAN_TYPE:
+ param_count = 1;
+ TC_PRT("Scan type\n (0 : Passive, 1: Active)");
+ break;
case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ADD_ADVERTISING_DATA:
param_count = 1;
TC_PRT("Select advertising data \n (0 : Service uuid, 1: Service solicitation 2 : Appearance & Tx power, 3 : All, 4 : ANCS");
TC_PRT("returns %s\n", __bt_get_error_message(ret));
break;
}
+ case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_SCAN_TYPE: {
+ int type = BT_ADAPTER_LE_PASSIVE_SCAN;
+
+ if (g_test_param.param_count > 0) {
+ type = atoi(g_test_param.params[0]);
+ __bt_free_test_param(&g_test_param);
+ }
+
+ ret = bt_adapter_le_set_scan_type(type);
+ TC_PRT("returns %s\n", __bt_get_error_message(ret));
+ break;
+ }
case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_SCAN:
ret = bt_adapter_le_start_scan(
BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ENABLE,
BT_UNIT_TEST_FUNCTION_ADAPTER_LE_DISABLE,
BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_SCAN_MODE,
+BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_SCAN_TYPE,
BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_SCAN,
BT_UNIT_TEST_FUNCTION_ADAPTER_LE_STOP_SCAN,
BT_UNIT_TEST_FUNCTION_ADAPTER_LE_STOP_DEVICE_DISCOVERY,