NET_BUF_POOL_DEFINE macro
@def NET_BUF_POOL_DEFINE Define a new pool for buffers Defines a net_buf_pool struct and the necessary memory storage (array of structs) for the needed amount of buffers. After this,the buffers can be accessed from the pool through net_buf_alloc. The pool is defined as a static variable, so if it needs to be exported outside the current module this needs to happen with the help of a separate pointer rather than an extern declaration. If provided with a custom destroy callback this callback is responsible for eventually calling net_buf_destroy() to complete the process of returning the buffer to the pool.
Syntax
#define NET_BUF_POOL_DEFINE(_name, _count, _size, _ud_size, _destroy) \
NET_BUF_POOL_FIXED_DEFINE(_name, _count, _size, _destroy)
Arguments
_name
Name of the pool variable.
_count
Number of buffers in the pool.
_size
Maximum data size for each buffer.
_ud_size
Amount of user data space to reserve.
_destroy
Optional destroy callback when buffer is freed.