Bluetooth OPP Profile

group BT_OPP

Provide BT OPP profile interfaces.

Typedefs

typedef struct t_bt_opp_data_header_ind T_BT_OPP_DATA_HEADER_IND

BT OPP data header indication.

typedef struct t_bt_opp_data_ind T_BT_OPP_DATA_IND

BT OPP data indication.

typedef enum t_bt_opp_response_code T_BT_OPP_RESPONSE_CODE

BT OPP response code.

Enums

enum t_bt_opp_response_code

BT OPP response code.

Values:

enumerator BT_OPP_RSP_CONTINUE
enumerator BT_OPP_RSP_SUCCESS
enumerator BT_OPP_RSP_FORBIDDEN
enumerator BT_OPP_RSP_NOT_FOUND
enumerator BT_OPP_RSP_REQUESTED_ENTITY_TOO_LARGE
enumerator BT_OPP_RSP_UNSUPPORTED_MEDIA_TYPE

Functions

bool bt_opp_init(uint8_t server_chann, uint16_t l2c_psm)

Initialize OPP profile.

Experimental Added Since 2.13.0.0:

Parameters:
  • server_chann[in] RFCOMM server channel to be allocated for OPP.

  • l2c_psm[in] L2CAP PSM to be allocated for OPP.

Return values:
  • true – OPP profile was initialized successfully.

  • false – OPP profile was failed to initialize.

Returns:

The status of initializing OPP profile.

bool bt_opp_connect_cfm(uint8_t bd_addr[6], bool accept)

Accept or reject the incoming OPP Connection.

Experimental Added Since 2.13.0.0:

Parameters:
  • bd_addr[in] Remote BT address.

  • accept[in] Accept or reject the connection indication.

    • true Accept the connection indication.

    • false Reject the connection indication

Return values:
  • true – OPP connection confirmation was sent successfully.

  • false – OPP connection confirmation was failed to send.

Returns:

The status of sending the OPP connection confirmation.

bool bt_opp_connect_over_rfc_req(uint8_t bd_addr[6], uint8_t server_chann)

Send a OPP connection request over RFCOMM.

Experimental Added Since 2.13.0.0:

Parameters:
  • bd_addr[in] Remote BT address.

  • server_chann[in] The remote server channel defined in SDP record.

Return values:
  • true – OPP connection request was sent successfully.

  • false – OPP connection request was failed to send.

Returns:

The status of sending the OPP connection request.

bool bt_opp_connect_over_l2c_req(uint8_t bd_addr[6], uint16_t l2c_psm)

Send a OPP connection request over L2CAP.

Experimental Added Since 2.13.0.0:

Parameters:
  • bd_addr[in] Remote BT address.

  • l2c_psm[in] The remote L2CAP PSM defined in SDP record.

Return values:
  • true – OPP connection request was sent successfully.

  • false – OPP connection request was failed to send.

Returns:

The status of sending the OPP connection request.

bool bt_opp_disconnect_req(uint8_t bd_addr[6])

Send a OPP disconnection request.

Experimental Added Since 2.13.0.0:

Parameters:

bd_addr[in] Remote BT address.

Return values:
  • true – OPP disconnection request was sent successfully.

  • false – OPP disconnection request was failed to send.

Returns:

The status of sending the OPP disconnection request.

bool bt_opp_push_data_header_req(uint8_t bd_addr[6], uint32_t total_len, uint8_t *name, uint16_t name_len, uint8_t *type, uint16_t type_len, bool srm_enable)

Request to push data header.

Experimental Added Since 2.13.0.0:

Parameters:
  • bd_addr[in] Remote BT address.

  • total_len[in] Total length of data.

  • name[in] Name of the data. Unicode string.

  • name_len[in] Length of name.

  • type[in] Type of the data. ASCII string of MIME type.

  • type_len[in] Length of type.

  • srm_enable[in] Single response mode enable or not.

Return values:
  • true – Request was sent successfully.

  • false – Request was failed to send.

Returns:

The status of pushing data header.

bool bt_opp_push_data_req(uint8_t bd_addr[6], uint8_t *data, uint16_t data_len, bool more_data)

Request to push data.

Experimental Added Since 2.13.0.0:

Parameters:
  • bd_addr[in] Remote BT address.

  • data[in] The data to be sent.

  • data_len[in] Length of data.

  • more_data[in] True if the data is partial and more data to send later.

Return values:
  • true – Request was sent successfully.

  • false – Request was failed to send.

Returns:

The status of pushing data.

bool bt_opp_send_data_rsp(uint8_t bd_addr[6], T_BT_OPP_RESPONSE_CODE rsp_code)

Acknowledge on receiving an OPP data indication.

Experimental Added Since 2.13.0.0:

Parameters:
  • bd_addr[in] Remote BT address.

  • rsp_code[in] Response code on on receiving an OPP data.

Return values:
  • true – Response was sent successfully.

  • false – Response was failed to send.

Returns:

The status of sending the response.

bool bt_opp_push_abort(uint8_t bd_addr[6])

Request to terminate the push operation.

Experimental Added Since 2.13.0.0:

Parameters:

bd_addr[in] Remote BT address.

Return values:
  • true – Request was sent successfully.

  • false – Request was failed to send.

Returns:

The status of sending push abort message.

struct t_bt_opp_data_header_ind

BT OPP data header indication.

Public Members

uint8_t *name
uint16_t name_len
uint8_t *type
uint16_t type_len
uint32_t total_len
struct t_bt_opp_data_ind

BT OPP data indication.

Public Members

uint8_t *p_data
uint16_t data_len
bool data_end