Expand description
§CCSDS and ECSS packet standards implementations
This crate contains generic implementations for various CCSDS (Consultative Committee for Space Data Systems) and ECSS (European Cooperation for Space Standardization) packet standards. Currently, this includes the following components:
- Space Packet implementation according to CCSDS Blue Book 133.0-B-2
- CCSDS File Delivery Protocol (CFDP) packet implementations according to CCSDS Blue Book 727.0-B-5
- PUS Telecommand and PUS Telemetry implementation according to the ECSS-E-ST-70-41C standard.
- CUC (CCSDS Unsegmented Time Code) implementation according to CCSDS 301.0-B-4 3.2
- CDS (CCSDS Day Segmented Time Code) implementation according to CCSDS 301.0-B-4 3.3
- Some helper types to support ASCII timecodes as specified in CCSDS 301.0-B-4 3.5
§Features
spacepackets supports various runtime environments and is also suitable for no_std environments.
§Default features
std: Enables functionality relying on the standard library.alloc: Enables features which operate on containers likealloc::vec::Vec. Enabled by thestdfeature.
§Optional features
serde: Addsserdesupport for most types by addingSerializeandDeserialize`derives.chrono: Add basic support for thechronotime library.timelib: Add basic support for thetimetime library.defmt: Add support for thedefmtby adding thedefmt::Formatderive on many types.portable-atomic: Basic support forportable-atomiccrate in addition to the support for core atomic types. This support requires atomic CAS support enabled in the portable atomic crate.
§Module
This module contains helpers and data structures to generate Space Packets according to the CCSDS 133.0-B-2. This includes the SpHeader class to generate the Space Packet Header component common to all space packets.
§Example
use spacepackets::SpHeader;
use arbitrary_int::{u11, u14};
let sp_header = SpHeader::new_for_unseg_tc(u11::new(0x42), u14::new(12), 1);
println!("{:?}", sp_header);
let mut ccsds_buf: [u8; 32] = [0; 32];
sp_header.write_to_be_bytes(&mut ccsds_buf).expect("Writing CCSDS TC header failed");
println!("{:x?}", &ccsds_buf[0..6]);Modules§
- cfdp
- Low-level CCSDS File Delivery Protocol (CFDP) support according to CCSDS 727.0-B-5.
- crc
- CRC checksum support.
- ecss
- Common definitions and helpers required to create PUS TMTC packets according to ECSS-E-ST-70-41C
- seq_
count - Sequence counter module.
- time
- CCSDS Time Code Formats according to CCSDS 301.0-B-4
- uslp
- Support of the CCSDS Unified Space Data Link Protocol (USLP)
- util
- Utility module.
- zc
- zerocopy based CCSDS Space Packet Primary Header implementation.
Structs§
- Ccsds
Packet Creator - CCSDS packet creator with optional support for a CRC16 CCITT checksum appended to the end of the packet.
- Ccsds
Packet Creator Owned alloc - CCSDS packet creator variant which owns the packet data.
- Ccsds
Packet Creator With Reserved Data - CCSDS packet creator with optional support for a CRC16 CCITT checksum appended to the end of the packet and support for copying into the user buffer directly.
- Ccsds
Packet IdAnd Psc - Simple combination of PacketId and PacketSequenceControl field of this packet.
- Ccsds
Packet Reader - CCSDS packet reader structure.
- Invalid
Payload Length Error - Invalid payload length which is bounded by u16::MAX
- Packet
Id - Abstraction for the CCSDS Packet ID, which forms the last thirteen bits of the first two bytes in the CCSDS primary header.
- Packet
Sequence Control - Abstraction for the CCSDS Packet Sequence Control (PSC) field which is the third and the fourth byte in the CCSDS primary header.
- Space
Packet Header - Space Packet Primary Header according to CCSDS 133.0-B-2.
Enums§
- Byte
Conversion Error - Generic error type when converting to and from raw byte slices.
- Ccsds
Packet Creation Error - Errors during CCSDS packet creation.
- Ccsds
Packet Read Error - CCSDS packet read error.
- Checksum
Type - Checksum types currently provided by the CCSDS packet support.
- Packet
Type - CCSDS packet type enumeration.
- Sequence
Flags - CCSDS packet sequence flags.
- Zero
Copy Error - zerocopy serialization and deserialization errors.
Constants§
- CCSDS_
HEADER_ LEN - Length of the CCSDS header.
- MAX_
APID - Maximum allowed value for the 11-bit APID.
- MAX_
SEQ_ COUNT - Maximum allowed value for the 14-bit APID.
Traits§
- Ccsds
Packet - Generic trait to access fields of a CCSDS space packet header according to CCSDS 133.0-B-2.
- Ccsds
Primary Header - Helper trait to generate the primary header from the composite fields.
Functions§
- ccsds_
packet_ len_ for_ user_ data_ len - Calculate the full CCSDS packet length for a given user data length and optional checksum type.
- ccsds_
packet_ len_ for_ user_ data_ len_ with_ checksum - Calculate the full CCSDS packet length for a given user data length.
- packet_
type_ in_ raw_ packet_ id - Retrieve the PacketType from a raw packet ID.
Type Aliases§
- Packet
Sequence Ctrl Deprecated - Deprecated type alias.
- SpHeader
- Alias for SpacePacketHeader.