NprFrameCodec class final
#include <npr/common/frame_codec.hpp>
Low-level NPR parity/FEC codec shared by runtime, PHY, MAC, and frame builders.
This helper is intentionally placed in common/ rather than frames/ because it does not encode protocol semantics such as signaling, TDMA, or IPv4 layout. It only handles the transport-neutral byte-level NPR parity and FEC envelope.
Public static functions
- static auto encoded_size(size_t payload_size) -> size_t
- Computes encoded on-air size for a decoded payload.
- static auto has_even_parity(uint8_t byte) -> bool
- Returns
truewhen the provided byte has even parity. - static auto with_even_parity_7bit(uint8_t value_7bit) -> uint8_t
- Adds parity bit to a 7-bit value so the output byte has even parity.
Constructors, destructors, conversion operators
- NprFrameCodec(IFrameCodecDiagnostics* diagnostics = nullptr) explicit
Public functions
- auto decode(const uint8_t* input, size_t input_size, uint8_t* output, size_t output_capacity) const -> FecDecodeResult
- Decodes NPR on-air FEC layout into payload bytes.
- auto encode(const uint8_t* input, size_t input_size, uint8_t* output, size_t output_capacity, size_t* output_size) const -> bool
- Encodes decoded payload bytes into NPR on-air FEC layout.
- void set_diagnostics(IFrameCodecDiagnostics* diagnostics)
- Updates diagnostics sink used for parity/FEC counters.
- auto validate_header_bytes(uint8_t tdma_byte, uint8_t client_id_byte) const -> bool
- Validates the NPR TDMA/client-id header byte pair.