Infineon Logo AIROC BTSDK v4.6 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Functions

wiced_result_t wiced_transport_init (const wiced_transport_cfg_t *p_cfg)
 Initializes and configures the transport interface and also registers the callback handlers to be invoked when receiving data, init complete, etc. More...
 
wiced_transport_buffer_pool_twiced_transport_create_buffer_pool (uint32_t buffer_size, uint32_t buffer_count)
 Creates a buffer pool for the transport usage. More...
 
void * wiced_transport_allocate_buffer (wiced_transport_buffer_pool_t *p_pool)
 Allocates a buffer from the pool. More...
 
uint32_t wiced_transport_get_buffer_size (wiced_transport_buffer_pool_t *p_pool)
 Returns the size of the buffer in the pool. More...
 
uint32_t wiced_transport_get_buffer_count (wiced_transport_buffer_pool_t *p_pool)
 Gets the number of buffers available in the pool. More...
 
wiced_result_t wiced_transport_send_buffer (uint16_t code, uint8_t *p_buf, uint16_t length)
 Sends the packet to the host over the transport using the buffer allocated by the application. More...
 
void wiced_transport_free_buffer (void *p_buf)
 Frees the transport buffer. More...
 
wiced_result_t wiced_transport_send_data (uint16_t code, uint8_t *p_data, uint16_t length)
 Sends the packet to the host over the transport interface. More...
 
wiced_result_t wiced_transport_send_hci_trace (wiced_transport_buffer_pool_t *hci_trans_pool, wiced_bt_hci_trace_type_t type, uint16_t length, uint8_t *p_data)
 Sends the HCI trace data over the transport. More...
 
wiced_result_t wiced_transport_send_raw_buffer (uint8_t *p_buf, uint16_t length)
 Used when transport mode is WICED_TRANSPORT_UART_RAW_MODE. More...
 
void wiced_set_hci_uart_cts_rts_flow_control (BOOL32 on)
 Function wiced_set_hci_uart_cts_rts_flow_control. More...
 

Detailed Description

Function Documentation

void wiced_set_hci_uart_cts_rts_flow_control ( BOOL32  on)

Function wiced_set_hci_uart_cts_rts_flow_control.

Enable the CTS RTS Flow Control on or off

Note: If user would like to turn off HCI UART flow control, then this function must be called in APPLICATION_START()

Parameters
[in]on- true, enable CTS RTS Flow Control false, disable CTS RTS Flow Control
Returns
none
void* wiced_transport_allocate_buffer ( wiced_transport_buffer_pool_t p_pool)

Allocates a buffer from the pool.

Parameters
[in]p_pool- The pointer to the buffer pool returned from wiced_transport_create_buffer_pool.
Returns
- The pointer to the buffer on success. NULL on a failure. The application writes the payload starting from this location.
wiced_transport_buffer_pool_t* wiced_transport_create_buffer_pool ( uint32_t  buffer_size,
uint32_t  buffer_count 
)

Creates a buffer pool for the transport usage.

The application creats a buffer pool if it has to send a packet of the size > 268 bytes. The application specifies the payload length as the buffer size. The transport takes care of creating a pool of the desired size considering the transport header requirements and the application specified payload size.

Parameters
[in]buffer_size- The size of each buffer in the pool. The application specifies the payload length as the buffer size.
[in]buffer_count- The number of buffers in the pool.
Returns
- The pointer to the buffer pool on success. NULL on a failure.
void wiced_transport_free_buffer ( void *  p_buf)

Frees the transport buffer.

NOTE When receiving a packet, the application takes care of freeing the RX buffers. When sending a packet, the transport takes care of freeing the buffer after the packet is sent.

Parameters
[in]p_buf- The pointer to the buffer to be freed.
Returns
None.
uint32_t wiced_transport_get_buffer_count ( wiced_transport_buffer_pool_t p_pool)

Gets the number of buffers available in the pool.

Parameters
[in]p_pool- The pointer to the buffer pool created using wiced_transport_create_buffer_pool.
Returns
- The number of the buffers available in the pool.
uint32_t wiced_transport_get_buffer_size ( wiced_transport_buffer_pool_t p_pool)

