The following APIs provides the memory buffer management used by the application and the upper layer stack of the AIROC Bluetooth Stack.
More...
The following APIs provides the memory buffer management used by the application and the upper layer stack of the AIROC Bluetooth Stack.
- Note
- For more information on application buffer pool allocation, please refer to the app note /doc/WICED-Application-Buffer-Pools.pdf
uint16_t wiced_bt_buffer_poolutilization |
( |
uint8_t |
pool_id | ) |
|
Get specific buffer pool utilization.
- Parameters
-
size | Parameters pool_id - (input) pool ID |
- Returns
- Return % of buffers used from 0 to 100
Creates a private buffer pool dedicated for the application usage.
- Parameters
-
buffer_size | The size of the buffers in the pool |
buffer_cnt | The number of buffers in the pool |
- Returns
- The pointer to the created pool on success NULL on failure
Note: The max number of buffer pools configured in wiced_bt_cfg_settings_t.max_number_of_buffer_pools must be increased for each buffer pool the application creates.
void wiced_bt_free_buffer |
( |
void * |
p_buf | ) |
|
Frees an existing buffer in a pool.
- Parameters
-
p_buf | The pointer to the start of the buffer to be freed |
- Returns
- void
void* wiced_bt_get_buffer |
( |
uint16_t |
buffer_size | ) |
|
Allocates a buffer from the public pools.
Public pools shall be specified using wiced_bt_cfg_buf_pool_t from the application.
- Parameters
-
buffer_size | The size of the buffer |
- Returns
- The pointer to the buffer on success NULL on failure
To get the number of buffers available in the pool.
- Parameters
-
p_pool | The pointer to the created pool |
- Returns
- The number of buffers available in the pool
Allocates a buffer from the private pool.
Pass the pool pointer to get the buffer from the desired pool.
- Parameters
-
p_pool | The pointer to the created pool |
- Returns
- The pointer to the buffer on success NULL on failure
uint32_t wiced_bt_get_buffer_size |
( |
void * |
p_buf | ) |
|
Gets the buffer size.
- Parameters
-
p_buf | The pointer to the start of the buffer |
- Returns
- The size of the buffer on success 0 if unsuccessful
Dumps dynamic buffer usage (see wiced_bt_buffer_statistics_t),from the last start of the system.
- Parameters
-
p_buffer_stat | The pointer buffer to fill statistics |
size | The size of the memory to get the statistics |
- Returns
- WICED_BT_SUCCESS on success else error
uint32_t wiced_memory_get_free_bytes |
( |
void |
| ) |
|
Returns the number of free bytes of RAM left.
- Returns
- The number of free bytes of RAM left
void* wiced_memory_permanent_allocate |
( |
uint32_t |
size | ) |
|
Allocates memory for permanent usage.
- Parameters
-
size | The size of the memory to be allocated |
- Returns
- The pointer to the allocated memory on success NULL on failure
wiced_bool_t wiced_memory_set_application_thread_stack_size |
( |
uint16_t |
new_stack_size | ) |
|
Update the stack size of the application thread (MPAF) NOTE : This API will work only when invoked from SPAR_CRT_SETUP()
- Parameters
-
new_stack_size | Required size of the stack |
- Returns
- TRUE on success else FALSE