dotstack API Reference
1.10.37
|
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_t * | bt_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... | |
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
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.
session | OBEX session. |
header_count | The number of optional OBEX headers sent with the disconnect request. |
headers | Optional OBEX headers sent with the disconnect request. |
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.
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.
session | OBEX session. |
remote_addr | Address of the remote device. |
psm | L2CAP PSM of the OBEX server. |
header_count | The number of optional OBEX headers sent with the connect request. |
headers | Optional OBEX headers sent with the connect request. |
callback | The callback function that will be called when the OBEX generates an event. |
param | A pointer to arbitrary data to be passed to the callback function. |
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.
session | OBEX session. |
header_count | The number of optional OBEX headers sent with the disconnect request. |
headers | Optional OBEX headers sent with the disconnect request. |
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.
session | OBEX session. |
hdr | Pointer to a buffer that will be filled with the header values. |
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.
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.
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.
session | OBEX session. |
hdr | Pointer to a buffer that will be filled with the header values. |
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.
session | OBEX session. |
psm | L2CAP PSM to listent on. |
callback | The callback function that will be called when the OBEX generates an event. |
param | A pointer to arbitrary data to be passed to the callback function. |
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.
session | OBEX session. |
opcode | Operation code. |
flags | Flags sent with the request. |
header_count | The number of optional OBEX headers sent with the disconnect request. |
headers | Optional OBEX headers sent with the disconnect request. |
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.
session | OBEX session. |
opcode | Operation code. |
response_code | Response code. |
flags | Flags sent with the response. |
header_count | The number of optional OBEX headers sent with the disconnect request. |
headers | Optional OBEX headers sent with the disconnect request. |
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.
session | OBEX session. |
path | The path to navigate to. |
len | The length of the path's name. |
flags | Flags sent with the request. |
TRUE
if the function succeeds. FALSE
otherwise.