Download FreeRTOS
 

Quality RTOS & Embedded Software

LIBRARIES
WHAT'S NEW
Simplifying Authenticated Cloud Connectivity for Any Device.
Designing an energy efficient and cloud-connected IoT solution with CoAP.
Introducing FreeRTOS Kernel version 11.0.0:
FreeRTOS Roadmap and Code Contribution process.
OPC-UA over TSN with FreeRTOS.

pucGetNetworkBuffer()
[Ethernet Driver Porting API]

FreeRTOS_IP_Private.h
NetworkBufferManagement.h
uint8_t *pucGetNetworkBuffer( size_t *pxRequestedSizeBytes );
		

Data that is sent out to the network or received from the network is stored in a network buffer. A network buffer is basically just a block of RAM (actually an array of uint8_t in the source code).

The embedded TCP/IP stack needs to first locate the network buffers, and once located know how big the network buffers are. Network buffer descriptors are used for that purpose.

Whereas pxGetNetworkBufferWithDescriptor() obtains a network buffer descriptor that can (optionally) reference an Ethernet buffer, pucGetNetworkBuffer() just obtains the Ethernet buffer itself and would normally only be used allocate buffers to DMA descriptors in zero copy drivers.

pucGetNetworkBuffer() must not be called from an interrupt service routine (ISR).


Parameters:

xRequestedSizeBytes   The size of the Ethernet buffer to obtain. The size is specified in bytes.


Returns:

Successful calls return a pointer to the obtained Ethernet buffer. Unsuccessful calls return NULL.

Example usage:

Examples are provided on the Porting FreeRTOS to a Different Microcontroller page.

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.