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.
- 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.
FecfProperties
removed, not required anymoreTransferFrame
constructor now expectshas_fecf
boolean parameter which defaults to true. The checksum will be calculated and appended by thepack
method. Theunpack
method expects thehas_fecf
flag 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
unpack
methods now accept bothbytes
andbytearray
- Python 3.8 is not supported anymore as it has reached end-of-life.
MetadataPdu
options have to be specified as an optional list of abstract TLVs now. A new getter methodoptions_as_tlv
can be used to retrieve a list of concrete TLV objects.- All exceptions has an
*Error
suffix now - Removed
exceptions
module in CFDP and moved it to individualdefs
definition modules. The Errors can still be directly imported fromspacepackets.cfdp
orspacepackets.cfdp.tlv
.
CrcError
exception constructor was previously named__int__
by accident.
Renamed PusFileSeqCountProvider
to CcsdsFileSeqCountProvider
but keep old alias.
- New
SpacePacketHeader.tc
andSpacePacketHeader.tm
constructors 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
apid
constructor 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
bytes
type 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_now
renamed tonow
.- The ECSS TMTC APID field must not be set explicitely in the class constructors.
spacepackets.ecss.tm.PUS_TM_TIMESTAMP_OFFSET
constant which can be used as a look-ahead to determine the timestamp length from a raw PUS TM packet.spacepackets.ccsds.CCSDS_HEADER_LEN
constant.
- PUS TC app data setter method.
- New
PusTelecommand
alias/shorthand:PusTc
. - New
SpacePacketHeader
alias/shorthand:SpHeader
. - New
PusTelemetry
alias/shorthand:PusTm
.
- Explicitely disambigute
ByteFieldU<[8, 16, 32, 64]>.from_bytes
fromUnsignedByteField.from_bytes
by 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_int
andByteFieldGenerator.from_bytes
method. These will now raise an exception if the passed value width in not in [1, 2, 4, 8].
- Added
ByteFieldU64
variant. - Added
spacepackets.countdown
utility module. This class was moved fromtmtccmd.util.countdown
and contains theCountdown
class. It was moved here so it can be re-used more easily. - Added
spacepackets.seqcount
utility module. This class was moved fromtmtccmd.util.seqcnt
and contains sequence counter abstractions and concrete implementations. It was moved here so it can be re-used more easily.
- Extended
AbstractSpacePacket
with the following abstract properties:ccsds_version
packet_id
packet_seq_control
- The following properties were added but use the abstract properties:
packet_type
sec_header_flag
seq_flags
- Metadata PDU typing correction.
- More robust
__eq__
implementations which check the type compared against. - Some minor typing corrections.
- The
PusTelecommand
class now implementsAbstractSpacePacket
.
- Directive code for the NAK PDU was set to the ACK PDU directive code.
- Reordered argument order for
FinishedParams
to be in line with the CFDP standard. This might break code not using keyword arguments. - Renamed
FileDeliveryStatus
toFileStatus
to be closer to the CFDP name. - Moved
spacepackets.cfdp.pdu.finished.FileDeliveryStatus
tospacepackets.cfdp.defs.FileStatus
. The new enumeration is also re-exported inspacepackets.cfdp
. - Moved
spacepackets.cfdp.pdu.finished.DeliveryCode
tospacepackets.cfdp.defs.DeliveryCode
. The new enumeration is also re-exported inspacepackets.cfdp
. - Renamed
len
field of CFDP LV tovalue_len
to avoid confusion and for consistency. - Renamed
length
field of CFDP TLV tovalue_len
to avoid confusion and for consistency.
- New
TransactionId
class used for unique identification of CFDP transfers. UnsignedByteField.from_bytes
constructor.DirectoryOperationMessageType
enumeration for CFDP.OriginatingTransactionId
reserved CFDP message abstraction.ProxyPutResponse
reserved CFDP message abstraction.ProxyTransmissionMode
reserved CFDP message abstraction.ProxyClosureRequested
reserved CFDP message abstraction.DirectoryListingRequest
reserved CFDP message abstraction.DirectoryListingResponse
reserved CFDP message abstraction.
- USLP configuration module.
- Added
__repr__
forAckPdu
class. - Added
__repr__
forKeepAlivePdu
class. - Added
__repr__
forPromptPdu
class. - Added a
finished_params
property for theFinishedPdu
class. - Added a
transmission_mode
property for theAbstractPduBase
class. - Renamed
trans_mode
setter and getter properties totransmission_mode
. - Filedata PDU: New
SegmentMetadata
dataclass 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
FileDataParams
dataclass now is composed of anOptional[SegmentMetadata]
.
- Set the
direction
field of the PDU classes correctly depending on the PDU type. This field was previously always set toDirection.TOWARDS_RECEIVER
.
- Moved
pdu_header
abstract property fromAbstractFileDirectiveBase
toAbstractPduBase
class - Renamed
TlvHolder
fieldbase
totlv
andPduHolder
fieldbase
topdu
.
- Added
direction
abstract method forAbstractPduBase
.
- The
parse_space_packets
function analysis queue argument is now expected to be filled on the right side.
- New
ProxyPutRequestParams
dataclass as a generic data model for the CFDP proxy put request parameters. - New API for
ReservedCfdpMessage
get_reserved_cfdp_message_type
: Retrieve type asint
is_cfdp_proxy_operation
get_cfdp_proxy_message_type
get_proxy_put_request_params
to extract proxy put request parameters from the message when applicable.
MessageToUserTlv
: Added new methodto_reserved_msg_tlv
which can be used to create aReservedCfdpMessage
from the instance when applicable.
- Renamed
MessageToUserTlv.is_standard_proxy_dir_ops_msg
tois_reserved_cfdp_message
ProxyPutRequest
constructor now expects aProxyPutRequestParams
instance.- Swapped
FileDataPdu
,KeepAlivePdu
,EofPdu
,FinishedPdu
,PromptPdu
andAckPdu
constructor argument order :PduConfig
is the first parameter now whileFileDataParams
is the second parameter.PduConfig
is the only common parameter, so it makes more sense to have it as the first argument.
- The new
is_reserved_cfdp_message
API 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
TlvTypes
toTlvType
. - Package version is single-sourced using the
importlib.metadata
variant: Thepyproject.toml
now contains the version information, but the informatio can be retrieved at runtime by using the newversion.get_version
API orimportlib.metadata.version("spacepackets")
.
- Added basic low level support for the Proxy Put Request operation.
setup.py
which is not required anymore.
- Moved
CRC16_CCITT_FUNC
fromspacepackets.ecss.crc
tospacepackets.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.spacepackets
parse_space_packets
function: 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 thedeque
properly.
- 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 totmtccmd
package because it is not ECSS generic. - Added first basic
ecss.pus_15_tm_storage
module withSubservice
enum.
- Use custom package discovery in
pyproject.toml
for more robustness.
- The CRC16 function retrieved from
crcmod
is now cached on module level instead of being re-created for every usage. This might yield performance improvements. - Remove
setup.cfg
and fully move topyproject.toml
. Theflake8
config was moved to a.flake8
file.
- The
crc16
property of bothspacepackets.ecss.tc.PusTelecommand
andspacepackets.ecss.tm.PusTelemetry
still was anint
in some cases. It should always be anOptional[bytes]
(size 2) now.
Refactored logging
module usage to be more pythonic.
- New
spacepackets.exceptions
module with new generic exceptionBytesTooShortError
for errors where the object creation from a raw byte stream fails. spacepackets.get_lib_logger
to get access to the library root loggerspacepackets.ecss.tc.PusTelecommand
:empty
constructorspacepackets.ecss.tm.PusTelemetry
:empty
constructor
- (breaking): All
unpack
APIs now consistently expect use thedata
keyword argument - (possibly breaking): The
spacepackets.ecss.tc.PusTelecommand
now throws theInvalidTcCrc16
exception if an invalid CRC16 is detected. - (possibly breaking): The
spacepackets.ecss.tm.PusTelemetry
now throws theInvalidTmCrc16
exception if an invalid CRC16 is detected. - (possibly breaking):
spacepackets.ecss.tc.PusTelecommand
andspacepackets.ecss.tm.PusTelemetry
: Thecalc_crc
keyword argument forpack
has been renamed torecalc_crc
. - (breaking): The
crc16
proprerty will now return aOptional[bytes]
object instead of an integer. PusTmSecondaryHeader.HEADER_SIZE
renamed toPusTmSecondaryHeader.MIN_LEN
to better reflect the header can actually be larger if it includes the timestamp.
spacepackets.cfdp.conf.check_packet_length
spacepackets.log
module.spacepackets.ecss.tc.PusTelecommand
andspacepackets.ecss.tm.PusTelemetry
:valid
property removed. Instead, detection of an invalid CRC will now trigger aInvalidTmCrc16
orInvalidTcCrc16
exception.
- Printer utilities for PUS TMTC classes.
ecss.pus_17_test.Service17Tm
: Remove (optional) PUS version argument forunpack
ccsds.time.CdsShortTimestamp
: Fix for__add__
dunder, use integer division when adding microseconds to MS of day.ccsds.time.CdsShortTimestamp
: Fixed bug inread_from_raw
method where the retrieved CCSDS days were assigned to the UNIX seconds.
- (breaking):
parse_space_packets
: Expects a tuple ofPacketId
s instead of raw integers now which are converted to integers internally. - (breaking):
AbstractPusTm
get_sp_header
renamed tosp_header
and is a property now. - (breaking):
ecss.PusTelemetry
: public membersp_header
is now namedspace_packet_header
to avoid name clash with new property. - (breaking):
SequenceFlags
argument removed fromecss.tc.PusTelecommand
. ECSS specifies this field is always set toSequenceFlags.UNSEGMENTED
.
- New
ecss.PacketFieldU8
,ecss.PacketFieldU16
andecss.PacketFieldU32
helper types. - (breaking):
AbstractPusTm
: Add newtime_provider
abstract property which should returnOptional[CcsdsTimeProvider]
- New
ecss.check_pus_crc
function to check whether a PUS packet in raw format.
CcsdsTimeProvider
: Addlen_packed
, marklen
as deprecatedecss.pus_1_verification
:Service1Tm
:time_provider
needs 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_provider
does 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.datetime
instance returned fromas_date_time
now returns has thedatetime.timezone.utc
set as the time zone information.
CdsShortTimestamp
:- Add new
from_now
classmethod 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_time
to create timestamp fromdatetime.datetime
- Add
ms_of_day
andccsds_days
properties - (breaking):
ms_of_day
staticmethod renamed toms_of_today
- Add
CcsdsTimeProvider
: Renamedas_datetime
toas_date_time
. Old function still there but marked deprecated.- (breaking): The
CcsdsTimeProvider
is 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):
PusServices
renamed toPusService
, not a flag enum. - (breaking):
Service17Tm.unpack
: Time reader needs to be passed explicitely as second argument. - (breaking): Rename
pus_1_verification.Subservices
topus_1_verification.Subservice
- (breaking): Rename
pus_3_hk.Subservices
topus_3_hk.Subservice
- (breaking): Rename
pus_5_event.Subservices
topus_5_event.Subservice
- (breaking): Rename
pus_17_test.Subservices
topus_17_test.Subservice
- Improved Time Handling inside for the TM module, make it possible to use different timestamps
- Introduces
CcsdsTimeProvider
abstraction to allow this. - Improve implementation of
CdsShortTimestamp
class - Basic
AbstractPusTm
class - Basic
AbstractSpacePacket
class - 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
ccsds
module - 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
AbstractPduBase
andAbstractFileDirectiveBase
- Generic
UnsignedByteField
implementation. 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.toml
file for full support, but still keepsetup.cfg
for now - API improvements for PUS Verificator
- Setter properties for sequence count and APID in ECSS module
- Make
as_u32
function ofRequestId
public
- Small bugfix for PUS 1 Step ID unpacking
- Added
PusVerificator
module 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.fields
module which contains thePtc
and various PFC enumerations. Also add a generic abstraction for enumerated fields in form of aPacketFieldEnum
and 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
RequestId
class 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_crc
call and then omit the calculation in thepack
call with an additional argument.
- New Helper objects for CCSDS Space Packet subfields, namely new
PacketId
andPacketSeqCtrl
class - 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
PusServices
enumeration
- 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
bytes
instead ofbytearray
where 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
black
Python formatter - Small tweaks to the NOTICE file