leodos_protocols/datalink/spp/segmentation/mod.rs
1//! Helpers for segmentation and reassembly of large data blocks across multiple Space Packets.
2//!
3//! This module provides a high-level API to handle data that is too large to fit
4//! into a single `SpacePacket`. This implementation is `#![no_std]` and allocator-free.
5//! The user is responsible for providing buffers for the reassembly process.
6//!
7//! # Workflow
8//!
9//! **Sending (Segmentation):**
10//! 1. Create a [`Segmenter`] iterator over your large data slice.
11//! 2. The iterator yields [`SegmentedPacketData`] structs.
12//! 3. Use the information from each struct to build and send a `SpacePacket`.
13//!
14//! **Receiving (Reassembly):**
15//! 1. The user must manage a pool of [`Reassembler`] instances. The [`ReassemblyManager`]
16//! is a helper for this.
17//! 2. When a `First` packet is received, associate a free `Reassembler` (and its buffer)
18//! with the packet's `Apid`.
19//! 3. Feed subsequent packets for that `Apid` to the correct `Reassembler`.
20//! 4. When the `Last` packet is processed, the `Reassembler` will yield a slice
21//! containing the complete data.
22
23/// Reassembly of segmented packets back into a contiguous data block.
24pub mod reassembler;
25/// Segmentation of large data into multiple packet-sized chunks.
26pub mod segmenter;