NetBurner 3.5.0
PDF Version
 
Buffers - System Buffer Pool

Functions

uint16_t GetFreeCount ()
 Returns the number of free buffers in the system. Buffers are used for both serial and network interfaces.
 
void ShowBuffer (PoolPtr p)
 Prints a pool buffer to stdout.
 

Detailed Description

#include< buffers.h >

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

◆ GetFreeCount()

uint16_t GetFreeCount ( )

#include <buffers.h>

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.