#include "packet_utils.h"Data Structures | |
| struct | packet |
| struct | tx_strip_pkt |
| struct | pkt_enc_pool |
| struct | rx_strip_pkt |
| struct | pkt_dec_pool |
Macros | |
| #define | U16_BYTES (2) |
| #define | PAYLOAD_BYTES (48) |
| #define | XOR_BYTES (53) |
| #define | POOL_DEPTH (32) |
| #define | SYNC8 (0xAA) |
| #define | PKT_CHECK(cond, tag, msg) |
Functions | |
| static void | enc_pool_update_slot (pkt_enc_pool_t *restrict pool, const packet_t *restrict pkt) |
| static void | enc_pool_next_slot (pkt_enc_pool_t *restrict pool) |
| static const struct tx_strip_pkt * | enc_pool_get_slot_n (const pkt_enc_pool_t *restrict pool, uint8_t n) |
| static void | dec_pool_update_slot (pkt_dec_pool_t *restrict pool, const packet_t *restrict pkt) |
| static void | dec_pool_mark_known (pkt_dec_pool_t *restrict pool, const packet_t *restrict pkt) |
| static const struct rx_strip_pkt * | dec_pool_get_slot_n (const pkt_dec_pool_t *restrict pool, uint16_t n) |
| static void | pkt_set_xor_part (const pkt_enc_pool_t *restrict pool, packet_t *restrict pkt) |
| static void | pkt_set_sync8 (packet_t *restrict pkt) |
| static uint8_t | pkt_get_sync8 (const packet_t *restrict pkt) |
| static bool | pkt_sync8_is_valid (const packet_t *restrict pkt) |
| packet_t * | pkt_create (void) |
| void | pkt_destroy (packet_t *restrict pkt) |
| pkt_enc_pool_t * | pkt_enc_pool_create (void) |
| void | pkt_enc_pool_destroy (pkt_enc_pool_t *restrict pool) |
| pkt_dec_pool_t * | pkt_dec_pool_create (void) |
| void | pkt_dec_pool_destroy (pkt_dec_pool_t *restrict pool) |
| pkt_err_t | pkt_encode (packet_t *restrict pkt, pkt_enc_pool_t *restrict pool) |
| pkt_err_t | pkt_decode (const packet_t *restrict pkt, pkt_dec_pool_t *restrict pool) |
| pkt_err_t | pkt_get_id (const packet_t *restrict pkt, uint16_t *id) |
| pkt_err_t | pkt_get_header (const packet_t *restrict pkt, header_t *header) |
| pkt_err_t | pkt_set_header (packet_t *restrict pkt, const header_t *restrict header) |
| pkt_err_t | pkt_get_payload (const packet_t *restrict pkt, uint8_t *payload, size_t len) |
| pkt_err_t | pkt_set_payload (packet_t *restrict pkt, const uint8_t *restrict payload, size_t len) |
Variables | |
| static const char * | TAG = "pkt_utils" |
| static _Atomic uint16_t | id = 0 |
| struct packet |
| Data Fields | ||
|---|---|---|
| uint8_t | dct | |
| uint8_t | id[U16_BYTES] | |
| uint8_t | index[U16_BYTES] | |
| uint8_t | payload[PAYLOAD_BYTES] | |
| uint8_t | sync8 | |
| uint8_t | total[U16_BYTES] | |
| uint8_t | xor_part[XOR_BYTES] | |
| struct tx_strip_pkt |
| Data Fields | ||
|---|---|---|
| uint8_t | dct | |
| uint8_t | index[U16_BYTES] | |
| uint8_t | payload[PAYLOAD_BYTES] | |
| uint8_t | total[U16_BYTES] | |
| struct pkt_enc_pool |
| Data Fields | ||
|---|---|---|
| struct tx_strip_pkt * | pkt | |
| struct tx_strip_pkt | pool[POOL_DEPTH] | |
| struct rx_strip_pkt |
| Data Fields | ||
|---|---|---|
| uint8_t | dct | |
| uint8_t | index[U16_BYTES] | |
| uint8_t | payload[PAYLOAD_BYTES] | |
| uint8_t | total[U16_BYTES] | |
| uint8_t | xor_part[XOR_BYTES] | |
| struct pkt_dec_pool |
| Data Fields | ||
|---|---|---|
| uint32_t | known | |
| struct rx_strip_pkt * | pkt | |
| struct rx_strip_pkt | pool[POOL_DEPTH] | |
| #define PAYLOAD_BYTES (48) |
| #define PKT_CHECK | ( | cond, | |
| tag, | |||
| msg ) |
| #define POOL_DEPTH (32) |
| #define SYNC8 (0xAA) |
| #define U16_BYTES (2) |
| #define XOR_BYTES (53) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
| packet_t * pkt_create | ( | void | ) |
| pkt_dec_pool_t * pkt_dec_pool_create | ( | void | ) |
| void pkt_dec_pool_destroy | ( | pkt_dec_pool_t *restrict | pool | ) |
| pkt_err_t pkt_decode | ( | const packet_t *restrict | pkt, |
| pkt_dec_pool_t *restrict | pool ) |
| void pkt_destroy | ( | packet_t *restrict | pkt | ) |
| pkt_enc_pool_t * pkt_enc_pool_create | ( | void | ) |
| void pkt_enc_pool_destroy | ( | pkt_enc_pool_t *restrict | pool | ) |
| pkt_err_t pkt_encode | ( | packet_t *restrict | pkt, |
| pkt_enc_pool_t *restrict | pool ) |
|
inlinestatic |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
static |