NetBurner 3.3.8a
PDF Version
Buffers - System Buffer Pool

Functions

void FreeBufferList (PoolPtr nbuf)
 FreeBufferList Frees a linked list of pool buffers. The buffers must be linked by the pNextFifo_El Pointer. More...
 
uint16_t GetFreeCount ()
 Returns the number of free buffers in the system. Buffers are used for both serial and network interfaces. More...
 
void ShowBuffer (PoolPtr p)
 Prints a pool buffer to stdout.
 

Detailed Description

Functions associated with the buffers allocated for use by network interfaces and serial ports. If a system runs out of buffers it will no longer be able to send or receive network data.

Function Documentation

◆ FreeBufferList()

void FreeBufferList ( PoolPtr  pp)

FreeBufferList Frees a linked list of pool buffers. The buffers must be linked by the pNextFifo_El Pointer.

Parameters
ppThe first PoolPtr in the list to be freed

◆ GetFreeCount()

uint16_t GetFreeCount ( )

Returns the number of free buffers in the system. Buffers are used for both serial and network interfaces.

This function returns the number of free pool buffers, which are used for network and serial communication. The maximum number of buffers is defined in \nburn\nbrtos\include\constants.h:

#define BUFFER_POOL_SIZE (128)

The size of each buffer is defined as:

#define ETHER_BUFFER_SIZE 1548

If the number of free buffers reaches zero, then no further network communication will be possible until some buffers are freed. This is a good function to use as a debug tool for detecting buffer leaks in your application.

Serial ports also use buffers, which are allocated in constants.h:

#define SERIAL_TX_BUFFERS (2)
#define SERIAL_RX_BUFFERS (2)

Each serial port buffer is equal in size to an Ethernet buffer.

Returns
The number of free buffers in the system.