From: himanshu Date: Thu, 31 Oct 2019 12:42:13 +0000 (+0530) Subject: Add API to check if the scan filter feature is supported X-Git-Tag: submit/tizen_5.5/20191108.040531^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd080d0eed167ff9004afe4d11ad6a3dbae39741;p=platform%2Fcore%2Fapi%2Fbluetooth.git Add API to check if the scan filter feature is supported This API is used to find whether the scan filter feature is provided or not. int bt_adapter_le_is_scan_filter_supported(bool *is_supported); Change-Id: I6afbd7b84d7259f70b3462b967494e56c607cc09 Signed-off-by: himanshu --- diff --git a/include/bluetooth_internal.h b/include/bluetooth_internal.h index 8344a44..8956618 100644 --- a/include/bluetooth_internal.h +++ b/include/bluetooth_internal.h @@ -527,6 +527,24 @@ int bt_adapter_set_connectable(bool connectable); */ int bt_adapter_set_manufacturer_data(char *data, int len); +/** + * @brief Checks scan filter feature is supported or not. + * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE + * + * @param[out] is_supported The Scan Filter feature support: (@c true = supported , @c false = not supported) + * + * @return 0 on success, otherwise a negative error value. + * @retval #BT_ERROR_NONE Successful + * @retval #BT_ERROR_NOT_INITIALIZED Not initialized + * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled + * @retval #BT_ERROR_OPERATION_FAILED Operation failed + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + * + * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED. + */ +int bt_adapter_le_is_scan_filter_supported(bool *is_supported); + /** * @internal * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE diff --git a/src/bluetooth-adapter.c b/src/bluetooth-adapter.c index e112d84..8ceacbf 100644 --- a/src/bluetooth-adapter.c +++ b/src/bluetooth-adapter.c @@ -4179,3 +4179,24 @@ int bt_adapter_le_is_coded_phy_supported(bool *is_supported) return BT_ERROR_NONE; } + +int bt_adapter_le_is_scan_filter_supported(bool *is_supported) +{ + int ret = BT_ERROR_NONE; + gboolean support = FALSE; + + BT_CHECK_ADAPTER_STATUS(); + BT_CHECK_INIT_STATUS(); + BT_CHECK_INPUT_PARAMETER(is_supported); + + ret = _bt_get_error_code(bluetooth_is_scan_filter_supported(&support)); + + if (ret != BT_ERROR_NONE) { + BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret); + return ret; + } + + *is_supported = support ? true : false; + + return BT_ERROR_NONE; +}