Add API to check if the scan filter feature is supported 53/216753/2 accepted/tizen/unified/20191112.125158 submit/tizen/20191112.045846
authorhimanshu <h.himanshu@samsung.com>
Thu, 31 Oct 2019 12:42:13 +0000 (18:12 +0530)
committerhimanshu <h.himanshu@samsung.com>
Sat, 2 Nov 2019 06:47:30 +0000 (12:17 +0530)
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 <h.himanshu@samsung.com>
include/bluetooth_internal.h
src/bluetooth-adapter.c

index 8344a44..8956618 100644 (file)
@@ -528,6 +528,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
  * @brief Parse the samsung specific manufacturer data of discovered device.
index e112d84..8ceacbf 100644 (file)
@@ -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;
+}