Radio Control Layer (RCL)
Buffer Handler Functions

Detailed Description

These functions are meant mostly to be used by handlers and RCL itself

Functions

RCL_MultiBuffer * RCL_MultiBuffer_findFirstWritableBuffer (RCL_MultiBuffer *head)
 Find the first writable buffer in a list of MultiBuffers. More...
 
RCL_MultiBuffer * RCL_MultiBuffer_getBuffer (RCL_MultiBuffer *curBuffer, uint32_t minLength)
 Returns a buffer with at least minLength bytes remaining capacity. More...
 
uint32_t RCL_MultiBuffer_findAvailableRxSpace (const RCL_MultiBuffer *curBuffer)
 Find the minumum number of bytes that can be stored in available MultiBuffers. More...
 
static uint8_t * RCL_MultiBuffer_getNextWritableByte (RCL_MultiBuffer *curBuffer)
 Find the first byte to write in an RCL_MultiBuffer. More...
 
static void RCL_MultiBuffer_commitBytes (RCL_MultiBuffer *curBuffer, uint32_t numBytes)
 Update number of bytes written to RCL_MultiBuffer. More...
 

Function Documentation

§ RCL_MultiBuffer_findFirstWritableBuffer()

RCL_MultiBuffer* RCL_MultiBuffer_findFirstWritableBuffer ( RCL_MultiBuffer *  head)

#include </home/developer/.conan/data/rcl/8.10.00.12/library-lprf/ga/package/510d7dd2dbe5e675bad9bbb58cc66378e84fdf53/source/ti/drivers/rcl/RCL_Buffer.h>

Find the first writable buffer in a list of MultiBuffers.

Note
This function is intended as internal to RCL and its handlers
Parameters
head[in] - The head of the list
Returns
Pointer to first non-finished MultiBuffer after head; NULL if none

References RCL_BufferStateFinished.

Referenced by RCL_Handler_BLE5_updateRxCurBufferAndFifo(), RCL_Handler_Generic_updateRxCurBufferAndFifo(), RCL_Handler_Ieee_updateRxCurBufferAndFifo(), and RCL_MultiBuffer_get().

§ RCL_MultiBuffer_getBuffer()

RCL_MultiBuffer* RCL_MultiBuffer_getBuffer ( RCL_MultiBuffer *  curBuffer,
uint32_t  minLength 
)

#include </home/developer/.conan/data/rcl/8.10.00.12/library-lprf/ga/package/510d7dd2dbe5e675bad9bbb58cc66378e84fdf53/source/ti/drivers/rcl/RCL_Buffer.h>

Returns a buffer with at least minLength bytes remaining capacity.

Checks current buffer and next buffer against minLength, returns current if enough space, otherwise moves to next buffer.

If no such buffer is available, NULL is returned.

Note
This function is intended as internal to RCL and its handlers
The caller is responsible for issuing the necessary event if the decision is made to use the returned buffer and it is != curBuffer, or if the result of a NULL return is to stop using curBuffer.
Parameters
curBuffer[in] - Buffer to search from
minLength[in] - Minimum amount of bytes needed in buffer
Returns
Suitable RCL_MultiBuffer or NULL

References RCL_BufferStateFinished, and RCL_BufferStateInUse.

Referenced by RCL_Handler_BLE5_adv(), RCL_Handler_BLE5_aux_adv(), RCL_Handler_BLE5_conn(), RCL_Handler_BLE5_genericRx(), RCL_Handler_BLE5_scan_init(), RCL_Handler_Generic_Rx(), RCL_Handler_Ieee_RxTx(), RCL_Handler_Nesb_Prx(), RCL_Handler_Nesb_Ptx(), and RCL_MultiBuffer_get().

§ RCL_MultiBuffer_findAvailableRxSpace()

uint32_t RCL_MultiBuffer_findAvailableRxSpace ( const RCL_MultiBuffer *  curBuffer)

#include </home/developer/.conan/data/rcl/8.10.00.12/library-lprf/ga/package/510d7dd2dbe5e675bad9bbb58cc66378e84fdf53/source/ti/drivers/rcl/RCL_Buffer.h>

Find the minumum number of bytes that can be stored in available MultiBuffers.

Finds the number of bytes that can be guaranteed to be possible to store in available MultiBuffers, regardless of packet sizes. This is the size of a free MultiBuffer if that is available, or the remaining space in a MultiBuffer.

Note
This function is intended as internal to RCL and its handlers
Parameters
curBuffer[in] - Pointer to the first writable RCL_MultiBuffer
Returns
Number of available bytes

References RCL_BufferStateInUse.

Referenced by RCL_Handler_BLE5_updateRxCurBufferAndFifo(), RCL_Handler_Generic_updateRxCurBufferAndFifo(), RCL_Handler_Ieee_updateRxCurBufferAndFifo(), and RCL_MultiBuffer_get().

§ RCL_MultiBuffer_getNextWritableByte()

static uint8_t* RCL_MultiBuffer_getNextWritableByte ( RCL_MultiBuffer *  curBuffer)
inlinestatic

§ RCL_MultiBuffer_commitBytes()

static void RCL_MultiBuffer_commitBytes ( RCL_MultiBuffer *  curBuffer,
uint32_t  numBytes 
)
inlinestatic

#include </home/developer/.conan/data/rcl/8.10.00.12/library-lprf/ga/package/510d7dd2dbe5e675bad9bbb58cc66378e84fdf53/source/ti/drivers/rcl/RCL_Buffer.h>

Update number of bytes written to RCL_MultiBuffer.

Note
This function is intended as internal to RCL and its handlers
The caller is responsible for ensuring that the buffer can fit the bytes to be committed for issuing the necessary event if the decision is
Parameters
curBuffer[in] - Pointer to RCL_MultiBuffer
numBytes[in] - Number of bytes that have been written

Referenced by RCL_Handler_BLE5_commitPacket(), RCL_Handler_Generic_Rx(), RCL_Handler_Ieee_RxTx(), RCL_Handler_Nesb_Prx(), RCL_Handler_Nesb_Ptx(), and RCL_MultiBuffer_get().