AIROC™ BTSDK v4.9 - Documentation | ||||
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_t * | wiced_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... | |
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()
[in] | on | - true, enable CTS RTS Flow Control false, disable CTS RTS Flow Control |
void* wiced_transport_allocate_buffer | ( | wiced_transport_buffer_pool_t * | p_pool | ) |
Allocates a buffer from the pool.
[in] | p_pool | - The pointer to the buffer pool returned from wiced_transport_create_buffer_pool. |
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.
[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. |
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.
[in] | p_buf | - The pointer to the buffer to be freed. |
uint32_t wiced_transport_get_buffer_count | ( | wiced_transport_buffer_pool_t * | p_pool | ) |
Gets the number of buffers available in the pool.
[in] | p_pool | - The pointer to the buffer pool created using wiced_transport_create_buffer_pool. |
uint32_t wiced_transport_get_buffer_size | ( | wiced_transport_buffer_pool_t * | p_pool | ) |
Returns the size of the buffer in the pool.
[in] | p_pool | - The pointer to the buffer pool returned from wiced_trans_create_buffer_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.
[in] | p_cfg | - The AIROC transport config. |
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.
[in] | code | - The group code and command code. |
[in] | p_buf | - The pointer to the payload. |
[in] | length | - The payload length. |
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).
[in] | code | - The group code and command code. |
[in] | p_data | - The pointer to the payload. |
[in] | length | - The payload length. |
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.
[in] | hci_trans_pool | -
|
[in] | type | - The HCI trace type. |
[in] | p_data | - The pointer to the data payload. |
[in] | length | - The dData payload length. |
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.
[in] | p_buf | - Pointer to the payload |
[in] | length | - Payload length |