#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
#define PAYLOAD_DEF_CAP 1024 |
Payload default capacity.
bool payload_add_data |
( |
struct payload * |
payload, |
|
|
const uint8_t * |
data, |
|
|
size_t |
size |
|
) |
| |
Add data to a payload.
- Parameters
-
payload | The payload to add data to. |
data | The data to add. |
size | The size of the data. |
- Returns
- Success: true. Failure: false.
void payload_free |
( |
struct payload * |
payload | ) |
|
Free a payload.
- Parameters
-
payload | The payload to free. |
struct payload* payload_new |
( |
void |
| ) |
|
Allocate and initialize a new payload with a default capacity.
- Returns
- Success: The new allocated and initialiazed payload. Failure: NULL.
struct payload* payload_new_from_data |
( |
const uint8_t * |
data, |
|
|
size_t |
size |
|
) |
| |
Allocate and initialize a new payload from data.
- Parameters
-
data | The data to put in the payload. |
size | The size of the data. |
- Returns
- Success: The new allocated and initialized payload. Failure: NULL.
struct payload* payload_new_with_capacity |
( |
uint16_t |
capacity | ) |
|
Allocate and initialize a new payload with a capacity.
- Parameters
-
capacity | The capacity of the payload. |
- Returns
- Success: The new allocated and initialiazed payload. Failure: NULL.