Expand description
§CCSDS Spacecraft Data Stream Decoding
The project provides tools for decoding spacecraft downlink telemetry streams conforming
to the CCSDS recommended specifications (Blue Books)
TM Synchronization and Channel Coding and Space Packet Protocol.
Supports:
- Framing
- Stream synchronization
- Pseudo-noise removal
- Reed-Solomon FEC
- Spacepacket decoding
- Telemetry packets, i.e., packets with type 0
- Sequencing
- Packet groups
- Limited support for secondary header timecodes
- CCSDS Day Segmented timecodes
- NASA EOS timecodes for Aqua and Terra spacecrafts
- Provided but not directly used
§Examples
The following example shows how to decode an unsynchrozied byte stream of CADUs for
the Suomi-NPP spacecraft. This example code should work for any spacecraft data stream
that conforms to CCSDS TM Synchronization and Channel Coding and Space Packet Protocol
documents.
use std::fs;
use ccsds::{FrameDecoderBuilder, decode_framed_packets, collect_packet_groups, PacketGroup};
let file = fs::File::open("snpp.dat")
.expect("failed to open data file");
let frames = FrameDecoderBuilder::new(1024)
.reed_solomon_interleave(4)
.build(file);
// Suomi-NPP has 0 length izone and trailer
let packets = decode_framed_packets(157, Box::new(frames), 0, 0);
// The VIIRS sensor on Suomi-NPP uses packet grouping, so here we collect the packets
// into their associated groups.
let groups: Vec<PacketGroup> = collect_packet_groups(Box::new(packets))
.filter_map(|zult| zult.ok())
.collect();§References:
CCSDSSpace Packet ProtocolTM Synchronization and Channel CodingTM Synchronization and Channel Coding - Summary of Concept and Rationale
§License
GNU General Public License v3.0
Modules§
- Timecode parsing for CCSDS Space Packet data.
Structs§
- Provides Frames based on configuration provided by the parent FrameDecoderBuilder.
- Implements the CCSDS documented Reed-Solomon FEC.
- Builds a DecodedFrameIter that will return all frames decoded from the stream read from reader.
- Spacecraft framing configuration.
- Packet represents a single CCSDS space packet and its associated data.
- Packet data representing a CCSDS packet group according to the packet sequencing value in primary header.
- CCSDS Primary Header
- Spacecraft Reed-solomon configuration
- Synchronizer scans a byte stream for data blocks indicated by a sync marker.
Enums§
- Disposition of the RS process
Constants§
- Default CCSDS attached sync marker.
- Maximum packet sequence id before rollover.
- Packet is a part of a packet group, but not first and not last
- Packet is the first packet in a packet group
- Packet is the last packet in a packet group
- Packet is not part of a packet group, i.e., standalone.
- VCID value indicating fill data
Traits§
Functions§
- Collects the provided packets into PacketGroups.
- Decodes the provided frames into a packets contained within the frames’ MPDUs.
- Calculate the number of missing frame sequence counts.
- Calculate the number of missing sequence ids.
- Return an Iterator that groups read packets into PacketGroups.
- Return an iterator providing Packet data read from a byte synchronized ungrouped packet stream.
- Creates an iterator that produces byte-aligned data blocks.
- Correct a Reed-Solomon code block. The returned Block’s message will contain the corrected message iff the state is RSState::Corrected. Otherwise it will be None.
- Deinterleave an interleaved RS block (code block + check symbols).
- Return true if the input code block contains 1 or more errors.