Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into cfdp-proxy-op-support
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed Aug 17, 2023
2 parents a4e8205 + a566622 commit c56045f
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 17 deletions.
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -19,15 +21,25 @@ 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
for the `put_request` API.

## 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

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tmtccmd/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions tmtccmd/tc/pus_200_fsfw_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
89 changes: 75 additions & 14 deletions tmtccmd/tc/pus_3_fsfw_hk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
import struct
import deprecation
from typing import Tuple

from tmtccmd import __version__
from spacepackets.ecss.tc import PusTelecommand
Expand All @@ -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


Expand All @@ -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(
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit c56045f

Please sign in to comment.