![]() |
Cordio Stack and Cordio Profiles
r2p3-02rel0
|
Data Structures | |
| struct | wsfBufPoolDesc_t |
| Buffer pool descriptor structure. More... | |
| struct | WsfBufPoolStat_t |
| Pool statistics. More... | |
| struct | wsfBufDiagAllocFail_t |
| WSF buffer diagnostics - buffer allocation failure. More... | |
| struct | WsfBufDiag_t |
| WSF buffer diagnostics message. More... | |
Macros | |
| #define | WSF_BUF_FREE_CHECK TRUE |
| check if trying to free a buffer that is already free | |
| #define | WSF_BUF_ALLOC_BEST_FIT_FAIL_ASSERT FALSE |
| assert on best-fit buffer allocation failure | |
| #define | WSF_BUF_ALLOC_FAIL_ASSERT TRUE |
| assert on buffer allocation failure | |
| #define | WSF_BUF_STATS_HIST FALSE |
| buffer histogram stats | |
| #define | WSF_BUF_STATS_MAX_LEN 128 |
| Length of the buffer statistics array. | |
| #define | WSF_BUF_STATS_MAX_POOL 32 |
| Max number of pools can allocate. | |
| #define | WSF_BUF_ALLOC_FAILED 0x01 |
| Failure Codes. | |
| #define | WSF_BUF_STATS FALSE |
| Enable buffer allocation statistics. | |
Typedefs | |
| typedef void(* | wsfBufDiagCback_t) (WsfBufDiag_t *pInfo) |
| Callback providing WSF buffer diagnostic messages. More... | |
Functions | |
| uint32_t | WsfBufInit (uint32_t bufMemLen, uint8_t *pBufMem, uint8_t numPools, wsfBufPoolDesc_t *pDesc) |
| Initialize the buffer pool service. This function should only be called once upon system initialization. More... | |
| void * | WsfBufAlloc (uint16_t len) |
| Allocate a buffer. More... | |
| void | WsfBufFree (void *pBuf) |
| Free a buffer. More... | |
| uint8_t * | WsfBufGetAllocStats (void) |
| Diagnostic function to get the buffer allocation statistics. More... | |
| uint8_t * | WsfBufGetPoolOverFlowStats (void) |
| Diagnostic function to get the number of overflow times for each pool. More... | |
| uint8_t | WsfBufGetNumPool (void) |
| Get number of pools. More... | |
| void | WsfBufGetPoolStats (WsfBufPoolStat_t *pStat, uint8_t numPool) |
| Get statistics for each pool. More... | |
| void | WsfBufDiagRegister (wsfBufDiagCback_t callback) |
| Called to register the buffer diagnostics callback function. More... | |
| typedef void(* wsfBufDiagCback_t) (WsfBufDiag_t *pInfo) |
| uint32_t WsfBufInit | ( | uint32_t | bufMemLen, |
| uint8_t * | pBufMem, | ||
| uint8_t | numPools, | ||
| wsfBufPoolDesc_t * | pDesc | ||
| ) |
Initialize the buffer pool service. This function should only be called once upon system initialization.
| bufMemLen | Length in bytes of memory pointed to by pBufMem. |
| pBufMem | Memory in which to store the pools used by the buffer pool service. |
| numPools | Number of buffer pools. |
| pDesc | Array of buffer pool descriptors, one for each pool. |
| void* WsfBufAlloc | ( | uint16_t | len | ) |
Allocate a buffer.
| len | Length of buffer to allocate. |
| void WsfBufFree | ( | void * | pBuf | ) |
Free a buffer.
| pBuf | Buffer to free. |
| uint8_t* WsfBufGetAllocStats | ( | void | ) |
Diagnostic function to get the buffer allocation statistics.
| uint8_t* WsfBufGetPoolOverFlowStats | ( | void | ) |
Diagnostic function to get the number of overflow times for each pool.
| uint8_t WsfBufGetNumPool | ( | void | ) |
Get number of pools.
| void WsfBufGetPoolStats | ( | WsfBufPoolStat_t * | pStat, |
| uint8_t | numPool | ||
| ) |
Get statistics for each pool.
| pStat | Buffer to store the statistics. |
| numPool | Number of pool elements. |
| void WsfBufDiagRegister | ( | wsfBufDiagCback_t | callback | ) |
Called to register the buffer diagnostics callback function.
| callback | Pointer to the callback function. |