Bluetooth OPP(Object Push Profile) Server API provides functions for accepting objects such as pictures.
Required Header
#include <bluetooth.h>
Overview
This is OPP server 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_server_initialize_by_connection_request (const char *destination, bt_opp_server_connection_requested_cb connection_requested_cb, void *user_data) |
| Initializes the Bluetooth OPP server requested by bt_opp_server_connection_requested_cb().
|
int | bt_opp_server_deinitialize (void) |
| Deinitializes the Bluetooth OPP server.
|
int | bt_opp_server_accept (bt_opp_server_transfer_progress_cb progress_cb, bt_opp_server_transfer_finished_cb finished_cb, const char *name, void *user_data, int *transfer_id) |
| Accepts the push request from the remote device.
|
int | bt_opp_server_reject (void) |
| Rejects the push request from the remote device.
|
int | bt_opp_server_cancel_transfer (int transfer_id) |
| Cancels the transfer.
|
int | bt_opp_server_set_destination (const char *destination) |
| Sets the destination path of file to be pushed.
|
Typedefs |
typedef void(* | bt_opp_server_connection_requested_cb )(const char *remote_address, void *user_data) |
| Called when an OPP connection is requested.
|
typedef void(* | bt_opp_server_transfer_progress_cb )(const char *file, long long size, int percent, void *user_data) |
| Called when a file is being transferred.
|
typedef void(* | bt_opp_server_transfer_finished_cb )(int result, const char *file, long long size, void *user_data) |
| Called when a transfer is finished.
|
Typedef Documentation
Called when an OPP connection is requested.
- Since :
- 2.3
You must call bt_opp_server_accept_connection() if you want to accept. Otherwise, you must call bt_opp_server_reject_connection().
- Parameters:
-
[in] | remote_address | The address of remote device |
[in] | user_data | The user data passed from the callback registration function |
- See also:
- bt_opp_server_accept()
-
bt_opp_server_reject()
Called when a transfer is finished.
- Since :
- 2.3
- Parameters:
-
[in] | error_code | The result of push |
[in] | file | The path of file to be pushed |
[in] | size | The file size (bytes) |
[in] | user_data | The user data passed from the callback registration function |
- See also:
- bt_opp_server_accept()
-
bt_opp_server_accept_connection()
Called when a 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) |
[in] | user_data | The user data passed from the callback registration function |
- See also:
- bt_opp_server_accept()
-
bt_opp_server_accept_connection()
Function Documentation
Accepts the push request from the remote device.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] | progress_cb | The callback called when a file is being transferred |
[in] | finished_cb | The callback called when a transfer is finished |
[in] | name | The name to store. This can be NULL if you initialize OPP server by bt_opp_server_initialize_by_connection_request(). |
[in] | user_data | The user data to be passed to the callback function |
[out] | transfer_id | The ID of transfer |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- bt_opp_server_reject()
Cancels the transfer.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] | transfer_id | The ID of transfer |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- bt_opp_server_accept()
Deinitializes the Bluetooth OPP server.
- Since :
- 2.3
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- bt_opp_server_deinitialize()
Rejects the push request from the remote device.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- bt_opp_server_accept()
Sets the destination path of file to be pushed.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] | destination | The destination path of file to be pushed |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-