All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v0.17.0 2025-11-06
CdsCommonrenamed toCdsBase- cfdp: Removed
FileDirectiveTypevariant*Pdusuffix - ecss: Renamed
SubservicetoMessageSubtypeId - Simplified CDS short timestamp, contains one less field which reduced serialization length.
- Renamed
UnsignedEnum::valuetoUnsignedEnum::value_raw,valueis reserved for theconstvalue getter. - Renamed
CcsdsPrimaryHeader::from_composite_fieldstoCcsdsPrimaryHeader::new_from_composite_fields - Renamed
PusPacket::servicetoPusPacket::service_type_idandPusPacket::subservicetoPusPacket::message_subtype_id. Also addedPusPacket::message_type_id. Performed the same change for the ECSS PUS C secondary header traits.
- Added
CcsdsPacketCreator,CcsdsPacketReader,CcsdsPacketCreatorWithReservedDataandCcsdsPacketCreatorOwnedwhich simplify the process of creating full CCSDS space packets. - Added new optional
portable-atomicbecause portable atomics might not work on every architecture in addition to requiring atomic CAS support enabled inside for the crate.
- All
core::sync::Atomic?usages are feature gated properly to allow compilation on systems without atomic CAS.
v0.16.1 2025-09-26
SpHeader::packet_len is public now.
v0.16.0 2025-09-24
- Bump Rust MSRV to v1.83
PusTcCreatorhas its ownservice,subserviceandapidmethods and does not require trait imports anymore.- CFDP NAK PDU
SegmentRequestIteris not generic over the file size anymore. Instead, the iterator returns pairs ofu64for both large and normal file size. PusVersion::VersionNotSupportedcontains raw version number instead ofPusVersionenum now to make it more flexible.pus_versionAPI now returns aResult<PusVersion, u8>instead of aPusVersionto allow modelling invalid version numbers properly.- Renamed
CcsdsPacket::total_lentoCcsdsPacket::packet_len - Renamed
SequenceCountProvidertoSequenceCounter - Renamed
SeqCountProviderSimpletoSequenceCounterSimple - Renamed
CcsdsSimpleSeqCountProvidertoSequenceCounterCcsdsSimple - Renamed
SeqCountProviderSynctoSequenceCounterSync - Renamed
PusPacket::opt_crc16toPusPacket::checksum - Renamed
PacketSequenceCtrltoPacketSequenceControl - ECSS checksum generation is now optional as specified in the standard. Added
has_checksumparameters for ECSS TM/TC creators and readers to reflect this. - APID is represented by
arbitrary-int::u11while the sequence count is represented byarbitrary-int::u14. A lot of corresponding checks were removed because the type now ensure value validity. - ACK field changed from
u8toAckFlagsstructure. - PUS version raw representation is
u4now. - SC time reference status representation is
u4now. - Renamed
ptypetopacket_type - Renamed
PduHeader::new_no_file_datatoPduHeader::new_for_file_directive - Renamd
FinishedPduCreator::new_generictonewandnew_defaulttonew_no_error
PusVersion::Invalid, which will be modelled withResult<PusVersion, u8>now.
cfdp::pdu::ack::InvalidAckedDirectiveCodeErrorwhich is returned by theAckPduconstructor.cfdp::pdu::nak::NakPduCreatorWithReservedSegReqsBufconstructor which exposes the segment request buffer mutably to avoid the need for a separate segment request buffer.SpHeader::packet_lendirect method.AckFlagswhich is implemented withbitbybit::bitfieldApidOutOfRangeErrorandSequenceCountOutOfRangeError- Added PUS A legacy support for telecommands inside the
ecss.tc_pus_amodule - Added
SequenceCounter::increment_mutandSequenceCounter::get_and_increment_mut - Implemented
SequenceCounterforAtomicunsigned types and references of them PusPacket::has_checksumandWritablePusPacket::has_checksum- PUS TC builder API, either via
PusTcBuilder::new, orPusTcCreator::builder
v0.15.0 2025-07-18
PusTcCreatorWithReservedAppDataandPusTmCreatorWithReservedSourceDataconstructor variants which allow writing source/app data into the serialization buffer directly without requiring an extra buffer.
v0.14.0 2025-05-10
- Moved CRC constants/implementations to dedicated
crcmodule. crc::CRC_CCITT_FALSE_NO_TABLEandcrc::CRC_CCITT_FALSE_BIG_TABLEvariants.- Renamed
PusPacket::crc16toPusPacket::opt_crc16.
WritablePusPacket::write_to_bytes_crc_no_tableandWritablePusPacket::write_to_bytes_no_crcvariants.PusTmReader::new_crc_no_tableandPusTcReader::new_crc_no_tablevariants.crc16methods for PUS TM and PUS TC reader.- PUS TM and PUS TC reader now return the reader instance directly instead of a tuple of the reader
and the read size. The instance
total_lenmethod can be used to retrieve the read lenght.
v0.13.1 2025-03-21
- Bugfix due to operator precendence for
PusTcSecondaryHeader::pus_version,PusTcSecondaryHeaderWithoutTimestamp::pus_version,CdsTime::from_bytes_with_u16_daysandCdsTime::from_bytes_with_u24_days
v0.13.0 2024-11-08
- Bumped MSRV to 1.81.0
- Bump
zerocopyto v0.8.0 - Bump
thiserrorto v2.0.0
- Migrated all Error implementations to thiserror, improved some naming and error handling in general
v0.12.0 2024-09-10
- Bumped MSRV to 1.70.0
- Added new
cfdp::tlv::TlvOwnedtype which erases the lifetime and is clonable. - Dedicated
cfdp::tlv::TlvLvDataTooLargeerror struct for APIs where this is the only possible API error. - Added File Data PDU API which expects the expected file data size and then exposes the unwritten file data field as a mutable slice. This allows to read data from the virtual file system API to the file data buffer without an intermediate buffer.
- Generic
EofPdu::newconstructor. - Added generic sequence counter module.
- Added
MsgToUserTlv::to_tlvconverter which reduced the type and converts it to a genericTlv. - Implemented
From<MsgToUserTlv> for Tlvconverter trait. - Added CFDP maximum file segment length calculator method
calculate_max_file_seg_len_for_max_packet_len_and_pdu_header
- Added new
ReadableTlvto avoid some boilerplate code and have a common abstraction implemented for bothTlvandTlvOwnedto read the raw TLV data field and its length. - Replaced
cfdp::tlv::TlvLvErrorbycfdp::tlv::TlvLvDataTooLargewhere applicable.
- Fixed an error in the EOF writer which wrote the fault location to the wrong buffer position.
- cfdp
ConditionCode::CheckLimitReachedprevious had the wrong numerical value of0b1001(9) and now has the correct value of0b1010(10).
- Minor documentation build updates.
- Increased delegate version range to v0.13
- Bumped MSRV to 1.68.2
- Removed
defmt::Formatimpl forMetadataPduCreatorwhich seems to be problematic.
- The default data length for for
SpHeaderconstructors where the data field length is not specified is now 0. - The
SpHeader::new_from_fieldsis public now.
SpHeader::to_vecmethod.
- Moved
CCSDS_HEADER_LENconstant to the crate root.
- Added
SpacePacketHeadertype alias forSpHeadertype.
- Renamed
PacketIdandPacketSequenceCtrlnewmethod tonew_checkedand formernew_constmethod tonew. - Renamed
tc,tm,tc_unsegandtm_unsegvariants forPacketIdandSpHeadertonew_for_tc_checked,new_for_tm_checked,new_for_unseg_tc_checkedandnew_for_unseg_tm_checked. PusTmCreatorandPusTcCreatornow expect a regular instance ofSpHeaderinstead of a mutable reference.
SpHeader::new_from_apidandSpHeader::new_from_apid_checkedconstructor.#[inline]attribute for a lot of small functions.
Major API changes for the time API. If you are using the time API, it is strongly recommended to check all the API changes in the Changed chapter.
- CUC timestamp was fixed to include leap second corrections because it is based on the TAI
time reference. The default CUC time object do not implement
CcsdsTimeProvideranymore because the trait methods require cached leap second information. This task is now performed by thecuc::CucTimeWithLeapSecswhich implements the trait.
From<$EcssEnum$TY> from $TYfor the ECSS enum type definitions.- Added basic support conversions to the
timelibrary. Introduce newchronoandtimelibfeature gate. - Added
CcsdsTimeProvider::timelib_date_time. - Optional support for
defmtby adding optionaldefmt::Formatderives for common types.
PusTcCreator::new_simplenow expects a valid slice for the source data instead of an optional slice. For telecommands without application data,&[]can be passed.PusTmSecondaryHeaderconstructors now expects a valid slice for the time stamp instead of an optional slice.- Renamed
CcsdsTimeProvider::date_timetoCcsdsTimeProvider::chrono_date_time - Renamed
CcsdsTimeCodestoCcsdsTimeCode - Renamed
cds::TimeProvidertocds::CdsTime - Renamed
cuc::TimeProviderCcsdsEpochtocuc::CucTime UnixTimestamprenamed toUnixTimeUnixTimeseconds are now private and can be retrieved using thesecsmember method.UnixTime::newrenamed toUnixTime::new_checked.UnixTime::secsrenamed toUnixTime::as_secs.UnixTimenow has a nanosecond subsecond precision. Thenewconstructor now expects nanoseconds as the second argument.- Added new
UnixTime::new_subsec_millisandUnixTime::new_subsec_millis_checkedAPI to still allow creating a timestamp with only millisecond subsecond resolution. CcsdsTimeProvidernow has a newsubsec_nanosmethod in addition to a default implementation for thesubsec_millismethod.CcsdsTimeProvider::date_timerenamed toCcsdsTimeProvider::chrono_date_time.- Added
UnixTime::MIN,UnixTime::MAXandUnixTime::EPOCH. - Added
UnixTime::timelib_date_time. - Error handling for ECSS and time module is more granular now, with a new
DateBeforeCcsdsEpochErrorerror and aDateBeforeCcsdsEpochenum variant for bothCdsErrorandCucError. PusTmCreatornow has two lifetimes: One for the raw source data buffer and one for the raw timestamp.- Time API
from_now*API renamed tonow*.
- Legacy
PusTmandPusTcobjects.
From<$TY>for theEcssEnum$TYECSS enum type definitions.Subimplementation forUnixTimestampto calculate the duration between two timestamps.
CcsdsTimeProvidersubsecond_millisfunction now returnsu16instead ofOption<u16>.UnixTimestampsubsecond_millisfunction now returnsu16instead ofOption<u16>.
- Added
valueandto_vecmethods for theUnsignedEnumtrait. The value is returned as asu64. Renamed formervaluemethod onGenericUnsignedByteFieldtovalue_typed. - Added
value_constconst function forUnsignedByteFieldtype. - Added
value_typedconst functions forGenericUnsignedByteFieldandGenericEcssEnumWrapper.
CcsdsPacket,PusPacketandGenericPusTmSecondaryHeaderimplementation forPusTmZeroCopyWriter.- Additional length checks for
PusTmZeroCopyWriter.
PusTmZeroCopyWriter: Added additional timestamp length argument fornewconstructor.
- Typo:
PUC_TM_MIN_HEADER_LEN->PUS_TM_MIN_HEADER_LEN
- Added
pubvisibility forPacketSequenceCtrl::const_new.
- Added
len_writtenandto_vecmethods to theTimeWritertrait.
MetadataPduCreator: The serialization function shifted the closure requested information to the wrong position (first reserved bit) inside the raw content field.
- Add
WritablePduPackettrait which is a common trait of all CFDP PDU implementations. - Add
CfdpPdutrait which exposes fields and attributes common to all CFDP PDUs. - Add
GenericTlvandWritableTlvtrait as abstractions for the various TLV types.
- Set the direction field inside the PDU header field correctly explicitely for all CFDP PDU packets.
- Split up
FinishedPduintoFinishedPduCreatorandFinishedPduReaderto expose specialized APIs. - Split up
MetadataPduintoMetadataPduCreatorandMetadataPduReaderto expose specialized APIs. - Cleaned up CUC time implementation. Added
widthandcountergetter methods. - Renamed
SerializablePusPackettoWritablePusPacket. - Renamed
UnsignedPfctoPfcUnsignedandRealPfctoPfcReal. - Renamed
WritablePduPacket.written_lenandSerializablePusPacket.len_packedtolen_written. - Introduce custom implementation of
PartialEqforCommonPduConfigwhich only compares the values for the source entity ID, destination entity ID and transaction sequence number field to allow those fields to have different widths. - Removed the
PusError::RawDataTooShortvariant which is already covered byPusError::ByteConversionErrorvariant. - Ranamed
TlvLvError::ByteConversionErrortoTlvLvError::ByteConversion. - Renamed
PusError::IncorrectCrctoPusError::ChecksumFailure. - Some more struct variant changes for error enumerations.
PusError::NoRawDatavariant.cfdp::LenInByteswhich was not used.
PacketIdtrait impls:Ord,PartialOrdandHashSerializablePusPackettrait: Addto_vecmethod with default implementation.
- Bump
zerocopydependency to v0.7.0
- The
TlvandLvAPI return&[u8]instead ofOption<&[u8]>. ByteConversionErrorerror variantsToSliceTooSmallandFromSliceTooSmallare struct variants now.SizeMissmatchwas removed appropriately.UnsignedByteFieldErrorerror variantsValueTooLargeForWidthandInvalidWidthare struct variants now.TimestampErrorerror variantInvalidTimeCodeis struct variant now.
- Added
raw_dataAPI forTlvandLvto retrieve the wholeLv/Tlvslice if the object was created from a raw bytestream. - Added
MsgToUserTlvhelper class which wraps a regularTlvand adds some useful functionality. UnsignedByteFieldandGenericUnsignedByteFieldnewmethods areconstnow.PduErrorvariants which contained a tuple variant with multiple fields were converted to a struct variant.
- Added
pdu_datafield_lengetter function forPduHeader
SizeMissmatchbecause it is not required for theByteConversionErrorerror enumeration anymore.
- Moved MSRV from v1.60 to v1.61.
PusPackettrait:user_datanow returns&[u8]instead ofOption<&[u8]>. Empty user data can simply be an empty slice.- Moved ECSS TC components from
tctoecss.tc. - Moved ECSS TM components from
tmtoecss.tm. - Converted
PusTcclass to more specializedPusTcCreatorandPusTcReaderclasses. The oldPusTcclass is deprecated now. - Converted
PusTmclass to more specializedPusTmCreatorandPusTmReaderclasses. The oldPusTmclass is deprecated now. - Implement
DisplayandErrorforStdTimestampErrorproperly. - Remove some redundant
Errorsuffixes for enum error variants. CommonPduConfig:new_with_defaultsreplaced bynew_with_byte_fields.
source_dataandapp_dataAPI provided for PUS TM and PUS TC reader classes. These simply calluser_databut are also in line with the PUS packet standard names for those fields.- Added new marker trait
IsPusTelemetryimplemented byPusTmCreatorandPusTmReader. - Added new marker trait
IsPusTelecommandimplemented byPusTcCreatorandPusTcReader. metadata_paramgetter method for theMetadataPduobject.Defaultimpl for CFDPChecksumTypeDefaultimpl for CFDPCommonPduConfig
- All
MetadataGenericParamfields are now public. - New setter method
set_source_and_dest_idforCommonPduConfig.
- Added new
utilmodule which contains the following (new) helper modules:UnsignedEnumtrait as an abstraction for unsigned byte fields with variable lengths. It is not tied to the ECSS PFC value like theEcssEnumerationtrait. The method to retrieve the size of the unsigned enumeration in bytes is now calledsize.GenericUnsignedByteField<TYPE>and helper typedefsUnsignedU8,UnsignedU16,UnsignedU32andUnsignedU64as helper types implementingUnsignedEnumUnsignedByteFieldas a type-erased helper.
- Initial CFDP support: Added PDU packet implementation.
- Added
SerializablePusPacketas a generic abstraction for PUS packets which are writable. - Added new
PusTmZeroCopyWriterclass which allows to set fields on a raw TM packet, which might be more efficient that modification and re-writing a packet with thePusTmobject.
- The
EcssEnumerationnow requires theUnsignedEnumtrait and only adds thepfcmethod to it. - Renamed
byte_widthusages tosize(part of newUnsignedEnumtrait) - Moved
ecss::CRC_CCITT_FALSECRC constant to the root module. This CRC type is not just used by the PUS standard, but by the CCSDS Telecommand standard and the CFDP standard as well.
Clonetrait requirement fortime::cds::ProvidesDaysLentrait.- Added
CopyandClonederives forDaysLen16BitsandDaysLen24Bits.
num_enumdependency to avoid boilerplate code for primtive to enum conversions, for example for the PUS subservices.ecss.eventmodule containing aSubserviceenum.ecss.verificationmodule containing aSubserviceenum.ecss.schedulingmodule containing aSubserviceenum and some other helper enumerations.ecss.hkmodule containing aSubserviceenum.
- Added missing Service IDs to
ecss.PusServiceIdand marked in#[non_exhaustive].
time.UnixTimestamp: All constructors andFromconversions now use thenewconstructor, which should cause a correct conversion of 0 subsecond milliseconds to aNonevalue.
- Added
.gitignore.
- Correct implementation of Trait
PartialEqforPusTcandPusTm. The previous auto-derivation were incorrect because they also compared fields unrelated to the raw byte representation.
- Renamed
PusTcrawmethod toraw_bytesand add better docs to avoid confusion. Deprecaterawto avoid breaking change. - Added
raw_bytesmethod toPusTm.
time::cds::TimeProvider- Add
OrdandPartialOrd, use customPartialEqimpl to account for precision correctly. - Add
precision_as_nsfunction which converts microsecond and picosecond precision values into nanoseconds. - Add conversion trait to convert
cds::TimeProvider<DaysLen16Bits>intocds::TimeProvider<DaysLen24Bits>and vice-versa.
- Add
time::UnixTimestamp- Add
OrdandPartialOrdimplementations. - Add
Add<Duration>andAddAssign<Duration>implementations.
- Add
time::cds::TimeProvider: Fixed a bug where subsecond milliseconds were not accounted for when the provider has no submillisecond precision.
The timestamp of PusTm is now optional. See Added and Changed section for details.
PusTmSecondaryHeader: Newnew_simple_no_timestampAPI to create secondary header without timestamp.PusTm: Addnew_simple_no_timestampmethod to create TM without timestamp- New
UnixTimestampabstraction which contains the unix seconds as ani64and an optional subsecond millisecond counter (u16) MS_PER_DAYconstant.- CUC: Added
from_date_timeandfrom_unix_stampconstructors for time provider. - CUC: Add
Add<Duration>andAddAssign<Duration>impl for time provider.
- Implement
Add<Duration>andAddAssign<Duration>for time providers, which allows easily adding offsets to the providers. - Implement
TryFrom<DateTime<Utc>>for time providers. get_dyn_time_provider_from_bytes: Requiresallocsupport and returns the correctTimeProviderinstance wrapped as a boxed trait objectBox<DynCdsTimeProvider>by checking the length of days field.- Added constructor function to create the time provider
from
chrono::DateTime<Utc>and a generic UNIX timestamp (i64seconds and subsecond milliseconds). MAX_DAYS_24_BITSwhich contains maximum value which can be supplied to the days field of a CDS time provider with 24 bits days field width.- New
CdsTimestamptrait which encapsulates common fields for all CDS time providers. from_unix_secs_with_u24_daysandfrom_unix_secs_with_u16_dayswhich create the time provider from aUnixTimestampreference.from_dt_with_u16_days,from_dt_with_u24_daysand their..._us_precisionand..._ps_precisionvariants which allow to create time providers from achrono::DateTime<Utc>.- Add
from_bytes_with_u24_daysandfrom_bytes_with_u16_daysassociated methods
- (breaking)
unix_epoch_to_ccsds_epoch: Expect and returni64instead ofu64now. - (breaking)
ccsds_epoch_to_unix_epoch: Expect and returni64instead ofu64now. - (breaking)
PusTmSecondaryHeader: Timestamp is optional now, which translates to a timestamp of size 0. - (breaking):
PusTm: Renamedtime_stampmethod totimestamp, also returnsOptional<&'src_data [u8]>now. - (breaking):
PusTmSecondaryHeader: Renamedtime_stampfield totimestampfor consistency. - (breaking): Renamed
from_now_with_u24_days_and_us_prectofrom_now_with_u24_days_us_precision. Also did the same for theu16variant. - (breaking): Renamed
from_now_with_u24_days_and_ps_prectofrom_now_with_u24_days_ps_precision. Also did the same for theu16variant. CcsdsTimeProvidertrait (breaking):- Add new
unix_stampmethod returning the newUnixTimeStampstruct. - Add new
subsecond_millismethod returning counterOption<u16>. - Default impl for
unix_stampwhich re-usessubsecond_millisand existingunix_secondsmethod.
- Add new
TimestampError(breaking): AddDateBeforeCcsdsEpocherror type because new CDS API allow supplying invalid date times before CCSDS epoch. MakeTimestampErrorwith#[non_exhaustive]attribute to prevent future breakages if new error variants are added.
- CDS timestamp: Fixed another small logic error for stamp creation from the current time with picosecond precision. PR: https://egit.irs.uni-stuttgart.de/rust/spacepackets/pulls/8
- CDS timestamp: The conversion function from the current time were buggy when specifying picoseconds precision, which could lead to overflow multiplications and/or incorrect precision fields. PR: https://egit.irs.uni-stuttgart.de/rust/spacepackets/pulls/7
- Remove
Defaultderive on CDS time provider. This can lead to uninitialized preamble fields.
serdesupport is now optional and behind theserdefeature.PusTcSecondaryHeaderTtrait renamed toGenericPusTcSecondaryHeader.PusTmSecondaryHeaderTtrait renamed toGenericPusTmSecondaryHeader.SpHeader: Formertcandtmmethods now namedtc_unsegandtm_unseg. Formernewmethod now callednew_from_single_fields.SpHeader: Renamedfrom_bytestofrom_be_bytes. The function now returns the remaining slice as well.- All CDS specific functionality was moved into the
cdssubmodule of thetimemodule.CdsShortTimeProviderwas renamed toTimeProvider. PR: https://egit.irs.uni-stuttgart.de/rust/spacepackets/pulls/3
SpHeadergetter functionsp_headeradded forPusTcPR: https://egit.irs.uni-stuttgart.de/rust/spacepackets/pulls/6- Added PFC enumerations:
ecss::UnsignedPfcandecss::RealPfc. PR: https://egit.irs.uni-stuttgart.de/rust/spacepackets/pulls/5 - Added
std::error::Errorimplementation for all error enumerations if thestdfeature is enabled. - CUC timestamp implementation as specified in CCSDS 301.0-B-4 section 3.2. PR: https://egit.irs.uni-stuttgart.de/rust/spacepackets/pulls/4/files
- ACII timestamps as specified in CCSDS 301.0-B-4 section 3.5.
- Added MSRV in
Cargo.tomlwith therust-versionfield set to Rust 1.60. serdeSerializeandDeserializeadded to all types.- Added
constconstructors forPacketId,PacketSeqCtrlandSpHeader. - Added
PartialEqandEqderives toTimeProvider. SpHeader: Added serialization function into raw formatwrite_to_be_bytes.- Added 24-bit day field support for CDS short. The bit width is configured at type level
via a generic parameter type passed to the
cds::TimeProvider - Added submillisecond precision support for
cds::TimeProvider
- Small fix for faulty docs.rs build
EcssEnumerationExttrait which implementsDebug,Copy,Clone,PartialEqandEqin addition toEcssEnumeration
EcssEnumerationtrait: Renamewrite_to_bytestowrite_to_be_bytes
- Basic support for ECSS enumeration types for u8, u16, u32 and u64
- Better names for generic error enumerations:
PacketErrorrenamed toByteConversionError - CCSDS module:
sscabbreviations fully replaced by better nameseq_count - Time module:
CcsdsTimeProvider::date_timenow hasOption<DateTime<Utc>>as a returnvalue instead ofDateTime<Utc> PusTcandPusTm:new_from_raw_slicerenamed to simplerfrom_bytes
Initial release with CCSDS Space Packet Primary Header implementation and basic PUS TC and TM implementations.