Bluetooth OPP(Object Push Profile) Client API provides functions for pushing objects such as pictures.
Required Header
#include <bluetooth.h>
Overview
This is OPP Client APIs.
Related Features
This API is related with the following features:
It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information,thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Functions |
int | bt_opp_client_initialize (void) |
| Initializes the Bluetooth OPP client.
|
int | bt_opp_client_deinitialize (void) |
| Deinitializes the Bluetooth OPP client.
|
int | bt_opp_client_add_file (const char *file) |
| Adds file to be pushed.
|
int | bt_opp_client_clear_files (void) |
| Adds file to be pushed.
|
int | bt_opp_client_push_files (const char *remote_address, bt_opp_client_push_responded_cb responded_cb, bt_opp_client_push_progress_cb progress_cb, bt_opp_client_push_finished_cb finished_cb, void *user_data) |
| Pushes the file to the remote device, asynchronously.
|
int | bt_opp_client_cancel_push (void) |
| Cancels the push request in progress, asynchronously.
|
Typedefs |
typedef void(* | bt_opp_client_push_responded_cb )(int result, const char *remote_address, void *user_data) |
| Called when OPP server responds to the push request.
|
typedef void(* | bt_opp_client_push_progress_cb )(const char *file, long long size, int percent, void *user_data) |
| Called when each file is being transferred.
|
typedef void(* | bt_opp_client_push_finished_cb )(int result, const char *remote_address, void *user_data) |
| Called when the push request is finished.
|
Typedef Documentation
Called when the push request is finished.
- Since :
- 2.3
- Parameters:
-
[in] | result | The result of the push request |
[in] | remote_address | The remote address |
[in] | user_data | The user data passed from the callback registration function |
- See also:
- bt_opp_client_push_files()
Called when each file is being transferred.
- Since :
- 2.3
- Parameters:
-
[in] | file | The path of file to be pushed |
[in] | size | The file size (bytes) |
[in] | percent | The progress in percentage (1 ~ 100). 100 means that a file is transferred completely. |
[in] | user_data | The user data passed from the callback registration function |
- Precondition:
- bt_opp_client_push_files() will invoke this function.
- See also:
- bt_opp_client_push_files()
Called when OPP server responds to the push request.
- Since :
- 2.3
- Parameters:
-
[in] | result | The result of OPP server response |
[in] | remote_address | The remote address |
[in] | user_data | The user data passed from the callback registration function |
- Precondition:
- bt_opp_client_push_files() will invoke this function.
- See also:
- bt_opp_client_push_files()
Function Documentation
Deinitializes the Bluetooth OPP client.
- Since :
- 2.3
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- bt_opp_client_initialize()
Initializes the Bluetooth OPP client.
- Since :
- 2.3
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- bt_opp_client_deinitialize()
Pushes the file to the remote device, asynchronously.
At first, bt_opp_client_push_responded_cb() will be called when OPP server responds to the push request.
After connection is established, bt_opp_client_push_progress_cb() will be called repeatedly until a file is transferred completely.
If you send several files, then bt_opp_client_push_progress_cb() with another file will be called repeatedly until the file is transferred completely.
bt_opp_client_push_finished_cb() will be called when the push request is finished.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] | remote_address | The remote address |
[in] | responded_cb | The callback called when OPP server responds to the push request |
[in] | progress_cb | The callback called when each file is being transferred |
[in] | finished_cb | The callback called when the push request is finished |
[in] | user_data | The user data to be passed to the callback function |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- bt_opp_client_initialize()
-
bt_opp_client_cancel_push()