int bt_adapter_le_get_scan_result_manufacturer_data(const bt_adapter_le_device_scan_result_info_s *info,
bt_adapter_le_packet_type_e pkt_type, int *manufacturer_id, char **manufacturer_data, int *manufacturer_data_len);
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Gets iBeacon format's data from the scan result information.
+ * @since_tizen 4.0
+ *
+ * @remarks The @a ibeacon_info must be released with bt_adapter_le_free_ibeacon_report().
+ *
+ * @param[in] info The scan result information
+ * @param[in] pkt_type The packet type
+ * @param[out] ibeacon_info The iBeacon format's scan result data
+ *
+ * @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_NO_DATA No data available
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ * @see bt_adapter_le_scan_result_cb()
+ */
+int bt_adapter_le_get_scan_result_ibeacon_report(const bt_adapter_le_device_scan_result_info_s *info,
+ bt_adapter_le_packet_type_e pkt_type,
+ bt_adapter_le_ibeacon_scan_result_info_s **ibeacon_info);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Frees iBeacon information.
+ * @since_tizen 4.0
+ *
+ * @param[in] ibeacon_info The iBeacon format's scan result data
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see bt_adapter_le_get_scan_result_service_data_list()
+ */
+int bt_adapter_le_free_ibeacon_report(bt_adapter_le_ibeacon_scan_result_info_s *ibeacon_info);
+
/**
* @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
* @brief Create advertiser to advertise device's existence or respond to LE scanning request.
bt_pbap_list_vcards_cb callback,
void *user_data);
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Creates a scan filter to find only LE advertisements which match specific requirements.
+ * @details If the filter's attribute is not set, then the filter will accept
+ * all values of that attribute. If an attribute is set, the filter
+ * will accept only advertisements which match the set attribute.
+ *
+ * For example, if device name is set with
+ * bt_adapter_le_scan_filter_set_device_name(), the filter will accept
+ * only advertisements from devices with the given name. If device name
+ * is not set, advertisements will be filtered without regard to device
+ * names.
+ * @since_tizen 4.0
+ *
+ * @remarks The @a scan_filter should be destroyed with bt_adapter_le_scan_filter_destroy().
+ *
+ * @param[out] scan_filter The scan filter handle
+ *
+ * @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_OUT_OF_MEMORY Out of memory
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ * @see bt_adapter_le_scan_filter_destroy()
+ */
+int bt_adapter_le_scan_filter_create(bt_scan_filter_h *scan_filter);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Destroys a scan filter.
+ * @since_tizen 4.0
+ *
+ * @param[in] scan_filter The scan filter handle
+ *
+ * @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_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ * @see bt_adapter_le_scan_filter_create()
+ */
+int bt_adapter_le_scan_filter_destroy(bt_scan_filter_h scan_filter);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Sets the device address for the advertisements filter.
+ * @since_tizen 4.0
+ *
+ * @param[in] scan_filter The scan filter handle
+ * @param[in] address The device address by which advertisements will be filtered
+ *
+ * @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_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_set_device_address(bt_scan_filter_h scan_filter, const char *address);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Sets the device name for the advertisements filter.
+ * @details Any previously set value will be overwritten.
+ * @since_tizen 4.0
+ *
+ * @param[in] scan_filter The scan filter handle
+ * @param[in] name The device name by which advertisements will be filtered
+ *
+ * @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_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_set_device_name(bt_scan_filter_h scan_filter, const char *name);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Sets the service UUID for the advertisements filter.
+ * @details Any previously set value will be overwritten.
+ * @since_tizen 4.0
+ *
+ * @param[in] scan_filter The scan filter handle
+ * @param[in] uuid The service UUID by which advertisements will be filtered
+ *
+ * @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_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_set_service_uuid(bt_scan_filter_h scan_filter, const char *uuid);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Sets the service UUID and the mask for the advertisements filter,
+ * to use for filtering by partial data.
+ * @details Any previously set value will be overwritten. The mask works as follows:
+ * For each bit set to 1 in the mask, the corresponding bits in @a uuid
+ * and in the filtered data will have to be equal. If the mask bit is set to 0,
+ * the corresponding bits will be ignored.
+ * @since_tizen 4.0
+ *
+ * @remarks The @a mask and the service @a uuid must have equal lengths.
+ *
+ * @param[in] scan_filter The scan filter handle
+ * @param[in] uuid The service UUID by which advertisements will be filtered
+ * @param[in] mask The mask to filter advertisements
+ *
+ * @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_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_set_service_uuid_with_mask(bt_scan_filter_h scan_filter,
+ const char *uuid, const char *mask);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Sets the service solicitation UUID for the advertisements filter.
+ * @details Any previously set value will be overwritten.
+ * @since_tizen 4.0
+ *
+ * @param[in] scan_filter The scan filter handle
+ * @param[in] uuid The service solicitation UUID by which advertisements will be filtered
+ *
+ * @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_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_set_service_solicitation_uuid(bt_scan_filter_h scan_filter, const char *uuid);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Sets the service solicitation UUID and the mask for the advertisements filter,
+ * to use for filtering by partial data.
+ * @details Any previously set value will be overwritten. The mask works as follows:
+ * For each bit set to 1 in the mask, the corresponding bits in @a uuid
+ * and in the filtered data will have to be equal. If the mask bit is set to 0,
+ * the corresponding bits will be ignored.
+ * @since_tizen 4.0
+ *
+ * @remarks The @a mask and the service solicitation @a uuid must have equal lengths.
+ *
+ * @param[in] scan_filter The scan filter handle
+ * @param[in] uuid The service solicitation UUID by which advertisements will be filtered
+ * @param[in] mask The mask by which advertisements will be filtered
+ *
+ * @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_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_set_service_solicitation_uuid_with_mask(bt_scan_filter_h scan_filter,
+ const char *uuid, const char *mask);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Sets the service data for the advertisements filter.
+ * @details Any previously set value will be overwritten.
+ * @since_tizen 4.0
+ *
+ * @param[in] scan_filter The scan filter handle
+ * @param[in] uuid The service UUID by which advertisements will be filtered
+ * @param[in] data The service data by which advertisements will be filtered
+ * @param[in] data_len The length of the service data
+ *
+ * @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_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_set_service_data(bt_scan_filter_h scan_filter,
+ const char *uuid, const char *data, unsigned int data_len);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Sets the service data and the mask for the advertisements filter,
+ * to use for filtering by partial data.
+ * @details Any previously set value will be overwritten. The mask works as follows:
+ * For each bit set to 1 in the mask, the corresponding bits in @a data
+ * and in the filtered data will have to be equal. If the mask bit is set to 0,
+ * the corresponding bits will be ignored.
+ * @since_tizen 4.0
+ *
+ * @remarks The @a mask and the service @a data must have equal lengths.
+ *
+ * @param[in] scan_filter The scan filter handle
+ * @param[in] uuid The service UUID by which advertisements will be filtered
+ * @param[in] data The service data by which advertisements will be filtered
+ * @param[in] data_len The length of the service data
+ * @param[in] mask The mask by which advertisements will be filtered
+ * @param[in] mask_len The length of the mask
+ *
+ * @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_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_set_service_data_with_mask(bt_scan_filter_h scan_filter,
+ const char *uuid,
+ const char *data,
+ unsigned int data_len,
+ const char *mask,
+ unsigned int mask_len);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Sets the manufacturer data for the advertisements filter.
+ * @details Any previously set value will be overwritten.
+ * @since_tizen 4.0
+ *
+ * @param[in] scan_filter The scan filter handle
+ * @param[in] manufacturer_id The manufacturer ID (0x0000 ~ 0xFFFF)
+ * @param[in] data The manufacturer data (byte array)
+ * @param[in] data_len The length of the manufacturer data
+ *
+ * @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_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_set_manufacturer_data(bt_scan_filter_h scan_filter,
+ int manufacturer_id,
+ const char *data,
+ unsigned int data_len);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Sets the manufacturer data and the mask for the advertisements filter,
+ * to use for filtering by partial data.
+ * @details Any previously set value will be overwritten. The mask works as follows:
+ * For each bit set to 1 in the mask, the corresponding bits in @a data
+ * and in the filtered data will have to be equal. If the mask bit is set to 0,
+ * the corresponding bits will be ignored.
+ * @since_tizen 4.0
+ *
+ * @remarks The @a mask and the manufacturer @a data must have equal lengths.
+ *
+ * @param[in] scan_filter The scan filter handle
+ * @param[in] manufacturer_id The manufacturer ID (0x0000 ~ 0xFFFF)
+ * @param[in] data The manufacturer data (byte array)
+ * @param[in] data_len The length of the manufacturer data
+ * @param[in] mask The mask by which advertisements will be filtered
+ * @param[in] mask_len The length of the mask
+ *
+ * @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_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_set_manufacturer_data_with_mask(bt_scan_filter_h scan_filter,
+ int manufacturer_id,
+ const char *data,
+ unsigned int data_len,
+ const char *mask,
+ unsigned int mask_len);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Sets the scan filter type for the advertisements filter.
+ * @details The filter type is used when searching only for iBeacon or proximity
+ * type's advertising data. If the type is not set, LE scanner will
+ * search devices as with regard to other filtered attributes.
+ * If the type is set, all other attributes set for the filter are ignored.
+ * @since_tizen 4.0
+ *
+ * @param[in] scan_filter The scan filter handle
+ * @param[in] mode The scan filter 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_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_set_type(bt_scan_filter_h scan_filter,
+ bt_adapter_le_scan_filter_type_e mode);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Registers a scan filter to use for scanning.
+ * @details If the filter is registered, it cannot be changed.
+ * @since_tizen 4.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/bluetooth
+ *
+ * @remarks Several scan filters can be registered. If an advertisement passes
+ * any of the registered scan filters, it will be included in the results.
+ *
+ * @param[in] scan_filter The scan filter handle
+ *
+ * @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_NOW_IN_PROGRESS Scan is in progress
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_register(bt_scan_filter_h scan_filter);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Unregisters all registered scan filters.
+ * @since_tizen 4.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/bluetooth
+ *
+ * @param[in] scan_filter The scan filter handle
+ *
+ * @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_NOW_IN_PROGRESS Scan is in progress
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_unregister(bt_scan_filter_h scan_filter);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Unregisters all registered scan filters.
+ * @since_tizen 4.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/bluetooth
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_NOW_IN_PROGRESS Scan is in progress
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ *
+ */
+int bt_adapter_le_scan_filter_unregister_all(void);
+
/**
* @}
*/
*/
int bt_adapter_le_enable_privacy(bool enable_privacy);
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Creates scan filter to find only LE advertisement which has specific data.
- * @since_tizen 2.4
- *
- * @param[out] scan_filter The handle of scan filter
- *
- * @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_OUT_OF_MEMORY Out of memory
- * @retval #BT_ERROR_NOT_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- * @see bt_adapter_le_scan_filter_destroy()
- */
-int bt_adapter_le_scan_filter_create(bt_scan_filter_h *scan_filter);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Destroys scan filter.
- * @since_tizen 2.4
- *
- * @param[in] scan_filter The handle of scan filter
- *
- * @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_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- * @see bt_adapter_le_scan_filter_create()
- */
-int bt_adapter_le_scan_filter_destroy(bt_scan_filter_h scan_filter);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Adds the device address to filter advertisements
- * @since_tizen 2.4
- *
- * @param[in] scan_filter The handle of scan filter
- * @param[in] address The device address to filter advertisements
- *
- * @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_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- */
-int bt_adapter_le_scan_filter_set_device_address(bt_scan_filter_h scan_filter, const char *address);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Adds the device name to filter advertisements
- * @since_tizen 2.4
- *
- * @param[in] scan_filter The handle of scan filter
- * @param[in] name The device name to filter advertisements
- *
- * @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_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- */
-int bt_adapter_le_scan_filter_set_device_name(bt_scan_filter_h scan_filter, const char *name);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Adds the service UUID to filter advertisements
- * @since_tizen 2.4
- *
- * @param[in] scan_filter The handle of scan filter
- * @param[in] uuid The service UUID to filter advertisements
- *
- * @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_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- */
-int bt_adapter_le_scan_filter_set_service_uuid(bt_scan_filter_h scan_filter, const char *uuid);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Adds the service uuid and the mask to filter advertisements by partial data
- * @since_tizen 2.4
- *
- * @remarks the length of mask msut be the same with the length of service uuid.
- *
- * @param[in] scan_filter The handle of scan filter
- * @param[in] uuid The service UUID to filter advertisements
- * @param[in] mask The mask to filter advertisements
- *
- * @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_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- */
-int bt_adapter_le_scan_filter_set_service_uuid_with_mask(bt_scan_filter_h scan_filter,
- const char *uuid, const char *mask);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Adds the service solicitation UUID to filter advertisements
- * @since_tizen 2.4
- *
- * @param[in] scan_filter The handle of scan filter
- * @param[in] uuid The service solicitation UUID to filter advertisements
- *
- * @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_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- */
-int bt_adapter_le_scan_filter_set_service_solicitation_uuid(bt_scan_filter_h scan_filter, const char *uuid);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Adds the service solicitation uuid and the mask to filter advertisements by partial data
- * @since_tizen 2.4
- *
- * @remarks the length of mask msut be the same with the length of service solicitation uuid.
- *
- * @param[in] scan_filter The handle of scan filter
- * @param[in] uuid The service solicitation UUID to filter advertisements
- * @param[in] mask The mask to filter advertisements
- *
- * @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_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- */
-int bt_adapter_le_scan_filter_set_service_solicitation_uuid_with_mask(bt_scan_filter_h scan_filter,
- const char *uuid, const char *mask);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Adds the service data to filter advertisements
- * @since_tizen 2.4
- *
- * @param[in] scan_filter The handle of scan filter
- * @param[in] uuid The service UUID to filter advertisements
- * @param[in] data The service data to filter advertisements
- * @param[in] data_len The length of the service data
- *
- * @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_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- */
-int bt_adapter_le_scan_filter_set_service_data(bt_scan_filter_h scan_filter,
- const char *uuid, const char *data, unsigned int data_len);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Adds the service data and the mask to filter advertisements by partial data
- * @since_tizen 2.4
- *
- * @remarks the length of mask msut be the same with the length of service data.
- *
- * @param[in] scan_filter The handle of scan filter
- * @param[in] uuid The service UUID to filter advertisements
- * @param[in] data The service data to filter advertisements
- * @param[in] data_len The length of the service data
- * @param[in] mask The mask to filter advertisements
- * @param[in] mask_len The length of the mask to be set.
- *
- * @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_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- */
-int bt_adapter_le_scan_filter_set_service_data_with_mask(bt_scan_filter_h scan_filter,
- const char *uuid, const char *data, unsigned int data_len, const char *mask, unsigned int mask_len);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Adds the manufacturer data to filter advertisements
- * @since_tizen 2.4
- *
- * @param[in] scan_filter The handle of scan filter
- * @param[in] manufacturer_id The manufacturer ID (0x0000 ~ 0xFFFF)
- * @param[in] data The manufacturer data (byte array)
- * @param[in] data_len The length of manufacturer data
- *
- * @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_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- */
-int bt_adapter_le_scan_filter_set_manufacturer_data(bt_scan_filter_h scan_filter,
- int manufacturer_id, const char *data, unsigned int data_len);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Adds the manufacturer data and the mask to filter advertisements by partial data
- * @since_tizen 2.4
- *
- * @remarks the length of mask msut be the same with the length of service uuid.
- *
- * @param[in] scan_filter The handle of scan filter
- * @param[in] manufacturer_id The manufacturer ID (0x0000 ~ 0xFFFF)
- * @param[in] data The manufacturer data (byte array)
- * @param[in] data_len The length of manufacturer data
- * @param[in] mask The mask to filter advertisements
- * @param[in] mask_len The length of the mask to be set.
- *
- * @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_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- */
-int bt_adapter_le_scan_filter_set_manufacturer_data_with_mask(bt_scan_filter_h scan_filter,
- int manufacturer_id, const char *data, unsigned int data_len, const char *mask, unsigned int mask_len);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Registers the scan filter to use for scanning
- * @since_tizen 2.4
- *
- * @remarks Several scan filters can be registered. And the specific advertisements, satisfy the one of scan filters, will be found.
- *
- * @param[in] scan_filter The handle of scan filter
- *
- * @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_NOW_IN_PROGRESS Scan is in progress
- * @retval #BT_ERROR_NOT_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- */
-int bt_adapter_le_scan_filter_register(bt_scan_filter_h scan_filter);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Unregisters the scan filter to be registered
- * @since_tizen 2.4
- *
- * @param[in] scan_filter The handle of scan filter
- *
- * @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_NOW_IN_PROGRESS Scan is in progress
- * @retval #BT_ERROR_NOT_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- */
-int bt_adapter_le_scan_filter_unregister(bt_scan_filter_h scan_filter);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Unregisters all scan filters to be registered
- * @since_tizen 2.4
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #BT_ERROR_NONE Successful
- * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
- * @retval #BT_ERROR_NOW_IN_PROGRESS Scan is in progress
- * @retval #BT_ERROR_NOT_SUPPORTED Not supported
- *
- * @pre The Bluetooth service must be initialized with bt_initialize().
- *
- */
-int bt_adapter_le_scan_filter_unregister_all(void);
-
/**
* @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
* @brief Set advertising filter policy to use white list
*/
int bt_proximity_reporter_get_immediate_alert(const char *remote_address, int *value);
-
-/**
- * @internal
- * @brief API to set scan filter for iBeacons reports
- */
-int bt_adapter_le_scan_filter_set_ibeacon(bt_scan_filter_h scan_filter);
-
-/**
- * @internal
- * @brief API to read iBeacon report from LE scan result information
- */
-int bt_adapter_le_get_scan_result_ibeacon_report(const bt_adapter_le_device_scan_result_info_s *info,
- bt_adapter_le_packet_type_e pkt_type, bt_adapter_ibeacon_scan_result_info_s **ibeacon_info);
-
-/**
- * @internal
- * @brief API to clear the iBeacon report
- */
-int bt_adapter_le_free_ibeacon_report(bt_adapter_ibeacon_scan_result_info_s *ibeacon_info);
-
-/**
- * @internal
- * @brief API to Set the Proximity uuids scan report
- */
-int bt_adapter_le_scan_filter_set_proximity_uuid(bt_scan_filter_h scan_filter);
-
+/* This internal API will be removed */
/**
* @internal
+ * @deprecated Deprecated since 4.0. Use bt_adapter_le_scan_filter_unregister instead.
* @brief API to Unset the Proximity uuids scan report
*/
-int bt_adapter_le_scan_filter_unset_proximity_uuid(bt_scan_filter_h scan_filter);
+int bt_adapter_le_scan_filter_unset_proximity_uuid(bt_scan_filter_h scan_filter) TIZEN_DEPRECATED_API;
/**
* @internal
char *scan_data; /**< scan response data */
} bt_adapter_le_device_scan_result_info_s;
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief The structure for LE iBeacon scan result information.
+ * @since_tizen 4.0
+ *
+ * @see bt_adapter_le_start_scan()
+ */
+typedef struct {
+ int company_id; /**< Company ID */
+ int ibeacon_type; /**< iBeacon type */
+ char *uuid; /**< UUID */
+ int major_id; /**< Major ID */
+ int minor_id; /**< Minor ID */
+ int measured_power; /**< Measured power */
+} bt_adapter_le_ibeacon_scan_result_info_s;
+
/**
* @deprecated Deprecated since 2.3.1
* @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
typedef void (*bt_pbap_list_vcards_cb)(int result, const char *remote_address,
const bt_pbap_vcard_info_s *vcard_info, int count, void *user_data);
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief Enumeration for the scan filter type.
+ * @since_tizen 4.0
+ * @see bt_adapter_le_scan_filter_set_type()
+ */
+typedef enum {
+ BT_ADAPTER_LE_SCAN_FILTER_TYPE_IBEACON, /**< iBeacon filter type */
+ BT_ADAPTER_LE_SCAN_FILTER_TYPE_PROXIMITY_UUID, /**< Proximity UUID filter type */
+} bt_adapter_le_scan_filter_type_e;
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
+ * @brief The handle of a Bluetooth LE scan filter.
+ * @since_tizen 4.0
+ */
+typedef void *bt_scan_filter_h;
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
BT_DPM_PROFILE_NONE,
} bt_dpm_profile_e;
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief The handle to control Bluetooth LE scan filter
- * @since_tizen 2.4
- */
-typedef void *bt_scan_filter_h;
-
/**
* @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
* @brief Device LE connection update structure.
*/
typedef void (*bt_ag_vendor_cmd_cb) (char *command, void *user_data);
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
- * @brief Structure of le iBeacon scan result information.
- * @since_tizen 3.0
- *
- * @see bt_adapter_le_start_scan()
- */
-typedef struct {
- int company_id; /**< company ID */
- int ibeacon_type; /**< Ibeacon type */
- char *uuid; /**< UUID */
- int major_id; /**< Major ID */
- int minor_id; /**< Minor ID */
- int measured_power; /**< measured Power */
-} bt_adapter_ibeacon_scan_result_info_s;
-
/**
* @internal
* @brief The handle of a Transport Discover Service Provider.
return BT_ERROR_NO_DATA; /* LCOV_EXCL_STOP */
}
-int bt_adapter_le_free_ibeacon_report(bt_adapter_ibeacon_scan_result_info_s *ibeacon_info)
+int bt_adapter_le_free_ibeacon_report(bt_adapter_le_ibeacon_scan_result_info_s *ibeacon_info)
{
BT_CHECK_LE_SUPPORT();
}
int bt_adapter_le_get_scan_result_ibeacon_report(const bt_adapter_le_device_scan_result_info_s *info,
- bt_adapter_le_packet_type_e pkt_type, bt_adapter_ibeacon_scan_result_info_s **ibeacon_info)
+ bt_adapter_le_packet_type_e pkt_type, bt_adapter_le_ibeacon_scan_result_info_s **ibeacon_info)
{
int manufacturer_id;
char *manufacturer_data;
if (manufacturer_id != COMPANY_ID_APPLE)
return BT_ERROR_NO_DATA;
- *ibeacon_info = g_malloc0(sizeof(bt_adapter_ibeacon_scan_result_info_s));
+ *ibeacon_info = g_malloc0(sizeof(bt_adapter_le_ibeacon_scan_result_info_s));
if (*ibeacon_info == NULL)
return BT_ERROR_OUT_OF_MEMORY;
}
/* LCOV_EXCL_STOP */
+int bt_adapter_le_scan_filter_set_type(bt_scan_filter_h scan_filter,
+ bt_adapter_le_scan_filter_type_e mode)
+{
+ if (mode == BT_ADAPTER_LE_SCAN_FILTER_TYPE_IBEACON)
+ return bt_adapter_le_scan_filter_set_ibeacon(scan_filter);
+ else if (mode == BT_ADAPTER_LE_SCAN_FILTER_TYPE_PROXIMITY_UUID)
+ return bt_adapter_le_scan_filter_set_proximity_uuid(scan_filter);
+ else
+ return BT_ERROR_INVALID_PARAMETER;
+}
+
int bt_adapter_passkey_reply(char *passkey, bool authentication_reply)
{
BT_CHECK_INIT_STATUS();
char *manufacturer_data;
int manufacturer_data_len;
int count;
- bt_adapter_ibeacon_scan_result_info_s *ibeacon_info = NULL;
+ bt_adapter_le_ibeacon_scan_result_info_s *ibeacon_info = NULL;
pkt_type += i;
if (pkt_type == BT_ADAPTER_LE_PACKET_ADVERTISING
if (ret != BT_ERROR_NONE)
TC_PRT("failed with [0x%04x]", ret);
- ret = bt_adapter_le_scan_filter_set_ibeacon(scan_filter);
+ ret = bt_adapter_le_scan_filter_set_type(scan_filter, BT_ADAPTER_LE_SCAN_FILTER_TYPE_IBEACON);
if (ret != BT_ERROR_NONE)
TC_PRT("failed with [0x%04x]", ret);
ret = bt_adapter_le_scan_filter_create(&pxp_scan_filter);
TC_PRT("returns %s\n", __bt_get_error_message(ret));
- ret = bt_adapter_le_scan_filter_set_proximity_uuid(pxp_scan_filter);
+ ret = bt_adapter_le_scan_filter_set_type(pxp_scan_filter,
+ BT_ADAPTER_LE_SCAN_FILTER_TYPE_PROXIMITY_UUID);
TC_PRT("returns %s\n", __bt_get_error_message(ret));
ret = bt_adapter_le_scan_filter_register(pxp_scan_filter);