diff options
author | DoHyun Pyun <dh79.pyun@samsung.com> | 2016-11-11 14:37:15 +0900 |
---|---|---|
committer | DoHyun Pyun <dh79.pyun@samsung.com> | 2016-11-11 14:46:18 +0900 |
commit | 598dba226986ce1c84a97a186cf7e8e0575e3455 (patch) | |
tree | 9a8f4866f7a9c40f97bec69b87c606a17ed73926 | |
parent | 0abdd0c74306394cb9ca3b7933278d4a95b11457 (diff) | |
download | bluetooth-598dba226986ce1c84a97a186cf7e8e0575e3455.tar.gz bluetooth-598dba226986ce1c84a97a186cf7e8e0575e3455.tar.bz2 bluetooth-598dba226986ce1c84a97a186cf7e8e0575e3455.zip |
Add the bt_opp_get_transfer_progress internal API
Change-Id: I973ba9091b47161b5b28873de6116fd30d36ec97
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
-rw-r--r-- | include/mobile/bluetooth_internal.h | 16 | ||||
-rw-r--r-- | include/mobile/bluetooth_type_internal.h | 10 | ||||
-rw-r--r-- | include/tv/bluetooth_internal.h | 37 | ||||
-rw-r--r-- | include/tv/bluetooth_type_internal.h | 10 | ||||
-rw-r--r-- | include/wearable/bluetooth_internal.h | 16 | ||||
-rw-r--r-- | include/wearable/bluetooth_type_internal.h | 10 | ||||
-rw-r--r-- | src/bluetooth-opp-server.c | 21 |
7 files changed, 120 insertions, 0 deletions
diff --git a/include/mobile/bluetooth_internal.h b/include/mobile/bluetooth_internal.h index 9fb8067..528264e 100644 --- a/include/mobile/bluetooth_internal.h +++ b/include/mobile/bluetooth_internal.h @@ -1443,6 +1443,22 @@ int bt_opp_server_initialize(const char *destination, bt_opp_server_push_request /** * @internal + * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_MODULE + * @brief Gets the percentage progress for ongoing transfers. + * @since_tizen 3.0 + * @exception None + * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending) + * @param[in] transfer_id Transfer ID + * @param[out] progress Percentage Progress + * @retval #BT_ERROR_NONE Successful + * @retval #BT_ERROR_NOT_ENABLED Not enabled + * @retval #BT_ERROR_OPERATION_FAILED Operation failed + */ +int bt_opp_get_transfer_progress(bt_opp_transfer_type_t transfer_type, + int transfer_id, unsigned char *progress); + +/** + * @internal * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE * @brief Notifies the call event to the remote bluetooth device. * @since_tizen 2.3 diff --git a/include/mobile/bluetooth_type_internal.h b/include/mobile/bluetooth_type_internal.h index 545a705..0dfb58b 100644 --- a/include/mobile/bluetooth_type_internal.h +++ b/include/mobile/bluetooth_type_internal.h @@ -84,6 +84,16 @@ typedef enum { } bt_ag_call_state_e; /** + * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_MODULE + * @brief Enumerations for the transfer type + * @since_tizen 3.0 + */ +typedef enum { + BT_TRANSFER_INBOUND, /**< Inbound Transfer Type */ + BT_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */ +} bt_opp_transfer_type_t; + +/** * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE * @brief Called when the connectable state changes. * @since_tizen 2.3 diff --git a/include/tv/bluetooth_internal.h b/include/tv/bluetooth_internal.h index 33ca0e6..528264e 100644 --- a/include/tv/bluetooth_internal.h +++ b/include/tv/bluetooth_internal.h @@ -1443,6 +1443,22 @@ int bt_opp_server_initialize(const char *destination, bt_opp_server_push_request /** * @internal + * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_MODULE + * @brief Gets the percentage progress for ongoing transfers. + * @since_tizen 3.0 + * @exception None + * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending) + * @param[in] transfer_id Transfer ID + * @param[out] progress Percentage Progress + * @retval #BT_ERROR_NONE Successful + * @retval #BT_ERROR_NOT_ENABLED Not enabled + * @retval #BT_ERROR_OPERATION_FAILED Operation failed + */ +int bt_opp_get_transfer_progress(bt_opp_transfer_type_t transfer_type, + int transfer_id, unsigned char *progress); + +/** + * @internal * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE * @brief Notifies the call event to the remote bluetooth device. * @since_tizen 2.3 @@ -2094,6 +2110,27 @@ int bt_device_le_conn_update(const char *device_address, const bt_le_conn_update_s *parameters); /** + * @internal + * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE + * @brief Gets the is_alias_set property of a bonded device. + * @since_tizen 3.0 + * + * @param [in] remote_address The address of remote device + * @param [out] is_alias_set The is_alias_set property of device + * + * @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_ENABLED Not enabled + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + * + * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED. + */ +int bt_adapter_get_bonded_device_is_alias_set(const char *remote_address, gboolean *is_alias_set); + +/** * @ingroup CAPI_NETWORK_BLUETOOTH_HID_MODULE * @brief Registers the method for HID Device role * @since_tizen 2.3.1 diff --git a/include/tv/bluetooth_type_internal.h b/include/tv/bluetooth_type_internal.h index 4b6181a..e431b7c 100644 --- a/include/tv/bluetooth_type_internal.h +++ b/include/tv/bluetooth_type_internal.h @@ -84,6 +84,16 @@ typedef enum { } bt_ag_call_state_e; /** + * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_MODULE + * @brief Enumerations for the transfer type + * @since_tizen 3.0 + */ +typedef enum { + BT_TRANSFER_INBOUND, /**< Inbound Transfer Type */ + BT_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */ +} bt_opp_transfer_type_t; + +/** * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE * @brief Called when the connectable state changes. * @since_tizen 2.3 diff --git a/include/wearable/bluetooth_internal.h b/include/wearable/bluetooth_internal.h index e6bde51..0d7f046 100644 --- a/include/wearable/bluetooth_internal.h +++ b/include/wearable/bluetooth_internal.h @@ -1413,6 +1413,22 @@ int bt_opp_server_initialize(const char *destination, bt_opp_server_push_request /** * @internal + * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_MODULE + * @brief Gets the percentage progress for ongoing transfers. + * @since_tizen 3.0 + * @exception None + * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending) + * @param[in] transfer_id Transfer ID + * @param[out] progress Percentage Progress + * @retval #BT_ERROR_NONE Successful + * @retval #BT_ERROR_NOT_ENABLED Not enabled + * @retval #BT_ERROR_OPERATION_FAILED Operation failed + */ +int bt_opp_get_transfer_progress(bt_opp_transfer_type_t transfer_type, + int transfer_id, unsigned char *progress); + +/** + * @internal * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE * @brief Notifies the call event to the remote bluetooth device. * @since_tizen 2.3.1 diff --git a/include/wearable/bluetooth_type_internal.h b/include/wearable/bluetooth_type_internal.h index cd4cbce..06f4075 100644 --- a/include/wearable/bluetooth_type_internal.h +++ b/include/wearable/bluetooth_type_internal.h @@ -86,6 +86,16 @@ typedef enum { } bt_ag_call_state_e; /** + * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_MODULE + * @brief Enumerations for the transfer type + * @since_tizen 3.0 + */ +typedef enum { + BT_TRANSFER_INBOUND, /**< Inbound Transfer Type */ + BT_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */ +} bt_opp_transfer_type_t; + +/** * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE * @brief Called when the connectable state changes. * @since_tizen 2.3.1 diff --git a/src/bluetooth-opp-server.c b/src/bluetooth-opp-server.c index 29bb652..22cfcc3 100644 --- a/src/bluetooth-opp-server.c +++ b/src/bluetooth-opp-server.c @@ -222,3 +222,24 @@ int bt_opp_server_cancel_transfer(int transfer_id) return error_code; /* LCOV_EXCL_STOP */ } +/* LCOV_EXCL_START */ +int bt_opp_get_transfer_progress(bt_opp_transfer_type_t transfer_type, + int transfer_id, unsigned char *progress) +{ + int error_code = BT_ERROR_NONE; + + BT_CHECK_OPP_SERVER_SUPPORT(); + BT_CHECK_INIT_STATUS(); + BT_CHECK_INPUT_PARAMETER(progress); + + error_code = _bt_get_error_code(bluetooth_opp_get_transfer_progress(transfer_type, transfer_id, progress)); + if (error_code != BT_ERROR_NONE) { + BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), + error_code); + *progress = 0; + } + + return error_code; + +} +/* LCOV_EXCL_STOP */ |