From 1920e70a9ef3752866d15f64985057af0c8b4cd1 Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Mon, 19 Sep 2016 13:02:39 +0900 Subject: [PATCH] Add set LE mode APIs into public native API Change-Id: Iaae532130becad92c4e94c7e74afeab525f56130 Signed-off-by: DoHyun Pyun --- include/bluetooth_private.h | 11 -------- include/mobile/bluetooth.h | 41 ++++++++++++++++++++++++++++++ include/mobile/bluetooth_internal.h | 20 --------------- include/mobile/bluetooth_type.h | 22 ++++++++++++++++ include/mobile/bluetooth_type_internal.h | 11 -------- include/tv/bluetooth.h | 41 ++++++++++++++++++++++++++++++ include/tv/bluetooth_internal.h | 20 --------------- include/tv/bluetooth_type.h | 22 ++++++++++++++++ include/tv/bluetooth_type_internal.h | 11 -------- include/wearable/bluetooth.h | 41 ++++++++++++++++++++++++++++++ include/wearable/bluetooth_internal.h | 20 --------------- include/wearable/bluetooth_type.h | 22 ++++++++++++++++ include/wearable/bluetooth_type_internal.h | 11 -------- 13 files changed, 189 insertions(+), 104 deletions(-) diff --git a/include/bluetooth_private.h b/include/bluetooth_private.h index 0aba532..5fe1515 100644 --- a/include/bluetooth_private.h +++ b/include/bluetooth_private.h @@ -263,17 +263,6 @@ int bt_adapter_set_passkey_notification(bt_adapter_passkey_notification_cb callb int bt_adapter_unset_passkey_notification(void); /** - * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE - * @brief Enumerations of the Bluetooth device's LE connection mode. - * @since_tizen 3.0 - */ -typedef enum { - BT_DEVICE_LE_CONNECTION_MODE_BALANCED, /**< Balanced mode of power consumption and connection latency */ - BT_DEVICE_LE_CONNECTION_MODE_LOW_LATENCY, /**< Low connection latency but high power consumption */ - BT_DEVICE_LE_CONNECTION_MODE_LOW_ENERGY, /**< Low power consumption but high connection latency */ -} bt_device_le_connection_mode_e; - -/** * @internal */ typedef struct { diff --git a/include/mobile/bluetooth.h b/include/mobile/bluetooth.h index 7fcc974..1cf7180 100644 --- a/include/mobile/bluetooth.h +++ b/include/mobile/bluetooth.h @@ -1578,6 +1578,26 @@ int bt_adapter_le_set_advertising_mode(bt_advertiser_h advertiser, bt_adapter_le int bt_adapter_le_set_advertising_connectable(bt_advertiser_h advertiser, bool connectable); /** + * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE + * @brief Sets Bluetooth LE scan mode + * @since_tizen 3.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/bluetooth + * @param[in] scan_mode The scan mode + * + * @return 0 on success, otherwise a negative error value. + * @retval #BT_ERROR_NONE Successful + * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled + * @retval #BT_ERROR_INVALID_PARAM 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(). + * @see bt_initialize() + */ +int bt_adapter_le_set_scan_mode(bt_adapter_le_scan_mode_e scan_mode); + +/** * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE * @brief Creates a bond with a remote Bluetooth device, asynchronously. * @since_tizen 2.3 @@ -1810,6 +1830,27 @@ int bt_device_is_profile_connected(const char *remote_address, bt_profile_e bt_p /** * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE + * @brief Updates a LE connection mode + * @since_tizen 3.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/bluetooth + * + * @param[in] remote_address The address of the remote Bluetooth device + * @param[in] mode The LE connection mode + * + * @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_INITIALIZED Not initialized + * @retval #BT_ERROR_NOT_ENABLED Not enabled + * @retval #BT_ERROR_OPERATION_FAILED Operation failed + * @retval #BT_ERROR_PERMISSION_DENIED Permission denied + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + */ +int bt_device_update_le_connection_mode(const char *remote_address, bt_device_le_connection_mode_e mode); + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE * @brief Registers a callback function to be invoked when the bond creates. * @since_tizen 2.3 * @param[in] callback The callback function to register diff --git a/include/mobile/bluetooth_internal.h b/include/mobile/bluetooth_internal.h index f7f124d..23f3a40 100644 --- a/include/mobile/bluetooth_internal.h +++ b/include/mobile/bluetooth_internal.h @@ -645,26 +645,6 @@ int bt_adapter_le_enable_privacy(bool enable_privacy); /** * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief Set Bluetooth LE scan mode - * @since_tizen 2.3 - * @privlevel platform - * @privilege %http://tizen.org/privilege/bluetooth.admin - * @param[in] scan_mode The scan mode - * - * @return 0 on success, otherwise a negative error value. - * @retval #BT_ERROR_NONE Successful - * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled - * @retval #BT_ERROR_INVALID_PARAM 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(). - * @see bt_initialize() - */ -int bt_adapter_le_set_scan_mode(bt_adapter_le_scan_mode_e scan_mode); - -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE * @brief Creates scan filter to find only LE advertisement which has specific data. * @since_tizen 2.4 * diff --git a/include/mobile/bluetooth_type.h b/include/mobile/bluetooth_type.h index 6318f98..0bd2741 100644 --- a/include/mobile/bluetooth_type.h +++ b/include/mobile/bluetooth_type.h @@ -187,6 +187,17 @@ typedef enum { } bt_adapter_le_packet_data_type_e; /** + * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE + * @brief Enumerations of the Bluetooth le scan mode. + * @since_tizen 3.0 + */ +typedef enum { + BT_ADAPTER_LE_SCAN_MODE_BALANCED, /**< Balanced mode of power consumption and connection latency */ + BT_ADAPTER_LE_SCAN_MODE_LOW_LATENCY, /**< Low connection latency but high power consumption */ + BT_ADAPTER_LE_SCAN_MODE_LOW_ENERGY /**< Low power consumption but high connection latency */ +} bt_adapter_le_scan_mode_e; + +/** * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE * @brief Enumerations of device disconnect reason. * @since_tizen 2.3 @@ -424,6 +435,17 @@ typedef enum { } bt_appearance_type_e; /** + * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE + * @brief Enumerations of the Bluetooth device's LE connection mode. + * @since_tizen 3.0 + */ +typedef enum { + BT_DEVICE_LE_CONNECTION_MODE_BALANCED, /**< Balanced mode of power consumption and connection latency */ + BT_DEVICE_LE_CONNECTION_MODE_LOW_LATENCY, /**< Low connection latency but high power consumption */ + BT_DEVICE_LE_CONNECTION_MODE_LOW_ENERGY, /**< Low power consumption but high connection latency */ +} bt_device_le_connection_mode_e; + +/** * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE * @brief Enumerations of connected Bluetooth device event role. * @since_tizen 2.3 diff --git a/include/mobile/bluetooth_type_internal.h b/include/mobile/bluetooth_type_internal.h index 49ac6f1..643dbff 100644 --- a/include/mobile/bluetooth_type_internal.h +++ b/include/mobile/bluetooth_type_internal.h @@ -127,17 +127,6 @@ typedef enum { } bt_adapter_le_scan_type_e; /** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief Enumerations of the Bluetooth le scan mode. - * @since_tizen 2.3 - */ -typedef enum { - BT_ADAPTER_LE_SCAN_MODE_BALANCED, - BT_ADAPTER_LE_SCAN_MODE_LOW_LATENCY, - BT_ADAPTER_LE_SCAN_MODE_LOW_ENERGY -} bt_adapter_le_scan_mode_e; - -/** * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE * @brief Called when the manufacturer dat changes. * @since_tizen 2.3 diff --git a/include/tv/bluetooth.h b/include/tv/bluetooth.h index e5f4108..44c4f7c 100644 --- a/include/tv/bluetooth.h +++ b/include/tv/bluetooth.h @@ -1578,6 +1578,26 @@ int bt_adapter_le_set_advertising_mode(bt_advertiser_h advertiser, bt_adapter_le int bt_adapter_le_set_advertising_connectable(bt_advertiser_h advertiser, bool connectable); /** + * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE + * @brief Sets Bluetooth LE scan mode + * @since_tizen 3.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/bluetooth + * @param[in] scan_mode The scan mode + * + * @return 0 on success, otherwise a negative error value. + * @retval #BT_ERROR_NONE Successful + * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled + * @retval #BT_ERROR_INVALID_PARAM 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(). + * @see bt_initialize() + */ +int bt_adapter_le_set_scan_mode(bt_adapter_le_scan_mode_e scan_mode); + +/** * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE * @brief Creates a bond with a remote Bluetooth device, asynchronously. * @since_tizen 2.3 @@ -1810,6 +1830,27 @@ int bt_device_is_profile_connected(const char *remote_address, bt_profile_e bt_p /** * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE + * @brief Updates a LE connection mode + * @since_tizen 3.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/bluetooth + * + * @param[in] remote_address The address of the remote Bluetooth device + * @param[in] mode The LE connection mode + * + * @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_INITIALIZED Not initialized + * @retval #BT_ERROR_NOT_ENABLED Not enabled + * @retval #BT_ERROR_OPERATION_FAILED Operation failed + * @retval #BT_ERROR_PERMISSION_DENIED Permission denied + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + */ +int bt_device_update_le_connection_mode(const char *remote_address, bt_device_le_connection_mode_e mode); + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE * @brief Registers a callback function to be invoked when the bond creates. * @since_tizen 2.3 * @param[in] callback The callback function to register diff --git a/include/tv/bluetooth_internal.h b/include/tv/bluetooth_internal.h index f7f124d..23f3a40 100644 --- a/include/tv/bluetooth_internal.h +++ b/include/tv/bluetooth_internal.h @@ -645,26 +645,6 @@ int bt_adapter_le_enable_privacy(bool enable_privacy); /** * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief Set Bluetooth LE scan mode - * @since_tizen 2.3 - * @privlevel platform - * @privilege %http://tizen.org/privilege/bluetooth.admin - * @param[in] scan_mode The scan mode - * - * @return 0 on success, otherwise a negative error value. - * @retval #BT_ERROR_NONE Successful - * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled - * @retval #BT_ERROR_INVALID_PARAM 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(). - * @see bt_initialize() - */ -int bt_adapter_le_set_scan_mode(bt_adapter_le_scan_mode_e scan_mode); - -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE * @brief Creates scan filter to find only LE advertisement which has specific data. * @since_tizen 2.4 * diff --git a/include/tv/bluetooth_type.h b/include/tv/bluetooth_type.h index e498338..f0b495a 100644 --- a/include/tv/bluetooth_type.h +++ b/include/tv/bluetooth_type.h @@ -187,6 +187,17 @@ typedef enum { } bt_adapter_le_packet_data_type_e; /** + * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE + * @brief Enumerations of the Bluetooth le scan mode. + * @since_tizen 3.0 + */ +typedef enum { + BT_ADAPTER_LE_SCAN_MODE_BALANCED, /**< Balanced mode of power consumption and connection latency */ + BT_ADAPTER_LE_SCAN_MODE_LOW_LATENCY, /**< Low connection latency but high power consumption */ + BT_ADAPTER_LE_SCAN_MODE_LOW_ENERGY /**< Low power consumption but high connection latency */ +} bt_adapter_le_scan_mode_e; + +/** * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE * @brief Enumerations of device disconnect reason. * @since_tizen 2.3 @@ -424,6 +435,17 @@ typedef enum { } bt_appearance_type_e; /** + * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE + * @brief Enumerations of the Bluetooth device's LE connection mode. + * @since_tizen 3.0 + */ +typedef enum { + BT_DEVICE_LE_CONNECTION_MODE_BALANCED, /**< Balanced mode of power consumption and connection latency */ + BT_DEVICE_LE_CONNECTION_MODE_LOW_LATENCY, /**< Low connection latency but high power consumption */ + BT_DEVICE_LE_CONNECTION_MODE_LOW_ENERGY, /**< Low power consumption but high connection latency */ +} bt_device_le_connection_mode_e; + +/** * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE * @brief Enumerations of connected Bluetooth device event role. * @since_tizen 2.3 diff --git a/include/tv/bluetooth_type_internal.h b/include/tv/bluetooth_type_internal.h index 49ac6f1..643dbff 100644 --- a/include/tv/bluetooth_type_internal.h +++ b/include/tv/bluetooth_type_internal.h @@ -127,17 +127,6 @@ typedef enum { } bt_adapter_le_scan_type_e; /** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief Enumerations of the Bluetooth le scan mode. - * @since_tizen 2.3 - */ -typedef enum { - BT_ADAPTER_LE_SCAN_MODE_BALANCED, - BT_ADAPTER_LE_SCAN_MODE_LOW_LATENCY, - BT_ADAPTER_LE_SCAN_MODE_LOW_ENERGY -} bt_adapter_le_scan_mode_e; - -/** * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE * @brief Called when the manufacturer dat changes. * @since_tizen 2.3 diff --git a/include/wearable/bluetooth.h b/include/wearable/bluetooth.h index f4681df..8af1971 100644 --- a/include/wearable/bluetooth.h +++ b/include/wearable/bluetooth.h @@ -1351,6 +1351,26 @@ int bt_adapter_le_set_advertising_mode(bt_advertiser_h advertiser, bt_adapter_le int bt_adapter_le_set_advertising_connectable(bt_advertiser_h advertiser, bool connectable); /** + * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE + * @brief Sets Bluetooth LE scan mode + * @since_tizen 3.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/bluetooth + * @param[in] scan_mode The scan mode + * + * @return 0 on success, otherwise a negative error value. + * @retval #BT_ERROR_NONE Successful + * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled + * @retval #BT_ERROR_INVALID_PARAM 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(). + * @see bt_initialize() + */ +int bt_adapter_le_set_scan_mode(bt_adapter_le_scan_mode_e scan_mode); + +/** * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE * @brief Creates a bond with a remote Bluetooth device, asynchronously. * @since_tizen 2.3.1 @@ -1583,6 +1603,27 @@ int bt_device_is_profile_connected(const char *remote_address, bt_profile_e bt_p /** * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE + * @brief Updates a LE connection mode + * @since_tizen 3.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/bluetooth + * + * @param[in] remote_address The address of the remote Bluetooth device + * @param[in] mode The LE connection mode + * + * @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_INITIALIZED Not initialized + * @retval #BT_ERROR_NOT_ENABLED Not enabled + * @retval #BT_ERROR_OPERATION_FAILED Operation failed + * @retval #BT_ERROR_PERMISSION_DENIED Permission denied + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + */ +int bt_device_update_le_connection_mode(const char *remote_address, bt_device_le_connection_mode_e mode); + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE * @brief Registers a callback function to be invoked when the bond creates. * @since_tizen 2.3.1 * @param[in] callback The callback function to register diff --git a/include/wearable/bluetooth_internal.h b/include/wearable/bluetooth_internal.h index ced2205..5c47f13 100644 --- a/include/wearable/bluetooth_internal.h +++ b/include/wearable/bluetooth_internal.h @@ -615,26 +615,6 @@ int bt_adapter_le_enable_privacy(bool enable_privacy); /** * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief Set Bluetooth LE scan mode - * @since_tizen 2.3 - * @privlevel platform - * @privilege %http://tizen.org/privilege/bluetooth.admin - * @param[in] scan_mode The scan mode - * - * @return 0 on success, otherwise a negative error value. - * @retval #BT_ERROR_NONE Successful - * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled - * @retval #BT_ERROR_INVALID_PARAM 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(). - * @see bt_initialize() - */ -int bt_adapter_le_set_scan_mode(bt_adapter_le_scan_mode_e scan_mode); - -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE * @brief Creates scan filter to find only LE advertisement which has specific data. * @since_tizen 2.4 * diff --git a/include/wearable/bluetooth_type.h b/include/wearable/bluetooth_type.h index 37c47e7..2bb7859 100644 --- a/include/wearable/bluetooth_type.h +++ b/include/wearable/bluetooth_type.h @@ -186,6 +186,17 @@ typedef enum { } bt_adapter_le_packet_type_e; /** + * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE + * @brief Enumerations of the Bluetooth le scan mode. + * @since_tizen 3.0 + */ +typedef enum { + BT_ADAPTER_LE_SCAN_MODE_BALANCED, /**< Balanced mode of power consumption and connection latency */ + BT_ADAPTER_LE_SCAN_MODE_LOW_LATENCY, /**< Low connection latency but high power consumption */ + BT_ADAPTER_LE_SCAN_MODE_LOW_ENERGY /**< Low power consumption but high connection latency */ +} bt_adapter_le_scan_mode_e; + +/** * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE * @brief Enumerations of device disconnect reason. * @since_tizen 2.3.1 @@ -423,6 +434,17 @@ typedef enum { } bt_appearance_type_e; /** + * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE + * @brief Enumerations of the Bluetooth device's LE connection mode. + * @since_tizen 3.0 + */ +typedef enum { + BT_DEVICE_LE_CONNECTION_MODE_BALANCED, /**< Balanced mode of power consumption and connection latency */ + BT_DEVICE_LE_CONNECTION_MODE_LOW_LATENCY, /**< Low connection latency but high power consumption */ + BT_DEVICE_LE_CONNECTION_MODE_LOW_ENERGY, /**< Low power consumption but high connection latency */ +} bt_device_le_connection_mode_e; + +/** * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE * @brief Enumerations of connected Bluetooth device event role. * @since_tizen 2.3.1 diff --git a/include/wearable/bluetooth_type_internal.h b/include/wearable/bluetooth_type_internal.h index 7b12e5a..441a9ef 100644 --- a/include/wearable/bluetooth_type_internal.h +++ b/include/wearable/bluetooth_type_internal.h @@ -130,17 +130,6 @@ typedef enum { } bt_adapter_le_scan_type_e; /** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief Enumerations of the Bluetooth le scan mode. - * @since_tizen 2.3 - */ -typedef enum { - BT_ADAPTER_LE_SCAN_MODE_BALANCED, - BT_ADAPTER_LE_SCAN_MODE_LOW_LATENCY, - BT_ADAPTER_LE_SCAN_MODE_LOW_ENERGY -} bt_adapter_le_scan_mode_e; - -/** * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE * @brief Enumerations for the call handling event * @since_tizen 2.3 -- 2.7.4