![]() |
Morse Micro IoT SDK
2.9.7
|
Read-only buffer data structure.
The design of this data structure allows the buffer to exist either in statically or dynamically allocated memory.
For statically allocated memory, the field free_cb may be set to NULL and free_arg ignored. For example:
For dynamically allocated memory, the field free_cb is set to the appropriate function to free the buffer and free_arg is an opaque argument to the free function. This approach might be used, for example, when reading into a temporary buffer from storage that is not memory mapped. For example:
Definition at line 161 of file mmhal_wlan.h.
#include <mmhal_wlan.h>
Data Fields | |
| const uint8_t * | buf |
| Pointer to the start of the read-only buffer. More... | |
| uint32_t | len |
| Length of the buffer contents. More... | |
| void(* | free_cb )(void *arg) |
| Optional callback to be invoked by the consumer to release the buffer when it is no longer required. More... | |
| void * | free_arg |
Optional argument to free_cb. More... | |
| const uint8_t* mmhal_robuf::buf |
Pointer to the start of the read-only buffer.
May be NULL only if len is zero.
Definition at line 164 of file mmhal_wlan.h.
| void* mmhal_robuf::free_arg |
Optional argument to free_cb.
Ignored if free_cb is NULL.
Definition at line 177 of file mmhal_wlan.h.
| void(* mmhal_robuf::free_cb) (void *arg) |
Optional callback to be invoked by the consumer to release the buffer when it is no longer required.
If not required, set to NULL.
buf and len in this structure may be modified before free_cb() is invoked. However, the value of free_arg will be passed to free_cb(). Definition at line 175 of file mmhal_wlan.h.
| uint32_t mmhal_robuf::len |
Length of the buffer contents.
Definition at line 166 of file mmhal_wlan.h.