Add the bt_opp_get_transfer_progress internal API 61/97061/2 accepted/tizen/3.0/common/20161116.143015 accepted/tizen/3.0/ivi/20161116.020936 accepted/tizen/3.0/mobile/20161116.020842 accepted/tizen/3.0/tv/20161116.020907 accepted/tizen/3.0/wearable/20161116.020918 submit/tizen_3.0/20161115.010647
authorDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 11 Nov 2016 05:37:15 +0000 (14:37 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 11 Nov 2016 05:45:55 +0000 (14:45 +0900)
Change-Id: Ib55e3a87d4a058210102f463a0611d77e62ca51c
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
include/mobile/bluetooth_internal.h
include/mobile/bluetooth_type_internal.h
include/tv/bluetooth_internal.h
include/tv/bluetooth_type_internal.h
include/wearable/bluetooth_internal.h
include/wearable/bluetooth_type_internal.h
src/bluetooth-opp-server.c

index 9fb8067288194c772dad4fe04551937e9e9c7db7..528264e7bc9172810801da2c115261b17f5202f9 100644 (file)
@@ -1441,6 +1441,22 @@ int bt_socket_reject(int socket_fd);
  */
 int bt_opp_server_initialize(const char *destination, bt_opp_server_push_requested_cb push_requested_cb, void *user_data);
 
+/**
+ * @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
index 545a7054c8b59e9e8a7c173601b6d3a0e5f7a738..0dfb58bef5f8ddb76d965ddbc283e640608490f4 100644 (file)
@@ -83,6 +83,16 @@ typedef enum {
        BT_AG_CALL_STATE_WAITING,  /**< Waiting for connected indication event after answering an incoming call*/
 } 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.
index 33ca0e6d0b79813f9bff2f077e14935cf072054e..528264e7bc9172810801da2c115261b17f5202f9 100644 (file)
@@ -1441,6 +1441,22 @@ int bt_socket_reject(int socket_fd);
  */
 int bt_opp_server_initialize(const char *destination, bt_opp_server_push_requested_cb push_requested_cb, void *user_data);
 
+/**
+ * @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
@@ -2093,6 +2109,27 @@ int bt_panu_disconnect(const char *remote_address);
 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
index 4b6181aea62a6e8d7682ebf51f3ecac32d439c14..e431b7caa1399dd73fa5fd8487cddaebbcb77968 100644 (file)
@@ -83,6 +83,16 @@ typedef enum {
        BT_AG_CALL_STATE_WAITING,  /**< Waiting for connected indication event after answering an incoming call*/
 } 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.
index e6bde51200fdf4e47ac346d486da211acf3313f1..0d7f046f6e427b0dc3f7f5bd6128019f994e6670 100644 (file)
@@ -1411,6 +1411,22 @@ int bt_socket_reject(int socket_fd);
  */
 int bt_opp_server_initialize(const char *destination, bt_opp_server_push_requested_cb push_requested_cb, void *user_data);
 
+/**
+ * @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
index cd4cbce4a3bdef5ba0a956d25acef51b56377ee9..06f40759360d247668e1cb21eeacd0b170a83554 100644 (file)
@@ -85,6 +85,16 @@ typedef enum {
        BT_AG_CALL_STATE_WAITING,  /**< Waiting for connected indication event after answering an incoming call*/
 } 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.
index 29bb6523daa6088445f11e7fb5ab014ee0cf1d08..22cfcc358260270cb8083a5a0c0753e3cb27200c 100644 (file)
@@ -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 */