Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Header Operations

OBEX Header Operations. More...

Functions

uint8_t * wiced_bt_obex_header_init (wiced_bt_obex_handle_t handle, uint16_t pkt_size)
 Function wiced_bt_obex_header_init. More...
 
wiced_bt_obex_status_t wiced_bt_obex_add_header (uint8_t *p_pkt, wiced_bt_obex_header_identifier_t id, uint8_t *p_data, uint16_t len)
 Function wiced_bt_obex_add_header. More...
 
wiced_bt_obex_status_t wiced_bt_obex_add_header_utf8 (uint8_t *p_pkt, wiced_bt_obex_header_identifier_t id, uint8_t *p_str)
 Function wiced_bt_obex_add_header_utf8. More...
 
wiced_bt_obex_status_t wiced_bt_obex_add_triplet_header (uint8_t *p_pkt, wiced_bt_obex_header_identifier_t id, wiced_bt_obex_triplet_t *p_triplet, uint8_t num)
 Function wiced_bt_obex_add_triplet_header. More...
 
uint8_t * wiced_bt_obex_add_byte_sequence_start (uint8_t *p_pkt, uint16_t *p_len)
 Function wiced_bt_obex_add_byte_sequence_start. More...
 
wiced_bt_obex_status_t wiced_bt_obex_add_byte_sequence_end (uint8_t *p_pkt, wiced_bt_obex_header_identifier_t id, uint16_t len)
 Function wiced_bt_obex_add_byte_sequence_end. More...
 
wiced_bt_obex_status_t wiced_bt_obex_read_header (uint8_t *p_pkt, wiced_bt_obex_header_identifier_t id, uint8_t *p_data, uint16_t *p_len)
 Function wiced_bt_obex_read_header. More...
 
wiced_bt_obex_status_t wiced_bt_obex_read_header_utf8 (uint8_t *p_pkt, wiced_bt_obex_header_identifier_t id, uint8_t *p_data, uint16_t max_len)
 Function wiced_bt_obex_read_header_utf8. More...
 
wiced_bt_obex_status_t wiced_bt_obex_find_byte_sequence_header (uint8_t *p_pkt, wiced_bt_obex_header_identifier_t id, uint8_t **p_data, uint16_t *p_len)
 Function wiced_bt_obex_find_byte_sequence_header. More...
 
uint8_t wiced_bt_obex_find_body_header (uint8_t *p_pkt, uint8_t **p_body, uint16_t *p_len, wiced_bool_t *p_end)
 Function wiced_bt_obex_find_body_header. More...
 

Variables

uint16_t event
 
uint16_t len
 
uint16_t offset
 
uint16_t space_left
 
wiced_bt_obex_setpath_flag_t sp_flags
 
wiced_bool_t final
 
wiced_bt_obex_action_t action
 
uint8_t ssn
 
wiced_bool_t final
 
wiced_bt_obex_put_type_t type
 
uint8_t ssn
 
wiced_bool_t final
 
uint8_t ssn
 
wiced_bt_device_address_t peer_addr
 
uint16_t mtu
 
wiced_bt_obex_handle_t handle
 
wiced_bool_t no_rsp
 
uint8_t ssn
 
wiced_bt_obex_sess_opcode_t sess_op
 
wiced_bt_obex_sess_state_t sess_st
 
wiced_bt_device_address_t peer_addr
 
uint8_t * p_sess_info
 
uint32_t timeout
 
uint32_t obj_offset
 
uint8_t nssn
 
uint8_t ssn
 
wiced_bt_obex_action_t action
 
uint8_t ssn
 
wiced_bt_obex_setpath_flag_t flag
 
uint8_t ssn
 
wiced_bt_obex_conn_evt_t conn
 
wiced_bt_obex_sess_evt_t sess
 
wiced_bt_obex_put_evt_t put
 
wiced_bt_obex_setpath_evt_t sp
 
