4.1.3 bmm_buffer_free Function
C
void bmm_buffer_free(buffer_t *pbuffer)
Summary
Frees up a buffer
Description
This function frees up a buffer. The pointer passed to this function should be the pointer returned during buffer allocation. The result is unpredictable if an incorrect pointer is passed.
Precondition
bmm_buffer_init should have been called before using this function
Parameters
Param | Description |
---|---|
pbuffer | Pointer to buffer that has to be freed |
Returns
None
Example
buffer_t *buffer;
buffer = bmm_buffer_alloc(LARGE_BUFFER_SIZE);
if (buffer != NULL)
{
//Use the buffer
}
//Buffer Freeing
bmm_buffer_free(buffer);
Remarks
This routine is used by the PHY Layer for allocating the buffer for reception. Number of Buffers should be defined as per application needs before the buffer allocation function. If application allocates the buffer and not freeing them, Trx may not able to continuously receive the packet. So care should be taken when defining the Number of Buffers.