diff --git a/CHANGELOG.md b/CHANGELOG.md index 74c4db2b..bbcfc877 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ Starting from v4.0.0, this project adheres to [Semantic Versioning](http://semve # [unreleased] +# [v6.0.0rc0] + ## Added - The `CfdpParams` config wrapper now has an additional `proxy_op` field. @@ -19,7 +21,10 @@ Starting from v4.0.0, this project adheres to [Semantic Versioning](http://semve ## Changed -- `add_def_proc_and_cfdp_as_subparsers` returns the subparsers now. +- Adapted the FSFW specific Housekeeping service API to make HK requests diagnostic agnostic. + The PUS interface has proven to be cumbersome and problematic, so the split between diagnostic + and regular HK packets has been removed in newer version of the FSFW. The new API reflects that. + The old API is still available by using the `*_with_diag` suffix. - The former `PutRequestCfg` dataclass is now named `PutRequest`. The former `PutRequest` class is now named `PutRequestCfgWrapper` and simply wraps a `CfdpParams` dataclass. - The CFDP source handler expects the `PutRequest` dataclass instead of a CFDP request wrapper now @@ -27,7 +32,14 @@ Starting from v4.0.0, this project adheres to [Semantic Versioning](http://semve ## Removed -- The CFDP source handler `start_cfdp_transaction` API was removed. +- The CFDP source handler `start_cfdp_transaction` API was removed. It was only able to process + put requests in its current form anyway. The `put_request` method is sufficient for now. + +# [v5.0.0] 2023-07-13 + +## Changed + +- `add_def_proc_and_cfdp_as_subparsers` returns the subparsers now. # [v5.0.0rc0] 2023-06-09 diff --git a/release_checklist.md b/release-checklist.md similarity index 100% rename from release_checklist.md rename to release-checklist.md diff --git a/tmtccmd/__init__.py b/tmtccmd/__init__.py index d447f0ed..aa336c34 100644 --- a/tmtccmd/__init__.py +++ b/tmtccmd/__init__.py @@ -1,7 +1,7 @@ """Contains core methods called by entry point files to setup and start a tmtccmd application""" # I think this needs to be in string representation to be parsed so we can't # use a formatted string here. -__version__ = "5.0.0rc0" +__version__ = "5.0.0" import logging import sys diff --git a/tmtccmd/tc/pus_200_fsfw_mode.py b/tmtccmd/tc/pus_200_fsfw_mode.py index 551638ad..07a56d0e 100644 --- a/tmtccmd/tc/pus_200_fsfw_mode.py +++ b/tmtccmd/tc/pus_200_fsfw_mode.py @@ -11,6 +11,8 @@ class Mode(enum.IntEnum): + """Standard modes when commanding objects. These mode IDs are reserved by the FSFW, + so it is recommended to avoid these numbers for custom modes.""" OFF = 0 ON = 1 NORMAL = 2 diff --git a/tmtccmd/tc/pus_3_fsfw_hk.py b/tmtccmd/tc/pus_3_fsfw_hk.py index 0192f91d..244a2bc5 100644 --- a/tmtccmd/tc/pus_3_fsfw_hk.py +++ b/tmtccmd/tc/pus_3_fsfw_hk.py @@ -2,6 +2,7 @@ """ import struct import deprecation +from typing import Tuple from tmtccmd import __version__ from spacepackets.ecss.tc import PusTelecommand @@ -24,18 +25,42 @@ def make_interval(interval_seconds: float) -> bytearray: details="use create... API instead", ) def enable_periodic_hk_command(diag: bool, sid: bytes) -> PusTelecommand: - return create_enable_periodic_hk_command(diag, sid) + return create_enable_periodic_hk_command_with_diag(diag, sid) -def create_enable_periodic_hk_command(diag: bool, sid: bytes) -> PusTelecommand: - return __generate_periodic_hk_command(diag=diag, enable=True, sid=sid) +def create_enable_periodic_hk_command(sid: bytes) -> PusTelecommand: + return __generate_periodic_hk_command(enable=True, sid=sid) -def create_enable_periodic_hk_command_with_interval( +@deprecation.deprecated( + deprecated_in="v6.0.0rc0", + current_version=__version__, + details="use diagnostic agnostic API if possible", +) +def create_enable_periodic_hk_command_with_diag( + diag: bool, sid: bytes +) -> PusTelecommand: + return __generate_periodic_hk_command_legacy(diag=diag, enable=True, sid=sid) + + +@deprecation.deprecated( + deprecated_in="v6.0.0rc0", + current_version=__version__, + details="use diagnostic agnostic API if possible", +) +def create_enable_periodic_hk_command_with_interval_with_diag( diag: bool, sid: bytes, interval_seconds: float -) -> (PusTelecommand, PusTelecommand): - cmd0 = create_modify_collection_interval_cmd(diag, sid, interval_seconds) - cmd1 = __generate_periodic_hk_command(diag=diag, enable=True, sid=sid) +) -> Tuple[PusTelecommand, PusTelecommand]: + cmd0 = create_modify_collection_interval_cmd_with_diag(diag, sid, interval_seconds) + cmd1 = __generate_periodic_hk_command_legacy(diag=diag, enable=True, sid=sid) + return cmd0, cmd1 + + +def create_enable_periodic_hk_command_with_interval( + sid: bytes, interval_seconds: float +) -> Tuple[PusTelecommand, PusTelecommand]: + cmd0 = create_modify_collection_interval_cmd(sid, interval_seconds) + cmd1 = __generate_periodic_hk_command(enable=True, sid=sid) return cmd0, cmd1 @@ -46,12 +71,25 @@ def create_enable_periodic_hk_command_with_interval( ) def enable_periodic_hk_command_with_interval( diag: bool, sid: bytes, interval_seconds: float -) -> (PusTelecommand, PusTelecommand): - return create_enable_periodic_hk_command_with_interval(diag, sid, interval_seconds) +) -> Tuple[PusTelecommand, PusTelecommand]: + return create_enable_periodic_hk_command_with_interval_with_diag( + diag, sid, interval_seconds + ) + +def create_disable_periodic_hk_command(sid: bytes) -> PusTelecommand: + return __generate_periodic_hk_command(enable=False, sid=sid) -def create_disable_periodic_hk_command(diag: bool, sid: bytes) -> PusTelecommand: - return __generate_periodic_hk_command(diag=diag, enable=False, sid=sid) + +@deprecation.deprecated( + deprecated_in="v6.0.0rc0", + current_version=__version__, + details="use diagnostic agnostic API if possible", +) +def create_disable_periodic_hk_command_with_diag( + diag: bool, sid: bytes +) -> PusTelecommand: + return __generate_periodic_hk_command_legacy(diag=diag, enable=False, sid=sid) @deprecation.deprecated( @@ -60,10 +98,19 @@ def create_disable_periodic_hk_command(diag: bool, sid: bytes) -> PusTelecommand details="use create... API instead", ) def disable_periodic_hk_command(diag: bool, sid: bytes) -> PusTelecommand: - return create_disable_periodic_hk_command(diag, sid) + return create_disable_periodic_hk_command_with_diag(diag, sid) + + +def __generate_periodic_hk_command(enable: bool, sid: bytes) -> PusTelecommand: + app_data = bytearray(sid) + if enable: + subservice = Subservice.TC_ENABLE_PERIODIC_HK_GEN + else: + subservice = Subservice.TC_DISABLE_PERIODIC_HK_GEN + return PusTelecommand(service=3, subservice=subservice, app_data=app_data) -def __generate_periodic_hk_command( +def __generate_periodic_hk_command_legacy( diag: bool, enable: bool, sid: bytes ) -> PusTelecommand: app_data = bytearray(sid) @@ -88,10 +135,24 @@ def __generate_periodic_hk_command( def modify_collection_interval( diag: bool, sid: bytes, interval_seconds: float ) -> PusTelecommand: - return create_modify_collection_interval_cmd(diag, sid, interval_seconds) + return create_modify_collection_interval_cmd_with_diag(diag, sid, interval_seconds) def create_modify_collection_interval_cmd( + sid: bytes, interval_seconds: float +) -> PusTelecommand: + app_data = bytearray(sid) + app_data += make_interval(interval_seconds) + subservice = Subservice.TC_MODIFY_PARAMETER_REPORT_COLLECTION_INTERVAL + return PusTelecommand(service=3, subservice=subservice, app_data=app_data) + + +@deprecation.deprecated( + deprecated_in="v6.0.0rc0", + current_version=__version__, + details="use diagnostic agnostic API if possible", +) +def create_modify_collection_interval_cmd_with_diag( diag: bool, sid: bytes, interval_seconds: float ) -> PusTelecommand: app_data = bytearray(sid)