From: Lee Hyuk Date: Thu, 6 Apr 2017 01:48:44 +0000 (+0900) Subject: Publish IPSP APIs to Native public API X-Git-Tag: submit/tizen/20170410.040751~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a8ca9ef9da99f36b84bb873a2fb847ec359273a6;p=platform%2Fcore%2Fapi%2Fbluetooth.git Publish IPSP APIs to Native public API Change-Id: Idd37dce8650e4d146f67703cf53ff972c1bc0a07 Signed-off-by: Lee Hyuk --- diff --git a/include/bluetooth.h b/include/bluetooth.h index c009349..923f4e7 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -1217,6 +1217,116 @@ int bt_adapter_le_create_advertiser(bt_advertiser_h *advertiser); */ int bt_adapter_le_destroy_advertiser(bt_advertiser_h advertiser); +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE + * @brief Initializes the Bluetooth IPSP (Internet Protocol Support Profile) service. + * @since_tizen 4.0 + * @param[in] callback The callback called when the initialization is finished + * @param[in] user_data The user data to be passed to the callback function + * @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_OPERATION_FAILED Operation failed + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + * + * @pre The Bluetooth service must be initialized with bt_initialize(). + * @see bt_initialize() + */ +int bt_ipsp_initialize(bt_ipsp_init_state_changed_cb callback, void *user_data); + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE + * @brief Deinitializes the Bluetooth IPSP (Internet Protocol Support Profile) service. + * @since_tizen 4.0 + * @return 0 on success, otherwise a negative error value. + * @retval #BT_ERROR_NONE Successful + * @retval #BT_ERROR_NOT_INITIALIZED Not initialized + * @retval #BT_ERROR_OPERATION_FAILED Operation failed + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + * + * @pre The Bluetooth service must be initialized with bt_initialize(). + * @see bt_initialize() + */ +int bt_ipsp_deinitialize(void); + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE + * @brief Connects to a remote device's IPSP service over LE, asynchronously. + * @since_tizen 4.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/bluetooth + * @param[in] remote_address The remote address + * @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 Not enabled + * @retval #BT_ERROR_OPERATION_FAILED Operation failed + * @retval #BT_ERROR_PERMISSION_DENIED Permission denied + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + * + * @post bt_ipsp_set_connection_state_changed_cb() will be invoked. + * @see bt_ipsp_set_connection_state_changed_cb() + */ +int bt_ipsp_connect(const char *remote_address); + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE + * @brief Disonneicts from a remote device's IPSP service, asynchronously. + * @since_tizen 4.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/bluetooth + * @param[in] remote_address The remote address + * @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 Not enabled + * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected + * @retval #BT_ERROR_OPERATION_FAILED Operation failed + * @retval #BT_ERROR_PERMISSION_DENIED Permission denied + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + * + * @pre The remote device must be connected by bt_ipsp_connect(). + * @post bt_ipsp_set_connection_state_changed_cb() will be invoked. + * @see bt_ipsp_connect() + * @see bt_ipsp_set_connection_state_changed_cb() + */ +int bt_ipsp_disconnect(const char *remote_address); + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE + * @brief Registers a callback function that will be invoked when the connection state changes. + * @since_tizen 4.0 + * @param[in] callback The callback function to register + * @param[in] user_data The user data to be passed to the callback function + * @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_initialize() + */ +int bt_ipsp_set_connection_state_changed_cb(bt_ipsp_connection_state_changed_cb callback, + void *user_data); + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE + * @brief Unregisters the callback function called when the connection state changes. + * @since_tizen 4.0 + * @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_SUPPORTED Not supported + * + * @pre The Bluetooth service must be initialized with bt_initialize(). + * @see bt_initialize() + */ +int bt_ipsp_unset_connection_state_changed_cb(void); + /** * @deprecated Deprecated since 2.3.1 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE diff --git a/include/bluetooth_internal.h b/include/bluetooth_internal.h index 977746d..ec5ccd1 100644 --- a/include/bluetooth_internal.h +++ b/include/bluetooth_internal.h @@ -3363,116 +3363,6 @@ int bt_dpm_set_data_transfer_state(bt_dpm_status_e value); */ int bt_dpm_get_data_transfer_state(bt_dpm_status_e *value); -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief Initializes the Bluetooth IPSP(Internet Protocol Support Profile) service and set the callback. - * @since_tizen 4.0 - * @param[in] bt_ipsp_init_state_changed_cb The callback called when the initialization is finished - * @param[in] user_data The user data to be passed to the callback function - * @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_OPERATION_FAILED Operation failed - * @retval #BT_ERROR_NOT_SUPPORTED Not supported - * - * @pre The Bluetooth service must be initialized with bt_initialize(). - * @see bt_initialize() - */ -int bt_ipsp_initialize(bt_ipsp_init_state_changed_cb callback, void *user_data); - -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief Deinitializes the Bluetooth IPSP(Internet Protocol Support Profile) service. - * @since_tizen 4.0 - * @return 0 on success, otherwise a negative error value. - * @retval #BT_ERROR_NONE Successful - * @retval #BT_ERROR_NOT_INITIALIZED Not initialized - * @retval #BT_ERROR_OPERATION_FAILED Operation failed - * @retval #BT_ERROR_NOT_SUPPORTED Not supported - * - * @pre The Bluetooth service must be initialized with bt_initialize(). - * @see bt_initialize() - */ -int bt_ipsp_deinitialize(void); - -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief Connects to a IPSP service over LE to remote device, asynchronously. - * @since_tizen 4.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth - * @param[in] remote_address The remote address - * @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 Not enabled - * @retval #BT_ERROR_OPERATION_FAILED Operation failed - * @retval #BT_ERROR_PERMISSION_DENIED Permission denied - * @retval #BT_ERROR_NOT_SUPPORTED Not supported - * - * @post bt_ipsp_set_connection_state_changed_cb() will be invoked. - * @see bt_ipsp_set_connection_state_changed_cb() - */ -int bt_ipsp_connect(const char *address); - -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief Disonnects to a IPSP service over LE to remote device, asynchronously. - * @since_tizen 4.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/bluetooth - * @param[in] remote_address The remote address - * @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 Not enabled - * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected - * @retval #BT_ERROR_OPERATION_FAILED Operation failed - * @retval #BT_ERROR_PERMISSION_DENIED Permission denied - * @retval #BT_ERROR_NOT_SUPPORTED Not supported - * - * @pre The remote device must be connected by bt_ipsp_connect(). - * @post bt_ipsp_set_connection_state_changed_cb() will be invoked. - * @see bt_ipsp_connect() - * @see bt_ipsp_set_connection_state_changed_cb() - */ -int bt_ipsp_disconnect(const char *address); - -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief Registers a callback function that will be invoked when the connection state changes. - * @since_tizen 4.0 - * @param[in] bt_ipsp_connection_state_changed_cb The callback function to register - * @param[in] user_data The user data to be passed to the callback function - * @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_initialize() - */ -int bt_ipsp_set_connection_state_changed_cb(bt_ipsp_connection_state_changed_cb callback, - void *user_data); - -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief Unregisters the callback function. - * @since_tizen 4.0 - * @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_SUPPORTED Not supported - * - * @pre The Bluetooth service must be initialized with bt_initialize(). - * @see bt_initialize() - */ -int bt_ipsp_unset_connection_state_changed_cb(void); - /** * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE * @brief Gets the pbap connected status. diff --git a/include/bluetooth_type.h b/include/bluetooth_type.h index a89e68d..c9dffb7 100644 --- a/include/bluetooth_type.h +++ b/include/bluetooth_type.h @@ -1019,6 +1019,34 @@ typedef struct { int service_data_len; /**< Service data length */ } bt_adapter_le_service_data_s; +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE + * @brief Called when the IPSP initialization state changes. + * @since_tizen 4.0 + * @param[in] result The result of the initialization or deinitialization request + * @param[in] ipsp_initialized The initialized state: (@c true = initialized, @c false = deinitialized) + * @param[in] user_data The user data passed from the initialization request function + * @see bt_ipsp_initialize() + * @see bt_ipsp_deinitialize() + */ +typedef void (*bt_ipsp_init_state_changed_cb) + (int result, bool ipsp_initialized, void *user_data); + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE + * @brief Called when the IPSP connection state changes. + * @since_tizen 4.0 + * @param[in] result The result of the connection or disconnection request + * @param[in] connected The connection status: (@c true = connected, @c false = disconnected) + * @param[in] remote_address Address of remote device + * @param[in] iface_name The network interface name for IPv6 network interface + * @param[in] user_data The user data passed from the callback registration function + * @see bt_ipsp_connect() + * @see bt_ipsp_disconnect() + */ +typedef void (*bt_ipsp_connection_state_changed_cb) + (int result, bool connected, const char *remote_address, const char *iface_name, void *user_data); + /** * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE * @brief Device information structure used for identifying pear device. diff --git a/include/bluetooth_type_internal.h b/include/bluetooth_type_internal.h index 11960bb..22a2c69 100644 --- a/include/bluetooth_type_internal.h +++ b/include/bluetooth_type_internal.h @@ -669,33 +669,6 @@ typedef struct { */ typedef void (*bt_device_att_mtu_changed_cb)(int result, bt_device_att_mtu_info_s *mtu_info, void *user_data); -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief IPSP Init state changed callback - * @since_tizen 4.0 - * @param[in] result The result of the initializing or deinitializing request - * @param[in] ipsp_initialized The initialized state: (@c true = initialized, @c false = deinitialized) - * @param[in] user_data The user data passed from the callback registration function - * @see bt_ipsp_initialize() - */ -typedef void (*bt_ipsp_init_state_changed_cb) - (int result, bool ipsp_initialized, void *user_data); - -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE - * @brief IPSP Connection state changed callback - * @since_tizen 4.0 - * @param[in] result The result of the connecting or disconnecting request - * @param[in] connected The connection status: (@c true = connected, @c false = disconnected) - * @param[in] remote_address Address of remote device - * @param[in] iface_name The network interface name for IPv6 network interface - * @param[in] user_data The user data passed from the callback registration function - * @see bt_ipsp_connect() - * @see bt_ipsp_disconnect() - */ -typedef void (*bt_ipsp_connection_state_changed_cb) - (int result, bool connected, const char *remote_address, const char *iface_name, void *user_data); - /** * @ingroup CAPI_NETWORK_BLUETOOTH_PROXIMITY_MODULE * @brief The handle of a Proximity Monitor client handle which is associated with a remote device.