|
| static const char * | domain_to_str (domain_t domain) |
| |
| static const char * | category_to_str (domain_t domain, category_t category) |
| |
| static const char * | type_to_str (domain_t domain, category_t category, type_t type) |
| |
| static void | bytes_to_str (const uint8_t *restrict buffer, size_t sz, char *restrict out, size_t out_sz) |
| |
| static void | enc_pool_update_slot (pkt_enc_pool_t *restrict pool, const packet_t *restrict pkt) |
| |
| 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 bool | dec_pool_has_unknown_pkt (const pkt_dec_pool_t *restrict pool) |
| |
| static const struct rx_strip_pkt * | dec_pool_get_slot_n (const pkt_dec_pool_t *restrict pool, uint16_t n) |
| |
| static int8_t | dec_pool_try_recovery (pkt_dec_pool_t *restrict pool) |
| |
| 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) |
| |
| static uint16_t | pkt_compute_crc16_ccitt_false (const packet_t *restrict pkt) |
| |
| static void | pkt_set_crc16 (packet_t *restrict pkt) |
| |
| static uint16_t | pkt_get_crc16 (const packet_t *restrict pkt) |
| |
| static bool | pkt_crc16_is_valid (const packet_t *restrict pkt) |
| |
| packet_t * | pkt_create (void) |
| | Allocate and initialize a packet, with each byte set to 0.
|
| |
| void | pkt_destroy (packet_t *restrict pkt) |
| | Free a packet allocated by pkt_create().
|
| |
| pkt_enc_pool_t * | enc_pool_create (void) |
| | Allocate and initialize an encoder pool.
|
| |
| void | enc_pool_destroy (pkt_enc_pool_t *restrict pool) |
| | Free an encoder pool allocated by enc_pool_create().
|
| |
| pkt_dec_pool_t * | dec_pool_create (void) |
| | Allocate and initialize a decoder pool.
|
| |
| void | dec_pool_destroy (pkt_dec_pool_t *restrict pool) |
| | Free a decoder pool allocated by dec_pool_create().
|
| |
| pkt_err_t | pkt_encode (packet_t *restrict pkt, pkt_enc_pool_t *restrict pool) |
| | Finalize and encode a packet for transmission.
|
| |
| pkt_err_t | pkt_decode (const packet_t *restrict pkt, pkt_dec_pool_t *restrict pool, int8_t *restrict relative_loc) |
| | Validate and decode a received packet.
|
| |
| pkt_err_t | dec_pool_get_pkt_from_relative_loc (const pkt_dec_pool_t *restrict pool, int8_t relative_loc, packet_t *restrict pkt) |
| | Reconstruct a recovered packet from the decoder pool.
|
| |
| pkt_err_t | pkt_get_id (const packet_t *restrict pkt, uint16_t *id) |
| | Read the packet identifier.
|
| |
| pkt_err_t | header_sensor_config (header_t *restrict header) |
| | Configure a header for a current sensor measurement packet.
|
| |
| pkt_err_t | header_old_sensor_config (header_t *restrict header, uint16_t old_id) |
| | Configure a header for a retransmitted (old) sensor measurement packet.
|
| |
| pkt_err_t | pkt_get_header (const packet_t *restrict pkt, header_t *header) |
| | Unpack the header fields from a raw packet.
|
| |
| pkt_err_t | pkt_set_header (packet_t *restrict pkt, const header_t *restrict header) |
| | Pack header fields into a raw packet.
|
| |
| pkt_err_t | pkt_get_payload (const packet_t *restrict pkt, uint8_t *payload, size_t len) |
| | Copy the payload field out of a packet.
|
| |
| pkt_err_t | pkt_set_payload (packet_t *restrict pkt, const uint8_t *restrict payload, size_t len) |
| | Copy data into the payload field of a packet.
|
| |
| bool | pkt_is_chunked (const packet_t *restrict pkt) |
| | Check whether a packet carries chunked data.
|
| |
| pkt_err_t | pkt_log (const packet_t *restrict pkt) |
| | Log a human-readable dump of a packet to the PAL logger.
|
| |
| pkt_err_t | pkt_test_random_set_sync8 (packet_t *restrict pkt, bool *failed) |
| | Randomly corrupt the SYNC8 field for testing purposes.
|
| |
| pkt_err_t | pkt_test_random_set_crc16 (packet_t *restrict pkt) |
| | Randomly corrupt the CRC16 field for testing purposes.
|
| |
Plant-B application layer protocol - packet encoding and decoding.
- Author
- Adrien Chevrier
- Copyright
- Copyright (c) 2026 Adrien Chevrier. Under AGPL-3.0-or-later license.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.
- Version
- 0.1
- Date
- 2026-02-05