dotstack API Reference  1.10.37
Functions
OBEX2

The OBEX object model describes how OBEX objects are presented. More...

Functions

bt_bool bt_obex2_init (void)
 Initialize the OBEX2 layer. More...
 
bt_obex2_session_tbt_obex2_allocate_session (void)
 Allocate OBEX session. More...
 
bt_bool bt_obex2_connect (bt_obex2_session_t *session, bt_bdaddr_t *pbdaddr_remote, bt_int psm, bt_uint header_count, const bt_obex2_header_t *headers, bt_obex2_session_callback_fp callback, void *param)
 Connect to a remote device. More...
 
bt_bool bt_obex2_listen (bt_obex2_session_t *session, bt_int psm, bt_obex2_session_callback_fp callback, void *param)
 Start OBEX server. More...
 
bt_bool bt_obex2_disconnect (bt_obex2_session_t *session, bt_uint header_count, bt_obex2_header_t *headers)
 Disconnect from a remote device. More...
 
bt_bool bt_obex2_send_request (bt_obex2_session_t *session, bt_byte opcode, bt_byte flags, bt_uint header_count, const bt_obex2_header_t *headers)
 Send OBEX request. More...
 
bt_bool bt_obex2_send_response (bt_obex2_session_t *session, bt_byte opcode, bt_byte response_code, bt_byte flags, bt_uint header_count, bt_obex2_header_t *headers)
 Send OBEX response. More...
 
bt_bool bt_obex2_abort (bt_obex2_session_t *session, bt_uint header_count, bt_obex2_header_t *headers)
 Abort current operation. More...
 
bt_bool bt_obex2_setpath (bt_obex2_session_t *session, bt_byte *path, bt_uint len, bt_byte flags)
 Sent 'Set Path' request an OBEX server. More...
 
bt_bool bt_obex2_get_first_header (bt_obex2_session_t *session, bt_obex2_header_t *hdr)
 Get first header from the OBEX server response. More...
 
bt_bool bt_obex2_get_next_header (bt_obex2_session_t *session, bt_obex2_header_t *hdr)
 Get next header from the OBEX server response. More...
 
bt_uint bt_obex2_get_next_connection_id (void)
 Get next OBEX connection id. More...
 
bt_int bt_obex2_get_frame_length (bt_obex2_session_t *session)
 Get maximum frame length. More...
 

Detailed Description

The OBEX object model describes how OBEX objects are presented.

The OBEX protocol can transfer an object by using the Put- and Get-operations. One object can be exchanged in one or more Put-requests or Get-responses

Function Documentation

bt_bool bt_obex2_abort ( bt_obex2_session_t session,
bt_uint  header_count,
bt_obex2_header_t headers 
)

Abort current operation.

This function aborts current operation initiated from a MCE.

Parameters
sessionOBEX session.
header_countThe number of optional OBEX headers sent with the disconnect request.
headersOptional OBEX headers sent with the disconnect request.
Returns
  • TRUE if the function succeeds.
  • FALSE otherwise.
bt_obex2_session_t* bt_obex2_allocate_session ( void  )

Allocate OBEX session.

This function allocates new OBEX session.

Returns
  • A pointer to the new OBEX session structure if the function succeeds.
  • NULL otherwise.
bt_bool bt_obex2_connect ( bt_obex2_session_t session,
bt_bdaddr_t *  pbdaddr_remote,
bt_int  psm,
bt_uint  header_count,
const bt_obex2_header_t headers,
bt_obex2_session_callback_fp  callback,
void *  param 
)

Connect to a remote device.

This function establishes an OBEX connection with a remote device which is running OBEX server. Changes in the session state are reported through a callback function.

Parameters
sessionOBEX session.
remote_addrAddress of the remote device.
psmL2CAP PSM of the OBEX server.
header_countThe number of optional OBEX headers sent with the connect request.
headersOptional OBEX headers sent with the connect request.
callbackThe callback function that will be called when the OBEX generates an event.
paramA pointer to arbitrary data to be passed to the callback function.
Returns
  • TRUE if the function succeeds.
  • FALSE otherwise. The callback function is not called in this case.
