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.31.0 2025-09-10
- Added back PUS-A support for both TCs and TMs
- Make CRC calculation for ECSS PUS-C
unpackclassmethods optional by adding a andunpack_genericclassmethods which allows disabling the checksum validity check spacepackets.ecss.peek_pus_packet_infoto peek the PUS version and SP header from a raw packet- Added support for ECSS TM and ECSS TC modules for no-checksum packets via the
has_checksum,verify_checksumconstructor fields or managed parameters. ManagedParamsdataclass inside theecss.tmmodule which needs to be passed to the genericunapck_genericconstructor.
- Introduced
MiscParamsinside theecss.tmmodule, which replaces and wraps thespacecraft_time_refandpacket_versionparameters. ecss.pus_1_verification.UnpackParamsrenamed toVerificationManagedParams
v0.30.1 2025-07-11
- Migrated from
crcdependency tofastcrcto avoid massive performance on checksum calculations, for example for ECSS TM/TC or for CFDP packet handling. See #118.
v0.30.0 2025-06-23
- Various missing
__hash__impelementations. 113 - EOF PDU constructor can now accept the CRC32 checksum in integer format as well. 114
- Replaced
crcmoddependency bycrcfor checksum calculation 112
v0.29.0 2025-05-23
- CCSDS TM Frame impelementation. 109
- Bugfix for USLP VCF count handling. 107
v0.28.0 2025-02-10
- Improved the space packet parser API: The
parse_space_packetsfunction simply expects a byte buffer and returns results and useful context information inside aParseResultstructure. The formerparse_space_packetswas renamed toparse_space_packets_from_dequeand now treats the provideddequeread-only.
- USLP implementation: FECF is fixed to 2 bytes and always uses the standard CRC16 CCITT checksum
calculation now. Consequently, the USLP API was adapted and simplified.
FecfPropertiesremoved, not required anymoreTransferFrameconstructor now expectshas_fecfboolean parameter which defaults to true. The checksum will be calculated and appended by thepackmethod. Theunpackmethod expects thehas_fecfflag now as well and will perform a CRC16 calculation when the flag is set to True.
- Unpacking / re-packing was buggy for some file directives when the PDU checksum was activated.
This was fixed for the following PDUs:
- NAK
- EOF
- File Data
- Metadata
- Finished
- Typing improvements: Most raw byte APIs like
unpackmethods now accept bothbytesandbytearray
- Python 3.8 is not supported anymore as it has reached end-of-life.
MetadataPduoptions have to be specified as an optional list of abstract TLVs now. A new getter methodoptions_as_tlvcan be used to retrieve a list of concrete TLV objects.- All exceptions has an
*Errorsuffix now - Removed
exceptionsmodule in CFDP and moved it to individualdefsdefinition modules. The Errors can still be directly imported fromspacepackets.cfdporspacepackets.cfdp.tlv.
CrcErrorexception constructor was previously named__int__by accident.
Renamed PusFileSeqCountProvider to CcsdsFileSeqCountProvider but keep old alias.
- New
SpacePacketHeader.tcandSpacePacketHeader.tmconstructors which set the packet type correctly
- Custom
EntityIdTlv__eq__implementation which only compares the numerical value of the entity ID TLVs
AbstractTlvBase__repr__implementation
- The
apidconstructor arguments for the PUS TMTC constructors now have a default value of 0. This allows setting the APID in a centralized manner for APID groups and can reduce duplication.
- Global configuration module for TC and TM APID was removed.
- ECSS PUS telemetry time handling is now more generic and low level: Constructors expect
a simple
bytestype while unpackers/readers expect the length of the timestamp. A helper constant for the offset of the timestamp is exposed which can help with determining the length of the timestamp. CdsShortTimestamp.from_nowrenamed tonow.- The ECSS TMTC APID field must not be set explicitely in the class constructors.
spacepackets.ecss.tm.PUS_TM_TIMESTAMP_OFFSETconstant which can be used as a look-ahead to determine the timestamp length from a raw PUS TM packet.spacepackets.ccsds.CCSDS_HEADER_LENconstant.
- PUS TC app data setter method.
- New
PusTelecommandalias/shorthand:PusTc. - New
SpacePacketHeaderalias/shorthand:SpHeader. - New
PusTelemetryalias/shorthand:PusTm.
- Explicitely disambigute
ByteFieldU<[8, 16, 32, 64]>.from_bytesfromUnsignedByteField.from_bytesby renaming them toByteFieldU<[8, 16, 32, 64].from_<[8, 16, 32, 64]>_bytes. This might break calling code which might now callUnsignedByteField.from_bytes. - Improve
ByteFieldGenerator.from_intandByteFieldGenerator.from_bytesmethod. These will now raise an exception if the passed value width in not in [1, 2, 4, 8].
- Added
ByteFieldU64variant. - Added
spacepackets.countdownutility module. This class was moved fromtmtccmd.util.countdownand contains theCountdownclass. It was moved here so it can be re-used more easily. - Added
spacepackets.seqcountutility module. This class was moved fromtmtccmd.util.seqcntand contains sequence counter abstractions and concrete implementations. It was moved here so it can be re-used more easily.
- Extended
AbstractSpacePacketwith the following abstract properties:ccsds_versionpacket_idpacket_seq_control- The following properties were added but use the abstract properties:
packet_typesec_header_flagseq_flags
- Metadata PDU typing correction.
- More robust
__eq__implementations which check the type compared against. - Some minor typing corrections.
- The
PusTelecommandclass now implementsAbstractSpacePacket.
- Directive code for the NAK PDU was set to the ACK PDU directive code.
- Reordered argument order for
FinishedParamsto be in line with the CFDP standard. This might break code not using keyword arguments. - Renamed
FileDeliveryStatustoFileStatusto be closer to the CFDP name. - Moved
spacepackets.cfdp.pdu.finished.FileDeliveryStatustospacepackets.cfdp.defs.FileStatus. The new enumeration is also re-exported inspacepackets.cfdp. - Moved
spacepackets.cfdp.pdu.finished.DeliveryCodetospacepackets.cfdp.defs.DeliveryCode. The new enumeration is also re-exported inspacepackets.cfdp. - Renamed
lenfield of CFDP LV tovalue_lento avoid confusion and for consistency. - Renamed
lengthfield of CFDP TLV tovalue_lento avoid confusion and for consistency.
- New
TransactionIdclass used for unique identification of CFDP transfers. UnsignedByteField.from_bytesconstructor.DirectoryOperationMessageTypeenumeration for CFDP.OriginatingTransactionIdreserved CFDP message abstraction.ProxyPutResponsereserved CFDP message abstraction.ProxyTransmissionModereserved CFDP message abstraction.ProxyClosureRequestedreserved CFDP message abstraction.DirectoryListingRequestreserved CFDP message abstraction.DirectoryListingResponsereserved CFDP message abstraction.
- USLP configuration module.
- Added
__repr__forAckPduclass. - Added
__repr__forKeepAlivePduclass. - Added
__repr__forPromptPduclass. - Added a
finished_paramsproperty for theFinishedPduclass. - Added a
transmission_modeproperty for theAbstractPduBaseclass. - Renamed
trans_modesetter and getter properties totransmission_mode. - Filedata PDU: New
SegmentMetadatadataclass for better modelling of the filedata PDU. - Filedata PDU: New API to retrieve the maximum allowed file segment size for a given maximum packet size.
- NAK PDU: New API to retrieve the maximum amount of segment requests for a given maximum packet size.
- Filedata PDU: The
FileDataParamsdataclass now is composed of anOptional[SegmentMetadata].
- Set the
directionfield of the PDU classes correctly depending on the PDU type. This field was previously always set toDirection.TOWARDS_RECEIVER.
- Moved
pdu_headerabstract property fromAbstractFileDirectiveBasetoAbstractPduBaseclass - Renamed
TlvHolderfieldbasetotlvandPduHolderfieldbasetopdu.
- Added
directionabstract method forAbstractPduBase.
- The
parse_space_packetsfunction analysis queue argument is now expected to be filled on the right side.
- New
ProxyPutRequestParamsdataclass as a generic data model for the CFDP proxy put request parameters. - New API for
ReservedCfdpMessageget_reserved_cfdp_message_type: Retrieve type asintis_cfdp_proxy_operationget_cfdp_proxy_message_typeget_proxy_put_request_paramsto extract proxy put request parameters from the message when applicable.
MessageToUserTlv: Added new methodto_reserved_msg_tlvwhich can be used to create aReservedCfdpMessagefrom the instance when applicable.
- Renamed
MessageToUserTlv.is_standard_proxy_dir_ops_msgtois_reserved_cfdp_message ProxyPutRequestconstructor now expects aProxyPutRequestParamsinstance.- Swapped
FileDataPdu,KeepAlivePdu,EofPdu,FinishedPdu,PromptPduandAckPduconstructor argument order :PduConfigis the first parameter now whileFileDataParamsis the second parameter.PduConfigis the only common parameter, so it makes more sense to have it as the first argument.
- The new
is_reserved_cfdp_messageAPI now checks for a value length of 5 to ensure the message type is included as well.
- Bumped required Python version to v3.8.
- Renamed
TlvTypestoTlvType. - Package version is single-sourced using the
importlib.metadatavariant: Thepyproject.tomlnow contains the version information, but the informatio can be retrieved at runtime by using the newversion.get_versionAPI orimportlib.metadata.version("spacepackets").
- Added basic low level support for the Proxy Put Request operation.
setup.pywhich is not required anymore.
- Moved
CRC16_CCITT_FUNCfromspacepackets.ecss.crctospacepackets.crc. This checksum is not just used by PUS, but by the CCSDS TC and the CFDP standard as well.
- Checksum and PDU length checks when creating PDUs from a raw buffer.
- CRC flag support for CFDP.
- Bugfix in
ccsds.spacepacketsparse_space_packetsfunction: If a broken packet was detected and the current parsing index was larger than 0, the broken packet was not detected and re-inserted into thedequeproperly.
- Important bugfix in CFDP PDU header format: The entity length field and the transaction sequence number length field stored the actual length of the field instead of the length minus 1 like specified in the CFDP standard.
- Removed
ecss.pus_5_event.Severity, moved totmtccmdpackage because it is not ECSS generic. - Added first basic
ecss.pus_15_tm_storagemodule withSubserviceenum.
- Use custom package discovery in
pyproject.tomlfor more robustness.
- The CRC16 function retrieved from
crcmodis now cached on module level instead of being re-created for every usage. This might yield performance improvements. - Remove
setup.cfgand fully move topyproject.toml. Theflake8config was moved to a.flake8file.
- The
crc16property of bothspacepackets.ecss.tc.PusTelecommandandspacepackets.ecss.tm.PusTelemetrystill was anintin some cases. It should always be anOptional[bytes](size 2) now.
Refactored logging module usage to be more pythonic.
- New
spacepackets.exceptionsmodule with new generic exceptionBytesTooShortErrorfor errors where the object creation from a raw byte stream fails. spacepackets.get_lib_loggerto get access to the library root loggerspacepackets.ecss.tc.PusTelecommand:emptyconstructorspacepackets.ecss.tm.PusTelemetry:emptyconstructor
- (breaking): All
unpackAPIs now consistently expect use thedatakeyword argument - (possibly breaking): The
spacepackets.ecss.tc.PusTelecommandnow throws theInvalidTcCrc16exception if an invalid CRC16 is detected. - (possibly breaking): The
spacepackets.ecss.tm.PusTelemetrynow throws theInvalidTmCrc16exception if an invalid CRC16 is detected. - (possibly breaking):
spacepackets.ecss.tc.PusTelecommandandspacepackets.ecss.tm.PusTelemetry: Thecalc_crckeyword argument forpackhas been renamed torecalc_crc. - (breaking): The
crc16proprerty will now return aOptional[bytes]object instead of an integer. PusTmSecondaryHeader.HEADER_SIZErenamed toPusTmSecondaryHeader.MIN_LENto better reflect the header can actually be larger if it includes the timestamp.
spacepackets.cfdp.conf.check_packet_lengthspacepackets.logmodule.spacepackets.ecss.tc.PusTelecommandandspacepackets.ecss.tm.PusTelemetry:validproperty removed. Instead, detection of an invalid CRC will now trigger aInvalidTmCrc16orInvalidTcCrc16exception.
- Printer utilities for PUS TMTC classes.
ecss.pus_17_test.Service17Tm: Remove (optional) PUS version argument forunpackccsds.time.CdsShortTimestamp: Fix for__add__dunder, use integer division when adding microseconds to MS of day.ccsds.time.CdsShortTimestamp: Fixed bug inread_from_rawmethod where the retrieved CCSDS days were assigned to the UNIX seconds.
- (breaking):
parse_space_packets: Expects a tuple ofPacketIds instead of raw integers now which are converted to integers internally. - (breaking):
AbstractPusTmget_sp_headerrenamed tosp_headerand is a property now. - (breaking):
ecss.PusTelemetry: public membersp_headeris now namedspace_packet_headerto avoid name clash with new property. - (breaking):
SequenceFlagsargument removed fromecss.tc.PusTelecommand. ECSS specifies this field is always set toSequenceFlags.UNSEGMENTED.
- New
ecss.PacketFieldU8,ecss.PacketFieldU16andecss.PacketFieldU32helper types. - (breaking):
AbstractPusTm: Add newtime_providerabstract property which should returnOptional[CcsdsTimeProvider] - New
ecss.check_pus_crcfunction to check whether a PUS packet in raw format.
CcsdsTimeProvider: Addlen_packed, marklenas deprecatedecss.pus_1_verification:Service1Tm:time_providerneeds to be passed explicitely now, no default value.
ecss.tm.PusTelemetry: Various fixes for new optional timestamp feature, added checks that timestamp is not None.time_providerdoes not have a default value anymore and needs to be passed explicitely.CdsShortTimestamp: The newfrom_now(and formerfrom_current_time) classmehod now creates the timestamp from a UTC datetime.CdsShortTimestamp: Thedatetime.datetimeinstance returned fromas_date_timenow returns has thedatetime.timezone.utcset as the time zone information.
CdsShortTimestamp:- Add new
from_nowclassmethod and deprecatefrom_current_time. - Add
__eq__implementation which only compares CCSDS days and ms of day.
- Add new
CdsShortTimestamp- Add
__add__magic method impl which allows adding timedeltas (but only timedeltas) - Add new constructor
from_date_timeto create timestamp fromdatetime.datetime - Add
ms_of_dayandccsds_daysproperties - (breaking):
ms_of_daystaticmethod renamed toms_of_today
- Add
CcsdsTimeProvider: Renamedas_datetimetoas_date_time. Old function still there but marked deprecated.- (breaking): The
CcsdsTimeProvideris now optional for the ECSS TM packet constructors, but needs to be supplied explicitely. There is no automatic construction of a specific version of the CDS timestamp with 16 bit days anymore if no time provider is passed. If this behaviour is still required,CdsShortTimestamp.empty()can be passed explicitely. If not time provider is passed, it is assumed the time field is empty. - (breaking):
PusServicesrenamed toPusService, not a flag enum. - (breaking):
Service17Tm.unpack: Time reader needs to be passed explicitely as second argument. - (breaking): Rename
pus_1_verification.Subservicestopus_1_verification.Subservice - (breaking): Rename
pus_3_hk.Subservicestopus_3_hk.Subservice - (breaking): Rename
pus_5_event.Subservicestopus_5_event.Subservice - (breaking): Rename
pus_17_test.Subservicestopus_17_test.Subservice
- Improved Time Handling inside for the TM module, make it possible to use different timestamps
- Introduces
CcsdsTimeProviderabstraction to allow this. - Improve implementation of
CdsShortTimestampclass - Basic
AbstractPusTmclass - Basic
AbstractSpacePacketclass - Singular enum names for CFPD module
- Refactored and improved TLV API and handling. Implementation is also a bit more efficient
- Basic CFDP version support: Sanity checks on version field. Only version 2 supported
- Improved documentation, first docstrings
- Added more re-exports, for example for the
ccsdsmodule - Added several dunder method implementations, especially
__repr__,__str__and__eq__ - Improved CFDP packet stack API, several improvements derived from the implementation of a CFDP handler using it
- Added generic abstraction for CFDP File Data and File Directive PDUs in form of the
AbstractPduBaseandAbstractFileDirectiveBase - Generic
UnsignedByteFieldimplementation. This is a data structure which is regularly used for something like variable sized identifier fields. It provides a lot of boilerplate code like common dunder implementations - Split up and improve test structure a bit
- Update
pyproject.tomlfile for full support, but still keepsetup.cfgfor now - API improvements for PUS Verificator
- Setter properties for sequence count and APID in ECSS module
- Make
as_u32function ofRequestIdpublic
- Small bugfix for PUS 1 Step ID unpacking
- Added
PusVerificatormodule which can track the verification status of sent telecommands - Added several magic method implementations, notably
__eq__and__hash__where applicable - Removed PUS A support completely. PUS A is relatively old, and specialicing on one packet version makes the code a lot simpler
- Added
ecss.fieldsmodule which contains thePtcand various PFC enumerations. Also add a generic abstraction for enumerated fields in form of aPacketFieldEnumand aPacketFieldBase. This is useful to have an abstraction for the various PUS standard packet fields which can have variable sizes
- Minor name change for PUS 17 and PUS 1 TM classes
- New
RequestIdclass to encapsulate the field used by the PUS 1 Verification service - Update CRC16 handling for TMTC PUS classes. It is possible to calculate the CRC16
manually with a dedicated
calc_crccall and then omit the calculation in thepackcall with an additional argument.
- New Helper objects for CCSDS Space Packet subfields, namely new
PacketIdandPacketSeqCtrlclass - Remove PUS A support for PUS telecommands
- Added multiple
__str__and__repr__implementations where applicable - API simplification, shorter or better keywords for PUS TM and PUS TC constructor calls
- API improvements, bugfix and general improvements for CCSDS spacepacket header implementation
- Named value for fetching global APID
- Update
PusServicesenumeration
- Added subservice enumerations for generic PUS Services 1, 3, 5 and 17
- Improvement for API of PUS TM1 and PUS TM17 base classes
- Fix in size pre-check of space packet parser
parse_space_packets
- Add packet sizes in
__str__method of PUS TM and TC - Some type corrections: Expect
bytesinstead ofbytearraywhere applicable
- Unified Space Data Link Protocol Packet implementations
- Assign default print format in TM and TC implementation
- Important bugfix in space packet parser implementation
- Maximum TC packet size configurable now, will be checked when packaging TC packets. Default maximum size is 1004 bytes for now
- Smaller tweaks for CFDP
- Applied formatting with the
blackPython formatter - Small tweaks to the NOTICE file