wiced_bt_obex_action_evt_t action
 
wiced_bt_obex_get_evt_t get
 
uint16_t len
 
uint8_t target [OBEX_MAX_TARGET_LEN]
 
wiced_bt_obex_target_tp_target
 
wiced_bt_obex_server_cback_t * p_cback
 
uint16_t transport_rx_mtu
 
uint16_t obex_rx_mtu
 
uint8_t scn
 
wiced_bool_t authenticate
 
uint8_t auth_option
 
uint8_t realm_charset
 
uint8_t * p_realm
 
uint8_t realm_len
 
uint8_t max_sessions
 
wiced_bool_t get_nonf
 
uint16_t psm
 
uint32_t nonce
 
wiced_bool_t srm
 
uint8_t max_suspend
 
uint8_t tag
 
uint8_t len
 
uint8_t * p_array
 

Detailed Description

OBEX Header Operations.

Header Operation API Functions sub module for OBEX.

Function Documentation

wiced_bt_obex_status_t wiced_bt_obex_add_byte_sequence_end ( uint8_t *  p_pkt,
wiced_bt_obex_header_identifier_t  id,
uint16_t  len 
)

Function wiced_bt_obex_add_byte_sequence_end.

This function is called to finish adding byte sequence header by adding header identifier and length. It is assumed that the actual value of the byte sequence has been copied into the OBEX packet.

Parameters
[in]p_pkt: OBEX packet
[in]id: OBEX header identifier
[in]len: Length of data
Returns
wiced_bt_obex_status_t
uint8_t* wiced_bt_obex_add_byte_sequence_start ( uint8_t *  p_pkt,
uint16_t *  p_len 
)

Function wiced_bt_obex_add_byte_sequence_start.

This is an alternative way to add a byte sequence header. Call this function to get the starting point of the byte sequence header buffer, fill in byte sequence data, then call wiced_bt_obex_add_byte_sequence_end to finish.

Parameters
[in]p_pkt: OBEX packet
[out]p_len: Pointer to return available buffer length
Returns
Starting point to the OBEX packet byte sequence header buffer
wiced_bt_obex_status_t wiced_bt_obex_add_header ( uint8_t *  p_pkt,
wiced_bt_obex_header_identifier_t  id,
uint8_t *  p_data,
uint16_t  len 
)

Function wiced_bt_obex_add_header.

This function adds a header to the OBEX packet.

For Unicode text header, parameter p_data should point to an Ascii string and len should contain the string length. This function will convert the input to Unicode string. If the input string is UTF-8, call wiced_bt_obex_add_header_utf8 instead. For byte sequence header, parameter p_data should point to the byte sequence and len should contain the byte sequence length. For 1 byte header, parameter p_data should point to a byte and len should equal to 1. For 4 byte header, parameter p_data should point to a uint32_t and len should equal to 4.

Parameters
[in]p_pkt: OBEX packet
[in]id: OBEX header identifier
[in]p_data: Pointer to data
[in]len: Data length
Returns
wiced_bt_obex_status_t
wiced_bt_obex_status_t wiced_bt_obex_add_header_utf8 ( uint8_t *  p_pkt,
wiced_bt_obex_header_identifier_t  id,
uint8_t *  p_str 
)

Function wiced_bt_obex_add_header_utf8.

This function adds a Unicode string header with UTF-8 string as input

Parameters
[in]p_pkt: OBEX packet
[in]id: OBEX header identifier
[in]p_str: Pointer to UTF-8 string
Returns
wiced_bt_obex_status_t
wiced_bt_obex_status_t wiced_bt_obex_add_triplet_header ( uint8_t *  p_pkt,
wiced_bt_obex_header_identifier_t  id,
wiced_bt_obex_triplet_t p_triplet,
uint8_t  num 
)

Function wiced_bt_obex_add_triplet_header.

This function adds a header with data in triplet format