bt_bool bt_obex2_disconnect ( bt_obex2_session_t session,
bt_uint  header_count,
bt_obex2_header_t headers 
)

Disconnect from a remote device.

This function closes an OBEX connection with a remote device. Changes in the session state are reported through a callback function set in bt_obex_connect call.

Parameters
sessionOBEX session.
header_countThe number of optional OBEX headers sent with the disconnect request.
headersOptional OBEX headers sent with the disconnect request.
Returns
  • TRUE if the function succeeds.
  • FALSE otherwise.
bt_bool bt_obex2_get_first_header ( bt_obex2_session_t session,
bt_obex2_header_t hdr 
)

Get first header from the OBEX server response.

bt_obex2_get_first_header and bt_obex2_get_next_header are used to enumerate OBEX headers received from the OBEX server.

Parameters
sessionOBEX session.
hdrPointer to a buffer that will be filled with the header values.
Returns
  • TRUE if there is a header in the response.
  • FALSE otherwise.
bt_int bt_obex2_get_frame_length ( bt_obex2_session_t session)

Get maximum frame length.

This function returns maximum size of a frame that can be sent in one request or response.

Returns
  • Maximum frame size
bt_uint bt_obex2_get_next_connection_id ( void  )

Get next OBEX connection id.

This function returns next OBEX connection id. It is used in server implementations.

Returns
  • Next connection id
bt_bool bt_obex2_get_next_header ( bt_obex2_session_t session,
bt_obex2_header_t hdr 
)

Get next header from the OBEX server response.

bt_obex2_get_first_header and bt_obex2_get_next_header are used to enumerate OBEX headers received from the OBEX server.

Parameters
sessionOBEX session.
hdrPointer to a buffer that will be filled with the header values.
Returns
  • TRUE if there is a header in the response.
  • FALSE if there are no more headers in the response.
bt_bool bt_obex2_init ( void  )

Initialize the OBEX2 layer.

This function initializes the OBEX2 layer of the stack. It must be called prior to any other OBEX function is called.

bt_bool bt_obex2_listen ( bt_obex2_session_t session,
bt_int  psm,
bt_obex2_session_callback_fp  callback,
void *  param 
)

Start OBEX server.

This function starts an OBEX server.

Parameters
sessionOBEX session.
psmL2CAP PSM to listent on.
callbackThe callback function that will be called when the OBEX generates an event.
paramA pointer to arbitrary data to be passed to the callback function.
Returns
  • TRUE if the function succeeds.
  • FALSE otherwise. The callback function is not called in this case.
bt_bool bt_obex2_send_request ( bt_obex2_session_t session,
bt_byte  opcode,
bt_byte  flags,
bt_uint  header_count,
const bt_obex2_header_t headers 
)

Send OBEX request.

This function sends an OBEX request to an OBEX server.

Parameters
sessionOBEX session.
opcodeOperation code.
flagsFlags sent with the request.
header_countThe number of optional OBEX headers sent with the disconnect request.
headersOptional OBEX headers sent with the disconnect request.
Returns
  • TRUE if the function succeeds.
  • FALSE otherwise.
bt_bool bt_obex2_send_response ( bt_obex2_session_t session,
bt_byte  opcode,
bt_byte  response_code,
bt_byte  flags,
bt_uint  header_count,
bt_obex2_header_t headers 
)

Send OBEX response.

This function sends an OBEX response to an OBEX client.

Parameters
sessionOBEX session.
opcodeOperation code.
response_codeResponse code.
flagsFlags sent with the response.
header_countThe number of optional OBEX headers sent with the disconnect request.
headersOptional OBEX headers sent with the disconnect request.
Returns
  • TRUE if the function succeeds.
  • FALSE otherwise.
bt_bool bt_obex2_setpath ( bt_obex2_session_t session,
bt_byte *  path,
bt_uint  len,
bt_byte  flags 
)

Sent 'Set Path' request an OBEX server.

This function is used to navigate folders in an OBEX server.

Parameters
sessionOBEX session.
pathThe path to navigate to.
lenThe length of the path's name.
flagsFlags sent with the request.
Returns
  • TRUE if the function succeeds.
  • FALSE otherwise.