Returns the size of the buffer in the pool.

Parameters
[in]p_pool- The pointer to the buffer pool returned from wiced_trans_create_buffer_pool.
Returns
- The size of the buffers of the pool.
wiced_result_t wiced_transport_init ( const wiced_transport_cfg_t p_cfg)

Initializes and configures the transport interface and also registers the callback handlers to be invoked when receiving data, init complete, etc.

Parameters
[in]p_cfg- The AIROC transport config.
Returns
wiced_result_t
wiced_result_t wiced_transport_send_buffer ( uint16_t  code,
uint8_t *  p_buf,
uint16_t  length 
)

Sends the packet to the host over the transport using the buffer allocated by the application.

This function takes care of preparing the header and sending the data. The buffer is freed by the transport after sending the packet.

NOTE The application has to allocate the buffer from the transport pool using wiced_transport_allocate_buffer and copy the payload to this buffer and send the payload pointer. This allows the application to use custom size buffers and avoid the overrunning of generic buffers shared across the firmware code.

Parameters
[in]code- The group code and command code.
[in]p_buf- The pointer to the payload.
[in]length- The payload length.
Returns
wiced_result_t
wiced_result_t wiced_transport_send_data ( uint16_t  code,
uint8_t *  p_data,
uint16_t  length 
)

Sends the packet to the host over the transport interface.

This function allocates a buffer internally and prepares the header, copies the payload and then sends the packet over the transport. The maximum size of the buffer that can be allocated is 268 bytes.

The transport internally uses a buffer from the pool which is available for all general purposes. Following are the configuration of the internal pool: 1: The buffer size - 8 bytes, buffer count - 128. 2: The buffer size - 32 bytes, buffer count - 48. 3: The buffer size - 96 bytes, buffer count - 50. 4: The buffer size - 268 bytes, buffer count - 12.

NOTE Using the described generic pools, the max supportable payload size = 252(16 bytes for internal headers).

Parameters
[in]code- The group code and command code.
[in]p_data- The pointer to the payload.
[in]length- The payload length.
Returns
wiced_result_t
wiced_result_t wiced_transport_send_hci_trace ( wiced_transport_buffer_pool_t hci_trans_pool,
wiced_bt_hci_trace_type_t  type,
uint16_t  length,
uint8_t *  p_data 
)

Sends the HCI trace data over the transport.

Parameters
[in]hci_trans_pool-
  • Passes the pointer to the pool created by the application. if the application has created a dedicated transport pool for communicating with the host. Passes NULL if the application wants the stack to take care of allocating the buffer for sending the data to the host. The application should be able to use the transport buffer pool that it allocates and trace the whole HCI packets. In the case of stack allocation, the size of the trace is compromised according to the buffer availability.
[in]type- The HCI trace type.
[in]p_data- The pointer to the data payload.
[in]length- The dData payload length.
Returns
wiced_result_t WICED_SUCCESS on SUCCESS. WICED_NO_MEMORY if there are no buffers available to send. WICED_ERROR - otherwise.
wiced_result_t wiced_transport_send_raw_buffer ( uint8_t *  p_buf,
uint16_t  length 
)

Used when transport mode is WICED_TRANSPORT_UART_RAW_MODE.

Available with the wiced_uart_raw_mode_lib. Send the packet to the host over the transport using the buffer allocated by the application. This function takes care of preparing the header and sending the data. The buffer must be freed by the application if return status is WICED_SUCCESS. Note: Application has to allocate buffer from transport pool using wiced_transport_allocate_buffer and copy the payload to this buffer and send the payload pointer. This allows the application to use custom size buffers and avoid overrun of generic buffers, which is shared across firmware code.

Parameters
[in]p_buf- Pointer to the payload
[in]length- Payload length
Returns
wiced_result_t WICED_SUCCESS on SUCCESS. WICED_NO_MEMORY if there are no buffers available to send. WICED_ERROR - otherwise.