Parameters
[in]p_pkt: OBEX packet
[in]id: OBEX header identifier
[in]p_triplet: Pointer to triplets
[in]num: Number of triplets
Returns
wiced_bt_obex_status_t
uint8_t wiced_bt_obex_find_body_header ( uint8_t *  p_pkt,
uint8_t **  p_body,
uint16_t *  p_len,
wiced_bool_t p_end 
)

Function wiced_bt_obex_find_body_header.

This function finds OBEX_HI_BODY and OBEX_HI_BODY_END headers in an OBEX packet

Parameters
[in]p_pkt: OBEX packet
[out]p_body: A pointer to return body header pointer
[out]p_len: Return body header length
[out]p_end: WICED_TRUE : found a OBEX_HI_BODY_END header : WICED_FALSE : found a OBEX_HI_BODY header or no body header was found
Returns
0 : No body header was found 1 : Found a OBEX_HI_BODY or OBEX_HI_BODY_END header 2 : Found both OBEX_HI_BODY and OBEX_HI_BODY_END headers
wiced_bt_obex_status_t wiced_bt_obex_find_byte_sequence_header ( uint8_t *  p_pkt,
wiced_bt_obex_header_identifier_t  id,
uint8_t **  p_data,
uint16_t *  p_len 
)

Function wiced_bt_obex_find_byte_sequence_header.

This function finds a specific byte sequence header, return its data pointer and length

Parameters
[in]p_pkt: OBEX packet
[in]id: OBEX header identifier
[out]p_data: A pointer to return header data pointer
[out]p_len: Return header length
Returns
wiced_bt_obex_status_t
uint8_t* wiced_bt_obex_header_init ( wiced_bt_obex_handle_t  handle,
uint16_t  pkt_size 
)

Function wiced_bt_obex_header_init.

This function is called to initialize an OBEX packet. This function takes a GKI buffer and sets the offset in tOBEX_BUFFER as OBEX_HDR_OFFSET, the len as 0. The space_left is set to the length still available. This function compares the given (pkt_size - sizeof(uint8_t)) with the peer MTU to get the lesser of the two and set the space_left to (lesser_size - OBEX_HDR_OFFSET). If composing a header for the CONNECT request (there is no client handle yet), use OBEX_HANDLE_NULL as the handle.

Parameters
[in]handle: OBEX handle
[in]pkt_size: Required packet size
Returns
A pointer to allocated packet
wiced_bt_obex_status_t wiced_bt_obex_read_header ( uint8_t *  p_pkt,
wiced_bt_obex_header_identifier_t  id,
uint8_t *  p_data,
uint16_t *  p_len 
)

Function wiced_bt_obex_read_header.

This function reads a header from the OBEX packet.

For Unicode text header, this function will convert Unicode to Ascii string. To convert Unicode to UTF-8 string, call wiced_bt_obex_read_header_utf8 instead. For byte sequence header, it reads byte sequence to buffer pointed to by parameter p_data. To avoid the data copying, call wiced_bt_obex_find_byte_sequence_header instead. For 1 byte and 4 byte header, it reads data to buffer pointed to by p_data.

Parameters
[in]p_pkt: OBEX packet
[in]id: OBEX header identifier
[out]p_data: Pointer to buffer that receives data
in/out]p_len : Input: output buffer size, Output: read data length
Returns
wiced_bt_obex_status_t
wiced_bt_obex_status_t wiced_bt_obex_read_header_utf8 ( uint8_t *  p_pkt,
wiced_bt_obex_header_identifier_t  id,
uint8_t *  p_data,
uint16_t  max_len 
)

Function wiced_bt_obex_read_header_utf8.

This function reads a Unicode string header with UTF-8 string as output

Parameters
[in]p_pkt: OBEX packet
[in]id: OBEX header identifier
[out]p_data: Pointer to buffer that receives UTF-8 string
[in]max_len: Max output size
Returns
wiced_bt_obex_status_t