Crate spacepackets

Crate spacepackets 

Source
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:

§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 like alloc::vec::Vec. Enabled by the std feature.

§Optional features

  • serde: Adds serde support for most types by adding Serialize and Deserialize `derives.
  • chrono: Add basic support for the chrono time library.
  • timelib: Add basic support for the time time library.
  • defmt: Add support for the defmt by adding the defmt::Format derive on many types.
  • portable-atomic: Basic support for portable-atomic crate 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§

CcsdsPacketCreator
CCSDS packet creator with optional support for a CRC16 CCITT checksum appended to the end of the packet.
CcsdsPacketCreatorOwnedalloc
CCSDS packet creator variant which owns the packet data.
CcsdsPacketCreatorWithReservedData
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.
CcsdsPacketIdAndPsc
Simple combination of PacketId and PacketSequenceControl field of this packet.
CcsdsPacketReader
CCSDS packet reader structure.
InvalidPayloadLengthError
Invalid payload length which is bounded by u16::MAX
PacketId
Abstraction for the CCSDS Packet ID, which forms the last thirteen bits of the first two bytes in the CCSDS primary header.
PacketSequenceControl
Abstraction for the CCSDS Packet Sequence Control (PSC) field which is the third and the fourth byte in the CCSDS primary header.
SpacePacketHeader
Space Packet Primary Header according to CCSDS 133.0-B-2.

Enums§

ByteConversionError
Generic error type when converting to and from raw byte slices.
CcsdsPacketCreationError
Errors during CCSDS packet creation.
CcsdsPacketReadError
CCSDS packet read error.
ChecksumType
Checksum types currently provided by the CCSDS packet support.
PacketType
CCSDS packet type enumeration.
SequenceFlags
CCSDS packet sequence flags.
ZeroCopyError
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§

CcsdsPacket
Generic trait to access fields of a CCSDS space packet header according to CCSDS 133.0-B-2.
CcsdsPrimaryHeader
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§

PacketSequenceCtrlDeprecated
Deprecated type alias.
SpHeader
Alias for SpacePacketHeader.