Compare commits
310 Commits
v5.0.0
...
clean-up-e
Author | SHA1 | Date | |
---|---|---|---|
dc37a29d34
|
|||
d33013ed58 | |||
7e39a481bd | |||
4744de8a54 | |||
916ce92bdc | |||
bb765ac8a0 | |||
84f0f42783 | |||
ee2dade270 | |||
4f26c34c60 | |||
b5ae7c5f38 | |||
caaf937003
|
|||
1831ea8b7a
|
|||
747ad34eec
|
|||
2789453d57 | |||
5456d79965
|
|||
4c54aa7586 | |||
1a132684a6 | |||
f63a834d9a | |||
58def42281
|
|||
ee955e96fb
|
|||
97fb8a166f | |||
d477242881 | |||
451c2c07ee | |||
8de88127c3 | |||
e7e97ff2d3 | |||
35e3f8b572 | |||
77010937b8 | |||
c1f4a3f59d | |||
74e55b16dc | |||
f1f4a1e9a0
|
|||
40aa648e6b | |||
098843a74f
|
|||
1ea255d3e8 | |||
b1caaff672
|
|||
3b047094e6 | |||
56ebfb1000 | |||
a41dc9b691 | |||
1d121c40b2 | |||
0a417a89e9 | |||
7abce63a56 | |||
af24a95475 | |||
6ea3312b62 | |||
d7e61f1395 | |||
51227100af | |||
fc243b76cf
|
|||
62b16028e6
|
|||
4ae659cb4e
|
|||
228065bf3b
|
|||
1508acb7ae | |||
2642a772ad | |||
7c94ab3404 | |||
38b3166b3f | |||
e285ac1c47 | |||
534d0dc1af
|
|||
07b13c153d | |||
aad725a4e5 | |||
fd714a118d | |||
4446e471d9
|
|||
6a8f48c493
|
|||
0f6e7eb159
|
|||
c4bd355146 | |||
92fe9d92de
|
|||
99c6c8bbd0
|
|||
26552ebeca | |||
76e80c259c | |||
f59c2b9a9e | |||
bf3565f497 | |||
7f119f36d2 | |||
18728731ed | |||
14334dae92
|
|||
0aaf63215b | |||
72460fdb49
|
|||
b08f9d9af6
|
|||
66c1895cd0
|
|||
4e56bd172e | |||
ff73746935
|
|||
5821c60eb4
|
|||
2ca7bc5a70
|
|||
d9530271c3
|
|||
97b529318d
|
|||
c4598ff058
|
|||
b3d903115e | |||
6420bd162a | |||
9680066d0a | |||
d5e923233b | |||
d0b857dfb7 | |||
0c4ab25421 | |||
84f50bab83
|
|||
43d6b98695 | |||
4b7debacc6 | |||
97f99415d6 | |||
c195d03b2e
|
|||
8f8bcde90e | |||
d38fc53701 | |||
e4bc424093 | |||
5a87a17fa2 | |||
9567146ff8
|
|||
b45b0b2271
|
|||
d900a689da
|
|||
70c3f9dcaa
|
|||
9a1a686b9e
|
|||
e18ec86eca
|
|||
f52f4b1ce2 | |||
ad530925d5 | |||
c12dfd06d8 | |||
728b7c647c
|
|||
a5e38a6856
|
|||
f400dea799
|
|||
6bd94cc167
|
|||
7a664eeab8
|
|||
dbfe1dc0d5 | |||
0747b6aa72 | |||
d388676678
|
|||
4b6887e304 | |||
60f7ae5453
|
|||
10e163be75
|
|||
84df438e9d
|
|||
e249f147bc | |||
d5118f0f98
|
|||
39e6a04889
|
|||
eb697befe3
|
|||
0bce6a506c | |||
dcae930895
|
|||
28716209a3 | |||
012e9b148e
|
|||
34a3a67ac7 | |||
aba369f11f
|
|||
1123c4d4df
|
|||
7cd1b0070a
|
|||
ec8febf623
|
|||
c10a926b9f | |||
9711dd9242
|
|||
d82cecbe6e | |||
14820d63ac
|
|||
3d27711abb
|
|||
1d5db0951e
|
|||
d67987745d | |||
bde03fc9c0
|
|||
be1ac09515 | |||
f0860a785d
|
|||
ead9c20888
|
|||
d1fde6f1e5 | |||
caa843fb1a | |||
11f7ed8436 | |||
88b0c33632 | |||
0c4762712b
|
|||
dd74f6c3ca | |||
783bdd297a
|
|||
bf399c3d91 | |||
06a058fc4d
|
|||
b464182df7
|
|||
a30bccc995
|
|||
980242404a
|
|||
a8545211e8
|
|||
fe439b4d3c | |||
f63f4b9193
|
|||
8d28b321d4
|
|||
8b45dd8bff
|
|||
b20abc5bfb | |||
af1474f10c
|
|||
66db12796b
|
|||
2d08fc0bfa
|
|||
9edc819a97
|
|||
d23cc6834a | |||
33cff5e2d2
|
|||
acbcbbe98f
|
|||
c3b0470aa6
|
|||
1860b754ce
|
|||
68138c6e79
|
|||
e56f8732be | |||
af5e81158c
|
|||
baa1d20556 | |||
1faecb09de
|
|||
1ad621e630
|
|||
5fc3d8de99
|
|||
224328cc85
|
|||
d285b1caec | |||
1f49f0c70d
|
|||
649deac81b
|
|||
7fa1196633
|
|||
1b0a7aeabd
|
|||
412d67494d
|
|||
25377ccfa2
|
|||
6657bf072c
|
|||
7f79ef6c12
|
|||
d72b7d9d66
|
|||
c687b1411c
|
|||
c2bed714dc
|
|||
f9f8f9481f
|
|||
8d6ca602f2
|
|||
c0bd5f572c
|
|||
25c7decb1e
|
|||
cc7b1d3331
|
|||
948f3a1a41
|
|||
8743f59b56
|
|||
2cc4a18c1e | |||
b1fbad39e3 | |||
de57b9da5b | |||
55624f0447 | |||
9841076699
|
|||
f1876681fd | |||
14b558b7f7
|
|||
54a7c3566f
|
|||
011be9837e
|
|||
88161ed125
|
|||
f02230804d | |||
8ddcc37c74 | |||
b50c75c13c | |||
36799ef51d
|
|||
772ef5b323
|
|||
2f8bed4581
|
|||
72def77d40
|
|||
bc1a1774a6 | |||
4b08f5dd5b
|
|||
b0562ea9c7
|
|||
f76cd94535
|
|||
8a1e5b7b99
|
|||
0e208629b0
|
|||
403657110b
|
|||
23f21b40eb | |||
a6b3ccb4cc
|
|||
d7b494a950
|
|||
73bc043538
|
|||
02e7e809de
|
|||
d6f6aff139 | |||
d39a49bd4c | |||
f42318bc57 | |||
fd3a799019 | |||
1664e6adb5 | |||
8042f3607d
|
|||
59278447fd | |||
b58977fd65 | |||
beae6b3f05 | |||
12c60ac310 | |||
1acbb8bb43 | |||
051e9e6ffb | |||
6d88746ec3 | |||
5571a6852e | |||
1ddb93410e | |||
b0b186ac1f | |||
f95331742b | |||
c91ad9e08b | |||
fcabaa5b09 | |||
bf9ab7edf7 | |||
957d756d1e | |||
4b054b7628 | |||
9001a28545
|
|||
6b2fbc6917 | |||
ab770a0057 | |||
0cbf28f25c
|
|||
cbcc06ede7 | |||
a55aa4a667
|
|||
d2324dace9
|
|||
1e4e524f95
|
|||
39d6ec73c2 | |||
74cfa2949a
|
|||
ffdb4451f6
|
|||
15716c988b | |||
f5ec50b674 | |||
02b70ee203 | |||
95b6954175 | |||
a82cbff5a8
|
|||
87b766dfb8
|
|||
09b7a01ff6 | |||
fd6b76bfdd
|
|||
40c086086b
|
|||
83e8fe0587 | |||
6cffae4397
|
|||
d73ef3a314
|
|||
0b8bd61e80 | |||
380a02ee94
|
|||
c6e2e2de49 | |||
6479aeda63 | |||
26cf112121 | |||
62bd535622
|
|||
eea7683581 | |||
df6aa80169
|
|||
2fd1a46e66
|
|||
2153aa2842
|
|||
1f2f2aac13
|
|||
9be81f1725 | |||
601adfc9c2 | |||
ac84ac2c3e | |||
7ed18bd570 | |||
e27ad147d4
|
|||
ba47757b50
|
|||
7e9c626ec8
|
|||
8d6dd97d85
|
|||
2fae5613ce
|
|||
fdb14cbdc5
|
|||
0cef3fa924
|
|||
37a35c4446
|
|||
15d25b4c5b
|
|||
069f84d220 | |||
627a16d51a | |||
fcfae1f67f | |||
01ebd356ba | |||
5785bbd0cc
|
|||
d3e6101447
|
|||
6d5bde40db
|
|||
c48f04eed5
|
|||
18304c31fa | |||
8caa408cbd | |||
4a983958bf | |||
03ec5bdc39 | |||
9c5d6a15db | |||
ddc80071e0 | |||
deb0275bb5
|
|||
ec0ebc3653
|
|||
0a05873f4e |
18
.flake8
18
.flake8
@ -1,18 +0,0 @@
|
||||
[flake8]
|
||||
max-line-length = 100
|
||||
ignore = D203, W503
|
||||
per-file-ignores =
|
||||
*/__init__.py: F401
|
||||
exclude =
|
||||
.git,
|
||||
__pycache__,
|
||||
docs/conf.py,
|
||||
deps
|
||||
old,
|
||||
build,
|
||||
dist,
|
||||
venv
|
||||
max-complexity = 10
|
||||
extend-ignore =
|
||||
# See https://github.com/PyCQA/pycodestyle/issues/373
|
||||
E203,
|
24
.run/CFDP Downlink Test Large.run.xml
Normal file
24
.run/CFDP Downlink Test Large.run.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="CFDP Downlink Test Large" type="PythonConfigurationType" factoryName="Python" folderName="CFDP">
|
||||
<module name="tmtc" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
|
||||
<option name="PARAMETERS" value="cfdp -p /tmp/obsw_update.bin /tmp/obsw_update_copy.bin -d 0.1" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="false" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
24
.run/CFDP Downlink Test Larger.run.xml
Normal file
24
.run/CFDP Downlink Test Larger.run.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="CFDP Downlink Test Larger" type="PythonConfigurationType" factoryName="Python" folderName="CFDP">
|
||||
<module name="tmtc" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
|
||||
<option name="PARAMETERS" value="cfdp -p /tmp/fake_5kb.bin /tmp/fake_5kb_copy.bin -d 0.1" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="false" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
24
.run/CFDP Downlink Test.run.xml
Normal file
24
.run/CFDP Downlink Test.run.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="CFDP Downlink Test" type="PythonConfigurationType" factoryName="Python" folderName="CFDP">
|
||||
<module name="tmtc" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
|
||||
<option name="PARAMETERS" value="cfdp -p /tmp/hello.txt /tmp/hello2.txt -d 0.1" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="false" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
154
CHANGELOG.md
154
CHANGELOG.md
@ -10,7 +10,159 @@ list yields a list of all related PRs for each release.
|
||||
|
||||
# [unreleased]
|
||||
|
||||
# [v5.0.0]
|
||||
# [v5.13.0] 2024-01-30
|
||||
|
||||
## Added
|
||||
|
||||
- Added new parameter commands for PLOC MPSoC to skip SUPV commanding.
|
||||
|
||||
# [v5.12.1] 2023-12-13
|
||||
|
||||
## Added
|
||||
|
||||
- A few new commands to test the TC scheduler.
|
||||
|
||||
# [v5.12.0] 2023-12-06
|
||||
|
||||
## Added
|
||||
|
||||
- New ACS controller commands.
|
||||
|
||||
# [v5.11.0] 2023-11-30
|
||||
|
||||
## Added
|
||||
|
||||
- Added new commands to disable channel order checks partially for the payload PCDU normal modes.
|
||||
- Core controller auto switch enable and disable command.
|
||||
- Star Tracker JSON reload command. Reboot still required.
|
||||
- PLOC SUPV ADC and Counters report TM handling.
|
||||
|
||||
# [v5.10.1] 2023-10-27
|
||||
|
||||
- Minor improvements, update event translation.
|
||||
|
||||
# [v5.10.0] 2023-10-27
|
||||
|
||||
- Added new STR commands to allow more debugging.
|
||||
|
||||
# [v5.9.0] 2023-10-24
|
||||
|
||||
## Added
|
||||
|
||||
- Added command to update PL PCDU I and V parameter bounds commands.
|
||||
|
||||
# [v5.8.0] 2023-10-11
|
||||
|
||||
## Added
|
||||
|
||||
- Xiphos WDT enable and disable command.
|
||||
|
||||
# [v5.7.1] 2023-10-11
|
||||
|
||||
## Added
|
||||
|
||||
- SCEX normal command
|
||||
|
||||
# [v5.7.0] 2023-10-10
|
||||
|
||||
- `tmtccmd` v6.0.0
|
||||
- `spacepackets` v18.0.0
|
||||
|
||||
## Added
|
||||
|
||||
- Power controller commands.
|
||||
|
||||
# [v5.6.0] 2023-09-14
|
||||
|
||||
- `tmtccmd` v6.0.0
|
||||
- `spacepackets` v18.0.0
|
||||
|
||||
## Added
|
||||
|
||||
- CFDP file downlink support.
|
||||
|
||||
# [v5.5.1] 2023-09-12
|
||||
|
||||
## Fixed
|
||||
|
||||
- Some API usage fixes related to `tmtccmd` update.
|
||||
|
||||
# [v5.5.0] 2023-09-12
|
||||
|
||||
- Version is not specfied dynamically anymore and can be updated in `pyproject.toml`
|
||||
- New events and returnvalues
|
||||
- Bump `tmtccmd` to v6.0.0rc0
|
||||
|
||||
# [v5.4.3] 2023-08-15
|
||||
|
||||
## Added
|
||||
|
||||
- PLOC SUPV HK parsing.
|
||||
|
||||
# [v5.4.2] 2023-08-15
|
||||
|
||||
## Added
|
||||
|
||||
- New NONE entry for PL PCDU submode enum.
|
||||
|
||||
# [v5.4.1] 2023-08-15
|
||||
|
||||
## Added
|
||||
|
||||
- New event TLE_TOO_OLD
|
||||
|
||||
## Changed
|
||||
|
||||
- PL Subsystem mode ID is int enum now.
|
||||
|
||||
# [v5.4.0] 2023-08-15
|
||||
|
||||
## Added
|
||||
|
||||
- New enumeration for PL PCDU commanding.
|
||||
- Some new events
|
||||
|
||||
# [v5.3.1] 2023-07-26
|
||||
|
||||
## Changed
|
||||
|
||||
- Adaptions for ACS CTRL strategy enum to make it compatible to software. Also make it re-usable
|
||||
by putting it in global scope.
|
||||
|
||||
# [v5.3.0] 2023-07-26
|
||||
|
||||
## Added
|
||||
|
||||
- Dataset handling for new ACS fused rot rate dataset.
|
||||
|
||||
# [v5.2.0] 2023-07-13
|
||||
|
||||
- `tmtccmd` v5.0.0
|
||||
|
||||
## Added
|
||||
|
||||
- New TCS controller events
|
||||
|
||||
## Changed
|
||||
|
||||
- HK level can be specified as CLI argument now.
|
||||
|
||||
# [v5.1.0] 2023-06-28
|
||||
|
||||
## Added
|
||||
|
||||
- Internal error reporter dataset handling.
|
||||
|
||||
## Fixed
|
||||
|
||||
- `APP_LOGGER` is the root logger now.
|
||||
|
||||
## Changed
|
||||
|
||||
- HK is only displayed in brief format per default now. This will soon be adaptable by CLI
|
||||
argument.
|
||||
|
||||
# [v5.0.0] 2023-06-22
|
||||
|
||||
## Changed
|
||||
|
||||
|
43
README.md
43
README.md
@ -4,7 +4,7 @@ This application can be used to test the EIVE On-Board Software. Furthermore, it
|
||||
also be used to retrieve all sorts of telemetry data like housekeeping data.
|
||||
|
||||
It is recommended to use this application with a virtual environment.
|
||||
The [virtual environemnt](#venv) chapter describes how to set one up. The [requirements](#reqs)
|
||||
The [virtual environment](#venv) chapter describes how to set one up. The [requirements](#reqs)
|
||||
describes how to install all required packages.
|
||||
|
||||
The configuration file can currently be found at `tmtc_conf.json`. It caches settings
|
||||
@ -61,42 +61,57 @@ Run GUI mode
|
||||
# <a id="reqs"></a> Install requirements
|
||||
|
||||
There are two ways to install the requirements. One is to install the primary dependency
|
||||
`tmtccmd` interactively. This is the recommended way
|
||||
`tmtccmd` interactively.
|
||||
|
||||
Assuming you are running in a virtual environment:
|
||||
## Installing via PyPI
|
||||
|
||||
1. Install `tmtccmd` for virtual environment. `-e` for interactive installation.
|
||||
It is recommended to install `eive-tmtc` itself interactively, which also installs
|
||||
all required dependencies.
|
||||
|
||||
```sh
|
||||
cd deps/tmtccmd
|
||||
pip install -e .[gui]
|
||||
```
|
||||
```sh
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
Alternatively you can also install the packages from PyPI completely, but the risk of
|
||||
incompatibilities will be high there
|
||||
If you only want to install all dependencies:
|
||||
|
||||
```sh
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## Install interactively
|
||||
|
||||
Clone the dependency first inside the `deps` folder
|
||||
|
||||
```sh
|
||||
cd deps
|
||||
./install_tmtccmd.sh
|
||||
```
|
||||
|
||||
Then you can install `tmtccmd` interactively
|
||||
|
||||
```sh
|
||||
cd tmtccmd
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
# Run Linter
|
||||
|
||||
Can be used to quickly check validity of script. Install `flake8` first
|
||||
|
||||
```sh
|
||||
python3 -m pip install flake8
|
||||
python3 -m pip install ruff
|
||||
```
|
||||
|
||||
or on Windows
|
||||
|
||||
```sh
|
||||
py -m pip install flake8
|
||||
py -m pip install ruff
|
||||
```
|
||||
|
||||
and then run the `lint.py` script
|
||||
and then run it
|
||||
|
||||
```sh
|
||||
./lint.py
|
||||
ruff .
|
||||
```
|
||||
|
||||
# Run Auto-Formatter
|
||||
|
@ -1,14 +1,7 @@
|
||||
__version__ = "5.0.0"
|
||||
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
SW_NAME = "eive-tmtc"
|
||||
VERSION_MAJOR = 5
|
||||
VERSION_MINOR = 0
|
||||
VERSION_REVISION = 0
|
||||
|
||||
EIVE_TMTC_ROOT = Path(__file__).parent
|
||||
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent
|
||||
|
||||
APP_LOGGER = logging.getLogger(__name__)
|
||||
APP_LOGGER = logging.getLogger()
|
||||
|
0
eive_tmtc/cfdp/__init__.py
Normal file
0
eive_tmtc/cfdp/__init__.py
Normal file
20
eive_tmtc/cfdp/fault_handler.py
Normal file
20
eive_tmtc/cfdp/fault_handler.py
Normal file
@ -0,0 +1,20 @@
|
||||
import logging
|
||||
|
||||
from spacepackets.cfdp import ConditionCode
|
||||
from tmtccmd.cfdp.mib import DefaultFaultHandlerBase
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EiveCfdpFaultHandler(DefaultFaultHandlerBase):
|
||||
def notice_of_suspension_cb(self, cond: ConditionCode):
|
||||
_LOGGER.info(f"Received notice of suspension: {cond!r}")
|
||||
|
||||
def notice_of_cancellation_cb(self, cond: ConditionCode):
|
||||
_LOGGER.info(f"Received notice of cancellation: {cond!r}")
|
||||
|
||||
def abandoned_cb(self, cond: ConditionCode):
|
||||
_LOGGER.info(f"Abandoned transaction: {cond!r}")
|
||||
|
||||
def ignore_cb(self, cond: ConditionCode):
|
||||
_LOGGER.info(f"Ignored transaction: {cond!r}")
|
259
eive_tmtc/cfdp/handler.py
Normal file
259
eive_tmtc/cfdp/handler.py
Normal file
@ -0,0 +1,259 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import Optional, Tuple
|
||||
|
||||
import deprecation
|
||||
from spacepackets import PacketType, SpacePacket, SpacePacketHeader
|
||||
from spacepackets.cfdp import GenericPduPacket, PduFactory
|
||||
from spacepackets.cfdp.pdu import PduHolder
|
||||
from tmtccmd.cfdp import (
|
||||
CfdpUserBase,
|
||||
LocalEntityCfg,
|
||||
RemoteEntityCfgTable,
|
||||
)
|
||||
from tmtccmd.cfdp.defs import CfdpState
|
||||
from tmtccmd.cfdp.handler import (
|
||||
DestHandler,
|
||||
DestStateWrapper,
|
||||
SourceHandler,
|
||||
SourceStateWrapper,
|
||||
)
|
||||
from tmtccmd.cfdp.handler.common import PacketDestination, get_packet_destination
|
||||
from tmtccmd.cfdp.mib import CheckTimerProvider
|
||||
from tmtccmd.cfdp.request import PutRequest
|
||||
from tmtccmd.util import ProvidesSeqCount
|
||||
from tmtccmd.version import get_version
|
||||
|
||||
|
||||
@dataclass
|
||||
class StateWrapper:
|
||||
source_handler_state = SourceStateWrapper()
|
||||
dest_handler_state = DestStateWrapper()
|
||||
|
||||
|
||||
class CfdpHandler:
|
||||
"""Wrapper class which wraps both the :py:class:`tmtccmd.cfdp.handler.source.SourceHandler` and
|
||||
:py:class:`tmtccmd.cfdp.handler.dest.DestHandler` in a sensible way.
|
||||
|
||||
If you have special requirements, for example you want to spawn a new destination handler
|
||||
for each file copy transfer to allow multiple consecutive file transfers, it might be a good
|
||||
idea to write a custom wrapper."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
cfg: LocalEntityCfg,
|
||||
user: CfdpUserBase,
|
||||
seq_cnt_provider: ProvidesSeqCount,
|
||||
remote_cfg_table: RemoteEntityCfgTable,
|
||||
check_timer_provider: CheckTimerProvider,
|
||||
):
|
||||
self.remote_cfg_table = remote_cfg_table
|
||||
self.dest_handler = DestHandler(
|
||||
cfg=cfg,
|
||||
user=user,
|
||||
remote_cfg_table=remote_cfg_table,
|
||||
check_timer_provider=check_timer_provider,
|
||||
)
|
||||
self.source_handler = SourceHandler(
|
||||
cfg=cfg,
|
||||
seq_num_provider=seq_cnt_provider,
|
||||
user=user,
|
||||
remote_cfg_table=remote_cfg_table,
|
||||
check_timer_provider=check_timer_provider,
|
||||
)
|
||||
|
||||
def put_request(self, request: PutRequest):
|
||||
if not self.remote_cfg_table.get_cfg(request.destination_id):
|
||||
raise ValueError(
|
||||
f"No remote CFDP config found for entity ID {request.destination_id}"
|
||||
)
|
||||
self.source_handler.put_request(
|
||||
request, self.remote_cfg_table.get_cfg(request.destination_id) # type: ignore
|
||||
)
|
||||
|
||||
def pull_next_source_packet(self) -> Optional[PduHolder]:
|
||||
res = self.source_handler.state_machine()
|
||||
if res.states.num_packets_ready:
|
||||
return self.source_handler.get_next_packet()
|
||||
return None
|
||||
|
||||
def pull_next_dest_packet(self) -> Optional[PduHolder]:
|
||||
res = self.dest_handler.state_machine()
|
||||
if res.states.packets_ready:
|
||||
return self.dest_handler.get_next_packet()
|
||||
return None
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def __next__(self) -> Tuple[Optional[PduHolder], Optional[PduHolder]]:
|
||||
"""The iterator for this class will returns a tuple of optional PDUs wrapped b a
|
||||
:py:class:`PduHolder`.
|
||||
|
||||
:return: Can be a tuple where the first entry can hold a source packet and the second entry
|
||||
can be a destination packet. If both packets are None, a StopIteration will be raised.
|
||||
"""
|
||||
next_source_packet = self.pull_next_source_packet()
|
||||
next_dest_packet = self.pull_next_dest_packet()
|
||||
if not next_dest_packet and not next_source_packet:
|
||||
raise StopIteration
|
||||
return next_source_packet, next_dest_packet
|
||||
|
||||
def put_request_pending(self) -> bool:
|
||||
return self.source_handler.states.state != CfdpState.IDLE
|
||||
|
||||
@deprecation.deprecated(
|
||||
deprecated_in="6.0.0rc0",
|
||||
current_version=get_version(),
|
||||
details="Use insert_packet instead",
|
||||
)
|
||||
def pass_packet(self, packet: GenericPduPacket):
|
||||
self.insert_packet(packet)
|
||||
|
||||
def insert_packet(self, packet: GenericPduPacket):
|
||||
"""This function routes the packets based on PDU type and directive type if applicable.
|
||||
|
||||
The routing is based on section 4.5 of the CFDP standard which specifies the PDU forwarding
|
||||
procedure."""
|
||||
if get_packet_destination(packet) == PacketDestination.DEST_HANDLER:
|
||||
self.dest_handler.insert_packet(packet)
|
||||
elif get_packet_destination(packet) == PacketDestination.SOURCE_HANDLER:
|
||||
self.source_handler.insert_packet(packet) # type: ignore
|
||||
|
||||
|
||||
class CfdpInCcsdsHandler:
|
||||
"""Wrapper helper type used to wrap PDU packets into CCSDS packets and to extract PDU
|
||||
packets from CCSDS packets.
|
||||
|
||||
:param cfg: Local CFDP entity configuration.
|
||||
:param user: User wrapper. This contains the indication callback implementations and the
|
||||
virtual filestore implementation.
|
||||
:param cfdp_seq_cnt_provider: Every CFDP file transfer has a transaction sequence number.
|
||||
This provider is used to retrieve that sequence number.
|
||||
:param ccsds_seq_cnt_provider: Each CFDP PDU is wrapped into a CCSDS space packet, and each
|
||||
space packet has a dedicated sequence count. This provider is used to retrieve the
|
||||
sequence count.
|
||||
:param ccsds_apid: APID to use for the CCSDS space packet header wrapped around each PDU.
|
||||
This is important so that the OBSW can distinguish between regular PUS packets and
|
||||
CFDP packets."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
cfg: LocalEntityCfg,
|
||||
user: CfdpUserBase,
|
||||
remote_cfg_table: RemoteEntityCfgTable,
|
||||
ccsds_apid: int,
|
||||
cfdp_seq_cnt_provider: ProvidesSeqCount,
|
||||
ccsds_seq_cnt_provider: ProvidesSeqCount,
|
||||
check_timer_provider: CheckTimerProvider,
|
||||
):
|
||||
self.cfdp_handler = CfdpHandler(
|
||||
cfg=cfg,
|
||||
user=user,
|
||||
seq_cnt_provider=cfdp_seq_cnt_provider,
|
||||
remote_cfg_table=remote_cfg_table,
|
||||
check_timer_provider=check_timer_provider,
|
||||
)
|
||||
self.ccsds_seq_cnt_provider = ccsds_seq_cnt_provider
|
||||
self.ccsds_apid = ccsds_apid
|
||||
|
||||
def put_request_pending(self):
|
||||
return self.cfdp_handler.put_request_pending()
|
||||
|
||||
def state_machine(self):
|
||||
self.source_handler.state_machine()
|
||||
self.dest_handler.state_machine()
|
||||
|
||||
@deprecation.deprecated(
|
||||
deprecated_in="6.0.0rc1",
|
||||
current_version=get_version(),
|
||||
details="Use state_machine instead",
|
||||
)
|
||||
def fsm(self):
|
||||
self.state_machine()
|
||||
|
||||
@property
|
||||
def source_handler(self):
|
||||
return self.cfdp_handler.source_handler
|
||||
|
||||
@property
|
||||
def dest_handler(self):
|
||||
return self.cfdp_handler.dest_handler
|
||||
|
||||
def pull_next_source_packet(self) -> Optional[Tuple[PduHolder, SpacePacket]]:
|
||||
"""Retrieves the next PDU to send and wraps it into a space packet"""
|
||||
next_packet = self.cfdp_handler.pull_next_source_packet()
|
||||
if next_packet is None:
|
||||
return next_packet
|
||||
sp_header = SpacePacketHeader(
|
||||
packet_type=PacketType.TC,
|
||||
apid=self.ccsds_apid,
|
||||
seq_count=self.ccsds_seq_cnt_provider.get_and_increment(),
|
||||
data_len=next_packet.packet_len - 1,
|
||||
)
|
||||
return next_packet, SpacePacket(sp_header, None, next_packet.pack())
|
||||
|
||||
def pull_next_dest_packet(self) -> Optional[Tuple[PduHolder, SpacePacket]]:
|
||||
"""Retrieves the next PDU to send and wraps it into a space packet"""
|
||||
next_packet = self.cfdp_handler.pull_next_dest_packet()
|
||||
if next_packet is None:
|
||||
return next_packet
|
||||
sp_header = SpacePacketHeader(
|
||||
packet_type=PacketType.TC,
|
||||
apid=self.ccsds_apid,
|
||||
seq_count=self.ccsds_seq_cnt_provider.get_and_increment(),
|
||||
data_len=next_packet.packet_len - 1,
|
||||
)
|
||||
return next_packet, SpacePacket(sp_header, None, next_packet.pack())
|
||||
|
||||
@deprecation.deprecated(
|
||||
deprecated_in="6.0.0rc1",
|
||||
current_version=get_version(),
|
||||
details="Use insert_space_packet instead",
|
||||
)
|
||||
def pass_space_packet(self, space_packet: SpacePacket):
|
||||
self.insert_space_packet(space_packet)
|
||||
|
||||
def insert_space_packet(self, space_packet: SpacePacket) -> bool:
|
||||
if space_packet.user_data is None:
|
||||
raise ValueError(
|
||||
"space packet is empty, expected packet containing a CFDP PDU"
|
||||
)
|
||||
# Unwrap the user data and pass it to the handler
|
||||
pdu_raw = space_packet.user_data
|
||||
pdu_base = PduFactory.from_raw(pdu_raw)
|
||||
if pdu_base:
|
||||
self.insert_pdu_packet(pdu_base)
|
||||
return True
|
||||
return False
|
||||
|
||||
def insert_pdu_packet(self, pdu: GenericPduPacket):
|
||||
self.cfdp_handler.insert_packet(pdu)
|
||||
|
||||
@deprecation.deprecated(
|
||||
deprecated_in="6.0.0rc1",
|
||||
current_version=get_version(),
|
||||
details="Use insert_pdu_packet instead",
|
||||
)
|
||||
def pass_pdu_packet(self, pdu_base: GenericPduPacket):
|
||||
self.insert_pdu_packet(pdu_base)
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def __next__(
|
||||
self,
|
||||
) -> Tuple[
|
||||
Optional[Tuple[PduHolder, SpacePacket]],
|
||||
Optional[Tuple[PduHolder, SpacePacket]],
|
||||
]:
|
||||
"""The iterator for this class will returns a tuple of optional PDUs wrapped b a
|
||||
:py:class:`PduHolder`.
|
||||
|
||||
:return: Can be a tuple where the first entry can hold a source packet and the second entry
|
||||
can be a destination packet. If both packets are None, a StopIteration will be raised.
|
||||
"""
|
||||
next_source_tuple = self.pull_next_source_packet()
|
||||
next_dest_tuple = self.pull_next_dest_packet()
|
||||
if not next_source_tuple and not next_dest_tuple:
|
||||
raise StopIteration
|
||||
return next_source_tuple, next_dest_tuple
|
29
eive_tmtc/cfdp/tm.py
Normal file
29
eive_tmtc/cfdp/tm.py
Normal file
@ -0,0 +1,29 @@
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
from eive_tmtc.config.definitions import CFDP_APID
|
||||
from spacepackets.ccsds import SPACE_PACKET_HEADER_SIZE
|
||||
from spacepackets.cfdp import PduFactory, PduType
|
||||
from tmtccmd.cfdp.handler import CfdpInCcsdsHandler
|
||||
from tmtccmd.tmtc import SpecificApidHandlerBase
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class CfdpInCcsdsWrapper(SpecificApidHandlerBase):
|
||||
def __init__(self, cfdp_in_ccsds_handler: CfdpInCcsdsHandler):
|
||||
self.handler = cfdp_in_ccsds_handler
|
||||
super().__init__(CFDP_APID, None)
|
||||
|
||||
def handle_tm(self, packet: bytes, _user_args: Any):
|
||||
# Ignore the space packet header. Its only purpose is to use the same protocol and
|
||||
# have a seaprate APID for space packets. If this function is called, the APID is correct.
|
||||
pdu = packet[SPACE_PACKET_HEADER_SIZE:]
|
||||
generic_pdu = PduFactory.from_raw(pdu)
|
||||
assert generic_pdu is not None
|
||||
if generic_pdu.pdu_type == PduType.FILE_DATA:
|
||||
_LOGGER.info("Received File Data PDU")
|
||||
else:
|
||||
directive_type = PduFactory.pdu_directive_type(pdu)
|
||||
_LOGGER.info(f"Received File Directive PDU with type {directive_type!r}")
|
||||
self.handler.insert_pdu_packet(generic_pdu)
|
71
eive_tmtc/cfdp/user.py
Normal file
71
eive_tmtc/cfdp/user.py
Normal file
@ -0,0 +1,71 @@
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
from spacepackets.cfdp import ConditionCode
|
||||
from spacepackets.util import UnsignedByteField
|
||||
from tmtccmd.cfdp import CfdpUserBase, TransactionId
|
||||
from tmtccmd.cfdp.mib import CheckTimerProvider, Countdown, EntityType
|
||||
from tmtccmd.cfdp.user import (
|
||||
TransactionFinishedParams,
|
||||
MetadataRecvParams,
|
||||
FileSegmentRecvdParams,
|
||||
)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EiveCheckTimerProvider(CheckTimerProvider):
|
||||
def provide_check_timer(
|
||||
self,
|
||||
local_entity_id: UnsignedByteField,
|
||||
remote_entity_id: UnsignedByteField,
|
||||
entity_type: EntityType,
|
||||
) -> Countdown:
|
||||
return Countdown(timedelta(seconds=5.0))
|
||||
|
||||
|
||||
class EiveCfdpUser(CfdpUserBase):
|
||||
def transaction_indication(self, transaction_id: TransactionId):
|
||||
_LOGGER.info(f"CFDP User: Start of File {transaction_id}")
|
||||
|
||||
def eof_sent_indication(self, transaction_id: TransactionId):
|
||||
_LOGGER.info(f"CFDP User: EOF sent for {transaction_id}")
|
||||
|
||||
def transaction_finished_indication(self, params: TransactionFinishedParams):
|
||||
_LOGGER.info(f"CFDP User: {params.transaction_id} finished")
|
||||
_LOGGER.info(f"Delivery Code: {params.delivery_code!r}")
|
||||
_LOGGER.info(f"Condition code: {params.condition_code!r}")
|
||||
_LOGGER.info(f"File delivery status: {params.delivery_code!r}")
|
||||
|
||||
def metadata_recv_indication(self, params: MetadataRecvParams):
|
||||
pass
|
||||
|
||||
def file_segment_recv_indication(self, params: FileSegmentRecvdParams):
|
||||
_LOGGER.info(
|
||||
f"CFDP User: Received File Data PDU for {params.transaction_id} | Offset:"
|
||||
f" {params.offset} | Segment Length: {params.length}"
|
||||
)
|
||||
|
||||
def report_indication(self, transaction_id: TransactionId, status_report: any):
|
||||
pass
|
||||
|
||||
def suspended_indication(
|
||||
self, transaction_id: TransactionId, cond_code: ConditionCode
|
||||
):
|
||||
pass
|
||||
|
||||
def resumed_indication(self, transaction_id: TransactionId, progress: int):
|
||||
pass
|
||||
|
||||
def fault_indication(
|
||||
self, transaction_id: TransactionId, cond_code: ConditionCode, progress: int
|
||||
):
|
||||
pass
|
||||
|
||||
def abandoned_indication(
|
||||
self, transaction_id: TransactionId, cond_code: ConditionCode, progress: int
|
||||
):
|
||||
pass
|
||||
|
||||
def eof_recv_indication(self, transaction_id: TransactionId):
|
||||
_LOGGER.info(f"CFDP User: EOF received for {transaction_id}")
|
@ -65,7 +65,8 @@ class CustomServiceList(str, enum.Enum):
|
||||
PL_SS = "pl_subsystem"
|
||||
ACS_BRD_ASS = "acs_brd_ass"
|
||||
SUS_BRD_ASS = "sus_brd_ass"
|
||||
TCS = "tcs"
|
||||
TCS_SS = "tcs_subsystem"
|
||||
TCS_CTRL = "tcs_ctrl"
|
||||
TCS_ASS = "tcs_ass"
|
||||
TIME = "time"
|
||||
PROCEDURE = "proc"
|
||||
@ -75,3 +76,6 @@ class CustomServiceList(str, enum.Enum):
|
||||
SCEX = "scex"
|
||||
TM_STORE = "tm_store"
|
||||
SYSTEM = "system"
|
||||
PWR_CTRL = "pwr_ctrl"
|
||||
EPS_SS = "eps_subsystem"
|
||||
XIPHOS_WDT = "xiphos_wdt"
|
||||
|
@ -86,18 +86,27 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
||||
10802;0x2a32;SERIALIZATION_ERROR;LOW;No description;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||
10803;0x2a33;FILESTORE_ERROR;LOW;No description;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||
10804;0x2a34;FILENAME_TOO_LARGE_ERROR;LOW;P1: Transaction step ID, P2: 0 for source file name, 1 for dest file name;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||
10805;0x2a35;HANDLING_CFDP_REQUEST_FAILED;LOW;CFDP request handling failed. P2: Returncode.;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||
11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;The limits for the rotation in safe mode were violated.;mission/acs/defs.h
|
||||
11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;The system has recovered from a safe rate rotation violation.;mission/acs/defs.h
|
||||
11201;0x2bc1;RATE_RECOVERY;MEDIUM;The system has recovered from a rate rotation violation.;mission/acs/defs.h
|
||||
11202;0x2bc2;MULTIPLE_RW_INVALID;HIGH;Multiple RWs are invalid, uncommandable and therefore higher ACS modes cannot be maintained.;mission/acs/defs.h
|
||||
11203;0x2bc3;MEKF_INVALID_INFO;INFO;MEKF was not able to compute a solution. P1: MEKF state on exit;mission/acs/defs.h
|
||||
11204;0x2bc4;MEKF_RECOVERY;INFO;MEKF is able to compute a solution again.;mission/acs/defs.h
|
||||
11205;0x2bc5;MEKF_AUTOMATIC_RESET;INFO;MEKF performed an automatic reset after detection of nonfinite values.;mission/acs/defs.h
|
||||
11206;0x2bc6;MEKF_INVALID_MODE_VIOLATION;HIGH;MEKF was not able to compute a solution during any pointing ACS mode for a prolonged time.;mission/acs/defs.h
|
||||
11206;0x2bc6;PTG_CTRL_NO_ATTITUDE_INFORMATION;HIGH;For a prolonged time, no attitude information was available for the Pointing Controller. Falling back to Safe Mode.;mission/acs/defs.h
|
||||
11207;0x2bc7;SAFE_MODE_CONTROLLER_FAILURE;HIGH;The ACS safe mode controller was not able to compute a solution and has failed. P1: Missing information about magnetic field, P2: Missing information about rotational rate;mission/acs/defs.h
|
||||
11208;0x2bc8;TLE_TOO_OLD;INFO;The TLE for the SGP4 Propagator has become too old.;mission/acs/defs.h
|
||||
11209;0x2bc9;TLE_FILE_READ_FAILED;LOW;The TLE could not be read from the filesystem.;mission/acs/defs.h
|
||||
11210;0x2bca;PTG_RATE_VIOLATION;MEDIUM;The limits for the rotation in pointing mode were violated.;mission/acs/defs.h
|
||||
11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/power/defs.h
|
||||
11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/power/defs.h
|
||||
11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/power/defs.h
|
||||
11303;0x2c27;FDIR_REACTION_IGNORED;MEDIUM;No description;mission/power/defs.h
|
||||
11304;0x2c28;DATASET_READ_FAILED;INFO;The dataset read for the inputs of the Power Controller has failed.;mission/power/defs.h
|
||||
11305;0x2c29;VOLTAGE_OUT_OF_BOUNDS;HIGH;No description;mission/power/defs.h
|
||||
11306;0x2c2a;TIMEDELTA_OUT_OF_BOUNDS;LOW;Time difference for Coulomb Counter was too large. P1: time in s * 10;mission/power/defs.h
|
||||
11307;0x2c2b;POWER_LEVEL_LOW;HIGH;The State of Charge is below the limit for payload use. Setting Payload to faulty.;mission/power/defs.h
|
||||
11308;0x2c2c;POWER_LEVEL_CRITICAL;HIGH;The State of Charge is below the limit for higher modes. Setting Reaction Wheels to faulty.;mission/power/defs.h
|
||||
11400;0x2c88;GPIO_PULL_HIGH_FAILED;LOW;No description;mission/tcs/HeaterHandler.h
|
||||
11401;0x2c89;GPIO_PULL_LOW_FAILED;LOW;No description;mission/tcs/HeaterHandler.h
|
||||
11402;0x2c8a;HEATER_WENT_ON;INFO;No description;mission/tcs/HeaterHandler.h
|
||||
@ -121,6 +130,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
||||
11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/payload/PlocMpsocHandler.h
|
||||
11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/payload/PlocMpsocHandler.h
|
||||
11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux/payload/PlocMpsocHandler.h
|
||||
11607;0x2d57;SUPV_NOT_ON;LOW;SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition.;linux/payload/PlocMpsocHandler.h
|
||||
11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;No description;linux/payload/PlocMpsocHandler.h
|
||||
11701;0x2db5;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h
|
||||
11702;0x2db6;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h
|
||||
11703;0x2db7;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/acs/ImtqHandler.h
|
||||
@ -133,14 +144,17 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
||||
11802;0x2e1a;RESET_OCCURED;LOW;No description;mission/acs/rwHelpers.h
|
||||
11901;0x2e7d;BOOTING_FIRMWARE_FAILED_EVENT;LOW;Failed to boot firmware;mission/acs/str/StarTrackerHandler.h
|
||||
11902;0x2e7e;BOOTING_BOOTLOADER_FAILED_EVENT;LOW;Failed to boot star tracker into bootloader mode;mission/acs/str/StarTrackerHandler.h
|
||||
12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/payload/PlocSupervisorHandler.h
|
||||
12002;0x2ee2;SUPV_UNKNOWN_TM;LOW;Unhandled event. P1: APID, P2: Service ID;linux/payload/PlocSupervisorHandler.h
|
||||
12003;0x2ee3;SUPV_UNINIMPLEMENTED_TM;LOW;No description;linux/payload/PlocSupervisorHandler.h
|
||||
12004;0x2ee4;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux/payload/PlocSupervisorHandler.h
|
||||
12005;0x2ee5;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report P1: ID of command for which the execution failed P2: Status code sent by the supervisor handler;linux/payload/PlocSupervisorHandler.h
|
||||
12006;0x2ee6;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux/payload/PlocSupervisorHandler.h
|
||||
12007;0x2ee7;SUPV_HELPER_EXECUTING;LOW;Supervisor helper currently executing a command;linux/payload/PlocSupervisorHandler.h
|
||||
12008;0x2ee8;SUPV_MPSOC_SHUTDOWN_BUILD_FAILED;LOW;Failed to build the command to shutdown the MPSoC;linux/payload/PlocSupervisorHandler.h
|
||||
11903;0x2e7f;COM_ERROR_REPLY_RECEIVED;LOW;Received COM error. P1: Communication Error ID (datasheet p32);mission/acs/str/StarTrackerHandler.h
|
||||
12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/payload/plocSupvDefs.h
|
||||
12002;0x2ee2;SUPV_UNKNOWN_TM;LOW;Unhandled event. P1: APID, P2: Service ID;linux/payload/plocSupvDefs.h
|
||||
12003;0x2ee3;SUPV_UNINIMPLEMENTED_TM;LOW;No description;linux/payload/plocSupvDefs.h
|
||||
12004;0x2ee4;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux/payload/plocSupvDefs.h
|
||||
12005;0x2ee5;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report P1: ID of command for which the execution failed P2: Status code sent by the supervisor handler;linux/payload/plocSupvDefs.h
|
||||
12006;0x2ee6;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux/payload/plocSupvDefs.h
|
||||
12007;0x2ee7;SUPV_HELPER_EXECUTING;LOW;Supervisor helper currently executing a command;linux/payload/plocSupvDefs.h
|
||||
12008;0x2ee8;SUPV_MPSOC_SHUTDOWN_BUILD_FAILED;LOW;Failed to build the command to shutdown the MPSoC;linux/payload/plocSupvDefs.h
|
||||
12009;0x2ee9;SUPV_ACK_UNKNOWN_COMMAND;LOW;Received ACK, but no related command is unknown or has not been sent by this software instance. P1: Module APID. P2: Service ID.;linux/payload/plocSupvDefs.h
|
||||
12010;0x2eea;SUPV_EXE_ACK_UNKNOWN_COMMAND;LOW;Received ACK EXE, but no related command is unknown or has not been sent by this software instance. P1: Module APID. P2: Service ID.;linux/payload/plocSupvDefs.h
|
||||
12100;0x2f44;SANITIZATION_FAILED;LOW;No description;bsp_q7s/fs/SdCardManager.h
|
||||
12101;0x2f45;MOUNTED_SD_CARD;INFO;No description;bsp_q7s/fs/SdCardManager.h
|
||||
12300;0x300c;SEND_MRAM_DUMP_FAILED;LOW;Failed to send mram dump command to supervisor handler P1: Return value of commandAction function P2: Start address of MRAM to dump with this command;linux/payload/PlocMemoryDumper.h
|
||||
@ -160,6 +174,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
||||
12412;0x307c;PDEC_RESET_FAILED;HIGH;Failed to pull PDEC reset to low;linux/ipcore/pdec.h
|
||||
12413;0x307d;OPEN_IRQ_FILE_FAILED;HIGH;Failed to open the IRQ uio file;linux/ipcore/pdec.h
|
||||
12414;0x307e;PDEC_INIT_FAILED;HIGH;PDEC initialization failed. This might also be due to the persistent confiuration never becoming available, for example due to SD card issues.;linux/ipcore/pdec.h
|
||||
12415;0x307f;PDEC_CONFIG_CORRUPTED;HIGH;The PDEC configuration area has been corrupted P1: The first configuration word P2: The second configuration word;linux/ipcore/pdec.h
|
||||
12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/acs/StrComHandler.h
|
||||
12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/acs/StrComHandler.h
|
||||
12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/acs/StrComHandler.h
|
||||
@ -254,6 +269,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
||||
13800;0x35e8;MISSING_PACKET;LOW;No description;mission/payload/scexHelpers.h
|
||||
13801;0x35e9;EXPERIMENT_TIMEDOUT;LOW;No description;mission/payload/scexHelpers.h
|
||||
13802;0x35ea;MULTI_PACKET_COMMAND_DONE;INFO;No description;mission/payload/scexHelpers.h
|
||||
13803;0x35eb;FS_UNUSABLE;LOW;No description;mission/payload/scexHelpers.h
|
||||
13901;0x364d;SET_CONFIGFILEVALUE_FAILED;MEDIUM;No description;mission/utility/GlobalConfigHandler.h
|
||||
13902;0x364e;GET_CONFIGFILEVALUE_FAILED;MEDIUM;No description;mission/utility/GlobalConfigHandler.h
|
||||
13903;0x364f;INSERT_CONFIGFILEVALUE_FAILED;MEDIUM;No description;mission/utility/GlobalConfigHandler.h
|
||||
@ -272,6 +288,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
||||
14011;0x36bb;I2C_REBOOT;HIGH;I2C is unavailable. Recovery did not work, performing full reboot.;mission/sysDefs.h
|
||||
14012;0x36bc;PDEC_REBOOT;HIGH;PDEC recovery through reset was not possible, performing full reboot.;mission/sysDefs.h
|
||||
14013;0x36bd;FIRMWARE_INFO;INFO;Version information of the firmware (not OBSW). P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash P2: First four letters of Git SHA is the last byte of P1 is set.;mission/sysDefs.h
|
||||
14014;0x36be;ACTIVE_SD_INFO;INFO;Active SD card info. SD States: 0: OFF, 1: ON, 2: MOUNTED. P1: Active SD Card Index, 0 if none is active P2: First two bytes: SD state of SD card 0, last two bytes SD state of SD card 1;mission/sysDefs.h
|
||||
14100;0x3714;NO_VALID_SENSOR_TEMPERATURE;MEDIUM;No description;mission/controller/tcsDefs.h
|
||||
14101;0x3715;NO_HEALTHY_HEATER_AVAILABLE;MEDIUM;No description;mission/controller/tcsDefs.h
|
||||
14102;0x3716;SYRLINKS_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h
|
||||
@ -280,6 +297,9 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
||||
14106;0x371a;PCDU_SYSTEM_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h
|
||||
14107;0x371b;HEATER_NOT_OFF_FOR_OFF_MODE;MEDIUM;No description;mission/controller/tcsDefs.h
|
||||
14108;0x371c;MGT_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h
|
||||
14109;0x371d;TCS_SWITCHING_HEATER_ON;INFO;P1: Module index. P2: Heater index;mission/controller/tcsDefs.h
|
||||
14110;0x371e;TCS_SWITCHING_HEATER_OFF;INFO;P1: Module index. P2: Heater index;mission/controller/tcsDefs.h
|
||||
14111;0x371f;TCS_HEATER_MAX_BURN_TIME_REACHED;MEDIUM;P1: Heater index. P2: Maximum burn time for heater.;mission/controller/tcsDefs.h
|
||||
14201;0x3779;TX_TIMER_EXPIRED;INFO;The transmit timer to protect the Syrlinks expired P1: The current timer value;mission/system/com/ComSubsystem.h
|
||||
14202;0x377a;BIT_LOCK_TX_ON;INFO;Transmitter will be turned on due to detection of bitlock;mission/system/com/ComSubsystem.h
|
||||
14300;0x37dc;POSSIBLE_FILE_CORRUPTION;LOW;P1: Result code of TM packet parser. P2: Timestamp of possibly corrupt file as a unix timestamp.;mission/persistentTmStoreDefs.h
|
||||
@ -295,3 +315,6 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
||||
14312;0x37e8;DUMP_MISC_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h
|
||||
14313;0x37e9;DUMP_HK_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h
|
||||
14314;0x37ea;DUMP_CFDP_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h
|
||||
14500;0x38a4;TEMPERATURE_ALL_ONES_START;MEDIUM;Detected invalid values, starting invalid message counting;mission/acs/SusHandler.h
|
||||
14501;0x38a5;TEMPERATURE_ALL_ONES_RECOVERY;INFO;Detected valid values for a prolonged time again, resetting all counters. P1: Number of periods with invalid messages. P2: Maximum invalid message counter.;mission/acs/SusHandler.h
|
||||
14600;0x3908;FAULT_HANDLER_TRIGGERED;LOW;P1: CFDP fault handler code. P2: CFDP condition code.;mission/cfdp/defs.h
|
||||
|
|
@ -18,6 +18,7 @@ __OBJECT_ID_DICT = None
|
||||
|
||||
# Core Object IDs
|
||||
SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x00, 0xA2])
|
||||
INTERNAL_ERROR_REPORTER_ID = bytes([0x53, 0x04, 0x00, 0x00])
|
||||
|
||||
# Power Object IDs
|
||||
PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0xA1])
|
||||
@ -135,6 +136,7 @@ ACS_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x01])
|
||||
PL_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x02])
|
||||
TCS_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x03])
|
||||
COM_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x04])
|
||||
EPS_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x05])
|
||||
|
||||
# Legacy names, kept for backwards compatibility
|
||||
ACS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x01])
|
||||
@ -156,6 +158,8 @@ STR_ASSEMBLY = bytes([0x73, 0x00, 0x00, 0x09])
|
||||
TCS_CONTROLLER = bytes([0x43, 0x40, 0x00, 0x01])
|
||||
ACS_CONTROLLER = bytes([0x43, 0x00, 0x00, 0x02])
|
||||
CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03])
|
||||
PWR_CONTROLLER = bytes([0x43, 0x00, 0x00, 0x04])
|
||||
XIPHOS_WDT_ID = bytes([0x43, 0x00, 0x00, 0x07])
|
||||
|
||||
MISC_TM_STORE = bytes([0x73, 0x02, 0x00, 0x01])
|
||||
OK_TM_STORE = bytes([0x73, 0x02, 0x00, 0x02])
|
||||
@ -163,6 +167,9 @@ NOT_OK_TM_STORE = bytes([0x73, 0x02, 0x00, 0x03])
|
||||
HK_TM_STORE = bytes([0x73, 0x02, 0x00, 0x04])
|
||||
CFDP_TM_STORE = bytes([0x73, 0x03, 0x00, 0x00])
|
||||
|
||||
|
||||
SUPV_FILTER_SET = [PLOC_SUPV_ID, PDU_2_HANDLER_ID, PDU_1_HANDLER_ID]
|
||||
|
||||
ObjectIdDict = Dict[bytes, ObjectIdU32]
|
||||
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
0x00005060;P60DOCK_TEST_TASK
|
||||
0x43000002;ACS_CONTROLLER
|
||||
0x43000003;CORE_CONTROLLER
|
||||
0x43000004;POWER_CONTROLLER
|
||||
0x43000006;GLOBAL_JSON_CFG
|
||||
0x43000007;XIPHOS_WDT
|
||||
0x43400001;THERMAL_CONTROLLER
|
||||
0x44120006;MGM_0_LIS3_HANDLER
|
||||
0x44120010;GYRO_0_ADIS_HANDLER
|
||||
@ -156,11 +158,13 @@
|
||||
0x73000102;CFDP_TM_FUNNEL
|
||||
0x73000205;CFDP_HANDLER
|
||||
0x73000206;CFDP_DISTRIBUTOR
|
||||
0x73000207;CFDP_FAULT_HANDLER
|
||||
0x73010000;EIVE_SYSTEM
|
||||
0x73010001;ACS_SUBSYSTEM
|
||||
0x73010002;PL_SUBSYSTEM
|
||||
0x73010003;TCS_SUBSYSTEM
|
||||
0x73010004;COM_SUBSYSTEM
|
||||
0x73010005;EPS_SUBSYSTEM
|
||||
0x73020001;MISC_TM_STORE
|
||||
0x73020002;OK_TM_STORE
|
||||
0x73020003;NOT_OK_TM_STORE
|
||||
|
|
@ -210,6 +210,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
|
||||
0x27a8;DHI_NoReplyExpected;No description;168;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
0x27a9;DHI_NonOpTemperature;No description;169;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
0x27aa;DHI_CommandNotImplemented;No description;170;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
0x27ab;DHI_NonOpStateOfCharge;No description;171;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
0x27b0;DHI_ChecksumError;No description;176;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
0x27b1;DHI_LengthMissmatch;No description;177;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
0x27b2;DHI_InvalidData;No description;178;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
@ -322,289 +323,307 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
|
||||
0x3405;DC_NotActive;No description;5;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h
|
||||
0x3406;DC_TooMuchData;No description;6;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h
|
||||
0x3407;DC_Busy;No description;7;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h
|
||||
0x3601;CFDP_InvalidTlvType;No description;1;CFDP;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3602;CFDP_InvalidDirectiveField;No description;2;CFDP;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3603;CFDP_InvalidPduDatafieldLen;No description;3;CFDP;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3604;CFDP_InvalidAckDirectiveFields;No description;4;CFDP;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3605;CFDP_MetadataCantParseOptions;No description;5;CFDP;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3606;CFDP_NakCantParseOptions;No description;6;CFDP;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3607;CFDP_FinishedCantParseFsResponses;No description;7;CFDP;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3608;CFDP_FilestoreRequiresSecondFile;No description;8;CFDP;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3609;CFDP_FilestoreResponseCantParseFsMessage;No description;9;CFDP;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x360a;CFDP_InvalidPduFormat;No description;10;CFDP;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3701;TSI_BadTimestamp;No description;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h
|
||||
0x38a1;SGP4_InvalidEccentricity;No description;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x38a2;SGP4_InvalidMeanMotion;No description;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x38a3;SGP4_InvalidPerturbationElements;No description;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x38a4;SGP4_InvalidSemiLatusRectum;No description;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x38a5;SGP4_InvalidEpochElements;No description;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x38a6;SGP4_SatelliteHasDecayed;No description;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x38b1;SGP4_TleTooOld;No description;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x38b2;SGP4_TleNotInitialized;No description;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x3901;MUX_NotEnoughResources;No description;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3902;MUX_InsufficientMemory;No description;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3903;MUX_NoPrivilege;No description;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3904;MUX_WrongAttributeSetting;No description;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3905;MUX_MutexAlreadyLocked;No description;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3906;MUX_MutexNotFound;No description;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3907;MUX_MutexMaxLocks;No description;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3908;MUX_CurrThreadAlreadyOwnsMutex;No description;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3909;MUX_CurrThreadDoesNotOwnMutex;No description;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x390a;MUX_MutexTimeout;No description;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x390b;MUX_MutexInvalidId;No description;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x390c;MUX_MutexDestroyedWhileWaiting;No description;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3a01;MQI_Empty;No description;1;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h
|
||||
0x3a02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h
|
||||
0x3a03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h
|
||||
0x3a04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h
|
||||
0x3b00;SPH_ConnBroken;No description;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h
|
||||
0x3b01;SPH_SemaphoreTimeout;No description;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h
|
||||
0x3b02;SPH_SemaphoreNotOwned;No description;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h
|
||||
0x3b03;SPH_SemaphoreInvalid;No description;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h
|
||||
0x3c00;LPIF_PoolEntryNotFound;No description;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h
|
||||
0x3c01;LPIF_PoolEntryTypeConflict;No description;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h
|
||||
0x3da0;PVA_InvalidReadWriteMode;No description;160;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h
|
||||
0x3da1;PVA_InvalidPoolEntry;No description;161;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h
|
||||
0x3e00;HKM_QueueOrDestinationInvalid;No description;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h
|
||||
0x3e01;HKM_WrongHkPacketType;No description;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h
|
||||
0x3e02;HKM_ReportingStatusUnchanged;No description;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h
|
||||
0x3e03;HKM_PeriodicHelperInvalid;No description;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h
|
||||
0x3e04;HKM_PoolobjectNotFound;No description;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h
|
||||
0x3e05;HKM_DatasetNotFound;No description;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h
|
||||
0x3f01;DLEE_StreamTooShort;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h
|
||||
0x3f02;DLEE_DecodingError;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h
|
||||
0x4201;PUS11_InvalidTypeTimeWindow;No description;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4202;PUS11_InvalidTimeWindow;No description;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4203;PUS11_TimeshiftingNotPossible;No description;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4204;PUS11_InvalidRelativeTime;No description;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4205;PUS11_ContainedTcTooSmall;No description;5;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4206;PUS11_ContainedTcCrcMissmatch;No description;6;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4300;FILS_GenericFileError;No description;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4301;FILS_GenericDirError;No description;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4302;FILS_FilesystemInactive;No description;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4303;FILS_GenericRenameError;No description;3;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4304;FILS_IsBusy;No description;4;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4305;FILS_InvalidParameters;No description;5;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x430a;FILS_FileDoesNotExist;No description;10;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x430b;FILS_FileAlreadyExists;No description;11;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x430c;FILS_NotAFile;No description;12;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x430d;FILS_FileLocked;No description;13;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x430e;FILS_PermissionDenied;No description;14;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4315;FILS_DirectoryDoesNotExist;No description;21;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4316;FILS_DirectoryAlreadyExists;No description;22;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4317;FILS_NotADirectory;No description;23;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4318;FILS_DirectoryNotEmpty;No description;24;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x431e;FILS_SequencePacketMissingWrite;No description;30;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x431f;FILS_SequencePacketMissingRead;No description;31;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4400;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h
|
||||
0x4401;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h
|
||||
0x4402;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h
|
||||
0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h
|
||||
0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h
|
||||
0x4406;UXOS_PcloseCallError;No description;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h
|
||||
0x4500;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h
|
||||
0x4501;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h
|
||||
0x4502;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h
|
||||
0x4503;HSPI_Timeout;No description;3;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h
|
||||
0x4504;HSPI_Busy;No description;4;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h
|
||||
0x4505;HSPI_GenericError;No description;5;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h
|
||||
0x4601;HURT_UartReadFailure;No description;1;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h
|
||||
0x4602;HURT_UartReadSizeMissmatch;No description;2;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h
|
||||
0x4603;HURT_UartRxBufferTooSmall;No description;3;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h
|
||||
0x4801;HGIO_UnknownGpioId;No description;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4802;HGIO_DriveGpioFailure;No description;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4803;HGIO_GpioTypeFailure;No description;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4804;HGIO_GpioInvalidInstance;No description;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4805;HGIO_GpioDuplicateDetected;No description;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4806;HGIO_GpioInitFailed;No description;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4807;HGIO_GpioGetValueFailed;No description;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4c00;SPPA_NoPacketFound;No description;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h
|
||||
0x4c01;SPPA_SplitPacket;No description;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h
|
||||
0x4fa1;HEATER_CommandNotSupported;No description;161;HEATER_HANDLER;mission/tcs/HeaterHandler.h
|
||||
0x4fa2;HEATER_InitFailed;No description;162;HEATER_HANDLER;mission/tcs/HeaterHandler.h
|
||||
0x4fa3;HEATER_InvalidSwitchNr;No description;163;HEATER_HANDLER;mission/tcs/HeaterHandler.h
|
||||
0x4fa4;HEATER_MainSwitchSetTimeout;No description;164;HEATER_HANDLER;mission/tcs/HeaterHandler.h
|
||||
0x4fa5;HEATER_CommandAlreadyWaiting;No description;165;HEATER_HANDLER;mission/tcs/HeaterHandler.h
|
||||
0x50a0;SYRLINKS_CrcFailure;No description;160;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x50a1;SYRLINKS_UartFraminOrParityErrorAck;No description;161;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x50a2;SYRLINKS_BadCharacterAck;No description;162;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x50a3;SYRLINKS_BadParameterValueAck;No description;163;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x50a4;SYRLINKS_BadEndOfFrameAck;No description;164;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x50a5;SYRLINKS_UnknownCommandIdAck;No description;165;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x50a6;SYRLINKS_BadCrcAck;No description;166;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x50a7;SYRLINKS_ReplyWrongSize;No description;167;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x50a8;SYRLINKS_MissingStartFrameCharacter;No description;168;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x5100;IMTQ_InvalidCommandCode;No description;0;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5101;IMTQ_MgmMeasurementLowLevelError;No description;1;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5102;IMTQ_ActuateCmdLowLevelError;No description;2;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5103;IMTQ_ParameterMissing;No description;3;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5104;IMTQ_ParameterInvalid;No description;4;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5105;IMTQ_CcUnavailable;No description;5;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5106;IMTQ_InternalProcessingError;No description;6;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5107;IMTQ_RejectedWithoutReason;No description;7;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5108;IMTQ_CmdErrUnknown;No description;8;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5109;IMTQ_StartupCfgError;No description;9;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x510a;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;10;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x52b0;RWHA_SpiWriteFailure;No description;176;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x52b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x52b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x52b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x52b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x52b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x52b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x52b7;RWHA_SpiReadTimeout;Timeout when reading reply;183;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x53a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;160;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53a1;STRH_PingFailed;Ping command failed;161;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53a2;STRH_VersionReqFailed;Status in version reply signals error;162;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53a3;STRH_InterfaceReqFailed;Status in interface reply signals error;163;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53a4;STRH_PowerReqFailed;Status in power reply signals error;164;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;165;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53a6;STRH_ActionFailed;Status of reply to action command signals error;166;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53a7;STRH_FilePathTooLong;Received invalid path string. Exceeds allowed length;167;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53a8;STRH_FilenameTooLong;Name of file received with command is too long;168;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53a9;STRH_InvalidProgram;Received version reply with invalid program ID;169;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53aa;STRH_ReplyError;Status field reply signals error;170;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53ab;STRH_CommandTooShort;Received command which is too short (some data is missing for proper execution);171;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53ac;STRH_InvalidLength;Received command with invalid length (too few or too many parameters);172;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53ad;STRH_RegionMismatch;Region mismatch between send and received data;173;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53ae;STRH_AddressMismatch;Address mismatch between send and received data;174;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53af;STRH_LengthMismatch;Length field mismatch between send and received data;175;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53b0;STRH_FileNotExists;Specified file does not exist;176;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53b1;STRH_InvalidType;Download blob pixel command has invalid type field;177;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53b2;STRH_InvalidId;Received FPGA action command with invalid ID;178;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53b3;STRH_ReplyTooShort;Received reply is too short;179;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53b4;STRH_CrcFailure;Received reply with invalid CRC;180;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53b5;STRH_StrHelperExecuting;Star tracker handler currently executing a command and using the communication interface;181;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;182;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53b7;STRH_StartrackerNotRunningFirmware;Star tracker must be in firmware mode to run this command;183;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x53b8;STRH_StartrackerNotRunningBootloader;Star tracker must be in bootloader mode to run this command;184;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);224;DWLPWRON_CMD;linux/payload/plocMpsocHelpers.h
|
||||
0x54e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);225;DWLPWRON_CMD;linux/payload/plocMpsocHelpers.h
|
||||
0x5700;PLSPVhLP_RequestDone;No description;0;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x5701;PLSPVhLP_NoPacketFound;No description;1;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x5702;PLSPVhLP_DecodeBufTooSmall;No description;2;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x5703;PLSPVhLP_PossiblePacketLossConsecutiveStart;No description;3;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x5704;PLSPVhLP_PossiblePacketLossConsecutiveEnd;No description;4;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x5705;PLSPVhLP_HdlcError;No description;5;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x57a0;PLSPVhLP_FileClosedAccidentally;File accidentally close;160;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x57a1;PLSPVhLP_ProcessTerminated;Process has been terminated by command;161;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x57a2;PLSPVhLP_PathNotExists;Received command with invalid pathname;162;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x57a3;PLSPVhLP_EventBufferReplyInvalidApid;Expected event buffer TM but received space packet with other APID;163;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x58a0;SUSS_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;SUS_HANDLER;mission/acs/RwHandler.h
|
||||
0x58a1;SUSS_InvalidRampTime;Action Message with invalid ramp time was received.;161;SUS_HANDLER;mission/acs/RwHandler.h
|
||||
0x58a2;SUSS_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;SUS_HANDLER;mission/acs/RwHandler.h
|
||||
0x58a3;SUSS_ExecutionFailed;Command execution failed;163;SUS_HANDLER;mission/acs/RwHandler.h
|
||||
0x58a4;SUSS_CrcError;Reaction wheel reply has invalid crc;164;SUS_HANDLER;mission/acs/RwHandler.h
|
||||
0x58a5;SUSS_ValueNotRead;No description;165;SUS_HANDLER;mission/acs/RwHandler.h
|
||||
0x59a0;IPCI_PapbBusy;No description;160;CCSDS_IP_CORE_BRIDGE;linux/ipcore/PapbVcInterface.h
|
||||
0x5aa0;PTME_UnknownVcId;No description;160;PTME;linux/ipcore/Ptme.h
|
||||
0x5c01;STRHLP_SdNotMounted;SD card specified in path string not mounted;1;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5c02;STRHLP_FileNotExists;Specified file does not exist on filesystem;2;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5c03;STRHLP_PathNotExists;Specified path does not exist;3;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5c04;STRHLP_FileCreationFailed;Failed to create download image or read flash file;4;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5c05;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;5;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5c06;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;6;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5c07;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;7;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5c08;STRHLP_StatusError;Status field in reply signals error;8;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5c09;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);9;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5c0a;STRHLP_ReceptionTimeout;No description;10;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5c0b;STRHLP_DecodingError;No description;11;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5d00;GOMS_PacketTooLong;No description;0;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h
|
||||
0x5d01;GOMS_InvalidTableId;No description;1;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h
|
||||
0x5d02;GOMS_InvalidAddress;No description;2;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h
|
||||
0x5d03;GOMS_InvalidParamSize;No description;3;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h
|
||||
0x5d04;GOMS_InvalidPayloadSize;No description;4;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h
|
||||
0x5d05;GOMS_UnknownReplyId;No description;5;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h
|
||||
0x5ea0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;160;PLOC_MEMORY_DUMPER;linux/payload/PlocMemoryDumper.h
|
||||
0x5ea1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;161;PLOC_MEMORY_DUMPER;linux/payload/PlocMemoryDumper.h
|
||||
0x5fa0;PDEC_AbandonedCltuRetval;No description;160;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5fa1;PDEC_FrameDirtyRetval;No description;161;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5fa2;PDEC_FrameIllegalMultipleReasons;No description;162;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5fa3;PDEC_AdDiscardedLockoutRetval;No description;163;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5fa4;PDEC_AdDiscardedWaitRetval;No description;164;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5fa5;PDEC_AdDiscardedNsVs;No description;165;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5fa6;PDEC_NoReportRetval;No description;166;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5fa7;PDEC_ErrorVersionNumberRetval;No description;167;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5fa8;PDEC_IllegalCombinationRetval;No description;168;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5fa9;PDEC_InvalidScIdRetval;No description;169;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5faa;PDEC_InvalidVcIdMsbRetval;No description;170;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5fab;PDEC_InvalidVcIdLsbRetval;No description;171;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5fac;PDEC_NsNotZeroRetval;No description;172;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5fae;PDEC_InvalidBcCc;No description;174;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x5fb0;PDEC_CommandNotImplemented;Received action message with unknown action id;176;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/com/CcsdsIpCoreHandler.h
|
||||
0x61a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;160;RATE_SETTER;linux/ipcore/PtmeConfig.h
|
||||
0x61a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);161;RATE_SETTER;linux/ipcore/PtmeConfig.h
|
||||
0x61a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;162;RATE_SETTER;linux/ipcore/PtmeConfig.h
|
||||
0x61a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;163;RATE_SETTER;linux/ipcore/PtmeConfig.h
|
||||
0x6201;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h
|
||||
0x6202;JSONBASE_SetNotExists;Requested set does not exist in json file;2;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h
|
||||
0x6203;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h
|
||||
0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NvmParameterBase.h
|
||||
0x64a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;160;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h
|
||||
0x64a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;161;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h
|
||||
0x65a0;PLMPHLP_FileWriteError;File error occured for file transfers from OBC to the MPSoC.;160;PLOC_MPSOC_HELPER;linux/payload/PlocMpsocSpecialComHelper.h
|
||||
0x65a1;PLMPHLP_FileReadError;File error occured for file transfers from MPSoC to OBC.;161;PLOC_MPSOC_HELPER;linux/payload/PlocMpsocSpecialComHelper.h
|
||||
0x66a0;SADPL_CommandNotSupported;No description;160;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
|
||||
0x66a1;SADPL_DeploymentAlreadyExecuting;No description;161;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
|
||||
0x66a2;SADPL_MainSwitchTimeoutFailure;No description;162;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
|
||||
0x66a3;SADPL_SwitchingDeplSa1Failed;No description;163;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
|
||||
0x66a4;SADPL_SwitchingDeplSa2Failed;No description;164;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
|
||||
0x67a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;160;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x67a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;161;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x67a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;162;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x67a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;163;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x67a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;164;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x67a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;165;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x67a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;166;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x67a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);167;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x67a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;168;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x67a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;169;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x68a0;SPVRTVIF_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;160;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68a1;SPVRTVIF_InvalidServiceId;No description;161;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68a2;SPVRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;162;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68a3;SPVRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC supervisor;163;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68a4;SPVRTVIF_InvalidApid;Received space packet with invalid APID from PLOC supervisor;164;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68a5;SPVRTVIF_GetTimeFailure;Failed to read current system time;165;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68a6;SPVRTVIF_InvalidWatchdog;Received command with invalid watchdog parameter. Valid watchdogs are 0 for PS, 1 for PL and 2 for INT;166;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68a7;SPVRTVIF_InvalidWatchdogTimeout;Received watchdog timeout config command with invalid timeout. Valid timeouts must be in the range between 1000 and 360000 ms.;167;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68a8;SPVRTVIF_InvalidLatchupId;Received latchup config command with invalid latchup ID;168;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68a9;SPVRTVIF_SweepPeriodTooSmall;Received set adc sweep period command with invalid sweep period. Must be larger than 21.;169;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68aa;SPVRTVIF_InvalidTestParam;Receive auto EM test command with invalid test param. Valid params are 1 and 2.;170;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68ab;SPVRTVIF_MramPacketParsingFailure;Returned when scanning for MRAM dump packets failed.;171;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68ac;SPVRTVIF_InvalidMramAddresses;Returned when the start and stop addresses of the MRAM dump or MRAM wipe commands are invalid (e.g. start address bigger than stop address);172;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68ad;SPVRTVIF_NoMramPacket;Expect reception of an MRAM dump packet but received space packet with other apid.;173;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68ae;SPVRTVIF_PathDoesNotExist;Path to PLOC directory on SD card does not exist;174;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68af;SPVRTVIF_MramFileNotExists;MRAM dump file does not exists. The file should actually already have been created with the reception of the first dump packet.;175;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68b0;SPVRTVIF_InvalidReplyLength;No description;176;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68b1;SPVRTVIF_InvalidLength;Received action command has invalid length;177;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68b2;SPVRTVIF_FilenameTooLong;Filename too long;178;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68b3;SPVRTVIF_UpdateStatusReportInvalidLength;Received update status report with invalid packet length field;179;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68b4;SPVRTVIF_UpdateCrcFailure;Update status report does not contain expected CRC. There might be a bit flip in the update memory region.;180;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68b5;SPVRTVIF_SupvHelperExecuting;Supervisor helper task ist currently executing a command (wait until helper tas has finished or interrupt by sending the terminate command);181;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68c0;SPVRTVIF_BufTooSmall;No description;192;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x68c1;SPVRTVIF_NoReplyTimeout;No description;193;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x6900;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;0;ACS_CTRL;mission/controller/AcsController.h
|
||||
0x6a02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6a03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6a04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6a05;ACSMEKF_MekfNoSusMgmStrData;No description;5;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6a06;ACSMEKF_MekfCovarianceInversionFailed;No description;6;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6a07;ACSMEKF_MekfNotFinite;No description;7;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6a08;ACSMEKF_MekfInitialized;No description;8;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6a09;ACSMEKF_MekfRunning;No description;9;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6b00;SDMA_OpOngoing;No description;0;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6b01;SDMA_AlreadyOn;No description;1;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6b02;SDMA_AlreadyMounted;No description;2;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6b03;SDMA_AlreadyOff;No description;3;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6b0a;SDMA_StatusFileNexists;No description;10;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6b0b;SDMA_StatusFileFormatInvalid;No description;11;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6b0c;SDMA_MountError;No description;12;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6b0d;SDMA_UnmountError;No description;13;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6b0e;SDMA_SystemCallError;No description;14;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6b0f;SDMA_PopenCallError;No description;15;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6c00;LPH_SdNotReady;No description;0;LOCAL_PARAM_HANDLER;bsp_q7s/memory/LocalParameterHandler.h
|
||||
0x6d00;PTM_DumpDone;No description;0;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h
|
||||
0x6d01;PTM_BusyDumping;No description;1;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h
|
||||
0x6e00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h
|
||||
0x7000;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h
|
||||
0x3601;CFDP_InvalidTlvType;No description;1;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3602;CFDP_InvalidDirectiveField;No description;2;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3603;CFDP_InvalidPduDatafieldLen;No description;3;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3604;CFDP_InvalidAckDirectiveFields;No description;4;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3605;CFDP_MetadataCantParseOptions;No description;5;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3606;CFDP_NakCantParseOptions;No description;6;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3607;CFDP_FinishedCantParseFsResponses;No description;7;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3608;CFDP_FilestoreRequiresSecondFile;No description;8;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3609;CFDP_FilestoreResponseCantParseFsMessage;No description;9;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x360a;CFDP_InvalidPduFormat;No description;10;CFDP_BASE;fsfw/src/fsfw/cfdp/definitions.h
|
||||
0x3700;CFDP_SourceTransactionPending;No description;0;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||
0x3701;CFDP_FileDoesNotExist;No description;1;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||
0x3702;CFDP_FileSegmentLenInvalid;No description;2;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||
0x3703;CFDP_SourceNameEmpty;No description;3;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||
0x3704;CFDP_DestNameEmpty;No description;4;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||
0x3705;CFDP_WrongRemoteCfgEntityId;No description;5;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||
0x3706;CFDP_TargetMsgQueueFull;No description;6;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||
0x3707;CFDP_TmStoreFull;No description;7;CFDP_HANDLER;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||
0x3801;TSI_BadTimestamp;No description;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h
|
||||
0x39a1;SGP4_InvalidEccentricity;No description;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x39a2;SGP4_InvalidMeanMotion;No description;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x39a3;SGP4_InvalidPerturbationElements;No description;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x39a4;SGP4_InvalidSemiLatusRectum;No description;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x39a5;SGP4_InvalidEpochElements;No description;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x39a6;SGP4_SatelliteHasDecayed;No description;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x39b1;SGP4_TleTooOld;No description;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x39b2;SGP4_TleNotInitialized;No description;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h
|
||||
0x3a01;MUX_NotEnoughResources;No description;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3a02;MUX_InsufficientMemory;No description;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3a03;MUX_NoPrivilege;No description;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3a04;MUX_WrongAttributeSetting;No description;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3a05;MUX_MutexAlreadyLocked;No description;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3a06;MUX_MutexNotFound;No description;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3a07;MUX_MutexMaxLocks;No description;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3a08;MUX_CurrThreadAlreadyOwnsMutex;No description;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3a09;MUX_CurrThreadDoesNotOwnMutex;No description;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3a0a;MUX_MutexTimeout;No description;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3a0b;MUX_MutexInvalidId;No description;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3a0c;MUX_MutexDestroyedWhileWaiting;No description;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h
|
||||
0x3b01;MQI_Empty;No description;1;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h
|
||||
0x3b02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h
|
||||
0x3b03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h
|
||||
0x3b04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h
|
||||
0x3c01;SPH_SemaphoreTimeout;No description;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h
|
||||
0x3c02;SPH_SemaphoreNotOwned;No description;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h
|
||||
0x3c03;SPH_SemaphoreInvalid;No description;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h
|
||||
0x3d00;LPIF_PoolEntryNotFound;No description;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h
|
||||
0x3d01;LPIF_PoolEntryTypeConflict;No description;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h
|
||||
0x3ea0;PVA_InvalidReadWriteMode;No description;160;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h
|
||||
0x3ea1;PVA_InvalidPoolEntry;No description;161;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h
|
||||
0x3f00;HKM_QueueOrDestinationInvalid;No description;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h
|
||||
0x3f01;HKM_WrongHkPacketType;No description;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h
|
||||
0x3f02;HKM_ReportingStatusUnchanged;No description;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h
|
||||
0x3f03;HKM_PeriodicHelperInvalid;No description;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h
|
||||
0x3f04;HKM_PoolobjectNotFound;No description;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h
|
||||
0x3f05;HKM_DatasetNotFound;No description;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h
|
||||
0x4001;DLEE_StreamTooShort;No description;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h
|
||||
0x4002;DLEE_DecodingError;No description;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h
|
||||
0x4301;PUS11_InvalidTypeTimeWindow;No description;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4302;PUS11_InvalidTimeWindow;No description;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4303;PUS11_TimeshiftingNotPossible;No description;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4304;PUS11_InvalidRelativeTime;No description;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4305;PUS11_ContainedTcTooSmall;No description;5;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4306;PUS11_ContainedTcCrcMissmatch;No description;6;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4307;PUS11_MapIsFull;No description;7;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||
0x4400;FILS_GenericFileError;No description;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4401;FILS_GenericDirError;No description;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4402;FILS_FilesystemInactive;No description;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4403;FILS_GenericRenameError;No description;3;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4404;FILS_IsBusy;No description;4;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4405;FILS_InvalidParameters;No description;5;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x440a;FILS_FileDoesNotExist;No description;10;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x440b;FILS_FileAlreadyExists;No description;11;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x440c;FILS_NotAFile;No description;12;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x440d;FILS_FileLocked;No description;13;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x440e;FILS_PermissionDenied;No description;14;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4415;FILS_DirectoryDoesNotExist;No description;21;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4416;FILS_DirectoryAlreadyExists;No description;22;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4417;FILS_NotADirectory;No description;23;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4418;FILS_DirectoryNotEmpty;No description;24;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x441e;FILS_SequencePacketMissingWrite;No description;30;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x441f;FILS_SequencePacketMissingRead;No description;31;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||
0x4500;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h
|
||||
0x4501;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h
|
||||
0x4502;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h
|
||||
0x4503;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h
|
||||
0x4504;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h
|
||||
0x4506;UXOS_PcloseCallError;No description;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h
|
||||
0x4600;HSPI_OpeningFileFailed;No description;0;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h
|
||||
0x4601;HSPI_FullDuplexTransferFailed;No description;1;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h
|
||||
0x4602;HSPI_HalfDuplexTransferFailed;No description;2;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h
|
||||
0x4603;HSPI_Timeout;No description;3;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h
|
||||
0x4604;HSPI_Busy;No description;4;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h
|
||||
0x4605;HSPI_GenericError;No description;5;HAL_SPI;fsfw/src/fsfw_hal/common/spi/spiCommon.h
|
||||
0x4701;HURT_UartReadFailure;No description;1;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h
|
||||
0x4702;HURT_UartReadSizeMissmatch;No description;2;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h
|
||||
0x4703;HURT_UartRxBufferTooSmall;No description;3;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h
|
||||
0x4901;HGIO_UnknownGpioId;No description;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4902;HGIO_DriveGpioFailure;No description;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4903;HGIO_GpioTypeFailure;No description;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4904;HGIO_GpioInvalidInstance;No description;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4905;HGIO_GpioDuplicateDetected;No description;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4906;HGIO_GpioInitFailed;No description;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4907;HGIO_GpioGetValueFailed;No description;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h
|
||||
0x4d00;SPPA_NoPacketFound;No description;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h
|
||||
0x4d01;SPPA_SplitPacket;No description;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h
|
||||
0x50a1;HEATER_CommandNotSupported;No description;161;HEATER_HANDLER;mission/tcs/HeaterHandler.h
|
||||
0x50a2;HEATER_InitFailed;No description;162;HEATER_HANDLER;mission/tcs/HeaterHandler.h
|
||||
0x50a3;HEATER_InvalidSwitchNr;No description;163;HEATER_HANDLER;mission/tcs/HeaterHandler.h
|
||||
0x50a4;HEATER_MainSwitchSetTimeout;No description;164;HEATER_HANDLER;mission/tcs/HeaterHandler.h
|
||||
0x50a5;HEATER_CommandAlreadyWaiting;No description;165;HEATER_HANDLER;mission/tcs/HeaterHandler.h
|
||||
0x51a0;SYRLINKS_CrcFailure;No description;160;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x51a1;SYRLINKS_UartFraminOrParityErrorAck;No description;161;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x51a2;SYRLINKS_BadCharacterAck;No description;162;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x51a3;SYRLINKS_BadParameterValueAck;No description;163;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x51a4;SYRLINKS_BadEndOfFrameAck;No description;164;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x51a5;SYRLINKS_UnknownCommandIdAck;No description;165;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x51a6;SYRLINKS_BadCrcAck;No description;166;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x51a7;SYRLINKS_ReplyWrongSize;No description;167;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x51a8;SYRLINKS_MissingStartFrameCharacter;No description;168;SYRLINKS_HANDLER;mission/com/SyrlinksHandler.h
|
||||
0x5200;IMTQ_InvalidCommandCode;No description;0;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5201;IMTQ_MgmMeasurementLowLevelError;No description;1;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5202;IMTQ_ActuateCmdLowLevelError;No description;2;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5203;IMTQ_ParameterMissing;No description;3;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5204;IMTQ_ParameterInvalid;No description;4;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5205;IMTQ_CcUnavailable;No description;5;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5206;IMTQ_InternalProcessingError;No description;6;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5207;IMTQ_RejectedWithoutReason;No description;7;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5208;IMTQ_CmdErrUnknown;No description;8;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x5209;IMTQ_StartupCfgError;No description;9;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x520a;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;10;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||
0x53a0;RWHA_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;RW_HANDLER;mission/acs/RwHandler.h
|
||||
0x53a1;RWHA_InvalidRampTime;Action Message with invalid ramp time was received.;161;RW_HANDLER;mission/acs/RwHandler.h
|
||||
0x53a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/acs/RwHandler.h
|
||||
0x53a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/acs/RwHandler.h
|
||||
0x53a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/acs/RwHandler.h
|
||||
0x53a5;RWHA_ValueNotRead;No description;165;RW_HANDLER;mission/acs/RwHandler.h
|
||||
0x53b0;RWHA_SpiWriteFailure;No description;176;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x53b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x53b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x53b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x53b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x53b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x53b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x53b7;RWHA_SpiReadTimeout;Timeout when reading reply;183;RW_HANDLER;mission/acs/rwHelpers.h
|
||||
0x54a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;160;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54a1;STRH_PingFailed;Ping command failed;161;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54a2;STRH_VersionReqFailed;Status in version reply signals error;162;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54a3;STRH_InterfaceReqFailed;Status in interface reply signals error;163;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54a4;STRH_PowerReqFailed;Status in power reply signals error;164;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;165;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54a6;STRH_ActionFailed;Status of reply to action command signals error;166;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54a7;STRH_FilePathTooLong;Received invalid path string. Exceeds allowed length;167;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54a8;STRH_FilenameTooLong;Name of file received with command is too long;168;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54a9;STRH_InvalidProgram;Received version reply with invalid program ID;169;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54aa;STRH_ReplyError;Status field reply signals error;170;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54ab;STRH_CommandTooShort;Received command which is too short (some data is missing for proper execution);171;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54ac;STRH_InvalidLength;Received command with invalid length (too few or too many parameters);172;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54ad;STRH_RegionMismatch;Region mismatch between send and received data;173;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54ae;STRH_AddressMismatch;Address mismatch between send and received data;174;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54af;STRH_LengthMismatch;Length field mismatch between send and received data;175;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54b0;STRH_FileNotExists;Specified file does not exist;176;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54b1;STRH_InvalidType;Download blob pixel command has invalid type field;177;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54b2;STRH_InvalidId;Received FPGA action command with invalid ID;178;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54b3;STRH_ReplyTooShort;Received reply is too short;179;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54b4;STRH_CrcFailure;Received reply with invalid CRC;180;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54b5;STRH_StrHelperExecuting;Star tracker handler currently executing a command and using the communication interface;181;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;182;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54b7;STRH_StartrackerNotRunningFirmware;Star tracker must be in firmware mode to run this command;183;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x54b8;STRH_StartrackerNotRunningBootloader;Star tracker must be in bootloader mode to run this command;184;STR_HANDLER;mission/acs/str/StarTrackerHandler.h
|
||||
0x55e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);224;DWLPWRON_CMD;linux/payload/plocMpsocHelpers.h
|
||||
0x55e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);225;DWLPWRON_CMD;linux/payload/plocMpsocHelpers.h
|
||||
0x5800;PLSPVhLP_RequestDone;No description;0;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x5801;PLSPVhLP_NoPacketFound;No description;1;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x5802;PLSPVhLP_DecodeBufTooSmall;No description;2;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x5803;PLSPVhLP_PossiblePacketLossConsecutiveStart;No description;3;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x5804;PLSPVhLP_PossiblePacketLossConsecutiveEnd;No description;4;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x5805;PLSPVhLP_HdlcError;No description;5;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x58a0;PLSPVhLP_FileClosedAccidentally;File accidentally close;160;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x58a1;PLSPVhLP_ProcessTerminated;Process has been terminated by command;161;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x58a2;PLSPVhLP_PathNotExists;Received command with invalid pathname;162;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x58a3;PLSPVhLP_EventBufferReplyInvalidApid;Expected event buffer TM but received space packet with other APID;163;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||
0x59a0;SUSS_ErrorUnlockMutex;No description;160;SUS_HANDLER;mission/acs/archive/LegacySusHandler.h
|
||||
0x59a1;SUSS_ErrorLockMutex;No description;161;SUS_HANDLER;mission/acs/archive/LegacySusHandler.h
|
||||
0x5aa0;IPCI_PapbBusy;No description;160;CCSDS_IP_CORE_BRIDGE;linux/ipcore/PapbVcInterface.h
|
||||
0x5ba0;PTME_UnknownVcId;No description;160;PTME;linux/ipcore/Ptme.h
|
||||
0x5d01;STRHLP_SdNotMounted;SD card specified in path string not mounted;1;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5d02;STRHLP_FileNotExists;Specified file does not exist on filesystem;2;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5d03;STRHLP_PathNotExists;Specified path does not exist;3;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5d04;STRHLP_FileCreationFailed;Failed to create download image or read flash file;4;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5d05;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;5;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5d06;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;6;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5d07;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;7;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5d08;STRHLP_StatusError;Status field in reply signals error;8;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5d09;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);9;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5d0a;STRHLP_ReceptionTimeout;No description;10;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5d0b;STRHLP_DecodingError;No description;11;STR_HELPER;linux/acs/StrComHandler.h
|
||||
0x5e00;GOMS_PacketTooLong;No description;0;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h
|
||||
0x5e01;GOMS_InvalidTableId;No description;1;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h
|
||||
0x5e02;GOMS_InvalidAddress;No description;2;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h
|
||||
0x5e03;GOMS_InvalidParamSize;No description;3;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h
|
||||
0x5e04;GOMS_InvalidPayloadSize;No description;4;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h
|
||||
0x5e05;GOMS_UnknownReplyId;No description;5;GOM_SPACE_HANDLER;mission/power/GomspaceDeviceHandler.h
|
||||
0x5fa0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;160;PLOC_MEMORY_DUMPER;linux/payload/PlocMemoryDumper.h
|
||||
0x5fa1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;161;PLOC_MEMORY_DUMPER;linux/payload/PlocMemoryDumper.h
|
||||
0x60a0;PDEC_AbandonedCltuRetval;No description;160;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60a1;PDEC_FrameDirtyRetval;No description;161;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60a2;PDEC_FrameIllegalMultipleReasons;No description;162;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60a3;PDEC_AdDiscardedLockoutRetval;No description;163;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60a4;PDEC_AdDiscardedWaitRetval;No description;164;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60a5;PDEC_AdDiscardedNsVs;No description;165;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60a6;PDEC_NoReportRetval;No description;166;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60a7;PDEC_ErrorVersionNumberRetval;No description;167;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60a8;PDEC_IllegalCombinationRetval;No description;168;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60a9;PDEC_InvalidScIdRetval;No description;169;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60aa;PDEC_InvalidVcIdMsbRetval;No description;170;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60ab;PDEC_InvalidVcIdLsbRetval;No description;171;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60ac;PDEC_NsNotZeroRetval;No description;172;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60ae;PDEC_InvalidBcCc;No description;174;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x60b0;PDEC_CommandNotImplemented;Received action message with unknown action id;176;PDEC_HANDLER;linux/ipcore/pdec.h
|
||||
0x61a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/com/CcsdsIpCoreHandler.h
|
||||
0x62a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;160;RATE_SETTER;linux/ipcore/PtmeConfig.h
|
||||
0x62a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);161;RATE_SETTER;linux/ipcore/PtmeConfig.h
|
||||
0x62a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;162;RATE_SETTER;linux/ipcore/PtmeConfig.h
|
||||
0x62a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;163;RATE_SETTER;linux/ipcore/PtmeConfig.h
|
||||
0x6301;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h
|
||||
0x6302;JSONBASE_SetNotExists;Requested set does not exist in json file;2;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h
|
||||
0x6303;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;ARCSEC_JSON_BASE;mission/acs/str/ArcsecJsonParamBase.h
|
||||
0x64a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NvmParameterBase.h
|
||||
0x65a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;160;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h
|
||||
0x65a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;161;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h
|
||||
0x66a0;PLMPHLP_FileWriteError;File error occured for file transfers from OBC to the MPSoC.;160;PLOC_MPSOC_HELPER;linux/payload/PlocMpsocSpecialComHelper.h
|
||||
0x66a1;PLMPHLP_FileReadError;File error occured for file transfers from MPSoC to OBC.;161;PLOC_MPSOC_HELPER;linux/payload/PlocMpsocSpecialComHelper.h
|
||||
0x67a0;SADPL_CommandNotSupported;No description;160;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
|
||||
0x67a1;SADPL_DeploymentAlreadyExecuting;No description;161;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
|
||||
0x67a2;SADPL_MainSwitchTimeoutFailure;No description;162;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
|
||||
0x67a3;SADPL_SwitchingDeplSa1Failed;No description;163;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
|
||||
0x67a4;SADPL_SwitchingDeplSa2Failed;No description;164;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
|
||||
0x68a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;160;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x68a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;161;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x68a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;162;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x68a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;163;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x68a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;164;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x68a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;165;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x68a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;166;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x68a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);167;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x68a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;168;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x68a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;169;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
|
||||
0x69a0;SPVRTVIF_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;160;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69a1;SPVRTVIF_InvalidServiceId;No description;161;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69a2;SPVRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;162;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69a3;SPVRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC supervisor;163;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69a4;SPVRTVIF_InvalidApid;Received space packet with invalid APID from PLOC supervisor;164;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69a5;SPVRTVIF_GetTimeFailure;Failed to read current system time;165;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69a6;SPVRTVIF_InvalidWatchdog;Received command with invalid watchdog parameter. Valid watchdogs are 0 for PS, 1 for PL and 2 for INT;166;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69a7;SPVRTVIF_InvalidWatchdogTimeout;Received watchdog timeout config command with invalid timeout. Valid timeouts must be in the range between 1000 and 360000 ms.;167;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69a8;SPVRTVIF_InvalidLatchupId;Received latchup config command with invalid latchup ID;168;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69a9;SPVRTVIF_SweepPeriodTooSmall;Received set adc sweep period command with invalid sweep period. Must be larger than 21.;169;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69aa;SPVRTVIF_InvalidTestParam;Receive auto EM test command with invalid test param. Valid params are 1 and 2.;170;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69ab;SPVRTVIF_MramPacketParsingFailure;Returned when scanning for MRAM dump packets failed.;171;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69ac;SPVRTVIF_InvalidMramAddresses;Returned when the start and stop addresses of the MRAM dump or MRAM wipe commands are invalid (e.g. start address bigger than stop address);172;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69ad;SPVRTVIF_NoMramPacket;Expect reception of an MRAM dump packet but received space packet with other apid.;173;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69ae;SPVRTVIF_PathDoesNotExist;Path to PLOC directory on SD card does not exist;174;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69af;SPVRTVIF_MramFileNotExists;MRAM dump file does not exists. The file should actually already have been created with the reception of the first dump packet.;175;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69b0;SPVRTVIF_InvalidReplyLength;No description;176;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69b1;SPVRTVIF_InvalidLength;Received action command has invalid length;177;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69b2;SPVRTVIF_FilenameTooLong;Filename too long;178;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69b3;SPVRTVIF_UpdateStatusReportInvalidLength;Received update status report with invalid packet length field;179;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69b4;SPVRTVIF_UpdateCrcFailure;Update status report does not contain expected CRC. There might be a bit flip in the update memory region.;180;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69b5;SPVRTVIF_SupvHelperExecuting;Supervisor helper task ist currently executing a command (wait until helper tas has finished or interrupt by sending the terminate command);181;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69c0;SPVRTVIF_BufTooSmall;No description;192;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x69c1;SPVRTVIF_NoReplyTimeout;No description;193;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||
0x6aa0;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;160;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h
|
||||
0x6aa1;ACSCTRL_WriteFileFailed;Writing the TLE to the file has failed.;161;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h
|
||||
0x6aa2;ACSCTRL_ReadFileFailed;Reading the TLE to the file has failed.;162;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h
|
||||
0x6aa3;ACSCTRL_SingleRwUnavailable;A single RW has failed.;163;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h
|
||||
0x6aa4;ACSCTRL_MultipleRwUnavailable;Multiple RWs have failed.;164;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h
|
||||
0x6b02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6b03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6b04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6b05;ACSMEKF_MekfNoSusMgmStrData;No description;5;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6b06;ACSMEKF_MekfCovarianceInversionFailed;No description;6;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6b07;ACSMEKF_MekfNotFinite;No description;7;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6b08;ACSMEKF_MekfInitialized;No description;8;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6b09;ACSMEKF_MekfRunning;No description;9;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||
0x6c00;SDMA_OpOngoing;No description;0;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6c01;SDMA_AlreadyOn;No description;1;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6c02;SDMA_AlreadyMounted;No description;2;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6c03;SDMA_AlreadyOff;No description;3;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6c0a;SDMA_StatusFileNexists;No description;10;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6c0b;SDMA_StatusFileFormatInvalid;No description;11;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6c0c;SDMA_MountError;No description;12;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6c0d;SDMA_UnmountError;No description;13;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6c0e;SDMA_SystemCallError;No description;14;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6c0f;SDMA_PopenCallError;No description;15;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h
|
||||
0x6d00;LPH_SdNotReady;No description;0;LOCAL_PARAM_HANDLER;bsp_q7s/memory/LocalParameterHandler.h
|
||||
0x6e00;PTM_DumpDone;No description;0;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h
|
||||
0x6e01;PTM_BusyDumping;No description;1;PERSISTENT_TM_STORE;mission/tmtc/PersistentTmStore.h
|
||||
0x6f00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h
|
||||
0x6f01;TMS_PartiallyWritten;No description;1;TM_SINK;mission/tmtc/DirectTmSinkIF.h
|
||||
0x6f02;TMS_NoWriteActive;No description;2;TM_SINK;mission/tmtc/DirectTmSinkIF.h
|
||||
0x6f03;TMS_Timeout;No description;3;TM_SINK;mission/tmtc/DirectTmSinkIF.h
|
||||
0x7000;VCS_ChannelDoesNotExist;No description;0;VIRTUAL_CHANNEL;mission/com/VirtualChannel.h
|
||||
0x7200;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h
|
||||
|
|
@ -60,3 +60,5 @@
|
||||
142;COM_SUBSYSTEM
|
||||
143;PERSISTENT_TM_STORE
|
||||
144;SYRLINKS_COM
|
||||
145;SUS_HANDLER
|
||||
146;CFDP_APP
|
||||
|
|
@ -11,8 +11,8 @@ import struct
|
||||
from typing import Union
|
||||
|
||||
from spacepackets.ecss import PusTelecommand
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
from tmtccmd.util import ObjectIdU32, ObjectIdBase
|
||||
|
||||
|
||||
|
@ -6,13 +6,14 @@ from typing import cast
|
||||
from eive_tmtc.tmtc.acs.gyros import handle_gyr_cmd
|
||||
from eive_tmtc.tmtc.acs.mgms import handle_mgm_cmd
|
||||
from eive_tmtc.tmtc.power.power import pack_power_commands
|
||||
from eive_tmtc.tmtc.tcs.ctrl import pack_tcs_ctrl_commands
|
||||
from eive_tmtc.tmtc.tcs.rtd import pack_rtd_commands
|
||||
from eive_tmtc.tmtc.payload.scex import pack_scex_cmds
|
||||
from eive_tmtc.tmtc.tcs.subsystem import pack_tcs_sys_commands
|
||||
from tmtccmd import DefaultProcedureInfo, TcHandlerBase
|
||||
from tmtccmd.config import CoreServiceList
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.decorator import (
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc.decorator import (
|
||||
route_to_registered_service_handlers,
|
||||
ServiceProviderParams,
|
||||
)
|
||||
@ -34,6 +35,7 @@ from eive_tmtc.tmtc.core import pack_core_commands
|
||||
from eive_tmtc.tmtc.acs.star_tracker import pack_star_tracker_commands
|
||||
from eive_tmtc.tmtc.com.syrlinks_handler import pack_syrlinks_command
|
||||
from eive_tmtc.tmtc.com.pdec_handler import pack_pdec_handler_test
|
||||
from eive_tmtc.tmtc.wdt import pack_wdt_commands
|
||||
from eive_tmtc.tmtc.acs.acs_board import pack_acs_command
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from eive_tmtc.config.object_ids import (
|
||||
@ -65,7 +67,7 @@ from eive_tmtc.config.object_ids import (
|
||||
from eive_tmtc.tmtc.tcs.tmp1075 import pack_tmp1075_test_into
|
||||
from eive_tmtc.tmtc.acs.gps import pack_gps_command
|
||||
from eive_tmtc.tmtc.payload.rad_sensor import pack_rad_sensor_test_into
|
||||
from eive_tmtc.tmtc.power.plpcdu import pack_pl_pcdu_commands
|
||||
from eive_tmtc.tmtc.payload.plpcdu import pack_pl_pcdu_commands
|
||||
from eive_tmtc.tmtc.acs.str_img_helper import pack_str_img_helper_command
|
||||
from eive_tmtc.pus_tc.system.proc import pack_proc_commands
|
||||
|
||||
@ -99,8 +101,10 @@ def handle_default_procedure( # noqa C901: Complexity okay here.
|
||||
if service == CustomServiceList.ACU.value:
|
||||
object_id = cast(ObjectIdU32, obj_id_man.get(ACU_HANDLER_ID))
|
||||
return pack_acu_commands(object_id=object_id, q=queue_helper, op_code=op_code)
|
||||
if service == CustomServiceList.TCS.value:
|
||||
if service == CustomServiceList.TCS_SS.value:
|
||||
return pack_tcs_sys_commands(q=queue_helper, op_code=op_code)
|
||||
if service == CustomServiceList.TCS_CTRL.value:
|
||||
return pack_tcs_ctrl_commands(q=queue_helper, op_code=op_code)
|
||||
if service == CustomServiceList.TMP1075.value:
|
||||
menu_dict = {
|
||||
"0": ("TMP1075 TCS Board 0", TMP1075_HANDLER_TCS_BRD_0_ID),
|
||||
@ -202,6 +206,8 @@ def handle_default_procedure( # noqa C901: Complexity okay here.
|
||||
queue_helper=queue_helper,
|
||||
)
|
||||
)
|
||||
if service == CustomServiceList.XIPHOS_WDT.value:
|
||||
return pack_wdt_commands(queue_helper, op_code)
|
||||
if not route_to_registered_service_handlers(
|
||||
service,
|
||||
ServiceProviderParams(
|
||||
|
@ -1,7 +1,7 @@
|
||||
from typing import Union
|
||||
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Mode
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode
|
||||
from tmtccmd.util import ObjectIdU32, ObjectIdBase
|
||||
|
||||
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
||||
|
@ -10,7 +10,7 @@ from spacepackets.ecss import PusTelecommand
|
||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s11_tc_sched import (
|
||||
create_time_tagged_cmd,
|
||||
create_enable_tc_sched_cmd,
|
||||
@ -50,7 +50,7 @@ from eive_tmtc.tmtc.acs.gyros import (
|
||||
L3gGyroSetId as L3gGyroSetIds_1_3,
|
||||
)
|
||||
from eive_tmtc.tmtc.acs.gps import SetId as GpsSetIds
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
||||
make_sid,
|
||||
disable_periodic_hk_command,
|
||||
create_enable_periodic_hk_command_with_interval,
|
||||
@ -765,7 +765,6 @@ def gen_disable_listen_to_hk_for_x_seconds(
|
||||
def activate_mgts_alternately(
|
||||
q: DefaultPusQueueHelper,
|
||||
):
|
||||
|
||||
q.add_pus_tc(
|
||||
pack_dipole_command(
|
||||
object_id=oids.IMTQ_HANDLER_ID,
|
||||
|
163
eive_tmtc/pus_tc/tc_handler.py
Normal file
163
eive_tmtc/pus_tc/tc_handler.py
Normal file
@ -0,0 +1,163 @@
|
||||
import logging
|
||||
from typing import cast
|
||||
|
||||
from eive_tmtc.config.definitions import (
|
||||
CFDP_REMOTE_ENTITY_ID,
|
||||
PUS_APID,
|
||||
CFDP_LOCAL_ENTITY_ID,
|
||||
)
|
||||
from eive_tmtc.pus_tc.procedure_packer import handle_default_procedure
|
||||
from tmtccmd import TcHandlerBase, ProcedureWrapper
|
||||
from tmtccmd.cfdp.defs import CfdpRequestType
|
||||
from tmtccmd.cfdp.handler import CfdpInCcsdsHandler
|
||||
from tmtccmd.logging import get_current_time_string
|
||||
from tmtccmd.logging.pus import RawTmtcTimedLogWrapper
|
||||
from tmtccmd.tmtc import (
|
||||
DefaultPusQueueHelper,
|
||||
QueueWrapper,
|
||||
FeedWrapper,
|
||||
TcProcedureType,
|
||||
SendCbParams,
|
||||
TcQueueEntryType,
|
||||
)
|
||||
from tmtccmd.config.cfdp import generic_cfdp_params_to_put_request
|
||||
from spacepackets.ecss import PusVerificator
|
||||
from tmtccmd.util import FileSeqCountProvider
|
||||
from spacepackets.cfdp import PduHolder, DirectiveType
|
||||
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class TcHandler(TcHandlerBase):
|
||||
def __init__(
|
||||
self,
|
||||
seq_count_provider: FileSeqCountProvider,
|
||||
cfdp_in_ccsds_handler: CfdpInCcsdsHandler,
|
||||
pus_verificator: PusVerificator,
|
||||
high_level_file_logger: logging.Logger,
|
||||
raw_pus_logger: RawTmtcTimedLogWrapper,
|
||||
gui: bool,
|
||||
):
|
||||
super().__init__()
|
||||
self.cfdp_handler_started = False
|
||||
self.seq_count_provider = seq_count_provider
|
||||
self.pus_verificator = pus_verificator
|
||||
self.high_level_file_logger = high_level_file_logger
|
||||
self.pus_raw_logger = raw_pus_logger
|
||||
self.gui = gui
|
||||
self.proxy_op = True
|
||||
self.queue_helper = DefaultPusQueueHelper(
|
||||
queue_wrapper=QueueWrapper.empty(),
|
||||
default_pus_apid=PUS_APID,
|
||||
seq_cnt_provider=seq_count_provider,
|
||||
pus_verificator=pus_verificator,
|
||||
tc_sched_timestamp_len=4,
|
||||
)
|
||||
self.cfdp_in_ccsds_handler = cfdp_in_ccsds_handler
|
||||
|
||||
def cfdp_done(self) -> bool:
|
||||
if self.cfdp_handler_started:
|
||||
if (
|
||||
not self.cfdp_in_ccsds_handler.put_request_pending()
|
||||
and not self.proxy_op
|
||||
):
|
||||
self.cfdp_handler_started = False
|
||||
return True
|
||||
return False
|
||||
|
||||
def feed_cb(self, info: ProcedureWrapper, wrapper: FeedWrapper):
|
||||
self.queue_helper.queue_wrapper = wrapper.queue_wrapper
|
||||
if info.proc_type == TcProcedureType.DEFAULT:
|
||||
handle_default_procedure(self, info.to_def_procedure(), self.queue_helper)
|
||||
elif info.proc_type == TcProcedureType.CFDP:
|
||||
self.handle_cfdp_procedure(info)
|
||||
|
||||
def send_cb(self, send_params: SendCbParams):
|
||||
entry_helper = send_params.entry
|
||||
if entry_helper.is_tc:
|
||||
if entry_helper.entry_type == TcQueueEntryType.PUS_TC:
|
||||
pus_tc_wrapper = entry_helper.to_pus_tc_entry()
|
||||
# pus_tc_wrapper.pus_tc.apid = PUS_APID
|
||||
raw_tc = pus_tc_wrapper.pus_tc.pack()
|
||||
self.pus_raw_logger.log_tc(pus_tc_wrapper.pus_tc)
|
||||
tc_info_string = f"Sent {pus_tc_wrapper.pus_tc}"
|
||||
_LOGGER.info(tc_info_string)
|
||||
self.high_level_file_logger.info(
|
||||
f"{get_current_time_string(True)}: {tc_info_string}"
|
||||
)
|
||||
# with open("tc.bin", "wb") as of:
|
||||
# of.write(raw_tc)
|
||||
send_params.com_if.send(raw_tc)
|
||||
elif entry_helper.entry_type == TcQueueEntryType.CCSDS_TC:
|
||||
cfdp_packet_in_ccsds = entry_helper.to_space_packet_entry()
|
||||
send_params.com_if.send(cfdp_packet_in_ccsds.space_packet.pack())
|
||||
# TODO: Log raw CFDP packets similarly to how PUS packets are logged.
|
||||
# - Log full raw format including space packet wrapper
|
||||
# - Log context information: Transaction ID, and PDU type and directive
|
||||
# Could re-use file logger. Should probably do that
|
||||
# print(f"sending packet: [{cfdp_packet_in_ccsds.space_packet.pack()}]")
|
||||
# with open(f"cfdp_packet_{self.cfdp_counter}", "wb") as of:
|
||||
# of.write(cfdp_packet_in_ccsds.space_packet.pack())
|
||||
# self.cfdp_counter += 1
|
||||
elif entry_helper.entry_type == TcQueueEntryType.LOG:
|
||||
log_entry = entry_helper.to_log_entry()
|
||||
_LOGGER.info(log_entry.log_str)
|
||||
self.high_level_file_logger.info(log_entry.log_str)
|
||||
|
||||
def handle_cfdp_procedure(self, info: ProcedureWrapper):
|
||||
cfdp_procedure = info.to_cfdp_procedure()
|
||||
if cfdp_procedure.cfdp_request_type == CfdpRequestType.PUT:
|
||||
if (
|
||||
not self.cfdp_in_ccsds_handler.put_request_pending()
|
||||
and not self.cfdp_handler_started
|
||||
):
|
||||
put_req_cfg_wrapper = cfdp_procedure.request_wrapper.to_put_request()
|
||||
if put_req_cfg_wrapper.cfg.proxy_op:
|
||||
self.proxy_op = True
|
||||
put_req = generic_cfdp_params_to_put_request(
|
||||
params=put_req_cfg_wrapper.cfg,
|
||||
local_id=CFDP_LOCAL_ENTITY_ID,
|
||||
remote_id=CFDP_REMOTE_ENTITY_ID,
|
||||
dest_id_proxy_put_req=CFDP_LOCAL_ENTITY_ID,
|
||||
)
|
||||
_LOGGER.info(
|
||||
f"CFDP: Starting file put request with parameters:\n{put_req}"
|
||||
)
|
||||
self.cfdp_in_ccsds_handler.cfdp_handler.put_request(put_req)
|
||||
self.cfdp_handler_started = True
|
||||
|
||||
for source_pair, dest_pair in self.cfdp_in_ccsds_handler:
|
||||
pdu, sp = source_pair
|
||||
pdu = cast(PduHolder, pdu)
|
||||
if pdu.is_file_directive:
|
||||
if pdu.pdu_directive_type == DirectiveType.METADATA_PDU:
|
||||
metadata = pdu.to_metadata_pdu()
|
||||
self.queue_helper.add_log_cmd(
|
||||
"CFDP Source: Sending Metadata PDU for file with size "
|
||||
f"{metadata.file_size}"
|
||||
)
|
||||
elif pdu.pdu_directive_type == DirectiveType.EOF_PDU:
|
||||
self.queue_helper.add_log_cmd(
|
||||
"CFDP Source: Sending EOF PDU"
|
||||
)
|
||||
else:
|
||||
fd_pdu = pdu.to_file_data_pdu()
|
||||
self.queue_helper.add_log_cmd(
|
||||
"CFDP Source: Sending File Data PDU for segment at offset "
|
||||
f"{fd_pdu.offset} with length {len(fd_pdu.file_data)}"
|
||||
)
|
||||
self.queue_helper.add_ccsds_tc(sp)
|
||||
self.cfdp_in_ccsds_handler.confirm_source_packet_sent()
|
||||
self.cfdp_in_ccsds_handler.source_handler.state_machine()
|
||||
|
||||
def queue_finished_cb(self, info: ProcedureWrapper):
|
||||
if info is not None:
|
||||
if info.proc_type == TcQueueEntryType.PUS_TC:
|
||||
def_proc = info.to_def_procedure()
|
||||
_LOGGER.info(
|
||||
f"Finished queue for service {def_proc.service} and op code"
|
||||
f" {def_proc.op_code}"
|
||||
)
|
||||
elif info.proc_type == TcProcedureType.CFDP:
|
||||
_LOGGER.info("Finished CFDP queue")
|
@ -10,15 +10,17 @@ from eive_tmtc.config.object_ids import (
|
||||
CORE_CONTROLLER_ID,
|
||||
STAR_TRACKER_ID,
|
||||
P60_DOCK_HANDLER,
|
||||
ACS_CONTROLLER,
|
||||
)
|
||||
from eive_tmtc.tmtc.acs.imtq import ImtqActionId
|
||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
from eive_tmtc.tmtc.core import handle_core_ctrl_action_replies
|
||||
from eive_tmtc.tmtc.payload.ploc_mpsoc import handle_mpsoc_data_reply
|
||||
from eive_tmtc.tmtc.payload.ploc_supervisor import SupvActionId
|
||||
from eive_tmtc.tmtc.acs.star_tracker import StarTrackerActionId
|
||||
from eive_tmtc.tmtc.acs.star_tracker import handle_star_tracker_action_replies
|
||||
from eive_tmtc.tmtc.acs.acs_ctrl import handle_acs_ctrl_action_replies
|
||||
from eive_tmtc.tmtc.power.tm import handle_get_param_data_reply
|
||||
from tmtccmd.tm import Service8FsfwTm
|
||||
from tmtccmd.pus.s8_fsfw_action import Service8FsfwTm
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
from spacepackets.ccsds.time import CdsShortTimestamp
|
||||
from tmtccmd.util import ObjectIdDictT
|
||||
@ -52,7 +54,9 @@ def handle_action_reply(
|
||||
elif object_id.as_bytes == CORE_CONTROLLER_ID:
|
||||
return handle_core_ctrl_action_replies(action_id, pw, custom_data)
|
||||
elif object_id.as_bytes == STAR_TRACKER_ID:
|
||||
return handle_startracker_replies(action_id, pw, custom_data)
|
||||
return handle_star_tracker_action_replies(action_id, pw, custom_data)
|
||||
elif object_id.as_bytes == ACS_CONTROLLER:
|
||||
return handle_acs_ctrl_action_replies(action_id, pw, custom_data)
|
||||
elif object_id.as_bytes in [
|
||||
ACU_HANDLER_ID,
|
||||
PDU_1_HANDLER_ID,
|
||||
@ -89,20 +93,3 @@ def handle_supervisor_replies(action_id: int, pw: PrintWrapper, custom_data: byt
|
||||
content_list = [struct.unpack("!H", custom_data[:2])[0]]
|
||||
pw.dlog(f"{header_list}")
|
||||
pw.dlog(f"{content_list}")
|
||||
|
||||
|
||||
def handle_startracker_replies(
|
||||
action_id: int, pw: PrintWrapper, custom_data: bytearray
|
||||
):
|
||||
if action_id == StarTrackerActionId.CHECKSUM:
|
||||
if len(custom_data) != 5:
|
||||
_LOGGER.warning(
|
||||
"Star tracker reply has invalid length {0}".format(len(custom_data))
|
||||
)
|
||||
return
|
||||
header_list = ["Checksum", "Checksum valid"]
|
||||
print(custom_data[4])
|
||||
checksum_valid_flag = custom_data[4] >> 8
|
||||
content_list = ["0x" + custom_data[:4].hex(), checksum_valid_flag]
|
||||
pw.dlog(f"{header_list}")
|
||||
pw.dlog(f"{content_list}")
|
||||
|
@ -1,25 +1,24 @@
|
||||
import logging
|
||||
import datetime
|
||||
import logging
|
||||
import sys
|
||||
|
||||
from spacepackets.ccsds.time import CdsShortTimestamp
|
||||
from tmtccmd.fsfw import EventInfo
|
||||
from tmtccmd.pus.s5_fsfw_event import EventDefinition, Service5Tm
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode
|
||||
from tmtccmd.pus.s201_fsfw_health import FsfwHealth
|
||||
|
||||
from eive_tmtc.config.events import get_event_dict
|
||||
from eive_tmtc.config.object_ids import get_object_ids
|
||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
from eive_tmtc.pus_tm.verification_handler import generic_retval_printout
|
||||
from eive_tmtc.tmtc.acs.subsystem import AcsMode
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Mode
|
||||
from tmtccmd.tc.pus_201_fsfw_health import FsfwHealth
|
||||
|
||||
from tmtccmd.tm import Service5Tm
|
||||
from tmtccmd.fsfw import EventInfo
|
||||
from spacepackets.ccsds.time import CdsShortTimestamp
|
||||
from eive_tmtc.tmtc.core import SdCardSelect, SdState
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def handle_event_packet( # noqa C901: Complexity okay here
|
||||
raw_tm: bytes, pw: PrintWrapper
|
||||
): # noqa C901: Complexity okay here
|
||||
def handle_event_packet(raw_tm: bytes, pw: PrintWrapper):
|
||||
tm = Service5Tm.unpack(data=raw_tm, time_reader=CdsShortTimestamp.empty())
|
||||
event_dict = get_event_dict()
|
||||
event_def = tm.event_definition
|
||||
@ -35,15 +34,30 @@ def handle_event_packet( # noqa C901: Complexity okay here
|
||||
obj_name = event_def.reporter_id.hex(sep=",")
|
||||
else:
|
||||
obj_name = obj_id_obj.name
|
||||
assert tm.time_provider is not None
|
||||
generic_event_string = (
|
||||
f"Object {obj_name} generated Event {info.name} (ID: {event_def.event_id:#04x}) "
|
||||
f"at {tm.time_provider.as_date_time()}"
|
||||
f"Object {obj_name} generated Event {info.name} (ID: {event_def.event_id:#04x})"
|
||||
f" at {tm.time_provider.as_date_time()}"
|
||||
)
|
||||
_LOGGER.info(generic_event_string)
|
||||
pw.file_logger.info(
|
||||
f"{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}: {generic_event_string}"
|
||||
)
|
||||
specific_handler = False
|
||||
if pw.file_logger is not None:
|
||||
pw.file_logger.info(
|
||||
f"{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}:"
|
||||
f" {generic_event_string}"
|
||||
)
|
||||
specific_handler = handle_specific_events(pw, obj_name, info, event_def)
|
||||
if not specific_handler:
|
||||
additional_event_info = (
|
||||
f"Additional info: {info.info} | P1: {event_def.param1} | "
|
||||
f"P2: {event_def.param2}"
|
||||
)
|
||||
pw.dlog(additional_event_info)
|
||||
|
||||
|
||||
def handle_specific_events(
|
||||
pw: PrintWrapper, obj_name: str, info: EventInfo, event_def: EventDefinition
|
||||
) -> bool:
|
||||
specific_handler = True
|
||||
if info.name == "MODE_TRANSITION_FAILED":
|
||||
reason = generic_retval_printout(event_def.param1)
|
||||
for string in reason:
|
||||
@ -53,8 +67,8 @@ def handle_event_packet( # noqa C901: Complexity okay here
|
||||
if info.name == "SUPV_UPDATE_PROGRESS" or info.name == "WRITE_MEMORY_FAILED":
|
||||
additional_event_info = f"Additional info: {info.info}"
|
||||
context = (
|
||||
f"Progress Percent: {event_def.param1 >> 24 & 0xff} | "
|
||||
f"Sequence Count: {event_def.param1 & 0xffff} | Bytes Written: {event_def.param2}"
|
||||
f"Progress Percent: {event_def.param1 >> 24 & 0xff} | Sequence Count:"
|
||||
f" {event_def.param1 & 0xffff} | Bytes Written: {event_def.param2}"
|
||||
)
|
||||
pw.dlog(additional_event_info)
|
||||
pw.dlog(context)
|
||||
@ -95,7 +109,7 @@ def handle_event_packet( # noqa C901: Complexity okay here
|
||||
if info.name == "REBOOT_COUNTER":
|
||||
boot_count = (event_def.param1 << 32) | event_def.param2
|
||||
pw.dlog(f"Total boot count: {boot_count}")
|
||||
if info.name == "VERSION_INFO":
|
||||
if info.name == "VERSION_INFO" or info.name == "FIRMWARE_INFO":
|
||||
specific_handler = True
|
||||
ver_major = (event_def.param1 >> 24) & 0xFF
|
||||
ver_minor = (event_def.param1 >> 16) & 0xFF
|
||||
@ -105,8 +119,11 @@ def handle_event_packet( # noqa C901: Complexity okay here
|
||||
if has_git_sha:
|
||||
p2_as_bytes = event_def.param2.to_bytes(4, sys.byteorder)
|
||||
git_sha = p2_as_bytes.decode("ascii")
|
||||
version_string = f"v{ver_major}.{ver_minor}.{ver_rev}"
|
||||
pw.dlog(f"Version {version_string}")
|
||||
if info.name == "VERSION_INFO":
|
||||
name = "OBSW version: "
|
||||
else:
|
||||
name = "Firmware version: "
|
||||
pw.dlog(f"{name} v{ver_major}.{ver_minor}.{ver_rev}")
|
||||
if has_git_sha:
|
||||
pw.dlog(f"Git SHA first four letters: {git_sha}")
|
||||
if info.name == "CLOCK_SET":
|
||||
@ -123,6 +140,21 @@ def handle_event_packet( # noqa C901: Complexity okay here
|
||||
time = event_def.param1 + event_def.param2 / 1000.0
|
||||
time_dt = datetime.datetime.fromtimestamp(time, datetime.timezone.utc)
|
||||
pw.dlog(f"Current time: {time_dt}")
|
||||
if info.name == "ACTIVE_SD_INFO":
|
||||
sd_0_state = (event_def.param2 >> 16) & 0xFFFF
|
||||
sd_1_state = event_def.param2 & 0xFFFF
|
||||
active_sd = event_def.param1
|
||||
try:
|
||||
active_sd = SdCardSelect(event_def.param1)
|
||||
sd_0_state = SdState((event_def.param2 >> 16) & 0xFFFF)
|
||||
sd_1_state = SdState(event_def.param2 & 0xFFFF)
|
||||
except IndexError:
|
||||
_LOGGER.error(f"Received invalid event fields for event {event_def}")
|
||||
finally:
|
||||
pw.dlog(
|
||||
f"Active SD card {active_sd!r} | SD 0 State {sd_0_state!r} | SD 1 "
|
||||
f"State {sd_1_state!r}"
|
||||
)
|
||||
if info.name == "HEALTH_INFO":
|
||||
specific_handler = True
|
||||
health = FsfwHealth(event_def.param1)
|
||||
@ -131,12 +163,4 @@ def handle_event_packet( # noqa C901: Complexity okay here
|
||||
mode = event_def.param1
|
||||
submode = event_def.param2
|
||||
pw.dlog(f"Mode Number {mode}, Submode: {submode}")
|
||||
if not specific_handler:
|
||||
additional_event_info = (
|
||||
f"Additional info: {info.info} | P1: {event_def.param1} | "
|
||||
f"P2: {event_def.param2}"
|
||||
)
|
||||
pw.dlog(additional_event_info)
|
||||
if not specific_handler:
|
||||
# printer.handle_long_tm_print(packet_if=tm.pus_tm, info_if=tm.pus_tm)
|
||||
pass
|
||||
return specific_handler
|
||||
|
@ -1,21 +1,24 @@
|
||||
"""HK Handling for EIVE OBSW"""
|
||||
import dataclasses
|
||||
import logging
|
||||
from typing import List
|
||||
|
||||
# from pus_tm.tcp_server_objects import TCP_SEVER_SENSOR_TEMPERATURES
|
||||
from eive_tmtc.tmtc.acs.acs_ctrl import handle_acs_ctrl_hk_data
|
||||
from eive_tmtc.tmtc.internal_err_reporter import handle_ier_hk_data
|
||||
from eive_tmtc.tmtc.payload.ploc_mpsoc import handle_ploc_mpsoc_hk_data
|
||||
from eive_tmtc.tmtc.tcs.rtd import RTD_NAMES, handle_rtd_hk
|
||||
from eive_tmtc.tmtc.acs.star_tracker import handle_str_hk_data
|
||||
from eive_tmtc.tmtc.power.plpcdu import handle_plpcdu_hk
|
||||
from eive_tmtc.tmtc.payload.plpcdu import handle_plpcdu_hk
|
||||
from eive_tmtc.tmtc.payload.rad_sensor import handle_rad_sensor_data
|
||||
from eive_tmtc.tmtc.acs.sus import handle_sus_hk
|
||||
from eive_tmtc.tmtc.payload.ploc_supervisor import handle_supv_hk_data
|
||||
from eive_tmtc.tmtc.acs.reaction_wheels import handle_rw_hk_data
|
||||
from eive_tmtc.tmtc.power.pwr_ctrl import handle_pwr_ctrl_hk_data
|
||||
from eive_tmtc.tmtc.com.syrlinks_handler import handle_syrlinks_hk_data
|
||||
from eive_tmtc.tmtc.tcs import handle_thermal_controller_hk_data
|
||||
from eive_tmtc.tmtc.tcs.tmp1075 import handle_tmp_1075_hk_data
|
||||
from spacepackets.ecss import PusTelemetry
|
||||
from tmtccmd.tm.pus_3_fsfw_hk import (
|
||||
from tmtccmd.pus.tm.s3_fsfw_hk import (
|
||||
Service3Base,
|
||||
HkContentType,
|
||||
Service3FsfwTm,
|
||||
@ -44,14 +47,20 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
FORWARD_SENSOR_TEMPS = False
|
||||
# TODO: Transform this into a CLI argument
|
||||
HK_OUTPUT_LEVEL = 1
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class HkFilter:
|
||||
object_ids: List[ObjectIdU32]
|
||||
set_ids: List[int]
|
||||
|
||||
|
||||
def handle_hk_packet(
|
||||
raw_tm: bytes,
|
||||
obj_id_dict: ObjectIdDictT,
|
||||
printer: FsfwTmTcPrinter,
|
||||
hk_filter: HkFilter,
|
||||
hk_level: int,
|
||||
):
|
||||
tm_packet = Service3FsfwTm.unpack(raw_telemetry=raw_tm, custom_hk_handling=False)
|
||||
named_obj_id = obj_id_dict.get(tm_packet.object_id.as_bytes)
|
||||
@ -59,20 +68,22 @@ def handle_hk_packet(
|
||||
named_obj_id = tm_packet.object_id
|
||||
if tm_packet.subservice == 25 or tm_packet.subservice == 26:
|
||||
hk_data = tm_packet.tm_data[8:]
|
||||
if FORWARD_SENSOR_TEMPS:
|
||||
# TODO: Maybe use singleton?
|
||||
# TCP_SEVER_SENSOR_TEMPERATURES.report_raw_hk_data(
|
||||
# object_id=named_obj_id, set_id=tm_packet.set_id, hk_data=hk_data
|
||||
# )
|
||||
pass
|
||||
printer.generic_hk_tm_print(
|
||||
content_type=HkContentType.HK,
|
||||
object_id=named_obj_id,
|
||||
set_id=tm_packet.set_id,
|
||||
hk_data=hk_data,
|
||||
)
|
||||
|
||||
if named_obj_id in hk_filter.object_ids:
|
||||
handle_regular_hk_print(
|
||||
printer=printer,
|
||||
object_id=named_obj_id,
|
||||
hk_packet=tm_packet,
|
||||
tm=tm_packet.pus_tm,
|
||||
hk_data=hk_data,
|
||||
)
|
||||
return
|
||||
try:
|
||||
if HK_OUTPUT_LEVEL > 0:
|
||||
if hk_level >= 1:
|
||||
printer.generic_hk_tm_print(
|
||||
HkContentType.HK, named_obj_id, tm_packet.set_id, hk_data
|
||||
)
|
||||
if hk_level >= 1:
|
||||
handle_regular_hk_print(
|
||||
printer=printer,
|
||||
object_id=named_obj_id,
|
||||
@ -107,7 +118,9 @@ def handle_regular_hk_print( # noqa C901: Complexity okay here
|
||||
elif objb == obj_ids.IMTQ_HANDLER_ID:
|
||||
return handle_imtq_hk(pw=pw, hk_data=hk_data, set_id=set_id)
|
||||
elif objb == obj_ids.GPS_CONTROLLER:
|
||||
return handle_gps_data(pw=pw, hk_data=hk_data)
|
||||
return handle_gps_data(
|
||||
pw=pw, set_id=set_id, hk_data=hk_data, packet_time=packet_dt
|
||||
)
|
||||
elif objb == obj_ids.PCDU_HANDLER_ID:
|
||||
return handle_pcdu_hk(pw=pw, set_id=set_id, hk_data=hk_data)
|
||||
elif objb == obj_ids.BPX_HANDLER_ID:
|
||||
@ -122,6 +135,8 @@ def handle_regular_hk_print( # noqa C901: Complexity okay here
|
||||
return handle_ploc_mpsoc_hk_data(pw=pw, hk_data=hk_data, set_id=set_id)
|
||||
elif objb == obj_ids.ACU_HANDLER_ID:
|
||||
return handle_acu_hk_data(pw=pw, hk_data=hk_data, set_id=set_id)
|
||||
elif objb == obj_ids.INTERNAL_ERROR_REPORTER_ID:
|
||||
return handle_ier_hk_data(pw=pw, hk_data=hk_data, set_id=set_id)
|
||||
elif objb == obj_ids.RAD_SENSOR_ID:
|
||||
return handle_rad_sensor_data(pw=pw, hk_data=hk_data, set_id=set_id)
|
||||
elif objb in [obj_ids.RW1_ID, obj_ids.RW2_ID, obj_ids.RW3_ID, obj_ids.RW4_ID]:
|
||||
@ -187,8 +202,12 @@ def handle_regular_hk_print( # noqa C901: Complexity okay here
|
||||
return handle_acs_ctrl_hk_data(
|
||||
pw=pw, set_id=set_id, hk_data=hk_data, packet_time=packet_dt
|
||||
)
|
||||
elif objb == obj_ids.PWR_CONTROLLER:
|
||||
return handle_pwr_ctrl_hk_data(
|
||||
pw=pw, set_id=set_id, hk_data=hk_data, packet_time=packet_dt
|
||||
)
|
||||
else:
|
||||
_LOGGER.info(
|
||||
f"Service 3 TM: Parsing for object {object_id} and set ID {set_id} "
|
||||
f"has not been implemented."
|
||||
"has not been implemented."
|
||||
)
|
@ -2,24 +2,25 @@
|
||||
"""
|
||||
import logging
|
||||
|
||||
from eive_tmtc.config.object_ids import get_object_ids
|
||||
from spacepackets.ccsds.time import CdsShortTimestamp
|
||||
from spacepackets.ecss import PusTelemetry
|
||||
from spacepackets.ecss.pus_17_test import Service17Tm
|
||||
from spacepackets.util import PrintFormats
|
||||
from spacepackets.ccsds.time import CdsShortTimestamp
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
from tmtccmd.logging.pus import RawTmtcTimedLogWrapper
|
||||
from tmtccmd.pus import VerificationWrapper
|
||||
from tmtccmd.tm import Service20FsfwTm, Service200FsfwTm
|
||||
from tmtccmd.tm.pus_20_fsfw_param import Service20ParamDumpWrapper
|
||||
from tmtccmd.pus.s20_fsfw_param import Service20FsfwTm, Service20ParamDumpWrapper
|
||||
from tmtccmd.pus.s20_fsfw_param_defs import CustomSubservice as ParamSubservice
|
||||
from tmtccmd.tm.pus_200_fsfw_mode import Subservice as ModeSubservice
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
from .defs import PrintWrapper
|
||||
from tmtccmd.pus.s200_fsfw_mode import Service200FsfwTm
|
||||
from tmtccmd.pus.s200_fsfw_mode import Subservice as ModeSubservice
|
||||
|
||||
from eive_tmtc.config.object_ids import get_object_ids
|
||||
|
||||
from .event_handler import handle_event_packet
|
||||
from .verification_handler import handle_service_1_fsfw_packet, generic_retval_printout
|
||||
from .hk_handling import handle_hk_packet
|
||||
from .action_reply_handler import handle_action_reply
|
||||
from .defs import PrintWrapper
|
||||
from .event_handler import handle_event_packet
|
||||
from .hk_handler import HkFilter, handle_hk_packet
|
||||
from .verification_handler import generic_retval_printout, handle_service_1_fsfw_packet
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@ -29,12 +30,15 @@ def pus_factory_hook( # noqa C901 : Complexity okay here
|
||||
verif_wrapper: VerificationWrapper,
|
||||
printer: FsfwTmTcPrinter,
|
||||
raw_logger: RawTmtcTimedLogWrapper,
|
||||
hk_level: int,
|
||||
hk_filter: HkFilter,
|
||||
):
|
||||
if len(packet) < 8:
|
||||
_LOGGER.warning("Detected packet shorter than 8 bytes!")
|
||||
return
|
||||
try:
|
||||
tm_packet = PusTelemetry.unpack(packet, CdsShortTimestamp.empty())
|
||||
# _LOGGER.info(f"Sequence count: {tm_packet.seq_count}")
|
||||
except ValueError as value_error:
|
||||
_LOGGER.warning(f"{value_error}")
|
||||
_LOGGER.warning("Could not generate PUS TM object from raw data")
|
||||
@ -47,7 +51,13 @@ def pus_factory_hook( # noqa C901 : Complexity okay here
|
||||
if service == 1:
|
||||
handle_service_1_fsfw_packet(wrapper=verif_wrapper, raw_tm=packet)
|
||||
elif service == 3:
|
||||
handle_hk_packet(printer=printer, raw_tm=packet, obj_id_dict=obj_id_dict)
|
||||
handle_hk_packet(
|
||||
printer=printer,
|
||||
raw_tm=packet,
|
||||
obj_id_dict=obj_id_dict,
|
||||
hk_level=hk_level,
|
||||
hk_filter=hk_filter,
|
||||
)
|
||||
elif service == 5:
|
||||
handle_event_packet(raw_tm=packet, pw=pw)
|
||||
elif service == 8:
|
||||
@ -83,7 +93,8 @@ def pus_factory_hook( # noqa C901 : Complexity okay here
|
||||
# TODO: Could improve display further by actually displaying a matrix as a
|
||||
# matrix using row and column information
|
||||
pw.dlog(
|
||||
f"Received vector or matrix data: {param.param_raw.hex(sep=',')}"
|
||||
"Received vector or matrix data:"
|
||||
f" {param.param_raw.hex(sep=',')}"
|
||||
)
|
||||
except ValueError as e:
|
||||
pw.dlog(f"received {e} when trying to parse parameters")
|
@ -12,7 +12,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
class TmTcpServer:
|
||||
def __init__(self, ip_address: str, port: int):
|
||||
|
||||
self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
|
||||
self.server_socket.bind((ip_address, port))
|
||||
@ -46,7 +45,6 @@ class TmTcpServer:
|
||||
self.client_connection.setblocking(False)
|
||||
print("Client connected")
|
||||
except IOError:
|
||||
|
||||
return
|
||||
|
||||
data_json_bytes = json.dumps(dictionary).encode()
|
||||
@ -65,7 +63,6 @@ class TmTcpServer:
|
||||
self.client_connection = None
|
||||
|
||||
def report_raw_hk_data(self, object_id: ObjectIdU32, set_id: int, hk_data: bytes):
|
||||
|
||||
data_dict = {
|
||||
"type": "TM",
|
||||
"tmType": "Raw HK",
|
||||
|
@ -4,7 +4,7 @@ from typing import List, Optional
|
||||
from spacepackets.ccsds import CdsShortTimestamp
|
||||
from spacepackets.ecss.pus_1_verification import UnpackParams, Service1Tm
|
||||
from tmtccmd.pus import VerificationWrapper
|
||||
from tmtccmd.tm.pus_1_verification import Service1FsfwWrapper
|
||||
from tmtccmd.pus.s1_verification import Service1FsfwWrapper
|
||||
from eive_tmtc.config.retvals import get_retval_dict
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@ -48,7 +48,7 @@ def generic_retval_printout(
|
||||
if retval_info is None:
|
||||
raw_err = retval
|
||||
return [
|
||||
f"No returnvalue information found for error code with "
|
||||
"No returnvalue information found for error code with "
|
||||
f"subsystem ID {(raw_err >> 8) & 0xff} and unique ID {raw_err & 0xff}"
|
||||
]
|
||||
else:
|
||||
@ -58,9 +58,9 @@ def generic_retval_printout(
|
||||
)
|
||||
string_list = [retval_string]
|
||||
if p1:
|
||||
error_param_1_str = f"Error Parameter 1: hex {p1:#010x} " f"dec {p1} "
|
||||
error_param_1_str = f"Error Parameter 1: hex {p1:#010x} dec {p1} "
|
||||
string_list.append(error_param_1_str)
|
||||
if p2:
|
||||
error_param_2_str = f"Error Parameter 2: hex {p2:#010x} " f"dec {p2}"
|
||||
error_param_2_str = f"Error Parameter 2: hex {p2:#010x} dec {p2}"
|
||||
string_list.append(error_param_2_str)
|
||||
return string_list
|
||||
|
@ -6,3 +6,4 @@ from .health import add_health_cmd_defs
|
||||
from .system import add_system_cmd_defs
|
||||
from .tm_store import add_persistent_tm_store_cmd_defs
|
||||
from .tcs import add_tmp_sens_cmds
|
||||
from .wdt import add_xiphos_wdt_defs
|
||||
|
@ -6,9 +6,9 @@ from tmtccmd.config.tmtc import (
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.tc import service_provider, DefaultPusQueueHelper
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Mode
|
||||
from tmtccmd.tmtc import service_provider, DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode
|
||||
from eive_tmtc.config.object_ids import ACS_BOARD_ASS_ID
|
||||
|
||||
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -7,50 +7,64 @@ from eive_tmtc.config.definitions import CustomServiceList
|
||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import create_mode_command, Mode
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
from tmtccmd.pus.s200_fsfw_mode import create_mode_command, Mode
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
||||
make_sid,
|
||||
create_request_one_hk_command,
|
||||
create_enable_periodic_hk_command_with_interval,
|
||||
create_disable_periodic_hk_command,
|
||||
create_enable_periodic_hk_command_with_interval_with_diag,
|
||||
create_disable_periodic_hk_command_with_diag,
|
||||
)
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class GpsInfo:
|
||||
MAX_SATELLITES = 30
|
||||
|
||||
|
||||
class OpCode:
|
||||
OFF = "off"
|
||||
ON = "on"
|
||||
REQ_OS_HK = ["hk"]
|
||||
ENABLE_HK = ["enable_hk"]
|
||||
DISABLE_HK = ["disable_hk"]
|
||||
REQ_CORE_HK = ["core_hk_request"]
|
||||
ENABLE_CORE_HK = ["core_hk_enable"]
|
||||
DISABLE_CORE_HK = ["core_hk_disable"]
|
||||
REQ_SKYVIEW_HK = ["skyview_hk_request"]
|
||||
ENABLE_SKYVIEW_HK = ["skyview_hk_enable"]
|
||||
DISABLE_SKYVIEW_HK = ["skyview_hk_disable"]
|
||||
RESET_GNSS = ["reset"]
|
||||
|
||||
|
||||
class Info:
|
||||
OFF = "Off"
|
||||
ON = "On"
|
||||
REQ_OS_HK = "Request One-Shot HK"
|
||||
ENABLE_HK = "Enable HK"
|
||||
DISABLE_HK = "Disable HK"
|
||||
REQ_CORE_HK = "Request Core HK"
|
||||
ENABLE_CORE_HK = "Enable Core HK"
|
||||
DISABLE_CORE_HK = "Disable Core HK"
|
||||
REQ_SKYVIEW_HK = "Request Skyview HK"
|
||||
ENABLE_SKYVIEW_HK = "Enable Skyview HK"
|
||||
DISABLE_SKYVIEW_HK = "Disable Skyview HK"
|
||||
RESET_GNSS = "Reset GNSS using reset pin"
|
||||
|
||||
|
||||
class SetId(enum.IntEnum):
|
||||
HK = 0
|
||||
CORE_HK = 0
|
||||
SKYVIEW_HK = 1
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
def add_gps_cmds(defs: TmtcDefinitionWrapper):
|
||||
oce = OpCodeEntry()
|
||||
oce.add(keys=OpCode.RESET_GNSS, info=Info.RESET_GNSS)
|
||||
oce.add(keys=OpCode.REQ_OS_HK, info=Info.REQ_OS_HK)
|
||||
oce.add(keys=OpCode.ENABLE_HK, info=Info.ENABLE_HK)
|
||||
oce.add(keys=OpCode.DISABLE_HK, info=Info.DISABLE_HK)
|
||||
oce.add(keys=OpCode.OFF, info=Info.OFF)
|
||||
oce.add(keys=OpCode.ON, info=Info.ON)
|
||||
oce.add(keys=OpCode.RESET_GNSS, info=Info.RESET_GNSS)
|
||||
oce.add(keys=OpCode.REQ_CORE_HK, info=Info.REQ_CORE_HK)
|
||||
oce.add(keys=OpCode.ENABLE_CORE_HK, info=Info.ENABLE_CORE_HK)
|
||||
oce.add(keys=OpCode.DISABLE_CORE_HK, info=Info.DISABLE_CORE_HK)
|
||||
oce.add(keys=OpCode.REQ_SKYVIEW_HK, info=Info.REQ_SKYVIEW_HK)
|
||||
oce.add(keys=OpCode.ENABLE_SKYVIEW_HK, info=Info.ENABLE_SKYVIEW_HK)
|
||||
oce.add(keys=OpCode.DISABLE_SKYVIEW_HK, info=Info.DISABLE_SKYVIEW_HK)
|
||||
defs.add_service(
|
||||
name=CustomServiceList.GPS_CTRL.value,
|
||||
info="GPS/GNSS Controller",
|
||||
@ -58,27 +72,64 @@ def add_gps_cmds(defs: TmtcDefinitionWrapper):
|
||||
)
|
||||
|
||||
|
||||
def pack_gps_command(object_id: bytes, q: DefaultPusQueueHelper, op_code: str):
|
||||
sid = make_sid(object_id=object_id, set_id=SetId.HK)
|
||||
def pack_gps_command( # noqa: C901
|
||||
object_id: bytes, q: DefaultPusQueueHelper, op_code: str
|
||||
): # noqa: C901:
|
||||
if op_code in OpCode.RESET_GNSS:
|
||||
# TODO: This needs to be re-implemented
|
||||
_LOGGER.warning("Reset pin handling needs to be re-implemented")
|
||||
if op_code in OpCode.ENABLE_HK:
|
||||
if op_code in OpCode.ENABLE_CORE_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
if interval <= 0:
|
||||
raise ValueError("invalid interval")
|
||||
q.add_log_cmd(f"GPS: {Info.ENABLE_HK}")
|
||||
cmds = create_enable_periodic_hk_command_with_interval(
|
||||
diag=False, sid=sid, interval_seconds=interval
|
||||
q.add_log_cmd(f"GPS: {Info.ENABLE_CORE_HK}")
|
||||
cmds = create_enable_periodic_hk_command_with_interval_with_diag(
|
||||
diag=False,
|
||||
sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK),
|
||||
interval_seconds=interval,
|
||||
)
|
||||
for cmd in cmds:
|
||||
q.add_pus_tc(cmd)
|
||||
if op_code in OpCode.DISABLE_HK:
|
||||
q.add_log_cmd(f"gps: {Info.DISABLE_HK}")
|
||||
q.add_pus_tc(create_disable_periodic_hk_command(diag=False, sid=sid))
|
||||
if op_code in OpCode.REQ_OS_HK:
|
||||
q.add_log_cmd(f"GPS: {Info.REQ_OS_HK}")
|
||||
q.add_pus_tc(create_request_one_hk_command(sid=sid))
|
||||
if op_code in OpCode.DISABLE_CORE_HK:
|
||||
q.add_log_cmd(f"gps: {Info.DISABLE_CORE_HK}")
|
||||
q.add_pus_tc(
|
||||
create_disable_periodic_hk_command_with_diag(
|
||||
diag=False, sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK)
|
||||
)
|
||||
)
|
||||
if op_code in OpCode.REQ_CORE_HK:
|
||||
q.add_log_cmd(f"GPS: {Info.REQ_CORE_HK}")
|
||||
q.add_pus_tc(
|
||||
create_request_one_hk_command(
|
||||
sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK)
|
||||
)
|
||||
)
|
||||
if op_code in OpCode.ENABLE_SKYVIEW_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
if interval <= 0:
|
||||
raise ValueError("invalid interval")
|
||||
q.add_log_cmd(f"GPS: {Info.ENABLE_SKYVIEW_HK}")
|
||||
cmds = create_enable_periodic_hk_command_with_interval_with_diag(
|
||||
diag=False,
|
||||
sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK),
|
||||
interval_seconds=interval,
|
||||
)
|
||||
for cmd in cmds:
|
||||
q.add_pus_tc(cmd)
|
||||
if op_code in OpCode.DISABLE_SKYVIEW_HK:
|
||||
q.add_log_cmd(f"gps: {Info.DISABLE_SKYVIEW_HK}")
|
||||
q.add_pus_tc(
|
||||
create_disable_periodic_hk_command_with_diag(
|
||||
diag=False, sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK)
|
||||
)
|
||||
)
|
||||
if op_code in OpCode.REQ_SKYVIEW_HK:
|
||||
q.add_log_cmd(f"GPS: {Info.REQ_SKYVIEW_HK}")
|
||||
q.add_pus_tc(
|
||||
create_request_one_hk_command(
|
||||
sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK)
|
||||
)
|
||||
)
|
||||
if op_code in OpCode.ON:
|
||||
q.add_log_cmd(f"GPS: {Info.ON}")
|
||||
q.add_pus_tc(create_mode_command(object_id, Mode.ON, 0))
|
||||
@ -87,8 +138,27 @@ def pack_gps_command(object_id: bytes, q: DefaultPusQueueHelper, op_code: str):
|
||||
q.add_pus_tc(create_mode_command(object_id, Mode.OFF, 0))
|
||||
|
||||
|
||||
def handle_gps_data(pw: PrintWrapper, hk_data: bytes):
|
||||
pw.dlog(f"Received GPS data, HK data length {len(hk_data)}")
|
||||
def handle_gps_data(
|
||||
pw: PrintWrapper,
|
||||
set_id: int,
|
||||
hk_data: bytes,
|
||||
packet_time: datetime.datetime,
|
||||
):
|
||||
pw.ilog(_LOGGER, f"Received GPS CTRL HK with packet time {packet_time}")
|
||||
match set_id:
|
||||
case SetId.CORE_HK:
|
||||
handle_core_data(pw, hk_data)
|
||||
case SetId.SKYVIEW_HK:
|
||||
handle_skyview_data(pw, hk_data)
|
||||
|
||||
|
||||
def handle_core_data(pw: PrintWrapper, hk_data: bytes):
|
||||
if len(hk_data) < 4 * 8 + 4 + 2 + 8:
|
||||
pw.dlog(
|
||||
f"GPS Core dataset with size {len(hk_data)} does not have expected size"
|
||||
f" of {4*8+4+2+8} bytes"
|
||||
)
|
||||
return
|
||||
current_idx = 0
|
||||
fmt_str = "!ddddBBBHBBBBBI"
|
||||
inc_len = struct.calcsize(fmt_str)
|
||||
@ -126,3 +196,65 @@ def handle_gps_data(pw: PrintWrapper, hk_data: bytes):
|
||||
FsfwTmTcPrinter.get_validity_buffer(
|
||||
validity_buffer=hk_data[current_idx:], num_vars=14
|
||||
)
|
||||
|
||||
|
||||
def handle_skyview_data(pw: PrintWrapper, hk_data: bytes):
|
||||
data_length = 8 + GpsInfo.MAX_SATELLITES * (8 + 3 * 2 + 1)
|
||||
if len(hk_data) < data_length:
|
||||
pw.dlog(
|
||||
f"GPS Skyview dataset with size {len(hk_data)} does not have expected size"
|
||||
f" of {data_length} bytes"
|
||||
)
|
||||
return
|
||||
current_idx = 0
|
||||
fmt_str_unix = "!d"
|
||||
fmt_str_int16 = "!" + "h" * GpsInfo.MAX_SATELLITES
|
||||
fmt_str_double = "!" + "d" * GpsInfo.MAX_SATELLITES
|
||||
fmt_str_uint8 = "!" + "B" * GpsInfo.MAX_SATELLITES
|
||||
inc_len_unix = struct.calcsize(fmt_str_unix)
|
||||
inc_len_int16 = struct.calcsize(fmt_str_int16)
|
||||
inc_len_double = struct.calcsize(fmt_str_double)
|
||||
inc_len_uint8 = struct.calcsize(fmt_str_uint8)
|
||||
unix = struct.unpack(
|
||||
fmt_str_unix, hk_data[current_idx : current_idx + inc_len_unix]
|
||||
)[0]
|
||||
current_idx += inc_len_unix
|
||||
prn_id = struct.unpack(
|
||||
fmt_str_int16, hk_data[current_idx : current_idx + inc_len_int16]
|
||||
)
|
||||
current_idx += inc_len_int16
|
||||
azimuth = struct.unpack(
|
||||
fmt_str_int16, hk_data[current_idx : current_idx + inc_len_int16]
|
||||
)
|
||||
current_idx += inc_len_int16
|
||||
elevation = struct.unpack(
|
||||
fmt_str_int16, hk_data[current_idx : current_idx + inc_len_int16]
|
||||
)
|
||||
current_idx += inc_len_int16
|
||||
signal_to_noise = struct.unpack(
|
||||
fmt_str_double, hk_data[current_idx : current_idx + inc_len_double]
|
||||
)
|
||||
current_idx += inc_len_double
|
||||
used = struct.unpack(
|
||||
fmt_str_uint8, hk_data[current_idx : current_idx + inc_len_uint8]
|
||||
)
|
||||
current_idx += inc_len_uint8
|
||||
pw.dlog(f"Skyview Time: {unix} unix-sec")
|
||||
pw.dlog(
|
||||
"{:<8} {:<8} {:<8} {:<8} {:<8}".format(
|
||||
"PRN_ID", "AZ [°]", "EL [°]", "S2N [dBHz]", "USED"
|
||||
)
|
||||
)
|
||||
for idx in range(GpsInfo.MAX_SATELLITES):
|
||||
pw.dlog(
|
||||
"{:<8} {:<8} {:<8} {:<8} {:<8}".format(
|
||||
prn_id[idx],
|
||||
azimuth[idx],
|
||||
elevation[idx],
|
||||
signal_to_noise[idx],
|
||||
used[idx],
|
||||
)
|
||||
)
|
||||
FsfwTmTcPrinter.get_validity_buffer(
|
||||
validity_buffer=hk_data[current_idx:], num_vars=6
|
||||
)
|
||||
|
@ -3,13 +3,13 @@ import logging
|
||||
import struct
|
||||
|
||||
from spacepackets.ecss import PusTelecommand
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_201_fsfw_health import pack_set_health_cmd_data, FsfwHealth
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s201_fsfw_health import pack_set_health_cmd_data, FsfwHealth
|
||||
from tmtccmd.pus.s201_fsfw_health import Subservice
|
||||
|
||||
import eive_tmtc.config.object_ids as obj_ids
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import create_mode_command, Mode
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import create_request_one_hk_command, make_sid
|
||||
from tmtccmd.pus.s200_fsfw_mode import create_mode_command, Mode
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import create_request_one_hk_command, make_sid
|
||||
from tmtccmd.config.tmtc import (
|
||||
tmtc_definitions_provider,
|
||||
OpCodeEntry,
|
||||
@ -61,7 +61,7 @@ GYR_SEL_DICT = {
|
||||
|
||||
def handle_gyr_cmd(q: DefaultPusQueueHelper, op_code: str):
|
||||
print("Please select the Gyro Device")
|
||||
for (k, v) in GYR_SEL_DICT.items():
|
||||
for k, v in GYR_SEL_DICT.items():
|
||||
print(f"{k}: {v[0]}")
|
||||
sel_idx = int(input("Select gyro device by index: "))
|
||||
gyr_info = GYR_SEL_DICT[GyrSel(sel_idx)]
|
||||
|
@ -18,16 +18,16 @@ from tmtccmd.config.tmtc import (
|
||||
OpCodeEntry,
|
||||
TmtcDefinitionWrapper,
|
||||
)
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
||||
make_sid,
|
||||
generate_one_diag_command,
|
||||
generate_one_hk_command,
|
||||
create_request_one_diag_command,
|
||||
create_disable_periodic_hk_command,
|
||||
create_enable_periodic_hk_command_with_interval,
|
||||
create_enable_periodic_hk_command_with_interval_with_diag,
|
||||
create_disable_periodic_hk_command_with_diag,
|
||||
)
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
|
||||
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
|
||||
@ -227,12 +227,13 @@ def pack_imtq_test_into( # noqa C901
|
||||
duration = int(
|
||||
input(
|
||||
f"Specify torque duration [range [0, {pow(2, 16) - 1}, "
|
||||
f"0 for continuous generation until update]: "
|
||||
"0 for continuous generation until update]: "
|
||||
)
|
||||
)
|
||||
dur_str = "infinite" if duration == 0 else str(duration)
|
||||
q.add_log_cmd(
|
||||
f"IMTQ: Commanding dipole X={x_dipole}, Y={y_dipole}, Z={y_dipole}, duration={dur_str}"
|
||||
f"IMTQ: Commanding dipole X={x_dipole}, Y={y_dipole}, Z={y_dipole},"
|
||||
f" duration={dur_str}"
|
||||
)
|
||||
q.add_pus_tc(
|
||||
pack_dipole_command(
|
||||
@ -248,7 +249,7 @@ def pack_imtq_test_into( # noqa C901
|
||||
if op_code == OpCode.ENABLE_ENG_HK_NO_TORQUE:
|
||||
q.add_log_cmd("IMTQ: Enable ENG HK")
|
||||
interval = float(input("Please enter collection interval in seconds: "))
|
||||
cmds = create_enable_periodic_hk_command_with_interval(
|
||||
cmds = create_enable_periodic_hk_command_with_interval_with_diag(
|
||||
diag=True,
|
||||
sid=make_sid(object_id.as_bytes, ImtqSetId.ENG_HK_NO_TORQUE),
|
||||
interval_seconds=interval,
|
||||
@ -258,7 +259,7 @@ def pack_imtq_test_into( # noqa C901
|
||||
if op_code == OpCode.DISABLE_ENG_HK_NO_TORQUE:
|
||||
q.add_log_cmd("IMTQ: Disable ENG HK (No Torque)")
|
||||
q.add_pus_tc(
|
||||
create_disable_periodic_hk_command(
|
||||
create_disable_periodic_hk_command_with_diag(
|
||||
True, make_sid(object_id.as_bytes, ImtqSetId.ENG_HK_NO_TORQUE)
|
||||
)
|
||||
)
|
||||
@ -275,7 +276,7 @@ def pack_imtq_test_into( # noqa C901
|
||||
if op_code == OpCode.ENABLE_ENG_HK_WITH_TORQUE:
|
||||
q.add_log_cmd("IMTQ: Enable ENG HK with torque")
|
||||
interval = float(input("Please enter collection interval in seconds: "))
|
||||
cmds = create_enable_periodic_hk_command_with_interval(
|
||||
cmds = create_enable_periodic_hk_command_with_interval_with_diag(
|
||||
diag=True,
|
||||
sid=make_sid(object_id.as_bytes, ImtqSetId.ENG_HK_SET_WITH_TORQUE),
|
||||
interval_seconds=interval,
|
||||
@ -285,7 +286,7 @@ def pack_imtq_test_into( # noqa C901
|
||||
if op_code == OpCode.DISABLE_ENG_HK_WITH_TORQUE:
|
||||
q.add_log_cmd("IMTQ: Disable ENG HK with Torque")
|
||||
q.add_pus_tc(
|
||||
create_disable_periodic_hk_command(
|
||||
create_disable_periodic_hk_command_with_diag(
|
||||
True, make_sid(object_id.as_bytes, ImtqSetId.ENG_HK_SET_WITH_TORQUE)
|
||||
)
|
||||
)
|
||||
@ -320,14 +321,14 @@ def pack_imtq_test_into( # noqa C901
|
||||
if op_code == OpCode.DISABLE_MGM_RAW_NO_TORQUE:
|
||||
q.add_log_cmd("IMTQ: Disable MGM RAW HK (No Torque)")
|
||||
q.add_pus_tc(
|
||||
create_disable_periodic_hk_command(
|
||||
create_disable_periodic_hk_command_with_diag(
|
||||
True, make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_NO_TORQUE)
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.ENABLE_MGM_RAW_NO_TORQUE:
|
||||
q.add_log_cmd("IMTQ: Enable MGM RAW HK (No Torque)")
|
||||
interval = float(input("Please enter collection interval in seconds: "))
|
||||
cmds = create_enable_periodic_hk_command_with_interval(
|
||||
cmds = create_enable_periodic_hk_command_with_interval_with_diag(
|
||||
diag=True,
|
||||
sid=make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_NO_TORQUE),
|
||||
interval_seconds=interval,
|
||||
@ -346,7 +347,7 @@ def pack_imtq_test_into( # noqa C901
|
||||
if op_code == OpCode.ENABLE_MGM_RAW_WITH_TORQUE:
|
||||
q.add_log_cmd("IMTQ: Enable MGM RAW HK (No Torque)")
|
||||
interval = float(input("Please enter collection interval in seconds: "))
|
||||
cmds = create_enable_periodic_hk_command_with_interval(
|
||||
cmds = create_enable_periodic_hk_command_with_interval_with_diag(
|
||||
diag=True,
|
||||
sid=make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_WITH_TORQUE),
|
||||
interval_seconds=interval,
|
||||
@ -356,7 +357,7 @@ def pack_imtq_test_into( # noqa C901
|
||||
if op_code == OpCode.DISABLE_MGM_RAW_WITH_TORQUE:
|
||||
q.add_log_cmd("IMTQ: Disable MGM RAW HK (No Torque)")
|
||||
q.add_pus_tc(
|
||||
create_disable_periodic_hk_command(
|
||||
create_disable_periodic_hk_command_with_diag(
|
||||
True, make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_WITH_TORQUE)
|
||||
)
|
||||
)
|
||||
@ -388,7 +389,8 @@ def pack_dipole_command(
|
||||
duration = int(round(duration))
|
||||
if duration < 0 or duration > pow(2, 16) - 1:
|
||||
raise ValueError(
|
||||
f"Duration in ms of {duration} smaller than 0 or larger than allowed {pow(2, 16) - 1}"
|
||||
f"Duration in ms of {duration} smaller than 0 or larger than allowed"
|
||||
f" {pow(2, 16) - 1}"
|
||||
)
|
||||
command += struct.pack("!h", x_dipole)
|
||||
command += struct.pack("!h", y_dipole)
|
||||
@ -400,7 +402,8 @@ def pack_dipole_command(
|
||||
|
||||
def raise_dipole_error(dipole_str: str, value: int):
|
||||
raise ValueError(
|
||||
f"{dipole_str} {value} negative or larger than maximum allowed 2000 * 10^-4*Am^2"
|
||||
f"{dipole_str} {value} negative or larger than maximum allowed 2000 *"
|
||||
" 10^-4*Am^2"
|
||||
)
|
||||
|
||||
|
||||
|
@ -14,8 +14,8 @@ from eive_tmtc.config.object_ids import (
|
||||
|
||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider, TmtcDefinitionWrapper
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import create_mode_command, Mode
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s200_fsfw_mode import create_mode_command, Mode
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ MGM_SEL_DICT = {
|
||||
|
||||
def handle_mgm_cmd(q: DefaultPusQueueHelper, op_code: str):
|
||||
print("Please select the MGM Device")
|
||||
for (k, v) in MGM_SEL_DICT.items():
|
||||
for k, v in MGM_SEL_DICT.items():
|
||||
print(f"{k}: {v[0]}")
|
||||
sel_idx = int(input("Select MGM device by index: "))
|
||||
mgm_info = MGM_SEL_DICT[MgmSel(sel_idx)]
|
||||
|
@ -12,17 +12,17 @@ from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
from eive_tmtc.config.object_ids import RW1_ID, RW2_ID, RW3_ID, RW4_ID
|
||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
||||
generate_one_hk_command,
|
||||
generate_one_diag_command,
|
||||
make_sid,
|
||||
enable_periodic_hk_command_with_interval,
|
||||
disable_periodic_hk_command,
|
||||
)
|
||||
from tmtccmd.tc.pus_8_fsfw_funccmd import create_action_cmd
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode, Subservice
|
||||
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode, Subservice
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
@ -261,14 +261,12 @@ def pack_set_speed_command(
|
||||
if speed > 0:
|
||||
if speed < 1000 or speed > 65000:
|
||||
raise ValueError(
|
||||
"Invalid RW speed specified. "
|
||||
"Allowed range is [1000, 65000] 0.1 * RPM"
|
||||
"Invalid RW speed specified. Allowed range is [1000, 65000] 0.1 * RPM"
|
||||
)
|
||||
elif speed < 0:
|
||||
if speed < -65000 or speed > -1000:
|
||||
raise ValueError(
|
||||
"Invalid RW speed specified. "
|
||||
"Allowed range is [-65000, -1000] 0.1 * RPM"
|
||||
"Invalid RW speed specified. Allowed range is [-65000, -1000] 0.1 * RPM"
|
||||
)
|
||||
else:
|
||||
# Speed is 0
|
||||
@ -290,7 +288,6 @@ def pack_set_speed_command(
|
||||
def handle_rw_hk_data(
|
||||
pw: PrintWrapper, object_id: ObjectIdU32, set_id: int, hk_data: bytes
|
||||
):
|
||||
|
||||
current_idx = 0
|
||||
if set_id == RwSetId.STATUS_SET_ID:
|
||||
pw.dlog(
|
||||
@ -305,15 +302,16 @@ def handle_rw_hk_data(
|
||||
speed_rpm = speed / 10.0
|
||||
ref_speed_rpm = ref_speed / 10.0
|
||||
pw.dlog(
|
||||
f"Temperature {temp} C | Speed {speed_rpm} rpm | Reference Speed {ref_speed_rpm} rpm"
|
||||
f"Temperature {temp} C | Speed {speed_rpm} rpm | Reference Speed"
|
||||
f" {ref_speed_rpm} rpm"
|
||||
)
|
||||
pw.dlog(
|
||||
f"State {state}. 0: Error, 1: Idle, 2: Coasting, 3: Running, speed stable, "
|
||||
f"4: Running, speed changing"
|
||||
"4: Running, speed changing"
|
||||
)
|
||||
pw.dlog(
|
||||
f"Current Limit Control mode {clc_mode}. 0: Low Current Mode (0.3 A), "
|
||||
f"1: High Current Mode (0.6 A)"
|
||||
"1: High Current Mode (0.6 A)"
|
||||
)
|
||||
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 5))
|
||||
if set_id == RwSetId.LAST_RESET:
|
||||
@ -362,22 +360,24 @@ def handle_rw_hk_data(
|
||||
) = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
||||
|
||||
pw.dlog(
|
||||
f"MCU Temperature {mcu_temp} | Pressure Sensore Temperature {pressure_sens_temp} C"
|
||||
f"MCU Temperature {mcu_temp} | Pressure Sensore Temperature"
|
||||
f" {pressure_sens_temp} C"
|
||||
)
|
||||
pw.dlog(f"Last Reset Status {last_reset_status}")
|
||||
pw.dlog(
|
||||
f"Current Limit Control mode {clc_mode}. 0: Low Current Mode (0.3 A), "
|
||||
f"1: High Current Mode (0.6 A)"
|
||||
"1: High Current Mode (0.6 A)"
|
||||
)
|
||||
pw.dlog(f"Speed {current_speed} rpm | Reference Speed {ref_speed} rpm")
|
||||
pw.dlog(
|
||||
f"State {state}. 0: Error, 1: Idle, 2: Coasting, 3: Running, speed stable, "
|
||||
f"4: Running, speed changing"
|
||||
"4: Running, speed changing"
|
||||
)
|
||||
pw.dlog("Number Of Invalid Packets:")
|
||||
pw.dlog("CRC | Length | CMD")
|
||||
pw.dlog(
|
||||
f"{num_invalid_crc_packets} | {num_invalid_len_packets} | {num_invalid_cmd_packets}"
|
||||
f"{num_invalid_crc_packets} | {num_invalid_len_packets} |"
|
||||
f" {num_invalid_cmd_packets}"
|
||||
)
|
||||
pw.dlog(
|
||||
f"Num Of CMD Executed Requests {num_of_cmd_executed_requests} | "
|
||||
@ -389,15 +389,16 @@ def handle_rw_hk_data(
|
||||
"RegOverrunErrs | TotalErrs"
|
||||
)
|
||||
pw.dlog(
|
||||
f"{uart_num_of_bytes_written} | {uart_num_of_bytes_read} | {uart_num_parity_errors} | "
|
||||
f"{uart_num_noise_errors} | {uart_num_frame_errors} | {uart_num_reg_overrun_errors} | "
|
||||
f"{uart_total_num_errors}"
|
||||
f"{uart_num_of_bytes_written} | {uart_num_of_bytes_read} |"
|
||||
f" {uart_num_parity_errors} | {uart_num_noise_errors} |"
|
||||
f" {uart_num_frame_errors} | {uart_num_reg_overrun_errors} |"
|
||||
f" {uart_total_num_errors}"
|
||||
)
|
||||
pw.dlog("SPI COM Info:")
|
||||
pw.dlog("NumBytesWritten | NumBytesRead | RegOverrunErrs | TotalErrs")
|
||||
pw.dlog(
|
||||
f"{spi_num_bytes_written} | {spi_num_bytes_read} | {spi_num_reg_overrun_errors} | "
|
||||
f"{spi_total_num_errors}"
|
||||
f"{spi_num_bytes_written} | {spi_num_bytes_read} |"
|
||||
f" {spi_num_reg_overrun_errors} | {spi_total_num_errors}"
|
||||
)
|
||||
if current_idx > 0:
|
||||
pw.dlog(
|
||||
|
@ -16,9 +16,16 @@ from eive_tmtc.utility.input_helper import InputHelper
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import create_request_one_diag_command, make_sid
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
||||
create_request_one_diag_command,
|
||||
create_request_one_hk_command,
|
||||
enable_periodic_hk_command_with_interval,
|
||||
disable_periodic_hk_command,
|
||||
make_sid,
|
||||
)
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
from eive_tmtc.config.object_ids import STR_ASSEMBLY, STAR_TRACKER_ID
|
||||
@ -65,7 +72,6 @@ class StarTrackerActionId(enum.IntEnum):
|
||||
CHANGE_DOWNLOAD_IMAGE = 57
|
||||
SET_JSON_FILE_NAME = 58
|
||||
SET_FLASH_READ_FILENAME = 59
|
||||
SET_TIME = 60
|
||||
DOWNLOAD_DBIMAGE = 61
|
||||
DOWNLOAD_BLOBPIXEL = 62
|
||||
DOWNLOAD_FPGA_IMAGE = 63
|
||||
@ -90,29 +96,48 @@ class StarTrackerActionId(enum.IntEnum):
|
||||
LOG_SUBSCRIPTION = 82
|
||||
DEBUG_CAMERA = 83
|
||||
FIRMWARE_UPDATE = 84
|
||||
SET_TIME_FROM_SYS_TIME = 87
|
||||
ADD_SECONDARY_TM_TO_NORMAL_MODE = 95
|
||||
RESET_SECONDARY_TM_SET = 96
|
||||
READ_SECONDARY_TM_SET = 97
|
||||
RELOAD_JSON_CFG_FILE = 100
|
||||
|
||||
|
||||
class OpCodes:
|
||||
class OpCode:
|
||||
ON_BOOTLOADER = "on_bootloader"
|
||||
ON_FIRMWARE = "on_firmware"
|
||||
NORMAL = "nml"
|
||||
OFF = "off"
|
||||
PING = "ping"
|
||||
REQUEST_SOLUTION_SET_HK = "hk_req_sol"
|
||||
REQUEST_SOLUTION_SET_ACTION = "action_req_sol"
|
||||
ONE_SHOOT_HK = "one_shot_hk"
|
||||
ENABLE_HK = "enable_hk"
|
||||
DISABLE_HK = "disable_hk"
|
||||
ADD_SECONDARY_TM_TO_NORMAL_MODE = "add_secondary_tm"
|
||||
RESET_SECONDARY_TM_SET = "reset_secondary_tm"
|
||||
READ_SECONDARY_TM_SET = "read_secondary_tm"
|
||||
TAKE_IMAGE = "take_image"
|
||||
UPLOAD_IMAGE = "upload_image"
|
||||
DOWNLOAD_IMAGE = "download_image"
|
||||
SET_IMG_PROCESSOR_MODE = "set_img_proc_mode"
|
||||
FW_UPDATE = "fw_update"
|
||||
SET_TIME_FROM_SYS_TIME = "set_time"
|
||||
RELOAD_JSON_CFG_FILE = "reload_json_cfg"
|
||||
|
||||
|
||||
class Info:
|
||||
REQUEST_SOLUTION_SET_HK = "Request Solution Set HK once"
|
||||
REQUEST_SOLUTION_SET_ACTION = "Request Solution Set Action"
|
||||
UPLOAD_IMAGE = "Upload Image"
|
||||
ONE_SHOOT_HK = "One shoot HK Set"
|
||||
ENABLE_HK = "Enable Periodic HK"
|
||||
DISABLE_HK = "Disable Periodic HK"
|
||||
ADD_SECONDARY_TM_TO_NORMAL_MODE = "Add specific Dataset to secondary TM"
|
||||
RESET_SECONDARY_TM_SET = "Reset secondary TM to Temperature Set only"
|
||||
READ_SECONDARY_TM_SET = "Read list of secondary TM Sets"
|
||||
UPLOAD_IMAGE = "Upload Optical Image"
|
||||
DOWNLOAD_IMAGE = "Download Optical Image"
|
||||
TAKE_IMAGE = "Take Image"
|
||||
SET_IMG_PROCESSOR_MODE = "Set Image Processor Mode"
|
||||
FW_UPDATE = "Firmware Update"
|
||||
SET_TIME_FROM_SYS_TIME = "Set time from system time"
|
||||
RELOAD_JSON_CFG_FILE = "Reload JSON configuration file. Reboot still required."
|
||||
|
||||
|
||||
class SetId(enum.IntEnum):
|
||||
@ -122,11 +147,24 @@ class SetId(enum.IntEnum):
|
||||
TEMPERATURE = 25
|
||||
SOLUTION = 24
|
||||
HISTOGRAM = 28
|
||||
CONTRAST = 29
|
||||
CHECKSUM = 50
|
||||
CAMERA = 67
|
||||
LIMITS = 68
|
||||
CENTROIDING = 72
|
||||
LISA = 73
|
||||
AUTO_BLOB = 89
|
||||
MATCHED_CENTROIDS = 90
|
||||
BLOB = 91
|
||||
BLOBS = 92
|
||||
CENTROID = 93
|
||||
CENTROIDS = 94
|
||||
|
||||
|
||||
class DataSetRequest(enum.IntEnum):
|
||||
ONESHOT = 0
|
||||
ENABLE = 1
|
||||
DISABLE = 2
|
||||
|
||||
|
||||
class FileDefs:
|
||||
@ -209,34 +247,36 @@ def pack_star_tracker_commands( # noqa C901
|
||||
f"Generate command for star tracker with object id: {object_id.as_hex_string}"
|
||||
)
|
||||
obyt = object_id.as_bytes
|
||||
if op_code == OpCodes.ON_BOOTLOADER:
|
||||
if op_code == OpCode.ON_BOOTLOADER:
|
||||
q.add_log_cmd("Star tracker: Mode On, Submode Bootloader")
|
||||
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.ON, Submode.BOOTLOADER)
|
||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
||||
if op_code == OpCodes.ON_FIRMWARE:
|
||||
if op_code == OpCode.ON_FIRMWARE:
|
||||
q.add_log_cmd("Star tracker: Mode On, Submode Firmware")
|
||||
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.ON, Submode.FIRMWARE)
|
||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
||||
if op_code == OpCodes.NORMAL:
|
||||
if op_code == OpCode.NORMAL:
|
||||
q.add_log_cmd("Star tracker: Mode Normal")
|
||||
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.NORMAL, 0)
|
||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
||||
if op_code == OpCodes.OFF:
|
||||
if op_code == OpCode.OFF:
|
||||
q.add_log_cmd("Star tracker: Mode Off")
|
||||
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.OFF, 0)
|
||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
||||
if op_code == OpCodes.REQUEST_SOLUTION_SET_HK:
|
||||
q.add_log_cmd(Info.REQUEST_SOLUTION_SET_HK)
|
||||
q.add_pus_tc(create_request_one_diag_command(make_sid(obyt, SetId.SOLUTION)))
|
||||
if op_code == OpCodes.REQUEST_SOLUTION_SET_ACTION:
|
||||
q.add_log_cmd("Star tracker: Request solution")
|
||||
data = obyt + struct.pack("!I", StarTrackerActionId.REQ_SOLUTION)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == OpCode.ONE_SHOOT_HK:
|
||||
q.add_log_cmd(Info.ONE_SHOOT_HK)
|
||||
request_dataset(q, DataSetRequest.ONESHOT)
|
||||
if op_code == OpCode.ENABLE_HK:
|
||||
q.add_log_cmd(Info.ENABLE_HK)
|
||||
request_dataset(q, DataSetRequest.ENABLE)
|
||||
if op_code == OpCode.DISABLE_HK:
|
||||
q.add_log_cmd(Info.DISABLE_HK)
|
||||
request_dataset(q, DataSetRequest.DISABLE)
|
||||
if op_code == "4":
|
||||
q.add_log_cmd("Star tracker: Mode Raw")
|
||||
data = pack_mode_data(obyt, Mode.RAW, 0)
|
||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
||||
if op_code == OpCodes.PING:
|
||||
if op_code == OpCode.PING:
|
||||
q.add_log_cmd("Star tracker: Ping")
|
||||
data = obyt + struct.pack("!I", StarTrackerActionId.PING)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
@ -279,7 +319,7 @@ def pack_star_tracker_commands( # noqa C901
|
||||
q.add_log_cmd("Star tracker: Request time")
|
||||
data = obyt + struct.pack("!I", StarTrackerActionId.REQ_TIME)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == OpCodes.UPLOAD_IMAGE:
|
||||
if op_code == OpCode.UPLOAD_IMAGE:
|
||||
q.add_log_cmd("Star tracker: Upload image")
|
||||
image = get_upload_image()
|
||||
data = (
|
||||
@ -288,8 +328,8 @@ def pack_star_tracker_commands( # noqa C901
|
||||
+ bytearray(image, "utf-8")
|
||||
)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == "16":
|
||||
q.add_log_cmd("Star tracker: Download image")
|
||||
if op_code == OpCode.DOWNLOAD_IMAGE:
|
||||
q.add_log_cmd(f"STR: {Info.DOWNLOAD_IMAGE}")
|
||||
path = input("Specify storage location (default - /mnt/sd0/startracker): ")
|
||||
if not path:
|
||||
path = FileDefs.download_path
|
||||
@ -380,7 +420,7 @@ def pack_star_tracker_commands( # noqa C901
|
||||
+ bytearray(json_file, "utf-8")
|
||||
)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == OpCodes.TAKE_IMAGE:
|
||||
if op_code == OpCode.TAKE_IMAGE:
|
||||
q.add_log_cmd("Star tracker: Take image")
|
||||
actionid = int(
|
||||
input("Specify parameter ID (4: take image, 7: get histogram): ")
|
||||
@ -438,14 +478,9 @@ def pack_star_tracker_commands( # noqa C901
|
||||
q.add_log_cmd("Star tracker: Get checksum")
|
||||
data = pack_checksum_command(obyt)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == "38":
|
||||
q.add_log_cmd("Star tracker: Set time")
|
||||
unix_time = 1640783543
|
||||
data = (
|
||||
obyt
|
||||
+ struct.pack("!I", StarTrackerActionId.SET_TIME)
|
||||
+ struct.pack("!Q", unix_time)
|
||||
)
|
||||
if op_code == OpCode.SET_TIME_FROM_SYS_TIME:
|
||||
q.add_log_cmd(Info.SET_TIME_FROM_SYS_TIME)
|
||||
data = obyt + struct.pack("!I", StarTrackerActionId.SET_TIME_FROM_SYS_TIME)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == "39":
|
||||
q.add_log_cmd("Star tracker: Download Centroid")
|
||||
@ -485,34 +520,6 @@ def pack_star_tracker_commands( # noqa C901
|
||||
+ struct.pack("!B", type)
|
||||
)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == "44":
|
||||
q.add_log_cmd("Star tracker: Download FPGA Image")
|
||||
position = int(input("Start position: "))
|
||||
length = int(input("Size to download: "))
|
||||
data = (
|
||||
obyt
|
||||
+ struct.pack("!I", StarTrackerActionId.DOWNLOAD_FPGA_IMAGE)
|
||||
+ struct.pack("!I", position)
|
||||
+ struct.pack("!I", length)
|
||||
+ bytearray(FileDefs.downloadFpgaImagePath, "utf-8")
|
||||
)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == "45":
|
||||
q.add_log_cmd("Star tracker: Change donwload FPGA image file name")
|
||||
data = (
|
||||
obyt
|
||||
+ struct.pack("!I", StarTrackerActionId.CHANGE_FPGA_DOWNLOAD_FILE)
|
||||
+ bytearray(FileDefs.downloadFpgaImageName, "utf-8")
|
||||
)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == "46":
|
||||
q.add_log_cmd("Star tracker: Upload FPGA image")
|
||||
data = (
|
||||
obyt
|
||||
+ struct.pack("!I", StarTrackerActionId.UPLOAD_FPGA_IMAGE)
|
||||
+ bytearray(FileDefs.uploadFpgaImageName, "utf-8")
|
||||
)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == "47":
|
||||
q.add_log_cmd("Star tracker: FPGA action")
|
||||
id = 3
|
||||
@ -534,7 +541,7 @@ def pack_star_tracker_commands( # noqa C901
|
||||
q.add_log_cmd("Star tracker: Request limits")
|
||||
data = obyt + struct.pack("!I", StarTrackerActionId.REQ_LIMITS)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == OpCodes.SET_IMG_PROCESSOR_MODE:
|
||||
if op_code == OpCode.SET_IMG_PROCESSOR_MODE:
|
||||
q.add_log_cmd(Info.SET_IMG_PROCESSOR_MODE)
|
||||
json_file = get_config_file()
|
||||
data = (
|
||||
@ -635,7 +642,7 @@ def pack_star_tracker_commands( # noqa C901
|
||||
+ bytearray(json_file, "utf-8")
|
||||
)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == OpCodes.FW_UPDATE:
|
||||
if op_code == OpCode.FW_UPDATE:
|
||||
q.add_log_cmd(Info.FW_UPDATE)
|
||||
firmware = get_firmware()
|
||||
data = (
|
||||
@ -644,6 +651,84 @@ def pack_star_tracker_commands( # noqa C901
|
||||
+ firmware.encode()
|
||||
)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == OpCode.ADD_SECONDARY_TM_TO_NORMAL_MODE:
|
||||
q.add_log_cmd(Info.ADD_SECONDARY_TM_TO_NORMAL_MODE)
|
||||
for val in SetId:
|
||||
print("{:<2}: {:<20}".format(val, val.name))
|
||||
set_id = int(input("Specify the dataset \n" ""))
|
||||
q.add_pus_tc(
|
||||
create_action_cmd(
|
||||
STAR_TRACKER_ID,
|
||||
StarTrackerActionId.ADD_SECONDARY_TM_TO_NORMAL_MODE,
|
||||
struct.pack("!I", set_id),
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.RESET_SECONDARY_TM_SET:
|
||||
q.add_log_cmd(Info.RESET_SECONDARY_TM_SET)
|
||||
q.add_pus_tc(
|
||||
create_action_cmd(
|
||||
STAR_TRACKER_ID,
|
||||
StarTrackerActionId.RESET_SECONDARY_TM_SET,
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.READ_SECONDARY_TM_SET:
|
||||
q.add_log_cmd(Info.READ_SECONDARY_TM_SET)
|
||||
q.add_pus_tc(
|
||||
create_action_cmd(
|
||||
STAR_TRACKER_ID, StarTrackerActionId.READ_SECONDARY_TM_SET
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.RELOAD_JSON_CFG_FILE:
|
||||
q.add_log_cmd(Info.RELOAD_JSON_CFG_FILE)
|
||||
q.add_pus_tc(
|
||||
create_action_cmd(STAR_TRACKER_ID, StarTrackerActionId.RELOAD_JSON_CFG_FILE)
|
||||
)
|
||||
|
||||
|
||||
def request_dataset(q: DefaultPusQueueHelper, req_type: DataSetRequest):
|
||||
for val in SetId:
|
||||
print("{:<2}: {:<20}".format(val, val.name))
|
||||
set_id = int(input("Specify the dataset \n" ""))
|
||||
if set_id in [SetId.SOLUTION, SetId.TEMPERATURE]:
|
||||
is_diag = True
|
||||
else:
|
||||
is_diag = False
|
||||
match req_type:
|
||||
case DataSetRequest.ONESHOT:
|
||||
if is_diag:
|
||||
q.add_pus_tc(
|
||||
create_request_one_diag_command(make_sid(STAR_TRACKER_ID, set_id))
|
||||
)
|
||||
else:
|
||||
q.add_pus_tc(
|
||||
create_request_one_hk_command(make_sid(STAR_TRACKER_ID, set_id))
|
||||
)
|
||||
case DataSetRequest.ENABLE:
|
||||
interval = float(
|
||||
input("Please specify interval in floating point seconds: ")
|
||||
)
|
||||
|
||||
if is_diag:
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
True, make_sid(STAR_TRACKER_ID, set_id), interval
|
||||
)
|
||||
else:
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(STAR_TRACKER_ID, set_id), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
case DataSetRequest.DISABLE:
|
||||
if is_diag:
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(True, make_sid(STAR_TRACKER_ID, set_id))
|
||||
)
|
||||
else:
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(
|
||||
False, make_sid(STAR_TRACKER_ID, set_id)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def pack_read_command(object_id: bytes) -> bytearray:
|
||||
@ -711,8 +796,24 @@ def handle_str_hk_data(set_id: int, hk_data: bytes, pw: PrintWrapper):
|
||||
pw.dlog(f"Received STR HK set with set ID {set_id}")
|
||||
if set_id == SetId.SOLUTION:
|
||||
handle_solution_set(hk_data, pw)
|
||||
elif set_id == SetId.HISTOGRAM:
|
||||
handle_histogram_set(hk_data, pw)
|
||||
elif set_id == SetId.TEMPERATURE:
|
||||
handle_temperature_set(hk_data, pw)
|
||||
elif set_id == SetId.AUTO_BLOB:
|
||||
handle_auto_blob_set(hk_data, pw)
|
||||
elif set_id == SetId.MATCHED_CENTROIDS:
|
||||
handle_matched_centroids_set(hk_data, pw)
|
||||
elif set_id == SetId.BLOB:
|
||||
handle_blob_set(hk_data, pw)
|
||||
elif set_id == SetId.BLOBS:
|
||||
handle_blobs_set(hk_data, pw)
|
||||
elif set_id == SetId.CENTROID:
|
||||
handle_centroid_set(hk_data, pw)
|
||||
elif set_id == SetId.CENTROIDS:
|
||||
handle_centroids_set(hk_data, pw)
|
||||
elif set_id == SetId.CONTRAST:
|
||||
handle_contrast_set(hk_data, pw)
|
||||
else:
|
||||
_LOGGER.warning(f"HK parsing for Star Tracker set ID {set_id} unimplemented")
|
||||
|
||||
@ -723,11 +824,14 @@ def unpack_time_hk(hk_data: bytes, current_idx: int, pw: PrintWrapper) -> int:
|
||||
(ticks, unix_time) = struct.unpack(
|
||||
ticks_time_fmt, hk_data[current_idx : current_idx + fmt_len]
|
||||
)
|
||||
unix_as_dt = datetime.datetime.fromtimestamp(
|
||||
int(round(unix_time / 10e6)), tz=datetime.timezone.utc
|
||||
)
|
||||
pw.dlog(f"Ticks: {ticks} | UNIX time: {unix_time}")
|
||||
pw.dlog(f"UNIX as datetime: {unix_as_dt}")
|
||||
try:
|
||||
unix_as_dt = datetime.datetime.fromtimestamp(
|
||||
int(round(unix_time / 1e6)), tz=datetime.timezone.utc
|
||||
)
|
||||
pw.dlog(f"Ticks: {ticks} | UNIX time: {unix_time}")
|
||||
pw.dlog(f"UNIX as datetime: {unix_as_dt}")
|
||||
except ValueError as e:
|
||||
_LOGGER.exception(e)
|
||||
current_idx += fmt_len
|
||||
return current_idx
|
||||
|
||||
@ -823,68 +927,255 @@ def handle_solution_set(hk_data: bytes, pw: PrintWrapper):
|
||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 23)
|
||||
|
||||
|
||||
def handle_blob_set(hk_data: bytes, pw: PrintWrapper):
|
||||
pw.dlog("Received Blob Set")
|
||||
if len(hk_data) < 14:
|
||||
_LOGGER.warning(f"Blob dataset HK data with length {len(hk_data)} too short")
|
||||
return
|
||||
current_idx = unpack_time_hk(hk_data, 0, pw)
|
||||
blob_count = struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0]
|
||||
pw.dlog(f"Blob count: {blob_count}")
|
||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx + 4 :], num_vars=3)
|
||||
|
||||
|
||||
def handle_blobs_set(hk_data: bytes, pw: PrintWrapper):
|
||||
pw.dlog("Received Blobs Set")
|
||||
if len(hk_data) < 6 + 2 * 2 * 8:
|
||||
_LOGGER.warning(f"Blobs dataset HK data with length {len(hk_data)} too short")
|
||||
return
|
||||
current_idx = unpack_time_hk(hk_data, 0, pw)
|
||||
fmt_str = "!HHH"
|
||||
inc_len = struct.calcsize(fmt_str)
|
||||
count, count_used, nr_4lines_skipped = struct.unpack(
|
||||
fmt_str, hk_data[current_idx : current_idx + inc_len]
|
||||
)
|
||||
current_idx += inc_len
|
||||
pw.dlog(
|
||||
f"Count {count} | Count Used {count_used} | Number of skipped 4lines {nr_4lines_skipped}"
|
||||
)
|
||||
fmt_coords = "!HHHHHHHH"
|
||||
inc_len = struct.calcsize(fmt_coords)
|
||||
x_coords = struct.unpack(fmt_coords, hk_data[current_idx : current_idx + inc_len])
|
||||
current_idx += inc_len
|
||||
y_coords = struct.unpack(fmt_coords, hk_data[current_idx : current_idx + inc_len])
|
||||
current_idx += inc_len
|
||||
pw.dlog("{:<8} {:<8}".format("X", "Y"))
|
||||
for idx in range(8):
|
||||
pw.dlog("{:<8} {:<8}".format(x_coords[idx], y_coords[idx]))
|
||||
assert current_idx == len(hk_data) - 1
|
||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=7)
|
||||
|
||||
|
||||
def handle_centroid_set(hk_data: bytes, pw: PrintWrapper):
|
||||
pw.dlog("Received Centroid Set")
|
||||
if len(hk_data) < 14:
|
||||
raise ValueError(
|
||||
f"Centroid dataset HK data with length {len(hk_data)} too short"
|
||||
)
|
||||
current_idx = unpack_time_hk(hk_data, 0, pw)
|
||||
centroid_count = struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0]
|
||||
current_idx += 4
|
||||
pw.dlog(f"Centroid count: {centroid_count}")
|
||||
assert current_idx == len(hk_data) - 1
|
||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3)
|
||||
|
||||
|
||||
def handle_centroids_set(hk_data: bytes, pw: PrintWrapper):
|
||||
pw.dlog("Received Centroids Set")
|
||||
current_idx = unpack_time_hk(hk_data, 0, pw)
|
||||
centroids_count = struct.unpack("!H", hk_data[current_idx : current_idx + 2])[0]
|
||||
current_idx += 2
|
||||
pw.dlog(f"Centroids count: {centroids_count}")
|
||||
fmt_coords = "!ffffffffffffffff"
|
||||
inc_len = struct.calcsize(fmt_coords)
|
||||
x_coords = struct.unpack(fmt_coords, hk_data[current_idx : current_idx + inc_len])
|
||||
current_idx += inc_len
|
||||
y_coords = struct.unpack(fmt_coords, hk_data[current_idx : current_idx + inc_len])
|
||||
current_idx += inc_len
|
||||
fmt_coords = "!BBBBBBBBBBBBBBBB"
|
||||
inc_len = struct.calcsize(fmt_coords)
|
||||
magnitude = struct.unpack(fmt_coords, hk_data[current_idx : current_idx + inc_len])
|
||||
current_idx += inc_len
|
||||
pw.dlog("{:<8} {:<8} {:<8} {:<8}".format("Index", "X", "Y", "Magnitude"))
|
||||
for idx in range(16):
|
||||
pw.dlog(
|
||||
"{:<8} {:<8.3f} {:<8.3f} {:<8}".format(
|
||||
idx, x_coords[idx], y_coords[idx], magnitude[idx]
|
||||
)
|
||||
)
|
||||
assert current_idx == len(hk_data) - 1
|
||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=6)
|
||||
|
||||
|
||||
def handle_matched_centroids_set(hk_data: bytes, pw: PrintWrapper):
|
||||
pw.dlog("Received Matched Centroids Set")
|
||||
if len(hk_data) < 4 + 8 + 1 + 4 * 16 * 5:
|
||||
raise ValueError(
|
||||
f"Matched Centroids dataset HK data with length {len(hk_data)} too short. Expected 333 bytes."
|
||||
)
|
||||
current_idx = unpack_time_hk(hk_data, 0, pw)
|
||||
num_matched_centroids = hk_data[current_idx]
|
||||
current_idx += 1
|
||||
pw.dlog(f"Number of matched centroids {num_matched_centroids}")
|
||||
fmt_ids = "!IIIIIIIIIIIIIIII"
|
||||
inc_len = struct.calcsize(fmt_ids)
|
||||
star_id = struct.unpack(fmt_ids, hk_data[current_idx : current_idx + inc_len])
|
||||
current_idx += inc_len
|
||||
fmt_floats = "!ffffffffffffffff"
|
||||
inc_len = struct.calcsize(fmt_floats)
|
||||
x_coords = struct.unpack(fmt_floats, hk_data[current_idx : current_idx + inc_len])
|
||||
current_idx += inc_len
|
||||
y_coords = struct.unpack(fmt_floats, hk_data[current_idx : current_idx + inc_len])
|
||||
current_idx += inc_len
|
||||
x_errors = struct.unpack(fmt_floats, hk_data[current_idx : current_idx + inc_len])
|
||||
current_idx += inc_len
|
||||
y_errors = struct.unpack(fmt_floats, hk_data[current_idx : current_idx + inc_len])
|
||||
current_idx += inc_len
|
||||
pw.dlog(
|
||||
"{:<8} {:<10} {:<10} {:<10} {:<10} {:<10}".format(
|
||||
"Index", "Star ID", "X", "Y", "X Error", "Y Error"
|
||||
)
|
||||
)
|
||||
for idx in range(16):
|
||||
pw.dlog(
|
||||
"{:<8} {:<10} {:<10.3f} {:<10.3f} {:<10.3f} {:<10.3f}".format(
|
||||
idx,
|
||||
star_id[idx],
|
||||
x_coords[idx],
|
||||
y_coords[idx],
|
||||
x_errors[idx],
|
||||
y_errors[idx],
|
||||
)
|
||||
)
|
||||
assert current_idx == len(hk_data) - 1
|
||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=8)
|
||||
|
||||
|
||||
def handle_auto_blob_set(hk_data: bytes, pw: PrintWrapper):
|
||||
pw.dlog("Received Auto Blob Set")
|
||||
if len(hk_data) < 4 + 8 + 4:
|
||||
raise ValueError(
|
||||
f"Matched Centroids dataset HK data with length {len(hk_data)} too short. Expected 16 bytes."
|
||||
)
|
||||
current_idx = unpack_time_hk(hk_data, 0, pw)
|
||||
fmt_threshold = "!f"
|
||||
inc_len = struct.calcsize(fmt_threshold)
|
||||
threshold = struct.unpack(
|
||||
fmt_threshold, hk_data[current_idx : current_idx + inc_len]
|
||||
)[0]
|
||||
current_idx += inc_len
|
||||
assert current_idx == len(hk_data) - 1
|
||||
pw.dlog(f"Threshold {threshold}")
|
||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3)
|
||||
|
||||
|
||||
def handle_histo_or_contrast_set(name: str, hk_data: bytes, pw: PrintWrapper):
|
||||
pw.dlog(f"Received {name} Set")
|
||||
current_idx = unpack_time_hk(hk_data, 0, pw)
|
||||
fmt_str = "!IIIIIIIII"
|
||||
bins_list = []
|
||||
inc_len = struct.calcsize(fmt_str)
|
||||
a_bins = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
||||
bins_list.append(a_bins)
|
||||
current_idx += inc_len
|
||||
b_bins = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
||||
bins_list.append(b_bins)
|
||||
current_idx += inc_len
|
||||
c_bins = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
||||
bins_list.append(c_bins)
|
||||
current_idx += inc_len
|
||||
d_bins = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
||||
bins_list.append(d_bins)
|
||||
pw.dlog(
|
||||
f"{name} Sections: A Upper Left | B Upper Right | C Lower Left | D Lower Right"
|
||||
)
|
||||
pw.dlog("{:<12} {:<10} {:<10} {:<10} {:<10}".format("Range", "A", "B", "C", "D"))
|
||||
for idx in range(9):
|
||||
if idx == 0:
|
||||
val_range = "0 (0-0)"
|
||||
elif idx == 1:
|
||||
val_range = "1 (1-1)"
|
||||
else:
|
||||
val_range = f"{idx} ({pow(2, idx - 1)}-{pow(2, idx) - 1})"
|
||||
pw.dlog(
|
||||
"{:<12} {:<10} {:<10} {:<10} {:<10}".format(
|
||||
val_range,
|
||||
bins_list[0][idx],
|
||||
bins_list[1][idx],
|
||||
bins_list[2][idx],
|
||||
bins_list[3][idx],
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def handle_histogram_set(hk_data: bytes, pw: PrintWrapper):
|
||||
handle_histo_or_contrast_set("Histogram", hk_data, pw)
|
||||
|
||||
|
||||
def handle_contrast_set(hk_data: bytes, pw: PrintWrapper):
|
||||
handle_histo_or_contrast_set("Contrast", hk_data, pw)
|
||||
|
||||
|
||||
def handle_star_tracker_action_replies(
|
||||
action_id: int, pw: PrintWrapper, custom_data: bytes
|
||||
):
|
||||
if action_id == StarTrackerActionId.CHECKSUM:
|
||||
handle_checksum(pw, custom_data)
|
||||
elif action_id == StarTrackerActionId.READ_SECONDARY_TM_SET:
|
||||
handle_read_secondary_tm_set(pw, custom_data)
|
||||
|
||||
|
||||
def handle_checksum(pw: PrintWrapper, custom_data: bytes):
|
||||
if len(custom_data) != 5:
|
||||
_LOGGER.warning(
|
||||
"Star tracker reply has invalid length {0}".format(len(custom_data))
|
||||
)
|
||||
return
|
||||
header_list = ["Checksum", "Checksum valid"]
|
||||
print(custom_data[4])
|
||||
checksum_valid_flag = custom_data[4] >> 8
|
||||
content_list = ["0x" + custom_data[:4].hex(), checksum_valid_flag]
|
||||
pw.dlog(f"{header_list}")
|
||||
pw.dlog(f"{content_list}")
|
||||
|
||||
|
||||
def handle_read_secondary_tm_set(pw: PrintWrapper, custom_data: bytes):
|
||||
pw.dlog("Received secondary TM Sets")
|
||||
if len(custom_data) % 4 != 0:
|
||||
raise ValueError(f"Received data of unexpected length {len(custom_data)}")
|
||||
data_length = int(len(custom_data) / 4)
|
||||
fmt_str = "!" + "I" * data_length
|
||||
inc_len = struct.calcsize(fmt_str)
|
||||
set_ids = struct.unpack(fmt_str, custom_data[:inc_len])
|
||||
pw.dlog("The following Datasets are currently Part of the secondary TM list")
|
||||
for set_id in set_ids:
|
||||
if set_id in SetId._value2member_map_:
|
||||
pw.dlog(SetId(set_id).name)
|
||||
else:
|
||||
pw.dlog(f"Unknown Set ID {set_id}")
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
def add_str_cmds(defs: TmtcDefinitionWrapper):
|
||||
oce = OpCodeEntry()
|
||||
oce.add(OpCodes.ON_BOOTLOADER, "Mode On, Submode Bootloader")
|
||||
oce.add(OpCodes.ON_FIRMWARE, "Mode On, Submode Firmware")
|
||||
oce.add(OpCodes.NORMAL, "Mode Normal")
|
||||
oce.add(OpCodes.OFF, "Mode Off")
|
||||
# oce.add("4", "Star Tracker: Mode Raw")
|
||||
oce.add(OpCodes.PING, "Star Tracker: Ping")
|
||||
oce.add(OpCodes.TAKE_IMAGE, "Take Image")
|
||||
oce.add(OpCodes.REQUEST_SOLUTION_SET_HK, Info.REQUEST_SOLUTION_SET_HK)
|
||||
oce.add(OpCodes.REQUEST_SOLUTION_SET_ACTION, Info.REQUEST_SOLUTION_SET_ACTION)
|
||||
oce.add(OpCodes.UPLOAD_IMAGE, Info.UPLOAD_IMAGE)
|
||||
oce.add(OpCodes.SET_IMG_PROCESSOR_MODE, Info.SET_IMG_PROCESSOR_MODE)
|
||||
oce.add("6", "Star Tracker: Switch to bootloader program")
|
||||
oce.add("7", "Star Tracker: Request temperature")
|
||||
oce.add("8", "Star Tracker: Request version")
|
||||
oce.add("9", "Star Tracker: Request interface")
|
||||
oce.add("10", "Star Tracker: Request power")
|
||||
oce.add("11", "Star Tracker: Set subscription parameters")
|
||||
oce.add("12", "Star Tracker: Boot image (requires bootloader mode)")
|
||||
oce.add("13", "Star Tracker: Request time")
|
||||
oce.add("14", "Star Tracker: Request solution")
|
||||
oce.add("16", "Star Tracker: Download image")
|
||||
oce.add("17", "Star Tracker: Set limit parameters")
|
||||
oce.add("17", "Star Tracker: Set limit parameters")
|
||||
oce.add("18", "Star Tracker: Set tracking parameters")
|
||||
oce.add("19", "Star Tracker: Set mounting parameters")
|
||||
oce.add("20", "Star Tracker: Set camera parameters")
|
||||
oce.add("22", "Star Tracker: Set centroiding parameters")
|
||||
oce.add("23", "Star Tracker: Set LISA parameters")
|
||||
oce.add("24", "Star Tracker: Set matching parameters")
|
||||
oce.add("25", "Star Tracker: Set validation parameters")
|
||||
oce.add("26", "Star Tracker: Set algo parameters")
|
||||
oce.add("28", "Star Tracker: Stop str helper")
|
||||
oce.add("30", "Star Tracker: Set name of download image")
|
||||
oce.add("31", "Star Tracker: Request histogram")
|
||||
oce.add("32", "Star Tracker: Request contrast")
|
||||
oce.add("33", "Star Tracker: Set json filename")
|
||||
oce.add("35", "Star Tracker: Flash read")
|
||||
oce.add("36", "Star Tracker: Set flash read filename")
|
||||
oce.add("37", "Star Tracker: Get checksum")
|
||||
oce.add("49", "Star Tracker: Request camera parameter")
|
||||
oce.add("50", "Star Tracker: Request limits")
|
||||
oce.add("52", "Star Tracker: (EGSE only) Load camera ground config")
|
||||
oce.add("53", "Star Tracker: (EGSE only) Load camera flight config")
|
||||
oce.add("54", "Star Tracker: Request log level parameters")
|
||||
oce.add("55", "Star Tracker: Request mounting parameters")
|
||||
oce.add("56", "Star Tracker: Request image processor parameters")
|
||||
oce.add("57", "Star Tracker: Request centroiding parameters")
|
||||
oce.add("58", "Star Tracker: Request lisa parameters")
|
||||
oce.add("59", "Star Tracker: Request matching parameters")
|
||||
oce.add("60", "Star Tracker: Request tracking parameters")
|
||||
oce.add("61", "Star Tracker: Request validation parameters")
|
||||
oce.add("62", "Star Tracker: Request algo parameters")
|
||||
oce.add("63", "Star Tracker: Request subscription parameters")
|
||||
oce.add("64", "Star Tracker: Request log subscription parameters")
|
||||
oce.add("65", "Star Tracker: Request debug camera parameters")
|
||||
oce.add("66", "Star Tracker: Set log level parameters")
|
||||
oce.add("67", "Star Tracker: Set log subscription parameters")
|
||||
oce.add("68", "Star Tracker: Set debug camera parameters")
|
||||
oce.add(OpCodes.FW_UPDATE, Info.FW_UPDATE)
|
||||
oce.add("70", "Star Tracker: Disable timestamp generation")
|
||||
oce.add("71", "Star Tracker: Enable timestamp generation")
|
||||
oce.add(OpCode.ON_BOOTLOADER, "Mode On, Submode Bootloader")
|
||||
oce.add(OpCode.ON_FIRMWARE, "Mode On, Submode Firmware")
|
||||
oce.add(OpCode.NORMAL, "Mode Normal")
|
||||
oce.add(OpCode.OFF, "Mode Off")
|
||||
oce.add(OpCode.PING, "Star Tracker: Ping")
|
||||
oce.add(OpCode.TAKE_IMAGE, "Take Image")
|
||||
oce.add(OpCode.UPLOAD_IMAGE, Info.UPLOAD_IMAGE)
|
||||
oce.add(OpCode.DOWNLOAD_IMAGE, Info.DOWNLOAD_IMAGE)
|
||||
oce.add(OpCode.ONE_SHOOT_HK, Info.ONE_SHOOT_HK)
|
||||
oce.add(OpCode.ENABLE_HK, Info.ENABLE_HK)
|
||||
oce.add(OpCode.DISABLE_HK, Info.DISABLE_HK)
|
||||
oce.add(OpCode.SET_IMG_PROCESSOR_MODE, Info.SET_IMG_PROCESSOR_MODE)
|
||||
oce.add(
|
||||
OpCode.ADD_SECONDARY_TM_TO_NORMAL_MODE, Info.ADD_SECONDARY_TM_TO_NORMAL_MODE
|
||||
)
|
||||
oce.add(OpCode.READ_SECONDARY_TM_SET, Info.READ_SECONDARY_TM_SET)
|
||||
oce.add(OpCode.RESET_SECONDARY_TM_SET, Info.RESET_SECONDARY_TM_SET)
|
||||
oce.add(OpCode.FW_UPDATE, Info.FW_UPDATE)
|
||||
oce.add(OpCode.SET_TIME_FROM_SYS_TIME, Info.SET_TIME_FROM_SYS_TIME)
|
||||
oce.add(OpCode.RELOAD_JSON_CFG_FILE, Info.RELOAD_JSON_CFG_FILE)
|
||||
defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce)
|
||||
|
@ -12,7 +12,7 @@
|
||||
import struct
|
||||
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
|
||||
|
||||
|
@ -11,9 +11,9 @@ from tmtccmd.config.tmtc import (
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Subservice as ModeSubservices
|
||||
from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.pus.s200_fsfw_mode import Subservice as ModeSubservices
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
|
||||
|
||||
class OpCode(str, enum.Enum):
|
||||
|
@ -7,9 +7,9 @@ from tmtccmd.config.tmtc import (
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.tc import service_provider, DefaultPusQueueHelper
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Mode
|
||||
from tmtccmd.tmtc import service_provider, DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode
|
||||
|
||||
|
||||
class SusOpCode:
|
||||
|
@ -15,8 +15,8 @@ from tmtccmd.config.tmtc import (
|
||||
OpCodeEntry,
|
||||
TmtcDefinitionWrapper,
|
||||
)
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import create_mode_command, Mode
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s200_fsfw_mode import create_mode_command, Mode
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
|
||||
|
||||
|
@ -8,10 +8,10 @@
|
||||
import enum
|
||||
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
|
||||
from tmtccmd.tc.pus_20_fsfw_param import create_load_param_cmd
|
||||
from tmtccmd.tc.pus_8_fsfw_funccmd import create_action_cmd
|
||||
from tmtccmd.pus.s20_fsfw_param import create_load_param_cmd
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
from tmtccmd.pus.s20_fsfw_param_defs import create_scalar_u8_parameter
|
||||
|
||||
from tmtccmd.config.tmtc import (
|
||||
@ -83,7 +83,7 @@ def pack_pdec_handler_test(
|
||||
0,
|
||||
ParameterId.POSITIVE_WINDOW,
|
||||
pw,
|
||||
).pack()
|
||||
)
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.NEGATIVE_WINDOW:
|
||||
@ -96,7 +96,7 @@ def pack_pdec_handler_test(
|
||||
0,
|
||||
ParameterId.NEGATIVE_WINDOW,
|
||||
nw,
|
||||
).pack()
|
||||
)
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.RESET_NO_INIT:
|
||||
|
@ -3,6 +3,7 @@ import enum
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from eive_tmtc.config.object_ids import COM_SUBSYSTEM_ID
|
||||
from eive_tmtc.tmtc.com.syrlinks_handler import Datarate
|
||||
from tmtccmd.pus.s20_fsfw_param_defs import create_scalar_u8_parameter
|
||||
|
||||
from .defs import Mode as ComMode
|
||||
|
||||
@ -11,17 +12,16 @@ from tmtccmd.config.tmtc import (
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import (
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
from tmtccmd.pus.s200_fsfw_mode import (
|
||||
create_mode_command,
|
||||
create_read_mode_command,
|
||||
create_announce_mode_command,
|
||||
create_announce_mode_recursive_command,
|
||||
)
|
||||
from tmtccmd.tc.pus_20_fsfw_param import (
|
||||
from tmtccmd.pus.s20_fsfw_param import (
|
||||
create_load_param_cmd,
|
||||
pack_scalar_u8_parameter_app_data,
|
||||
)
|
||||
|
||||
from tmtccmd.pus.s20_fsfw_param import create_scalar_u32_parameter
|
||||
@ -87,7 +87,7 @@ def build_com_subsystem_cmd(p: ServiceProviderParams): # noqa C901
|
||||
q.add_log_cmd(f"{prefix}: {Info.UPDATE_DEFAULT_DATARATE_LOW}")
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
pack_scalar_u8_parameter_app_data(
|
||||
create_scalar_u8_parameter(
|
||||
COM_SUBSYSTEM_ID,
|
||||
0,
|
||||
ParameterId.DATARATE,
|
||||
@ -99,7 +99,7 @@ def build_com_subsystem_cmd(p: ServiceProviderParams): # noqa C901
|
||||
q.add_log_cmd(f"{prefix}: {Info.UPDATE_DEFAULT_DATARATE_HIGH}")
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
pack_scalar_u8_parameter_app_data(
|
||||
create_scalar_u8_parameter(
|
||||
COM_SUBSYSTEM_ID,
|
||||
0,
|
||||
ParameterId.DATARATE,
|
||||
@ -122,7 +122,7 @@ def build_com_subsystem_cmd(p: ServiceProviderParams): # noqa C901
|
||||
0,
|
||||
ParameterId.TRANSMITTER_TIMEOUT,
|
||||
timeout,
|
||||
).pack()
|
||||
)
|
||||
)
|
||||
)
|
||||
elif o == OpCode.READ_MODE:
|
||||
|
@ -17,16 +17,16 @@ from tmtccmd.config.tmtc import (
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
||||
make_sid,
|
||||
create_request_one_diag_command,
|
||||
create_enable_periodic_hk_command_with_interval,
|
||||
create_disable_periodic_hk_command,
|
||||
create_request_one_hk_command,
|
||||
create_enable_periodic_hk_command_with_interval_with_diag,
|
||||
create_disable_periodic_hk_command_with_diag,
|
||||
)
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Mode, create_mode_command
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode, create_mode_command
|
||||
from eive_tmtc.config.object_ids import SYRLINKS_HANDLER_ID
|
||||
import struct
|
||||
|
||||
@ -182,24 +182,28 @@ def pack_syrlinks_command( # noqa C901: Complexity okay here.
|
||||
q.add_log_cmd(f"{prefix}: {Info.ENABLE_HK_RX_REGS}")
|
||||
sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET)
|
||||
interval = float(input("HK interval in floating point seconds"))
|
||||
cmds = create_enable_periodic_hk_command_with_interval(True, sid, interval)
|
||||
cmds = create_enable_periodic_hk_command_with_interval_with_diag(
|
||||
True, sid, interval
|
||||
)
|
||||
for cmd in cmds:
|
||||
q.add_pus_tc(cmd)
|
||||
if op_code in OpCode.DISABLE_HK_RX_REGS:
|
||||
q.add_log_cmd(f"{prefix}: {Info.DISABLE_HK_RX_REGS}")
|
||||
sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET)
|
||||
q.add_pus_tc(create_disable_periodic_hk_command(True, sid))
|
||||
q.add_pus_tc(create_disable_periodic_hk_command_with_diag(True, sid))
|
||||
if op_code in OpCode.ENABLE_HK_TX_REGS:
|
||||
q.add_log_cmd(f"{prefix}: {Info.ENABLE_HK_TX_REGS}")
|
||||
sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET)
|
||||
interval = float(input("HK interval in floating point seconds"))
|
||||
cmds = create_enable_periodic_hk_command_with_interval(True, sid, interval)
|
||||
cmds = create_enable_periodic_hk_command_with_interval_with_diag(
|
||||
True, sid, interval
|
||||
)
|
||||
for cmd in cmds:
|
||||
q.add_pus_tc(cmd)
|
||||
if op_code in OpCode.DISABLE_HK_TX_REGS:
|
||||
q.add_log_cmd(f"{prefix}: {Info.DISABLE_HK_TX_REGS}")
|
||||
sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET)
|
||||
q.add_pus_tc(create_disable_periodic_hk_command(True, sid))
|
||||
q.add_pus_tc(create_disable_periodic_hk_command_with_diag(True, sid))
|
||||
if op_code in OpCode.HK_TX_REGS:
|
||||
q.add_log_cmd(f"{prefix}: {Info.HK_TX_REGS}")
|
||||
sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET)
|
||||
|
@ -1,8 +1,8 @@
|
||||
from typing import Union
|
||||
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode, Subservice
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode, Subservice
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
|
||||
|
||||
|
@ -3,27 +3,44 @@ import logging
|
||||
import os
|
||||
import struct
|
||||
from pathlib import Path
|
||||
from typing import Tuple
|
||||
|
||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from spacepackets.ecss import PusTelecommand
|
||||
from tmtccmd.config import TmtcDefinitionWrapper
|
||||
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
|
||||
from tmtccmd.tc.pus_20_fsfw_param import (
|
||||
create_scalar_u8_parameter,
|
||||
create_load_param_cmd,
|
||||
)
|
||||
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
|
||||
from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
from tmtccmd.pus.s11_tc_sched import (
|
||||
create_enable_tc_sched_cmd,
|
||||
create_disable_tc_sched_cmd,
|
||||
)
|
||||
from tmtccmd.pus.s20_fsfw_param import (
|
||||
create_load_param_cmd,
|
||||
create_scalar_u8_parameter,
|
||||
)
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import generate_one_hk_command, make_sid
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID
|
||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SdState(enum.IntEnum):
|
||||
OFF = 0
|
||||
ON = 1
|
||||
MOUNTED = 2
|
||||
|
||||
|
||||
class SdCardSelect(enum.IntEnum):
|
||||
SD_0 = 0
|
||||
SD_1 = 1
|
||||
BOTH = 2
|
||||
NONE = 3
|
||||
|
||||
|
||||
class ActionId(enum.IntEnum):
|
||||
ANNOUNCE_VERSION = 1
|
||||
ANNOUNCE_CURRENT_IMAGE = 2
|
||||
@ -39,6 +56,8 @@ class ActionId(enum.IntEnum):
|
||||
SWITCH_TO_SD_0 = 16
|
||||
SWITCH_TO_SD_1 = 17
|
||||
SWITCH_TO_BOTH_SD_CARDS = 18
|
||||
AUTO_SWITCH_ENABLE = 19
|
||||
AUTO_SWITCH_DISABLE = 20
|
||||
XSC_REBOOT = 32
|
||||
FULL_REBOOT = 34
|
||||
EXECUTE_SHELL_CMD_BLOCKING = 40
|
||||
@ -50,6 +69,7 @@ class ActionId(enum.IntEnum):
|
||||
MV_HELPER = 53
|
||||
RM_HELPER = 54
|
||||
MKDIR_HELPER = 55
|
||||
ENABLE_SCHEDULER = 56
|
||||
|
||||
|
||||
class ParamId(enum.IntEnum):
|
||||
@ -89,14 +109,18 @@ class OpCode:
|
||||
SWITCH_TO_SD_1 = ["switch_to_sd_1"]
|
||||
SWITCH_TO_BOTH_SD_CARDS = ["switch_to_both_sd_cards"]
|
||||
READ_REBOOT_MECHANISM_INFO = "rbh_info"
|
||||
ENABLE_REBOOT_FILE_HANDLING = "rbh_off"
|
||||
DISABLE_REBOOT_FILE_HANDLING = "rbh_on"
|
||||
RESET_ALL_REBOOT_COUNTERS = "rbh_reset_a"
|
||||
RESET_REBOOT_COUNTER_00 = "rbh_reset_00"
|
||||
RESET_REBOOT_COUNTER_01 = "rbh_reset_01"
|
||||
RESET_REBOOT_COUNTER_10 = "rbh_reset_10"
|
||||
RESET_REBOOT_COUNTER_11 = "rbh_reset_11"
|
||||
SET_MAX_REBOOT_CNT = ["rbh_max_cnt"]
|
||||
ENABLE_REBOOT_FILE_HANDLING = "rwd_on"
|
||||
DISABLE_REBOOT_FILE_HANDLING = "rwd_off"
|
||||
RESET_ALL_REBOOT_COUNTERS = "rwd_reset_a"
|
||||
RWD_RESET_REBOOT_COUNTER_00 = "rwd_reset_00"
|
||||
RWD_RESET_REBOOT_COUNTER_01 = "rwd_reset_01"
|
||||
RWD_RESET_REBOOT_COUNTER_10 = "rwd_reset_10"
|
||||
RWD_RESET_REBOOT_COUNTER_11 = "rwd_reset_11"
|
||||
RWD_SET_MAX_REBOOT_CNT = "rwd_max_cnt"
|
||||
AUTO_SWITCH_ENABLE = "auto_switch_enable"
|
||||
AUTO_SWITCH_DISABLE = "auto_switch_disable"
|
||||
ENABLE_SCHEDULER = "enable_scheduler"
|
||||
DISABLE_SCHEDULER = "disable_scheduler"
|
||||
|
||||
|
||||
class Info:
|
||||
@ -122,6 +146,10 @@ class Info:
|
||||
MV_HELPER = "Filesystem Move Helper"
|
||||
RM_HELPER = "Filesystem Removal Helper"
|
||||
MKDIR_HELPER = "Filesystem Directory Creation Helper"
|
||||
AUTO_SWITCH_ENABLE = "Enable Auto-Switch Feature with a specific target image"
|
||||
AUTO_SWITCH_DISABLE = "Disable Auto-Switch Feature"
|
||||
ENABLE_SCHEDULER = "Enable scheduler"
|
||||
DISABLE_SCHEDULER = "Disable scheduler"
|
||||
|
||||
|
||||
class Chip(enum.IntEnum):
|
||||
@ -163,6 +191,8 @@ def add_core_controller_definitions(defs: TmtcDefinitionWrapper):
|
||||
oce.add(keys=OpCode.OBSW_UPDATE_FROM_TMP, info=Info.OBSW_UPDATE_FROM_TMP)
|
||||
oce.add(keys=OpCode.OBSW_UPDATE_FROM_SD_0, info=Info.OBSW_UPDATE_FROM_SD_0)
|
||||
oce.add(keys=OpCode.OBSW_UPDATE_FROM_SD_1, info=Info.OBSW_UPDATE_FROM_SD_1)
|
||||
oce.add(keys=OpCode.AUTO_SWITCH_ENABLE, info=Info.AUTO_SWITCH_ENABLE)
|
||||
oce.add(keys=OpCode.AUTO_SWITCH_DISABLE, info=Info.AUTO_SWITCH_DISABLE)
|
||||
oce.add(keys=OpCode.SYSTEMCTL_CMD_EXECUTOR, info=Info.SYSTEMCTL_CMD_EXECUTOR)
|
||||
oce.add(
|
||||
keys=OpCode.EXECUTE_SHELL_CMD_BLOCKING, info=Info.EXECUTE_SHELL_CMD_BLOCKING
|
||||
@ -188,21 +218,25 @@ def add_core_controller_definitions(defs: TmtcDefinitionWrapper):
|
||||
info="Reset all reboot counters",
|
||||
)
|
||||
oce.add(
|
||||
keys=OpCode.RESET_REBOOT_COUNTER_00,
|
||||
keys=OpCode.RWD_RESET_REBOOT_COUNTER_00,
|
||||
info="Reset reboot counter 0 0",
|
||||
)
|
||||
oce.add(
|
||||
keys=OpCode.RESET_REBOOT_COUNTER_01,
|
||||
keys=OpCode.RWD_RESET_REBOOT_COUNTER_01,
|
||||
info="Reset reboot counter 0 1",
|
||||
)
|
||||
oce.add(
|
||||
keys=OpCode.RESET_REBOOT_COUNTER_10,
|
||||
keys=OpCode.RWD_RESET_REBOOT_COUNTER_10,
|
||||
info="Reset reboot counter 1 0",
|
||||
)
|
||||
oce.add(
|
||||
keys=OpCode.RESET_REBOOT_COUNTER_11,
|
||||
keys=OpCode.RWD_RESET_REBOOT_COUNTER_11,
|
||||
info="Reset reboot counter 1 1",
|
||||
)
|
||||
oce.add(
|
||||
keys=OpCode.RWD_SET_MAX_REBOOT_CNT,
|
||||
info="Reset max reboot count for reboot watchdog",
|
||||
)
|
||||
oce.add(keys=OpCode.OBSW_UPDATE_FROM_SD_0, info=Info.OBSW_UPDATE_FROM_SD_0)
|
||||
oce.add(keys=OpCode.OBSW_UPDATE_FROM_SD_1, info=Info.OBSW_UPDATE_FROM_SD_1)
|
||||
oce.add(keys=OpCode.OBSW_UPDATE_FROM_TMP, info=Info.OBSW_UPDATE_FROM_TMP)
|
||||
@ -215,6 +249,8 @@ def add_core_controller_definitions(defs: TmtcDefinitionWrapper):
|
||||
oce.add(keys=OpCode.CP_HELPER, info=Info.CP_HELPER)
|
||||
oce.add(keys=OpCode.RM_HELPER, info=Info.RM_HELPER)
|
||||
oce.add(keys=OpCode.MKDIR_HELPER, info=Info.MKDIR_HELPER)
|
||||
oce.add(keys=OpCode.ENABLE_SCHEDULER, info=Info.ENABLE_SCHEDULER)
|
||||
oce.add(keys=OpCode.DISABLE_SCHEDULER, info=Info.DISABLE_SCHEDULER)
|
||||
defs.add_service(CustomServiceList.CORE.value, "Core Controller", oce)
|
||||
|
||||
|
||||
@ -336,14 +372,25 @@ def pack_core_commands( # noqa C901
|
||||
action_id=ActionId.RESET_REBOOT_COUNTER,
|
||||
)
|
||||
)
|
||||
elif op_code == OpCode.RESET_REBOOT_COUNTER_00:
|
||||
elif op_code == OpCode.RWD_RESET_REBOOT_COUNTER_00:
|
||||
reset_specific_boot_counter(q, 0, 0)
|
||||
elif op_code == OpCode.RESET_REBOOT_COUNTER_01:
|
||||
elif op_code == OpCode.RWD_RESET_REBOOT_COUNTER_01:
|
||||
reset_specific_boot_counter(q, 0, 1)
|
||||
elif op_code == OpCode.RESET_REBOOT_COUNTER_10:
|
||||
elif op_code == OpCode.RWD_RESET_REBOOT_COUNTER_10:
|
||||
reset_specific_boot_counter(q, 1, 0)
|
||||
elif op_code == OpCode.RESET_REBOOT_COUNTER_11:
|
||||
elif op_code == OpCode.RWD_RESET_REBOOT_COUNTER_11:
|
||||
reset_specific_boot_counter(q, 1, 1)
|
||||
elif op_code == OpCode.RWD_SET_MAX_REBOOT_CNT:
|
||||
max_count = int(input("Set new maximum reboot threshold [1, 50]: "))
|
||||
if max_count < 1 or max_count > 50:
|
||||
raise ValueError("Invalid value, must be in range 1 to 50")
|
||||
q.add_pus_tc(
|
||||
create_action_cmd(
|
||||
CORE_CONTROLLER_ID,
|
||||
ActionId.SET_MAX_REBOOT_CNT,
|
||||
user_data=bytes([max_count]),
|
||||
)
|
||||
)
|
||||
elif op_code in OpCode.OBSW_UPDATE_FROM_SD_0:
|
||||
q.add_log_cmd(Info.OBSW_UPDATE_FROM_SD_0)
|
||||
q.add_pus_tc(pack_obsw_update_cmd(ActionId.UPDATE_OBSW_FROM_SD_0))
|
||||
@ -353,6 +400,20 @@ def pack_core_commands( # noqa C901
|
||||
elif op_code in OpCode.OBSW_UPDATE_FROM_TMP:
|
||||
q.add_log_cmd(Info.OBSW_UPDATE_FROM_TMP)
|
||||
q.add_pus_tc(pack_obsw_update_cmd(ActionId.UPDATE_OBSW_FROM_TMP))
|
||||
elif op_code in OpCode.AUTO_SWITCH_ENABLE:
|
||||
q.add_log_cmd(Info.AUTO_SWITCH_ENABLE)
|
||||
chip, copy = determine_chip_and_copy()
|
||||
user_data = bytes([chip, copy])
|
||||
q.add_pus_tc(
|
||||
create_action_cmd(
|
||||
CORE_CONTROLLER_ID, ActionId.AUTO_SWITCH_ENABLE, user_data
|
||||
)
|
||||
)
|
||||
elif op_code in OpCode.AUTO_SWITCH_DISABLE:
|
||||
q.add_log_cmd(Info.AUTO_SWITCH_DISABLE)
|
||||
q.add_pus_tc(
|
||||
create_action_cmd(CORE_CONTROLLER_ID, ActionId.AUTO_SWITCH_DISABLE)
|
||||
)
|
||||
elif op_code in OpCode.SWITCH_TO_SD_0:
|
||||
q.add_log_cmd(Info.SWITCH_TO_SD_0)
|
||||
q.add_pus_tc(
|
||||
@ -463,6 +524,12 @@ def pack_core_commands( # noqa C901
|
||||
q.add_pus_tc(
|
||||
create_action_cmd(CORE_CONTROLLER_ID, ActionId.MKDIR_HELPER, user_data)
|
||||
)
|
||||
elif op_code == OpCode.ENABLE_SCHEDULER:
|
||||
q.add_log_cmd(Info.ENABLE_SCHEDULER)
|
||||
q.add_pus_tc(create_enable_tc_sched_cmd())
|
||||
elif op_code == OpCode.DISABLE_SCHEDULER:
|
||||
q.add_log_cmd(Info.DISABLE_SCHEDULER)
|
||||
q.add_pus_tc(create_disable_tc_sched_cmd())
|
||||
else:
|
||||
_LOGGER.warning(
|
||||
f"Unknown operation code {op_code} for core controller commands"
|
||||
@ -523,18 +590,17 @@ def create_full_reboot_cmds() -> PusTelecommand:
|
||||
)
|
||||
|
||||
|
||||
def determine_reboot_params() -> (bool, Chip, Copy):
|
||||
chip_select = -1
|
||||
copy_select = -1
|
||||
def determine_reboot_params() -> Tuple[bool, Chip, Copy]:
|
||||
reboot_self = input("Reboot self? [y/n]: ")
|
||||
if reboot_self in ["y", "yes", "1"]:
|
||||
_LOGGER.info("Rebooting currently running image")
|
||||
return True, chip_select, copy_select
|
||||
return True, Chip.NONE, Copy.NONE
|
||||
_LOGGER.info("Rebooting image specified by chip and copy")
|
||||
return False, determine_chip_and_copy()
|
||||
chip, copy = determine_chip_and_copy()
|
||||
return False, chip, copy
|
||||
|
||||
|
||||
def determine_chip_and_copy() -> (int, int):
|
||||
def determine_chip_and_copy() -> Tuple[Chip, Copy]:
|
||||
while True:
|
||||
chip_select = input("Chip select [0/1]: ")
|
||||
if chip_select in ["0", "1"]:
|
||||
|
@ -6,9 +6,9 @@ from tmtccmd.config.tmtc import (
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from tmtccmd.pus.s201_fsfw_health import Subservice, FsfwHealth
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
|
||||
|
||||
class OpCode:
|
||||
|
24
eive_tmtc/tmtc/internal_err_reporter.py
Normal file
24
eive_tmtc/tmtc/internal_err_reporter.py
Normal file
@ -0,0 +1,24 @@
|
||||
import enum
|
||||
import struct
|
||||
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
|
||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
|
||||
|
||||
class SetId(enum.IntEnum):
|
||||
ERROR_ID = 0
|
||||
|
||||
|
||||
def handle_ier_hk_data(pw: PrintWrapper, hk_data: bytes, set_id: int):
|
||||
pw.dlog(f"Received internal error reporter HK data with set ID {set_id}")
|
||||
if set_id == SetId.ERROR_ID:
|
||||
fmt_str = "!III"
|
||||
inc_len = struct.calcsize(fmt_str)
|
||||
(tm_errors, queue_errors, store_hits) = struct.unpack(
|
||||
fmt_str, hk_data[:inc_len]
|
||||
)
|
||||
pw.dlog(f"TM Errors: {tm_errors}")
|
||||
pw.dlog(f"Queue Errors: {queue_errors}")
|
||||
pw.dlog(f"Store Errors: {store_hits}")
|
||||
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[inc_len:], 3))
|
@ -6,8 +6,8 @@
|
||||
@date 02.05.2020
|
||||
"""
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
|
||||
from eive_tmtc.config.object_ids import TEST_DEVICE_ID
|
||||
|
||||
TEST_DEVICE_OBJ_ID = TEST_DEVICE_ID
|
||||
|
@ -4,6 +4,7 @@ from eive_tmtc.config.object_ids import (
|
||||
GPS_0_HEALTH_DEV,
|
||||
GYRO_0_ADIS_HANDLER_ID,
|
||||
GYRO_1_L3G_HANDLER_ID,
|
||||
GYRO_2_ADIS_HANDLER_ID,
|
||||
ACS_BOARD_ASS_ID,
|
||||
RW_ASSEMBLY,
|
||||
SUS_BOARD_ASS_ID,
|
||||
@ -14,6 +15,13 @@ from eive_tmtc.config.object_ids import (
|
||||
RW1_ID,
|
||||
RW2_ID,
|
||||
RTD_0_PLOC_HSPD,
|
||||
TMP1075_HANDLER_TCS_BRD_1_ID,
|
||||
TMP1075_HANDLER_TCS_BRD_0_ID,
|
||||
TMP1075_HANDLER_PLPCDU_0_ID,
|
||||
TMP1075_HANDLER_PLPCDU_1_ID,
|
||||
TMP1075_HANDLER_IF_BRD_ID,
|
||||
STR_ASSEMBLY,
|
||||
STAR_TRACKER_ID,
|
||||
)
|
||||
|
||||
SUBSYSTEM_DICT = {
|
||||
@ -27,20 +35,28 @@ ACS_OBJ_DICT = {
|
||||
1: ("SUS Assembly", SUS_BOARD_ASS_ID),
|
||||
2: ("ACS Board Assembly", ACS_BOARD_ASS_ID),
|
||||
3: ("RW Assembly", RW_ASSEMBLY),
|
||||
4: ("iMTQ MGT", IMTQ_HANDLER_ID),
|
||||
5: ("GYR 0 ADIS", GYRO_0_ADIS_HANDLER_ID),
|
||||
6: ("GYR 1 L3G", GYRO_1_L3G_HANDLER_ID),
|
||||
7: ("MGM 0 LIS3", MGM_0_LIS3_HANDLER_ID),
|
||||
8: ("MGM 1 RM3100", MGM_1_RM3100_HANDLER_ID),
|
||||
9: ("GPS 0 Health Device", GPS_0_HEALTH_DEV),
|
||||
10: ("SUS 0", SUS_0_N_LOC_XFYFZM_PT_XF),
|
||||
11: ("SUS 6", SUS_6_R_LOC_XFYBZM_PT_XF),
|
||||
12: ("RW 1", RW1_ID),
|
||||
13: ("RW 2", RW2_ID),
|
||||
4: ("STR Assembly", STR_ASSEMBLY),
|
||||
5: ("iMTQ MGT", IMTQ_HANDLER_ID),
|
||||
6: ("GYR 0 ADIS", GYRO_0_ADIS_HANDLER_ID),
|
||||
7: ("GYR 1 L3G", GYRO_1_L3G_HANDLER_ID),
|
||||
8: ("GYR 2 ADIS", GYRO_2_ADIS_HANDLER_ID),
|
||||
9: ("MGM 0 LIS3", MGM_0_LIS3_HANDLER_ID),
|
||||
10: ("MGM 1 RM3100", MGM_1_RM3100_HANDLER_ID),
|
||||
11: ("GPS 0 Health Device", GPS_0_HEALTH_DEV),
|
||||
12: ("SUS 0", SUS_0_N_LOC_XFYFZM_PT_XF),
|
||||
13: ("SUS 6", SUS_6_R_LOC_XFYBZM_PT_XF),
|
||||
14: ("RW 1", RW1_ID),
|
||||
15: ("RW 2", RW2_ID),
|
||||
16: ("STR", STAR_TRACKER_ID),
|
||||
}
|
||||
|
||||
TCS_OBJ_DICT = {
|
||||
0: ("RTD 0", RTD_0_PLOC_HSPD),
|
||||
1: ("TMP1075 PL PCDU 0", TMP1075_HANDLER_PLPCDU_0_ID),
|
||||
2: ("TMP1075 PL PCDU 1", TMP1075_HANDLER_PLPCDU_1_ID),
|
||||
3: ("TMP1075 TCS 0", TMP1075_HANDLER_TCS_BRD_0_ID),
|
||||
4: ("TMP1075 TCS 1", TMP1075_HANDLER_TCS_BRD_1_ID),
|
||||
5: ("TMP1075 IF BOARD", TMP1075_HANDLER_IF_BRD_ID),
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@ from eive_tmtc.config.definitions import CustomServiceList
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.config import TmtcDefinitionWrapper
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider, OpCodeEntry
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
|
||||
|
||||
|
@ -20,11 +20,12 @@ from tmtccmd.config.tmtc import (
|
||||
TmtcDefinitionWrapper,
|
||||
)
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
from eive_tmtc.utility.input_helper import InputHelper
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
|
||||
from tmtccmd.tc.pus_8_fsfw_funccmd import create_action_cmd
|
||||
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
|
||||
from tmtccmd.pus.s20_fsfw_param import create_load_param_cmd, create_scalar_u8_parameter
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@ -93,6 +94,10 @@ class ActionId(enum.IntEnum):
|
||||
TC_FLASH_READ_FULL_FILE = 30
|
||||
|
||||
|
||||
class ParamId(enum.IntEnum):
|
||||
PLOC_SUPV_CMD_TO_ON = 1
|
||||
|
||||
|
||||
class OpCode:
|
||||
ON = "on"
|
||||
OFF = "off"
|
||||
@ -115,6 +120,8 @@ class OpCode:
|
||||
SIMPLEX_SEND_FILE = "simplex_send_file"
|
||||
DOWNLINK_DATA_MODULATE = "downlink_data_modulate"
|
||||
MODE_SNAPSHOT = "mode_snapshot"
|
||||
ENABLE_PLOC_SUPV_COMMANDING_TO_ON = "enable_ploc_supv_cmd_to_on"
|
||||
DISABLE_PLOC_SUPV_COMMANDING_TO_ON = "disable_ploc_supv_cmd_to_on"
|
||||
|
||||
|
||||
class Info:
|
||||
@ -137,6 +144,10 @@ class Info:
|
||||
FLASH_GET_DIR_CONTENT = "Get flash directory content on MPSoC"
|
||||
DOWNLINK_DATA_MODULATE = "Downlink data modulate"
|
||||
MODE_SNAPSHOT = "Mode Snapshot"
|
||||
ENABLE_PLOC_SUPV_COMMANDING_TO_ON = "Enable PLOC SUPV commanding when switching ON"
|
||||
DISABLE_PLOC_SUPV_COMMANDING_TO_ON = (
|
||||
"Disable PLOC SUPV commanding when switching ON"
|
||||
)
|
||||
|
||||
|
||||
class MemAddresses(enum.IntEnum):
|
||||
@ -171,6 +182,13 @@ def add_ploc_mpsoc_cmds(defs: TmtcDefinitionWrapper):
|
||||
oce.add(OpCode.SIMPLEX_SEND_FILE, Info.SIMPLEX_SEND_FILE)
|
||||
oce.add(OpCode.DOWNLINK_DATA_MODULATE, Info.DOWNLINK_DATA_MODULATE)
|
||||
oce.add(OpCode.MODE_SNAPSHOT, Info.MODE_SNAPSHOT)
|
||||
oce.add(
|
||||
OpCode.ENABLE_PLOC_SUPV_COMMANDING_TO_ON, Info.ENABLE_PLOC_SUPV_COMMANDING_TO_ON
|
||||
)
|
||||
oce.add(
|
||||
OpCode.DISABLE_PLOC_SUPV_COMMANDING_TO_ON,
|
||||
Info.DISABLE_PLOC_SUPV_COMMANDING_TO_ON,
|
||||
)
|
||||
defs.add_service(CustomServiceList.PLOC_MPSOC.value, "Ploc MPSoC", oce)
|
||||
|
||||
|
||||
@ -179,6 +197,7 @@ def pack_ploc_mpsoc_commands( # noqa C901
|
||||
p: ServiceProviderParams,
|
||||
): # noqa C901: Complexity okay here.
|
||||
object_id = get_object_ids().get(PLOC_MPSOC_ID)
|
||||
assert object_id is not None
|
||||
q = p.queue_helper
|
||||
prefix = "PLOC MPSoC"
|
||||
op_code = p.op_code
|
||||
@ -313,6 +332,24 @@ def pack_ploc_mpsoc_commands( # noqa C901
|
||||
q.add_log_cmd("PLOC MPSoC: Mode snapshot")
|
||||
data = object_id.as_bytes + struct.pack("!I", ActionId.TC_MODE_SNAPSHOT)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
if op_code == OpCode.ENABLE_PLOC_SUPV_COMMANDING_TO_ON:
|
||||
q.add_log_cmd(Info.ENABLE_PLOC_SUPV_COMMANDING_TO_ON)
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_u8_parameter(
|
||||
object_id.as_bytes, 0, ParamId.PLOC_SUPV_CMD_TO_ON, 0
|
||||
)
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.DISABLE_PLOC_SUPV_COMMANDING_TO_ON:
|
||||
q.add_log_cmd(Info.DISABLE_PLOC_SUPV_COMMANDING_TO_ON)
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_u8_parameter(
|
||||
object_id.as_bytes, 0, ParamId.PLOC_SUPV_CMD_TO_ON, 1
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def generate_write_mem_command(
|
||||
@ -570,12 +607,12 @@ def handle_ploc_mpsoc_hk_data(pw: PrintWrapper, hk_data: bytes, set_id: int):
|
||||
pw.dlog(f"CAM SoC Temperature: {cam_soc_temp}")
|
||||
pw.dlog(f"System Monitor Temperature: {sysmon_temp}")
|
||||
pw.dlog(
|
||||
f"SYSMON VCC INT {sysmon_vcc_int:.3f} | SYSMON VCC AUX {sysmon_vcc_aux:.3f} | "
|
||||
f"SYSMON VCC BRAM {sysmon_vcc_bram:.3f}"
|
||||
f"SYSMON VCC INT {sysmon_vcc_int:.3f} | SYSMON VCC AUX"
|
||||
f" {sysmon_vcc_aux:.3f} | SYSMON VCC BRAM {sysmon_vcc_bram:.3f}"
|
||||
)
|
||||
pw.dlog(
|
||||
f"SYSMON VCC PAUX {sysmon_vcc_paux:.3f} | SYSMON VCC PINT {sysmon_vcc_pint:.3f} | "
|
||||
f"SYSMON VCC PDRO {sysmon_vcc_pdro:.3f}"
|
||||
f"SYSMON VCC PAUX {sysmon_vcc_paux:.3f} | SYSMON VCC PINT"
|
||||
f" {sysmon_vcc_pint:.3f} | SYSMON VCC PDRO {sysmon_vcc_pdro:.3f}"
|
||||
)
|
||||
|
||||
fmt_str = "!fffffffffffff"
|
||||
@ -602,8 +639,9 @@ def handle_ploc_mpsoc_hk_data(pw: PrintWrapper, hk_data: bytes, set_id: int):
|
||||
f"SYSMON MBA 1V8 {sysmon_mb_1v8:.3f}"
|
||||
)
|
||||
pw.dlog(
|
||||
f"SYSMON VCC 12V {sysmon_vcc_12v:.3f} | SYSMON VCC 5V {sysmon_vcc_5v:.3f} | "
|
||||
f"SYSMON VCC 3V3 {sysmon_vcc_3v3:.3f} | SYSMON VCC 3V3VA {sysmon_vcc_3v3va}"
|
||||
f"SYSMON VCC 12V {sysmon_vcc_12v:.3f} | SYSMON VCC 5V {sysmon_vcc_5v:.3f} |"
|
||||
f" SYSMON VCC 3V3 {sysmon_vcc_3v3:.3f} | SYSMON VCC 3V3VA"
|
||||
f" {sysmon_vcc_3v3va}"
|
||||
)
|
||||
pw.dlog(
|
||||
f"SYSMON VCC 2V5DDR {sysmon_vcc_2v5ddr:.3f} | "
|
||||
|
@ -10,23 +10,24 @@ import enum
|
||||
import logging
|
||||
import struct
|
||||
|
||||
from eive_tmtc.config.object_ids import PLOC_SUPV_ID, get_object_ids
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
|
||||
from tmtccmd.config import TmtcDefinitionWrapper
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider, OpCodeEntry
|
||||
from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
|
||||
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
||||
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_data
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import generate_one_hk_command, make_sid
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from eive_tmtc.config.object_ids import PLOC_SUPV_ID, get_object_ids
|
||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
from eive_tmtc.utility.input_helper import InputHelper
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
latchup_id_dict = {
|
||||
LATCHUP_ID_DICT = {
|
||||
"0": "0.85V",
|
||||
"1": "1.8V",
|
||||
"2": "MISC",
|
||||
@ -40,25 +41,13 @@ HARDCODED = "0"
|
||||
MANUAL_INPUT = "1"
|
||||
HARDCODED_FILE = "/home/rmueller/EIVE/mpsoc_boot.bin"
|
||||
|
||||
update_file_dict = {
|
||||
UPDATE_FILE_DICT = {
|
||||
HARDCODED: ["hardcoded", ""],
|
||||
MANUAL_INPUT: ["manual input", ""],
|
||||
"2": ["/mnt/sd0/ploc/supervisor/update.bin", "/mnt/sd0/ploc/supervisor/update.bin"],
|
||||
"3": [
|
||||
"/mnt/sd0/ploc/supervisor/update-large.bin",
|
||||
"/mnt/sd0/ploc/supervisor/update-large.bin",
|
||||
],
|
||||
"4": [
|
||||
"/mnt/sd0/ploc/supervisor/update-small.bin",
|
||||
"/mnt/sd0/ploc/supervisor/update-small.bin",
|
||||
],
|
||||
"5": [
|
||||
"/mnt/sd0/ploc/supervisor/mpsoc-uart-working.bin",
|
||||
"/mnt/sd0/ploc/supervisor/mpsoc-uart-working.bin",
|
||||
],
|
||||
"2": ["/mnt/sd0/ploc/mpsoc/image.bin", "/mnt/sd0/ploc/mpsoc/image.bin"],
|
||||
}
|
||||
|
||||
event_buffer_path_dict = {
|
||||
EVENT_BUFFER_PATH_DICT = {
|
||||
MANUAL_INPUT: ["manual input", ""],
|
||||
"2": ["/mnt/sd0/ploc/supervisor", "/mnt/sd0/ploc/supervisor"],
|
||||
}
|
||||
@ -84,7 +73,7 @@ FACTORY_RESET_OPS = {
|
||||
|
||||
|
||||
class SupvActionId(enum.IntEnum):
|
||||
HK_REPORT = 1
|
||||
REQUEST_HK_REPORT = 1
|
||||
START_MPSOC = 3
|
||||
SHUTWOWN_MPSOC = 4
|
||||
SEL_MPSOC_BOOT_IMAGE = 5
|
||||
@ -111,7 +100,7 @@ class SupvActionId(enum.IntEnum):
|
||||
SET_GPIO = 34
|
||||
READ_GPIO = 35
|
||||
RESTART_SUPERVISOR = 36
|
||||
LOGGING_REQUEST_COUNTERS = 38
|
||||
REQUEST_LOGGING_COUNTERS = 38
|
||||
FACTORY_RESET = 39
|
||||
START_MPSOC_QUIET = 45
|
||||
SET_SHUTDOWN_TIMEOUT = 46
|
||||
@ -130,27 +119,33 @@ class SupvActionId(enum.IntEnum):
|
||||
MEM_CHECK = 61
|
||||
|
||||
|
||||
class SetIds(enum.IntEnum):
|
||||
class SetId(enum.IntEnum):
|
||||
HK_REPORT = 102
|
||||
BOOT_STATUS_REPORT = 103
|
||||
LATCHUP_REPORT = 104
|
||||
COUNTERS_REPORT = 105
|
||||
ADC_REPORT = 106
|
||||
UPDATE_STATUS_REPORT = 107
|
||||
|
||||
|
||||
class OpCodes:
|
||||
OFF = ["0", "off"]
|
||||
ON = ["1", "on"]
|
||||
NORMAL = ["2", "nml"]
|
||||
HK_TO_OBC = ["3", "hk_to_obc"]
|
||||
REQUEST_HK = ["4", "req_hk"]
|
||||
START_MPSOC = ["5", "start_mpsoc"]
|
||||
SHUTDOWN_MPSOC = ["6", "stop_mpsoc"]
|
||||
SEL_NVM = ["7", "sel_nvm"]
|
||||
SET_TIME_REF = ["set_time_ref"]
|
||||
FACTORY_FLASH = ["factory_flash"]
|
||||
REQ_BOOT_STATUS_REPORT = ["13", "boot_report"]
|
||||
START_UPDATE = ["42", "start_update"]
|
||||
PERFORM_UPDATE = ["update"]
|
||||
FACTORY_RESET = ["factory_reset"]
|
||||
MEM_CHECK = ["mem_check"]
|
||||
class OpCode:
|
||||
OFF = "off"
|
||||
ON = "on"
|
||||
NORMAL = "nml"
|
||||
HK_TO_OBC = "hk_to_obc"
|
||||
REQUEST_HK_SET_FROM_DEV = "req_hk_from_dev"
|
||||
REQUEST_HK_SET = "req_hk"
|
||||
START_MPSOC = "start_mpsoc"
|
||||
SHUTDOWN_MPSOC = "stop_mpsoc"
|
||||
SEL_NVM = "sel_nvm"
|
||||
SET_TIME_REF = "set_time_ref"
|
||||
FACTORY_FLASH = "factory_flash"
|
||||
REQ_BOOT_STATUS_REPORT = "boot_report"
|
||||
START_UPDATE = "start_update"
|
||||
PERFORM_UPDATE = "update"
|
||||
FACTORY_RESET = "factory_reset"
|
||||
MEM_CHECK = "mem_check"
|
||||
RESET_MPSOC = "reset_mpsoc"
|
||||
|
||||
|
||||
class Info(str, enum.Enum):
|
||||
@ -159,7 +154,8 @@ class Info(str, enum.Enum):
|
||||
ON = "Switch On"
|
||||
NML = "Switch Normal"
|
||||
HK_TO_OBC = "Request HK from PLOC SUPV"
|
||||
REQUEST_HK = "Request HK set from PLOC Handler"
|
||||
REQUEST_HK_SET_FROM_DEV = "Request HK set from the device to the PLOC Handler"
|
||||
REQUEST_HK_SET = "Request HK set from PLOC Handler"
|
||||
SET_TIME_REF = "Set time reference"
|
||||
FACTORY_FLASH = "Factory Flash Mode"
|
||||
PERFORM_UPDATE = "Start or continue MPSoC SW update at starting bytes"
|
||||
@ -168,27 +164,28 @@ class Info(str, enum.Enum):
|
||||
REQ_BOOT_STATUS_REPORT = "Request boot status report and HK"
|
||||
MEM_CHECK = "Memory Check"
|
||||
SEL_NVM = "Select NVM"
|
||||
RESET_MPSOC = "Reset MPSoC"
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
def add_ploc_supv_cmds(defs: TmtcDefinitionWrapper):
|
||||
|
||||
oce = OpCodeEntry()
|
||||
oce.add(OpCodes.OFF, Info.OFF)
|
||||
oce.add(OpCodes.ON, Info.ON)
|
||||
oce.add(OpCodes.NORMAL, Info.NML)
|
||||
oce.add(OpCodes.HK_TO_OBC, Info.HK_TO_OBC)
|
||||
oce.add(OpCodes.REQUEST_HK, Info.REQUEST_HK)
|
||||
oce.add(OpCodes.START_MPSOC, "PLOC Supervisor: Start MPSoC")
|
||||
oce.add(OpCodes.SHUTDOWN_MPSOC, "PLOC Supervisor: Shutdown MPSoC")
|
||||
oce.add(OpCodes.SEL_NVM, Info.SEL_NVM)
|
||||
oce.add(OpCodes.SET_TIME_REF, Info.SET_TIME_REF)
|
||||
oce.add(OpCodes.FACTORY_RESET, Info.FACTORY_RESET)
|
||||
oce.add(OpCode.OFF, Info.OFF)
|
||||
oce.add(OpCode.ON, Info.ON)
|
||||
oce.add(OpCode.NORMAL, Info.NML)
|
||||
oce.add(OpCode.HK_TO_OBC, Info.HK_TO_OBC)
|
||||
oce.add(OpCode.REQUEST_HK_SET, Info.REQUEST_HK_SET)
|
||||
oce.add(OpCode.REQUEST_HK_SET_FROM_DEV, Info.REQUEST_HK_SET_FROM_DEV)
|
||||
oce.add(OpCode.START_MPSOC, "PLOC Supervisor: Start MPSoC")
|
||||
oce.add(OpCode.SHUTDOWN_MPSOC, "PLOC Supervisor: Shutdown MPSoC")
|
||||
oce.add(OpCode.SEL_NVM, Info.SEL_NVM)
|
||||
oce.add(OpCode.SET_TIME_REF, Info.SET_TIME_REF)
|
||||
oce.add(OpCode.FACTORY_RESET, Info.FACTORY_RESET)
|
||||
oce.add(OpCode.RESET_MPSOC, Info.RESET_MPSOC)
|
||||
oce.add("8", "PLOC Supervisor: Set max restart tries")
|
||||
oce.add("9", "PLOC Supervisor: Reset MPSoC")
|
||||
oce.add("11", "PLOC Supervisor: Set boot timeout")
|
||||
oce.add("12", "PLOC Supervisor: Disable Hk")
|
||||
oce.add(OpCodes.REQ_BOOT_STATUS_REPORT, Info.REQ_BOOT_STATUS_REPORT)
|
||||
oce.add(OpCode.REQ_BOOT_STATUS_REPORT, Info.REQ_BOOT_STATUS_REPORT)
|
||||
oce.add("17", "PLOC Supervisor: Enable latchup alert")
|
||||
oce.add("18", "PLOC Supervisor: Disable latchup alert")
|
||||
oce.add("20", "PLOC Supervisor: Set alert limit")
|
||||
@ -202,12 +199,12 @@ def add_ploc_supv_cmds(defs: TmtcDefinitionWrapper):
|
||||
oce.add("35", "PLOC Supervisor: Set GPIO")
|
||||
oce.add("36", "PLOC Supervisor: Read GPIO")
|
||||
oce.add("37", "PLOC Supervisor: Restart supervisor")
|
||||
oce.add(OpCodes.PERFORM_UPDATE, Info.PERFORM_UPDATE)
|
||||
oce.add(OpCodes.START_UPDATE, Info.START_UPDATE)
|
||||
oce.add(OpCode.PERFORM_UPDATE, Info.PERFORM_UPDATE)
|
||||
oce.add(OpCode.START_UPDATE, Info.START_UPDATE)
|
||||
oce.add("43", "PLOC Supervisor: Terminate supervisor process")
|
||||
oce.add("44", "PLOC Supervisor: Start MPSoC quiet")
|
||||
oce.add("45", "PLOC Supervisor: Set shutdown timeout")
|
||||
oce.add(OpCodes.FACTORY_FLASH, Info.FACTORY_FLASH)
|
||||
oce.add(OpCode.FACTORY_FLASH, Info.FACTORY_FLASH)
|
||||
oce.add("47", "PLOC Supervisor: Enable auto TM")
|
||||
oce.add("48", "PLOC Supervisor: Disable auto TM")
|
||||
oce.add("51", "PLOC Supervisor: Logging request event buffers")
|
||||
@ -218,7 +215,7 @@ def add_ploc_supv_cmds(defs: TmtcDefinitionWrapper):
|
||||
oce.add("56", "PLOC Supervisor: Reset PL")
|
||||
oce.add("57", "PLOC Supervisor: Enable NVMs")
|
||||
oce.add("58", "PLOC Supervisor: Continue update")
|
||||
oce.add(OpCodes.MEM_CHECK, Info.MEM_CHECK)
|
||||
oce.add(OpCode.MEM_CHECK, Info.MEM_CHECK)
|
||||
defs.add_service(CustomServiceList.PLOC_SUPV.value, "PLOC Supervisor", oce)
|
||||
|
||||
|
||||
@ -227,39 +224,56 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
||||
q = p.queue_helper
|
||||
op_code = p.op_code
|
||||
object_id = get_object_ids().get(PLOC_SUPV_ID)
|
||||
assert object_id is not None
|
||||
q.add_log_cmd(f"Testing PLOC Supervisor with object id: {object_id.as_hex_string}")
|
||||
obyt = object_id.as_bytes
|
||||
prefix = "PLOC Supervisor"
|
||||
if op_code in OpCodes.OFF:
|
||||
if op_code == OpCode.OFF:
|
||||
q.add_log_cmd(f"{prefix}: {Info.OFF}")
|
||||
command = pack_mode_data(object_id.as_bytes, Mode.OFF, 0)
|
||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
|
||||
if op_code in OpCodes.ON:
|
||||
if op_code == OpCode.ON:
|
||||
q.add_log_cmd(f"{prefix}: {Info.ON}")
|
||||
command = pack_mode_data(object_id.as_bytes, Mode.ON, 0)
|
||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
|
||||
if op_code in OpCodes.NORMAL:
|
||||
if op_code == OpCode.NORMAL:
|
||||
q.add_log_cmd(f"{prefix}: {Info.NML}")
|
||||
command = pack_mode_data(object_id.as_bytes, Mode.NORMAL, 0)
|
||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
|
||||
if op_code in OpCodes.HK_TO_OBC:
|
||||
if op_code == OpCode.HK_TO_OBC:
|
||||
q.add_log_cmd(f"{prefix}: {Info.HK_TO_OBC}")
|
||||
command = obyt + struct.pack("!I", SupvActionId.HK_REPORT)
|
||||
command = obyt + struct.pack("!I", SupvActionId.REQUEST_HK_REPORT)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
if op_code in OpCodes.REQUEST_HK:
|
||||
q.add_log_cmd(f"{prefix}: {Info.REQUEST_HK}")
|
||||
sid = make_sid(object_id.as_bytes, SetIds.HK_REPORT)
|
||||
if op_code == OpCode.REQUEST_HK_SET:
|
||||
q.add_log_cmd(f"{prefix}: {Info.REQUEST_HK_SET}")
|
||||
sid = make_sid(object_id.as_bytes, prompt_set_id())
|
||||
cmd = generate_one_hk_command(sid)
|
||||
q.add_pus_tc(cmd)
|
||||
elif op_code in OpCodes.START_MPSOC:
|
||||
if op_code == OpCode.REQUEST_HK_SET_FROM_DEV:
|
||||
q.add_log_cmd(f"{prefix}: {Info.REQUEST_HK_SET_FROM_DEV}")
|
||||
set_id = prompt_set_id()
|
||||
action_cmd = None
|
||||
if set_id == SetId.HK_REPORT:
|
||||
action_cmd = create_action_cmd(PLOC_SUPV_ID, SupvActionId.REQUEST_HK_REPORT)
|
||||
if set_id == SetId.ADC_REPORT:
|
||||
action_cmd = create_action_cmd(
|
||||
PLOC_SUPV_ID, SupvActionId.REQUEST_ADC_REPORT
|
||||
)
|
||||
if set_id == SetId.COUNTERS_REPORT:
|
||||
action_cmd = create_action_cmd(
|
||||
PLOC_SUPV_ID, SupvActionId.REQUEST_LOGGING_COUNTERS
|
||||
)
|
||||
assert action_cmd is not None
|
||||
q.add_pus_tc(action_cmd)
|
||||
elif op_code == OpCode.START_MPSOC:
|
||||
q.add_log_cmd("PLOC Supervisor: Start MPSoC")
|
||||
command = obyt + struct.pack("!I", SupvActionId.START_MPSOC)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
if op_code in OpCodes.SHUTDOWN_MPSOC:
|
||||
if op_code == OpCode.SHUTDOWN_MPSOC:
|
||||
q.add_log_cmd("PLOC Supervisor: Shutdown MPSoC")
|
||||
command = object_id.as_bytes + struct.pack("!I", SupvActionId.SHUTWOWN_MPSOC)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
if op_code in OpCodes.SEL_NVM:
|
||||
if op_code == OpCode.SEL_NVM:
|
||||
q.add_log_cmd("PLOC Supervisor: Select MPSoC boot image")
|
||||
mem = int(input("MEM (NVM0 - 0 or NVM1 - 1): "))
|
||||
bp0 = int(input("BP0 (0 or 1): "))
|
||||
@ -267,9 +281,8 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
||||
bp2 = int(input("BP2 (0 or 1): "))
|
||||
command = pack_sel_boot_image_cmd(object_id.as_bytes, mem, bp0, bp1, bp2)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
if op_code in OpCodes.FACTORY_RESET:
|
||||
if op_code == OpCode.FACTORY_RESET:
|
||||
q.add_log_cmd(f"{prefix}: {Info.FACTORY_RESET}")
|
||||
key = -1
|
||||
while True:
|
||||
print("Please select the key for a factory reset operation")
|
||||
for key, val in FACTORY_RESET_OPS.items():
|
||||
@ -294,11 +307,11 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
||||
+ struct.pack("!B", restart_tries)
|
||||
)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
if op_code == "9":
|
||||
q.add_log_cmd("PLOC Supervisor: Reset MPSoC")
|
||||
if op_code == OpCode.RESET_MPSOC:
|
||||
q.add_log_cmd(Info.RESET_MPSOC)
|
||||
command = object_id.as_bytes + struct.pack("!I", SupvActionId.RESET_MPSOC)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
if op_code in OpCodes.SET_TIME_REF:
|
||||
if op_code == OpCode.SET_TIME_REF:
|
||||
q.add_log_cmd("PLOC Supervisor: Set time reference")
|
||||
command = object_id.as_bytes + struct.pack("!I", SupvActionId.SET_TIME_REF)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
@ -315,14 +328,14 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
||||
q.add_log_cmd("PLOC Supervisor: Disable HK")
|
||||
command = object_id.as_bytes + struct.pack("!I", SupvActionId.DISABLE_HK)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
if op_code in OpCodes.REQ_BOOT_STATUS_REPORT:
|
||||
if op_code in OpCode.REQ_BOOT_STATUS_REPORT:
|
||||
q.add_log_cmd(f"{prefix}: {Info.REQ_BOOT_STATUS_REPORT}")
|
||||
command = object_id.as_bytes + struct.pack(
|
||||
"!I", SupvActionId.GET_BOOT_STATUS_REPORT
|
||||
)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
q.add_wait_seconds(2.0)
|
||||
sid = make_sid(object_id.as_bytes, SetIds.BOOT_STATUS_REPORT)
|
||||
sid = make_sid(object_id.as_bytes, SetId.BOOT_STATUS_REPORT)
|
||||
req_hk = generate_one_hk_command(sid)
|
||||
q.add_pus_tc(req_hk)
|
||||
if op_code == "17":
|
||||
@ -383,11 +396,11 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
||||
"!I", SupvActionId.RESTART_SUPERVISOR
|
||||
)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
if op_code in OpCodes.START_UPDATE:
|
||||
if op_code in OpCode.START_UPDATE:
|
||||
q.add_log_cmd("PLOC Supversior: Start new MPSoC SW update")
|
||||
command = pack_update_command(object_id.as_bytes, True)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
if op_code in OpCodes.PERFORM_UPDATE:
|
||||
if op_code in OpCode.PERFORM_UPDATE:
|
||||
q.add_log_cmd("PLOC Supervisor: Perform MPSoC SW update")
|
||||
command = pack_update_command(object_id.as_bytes, False)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
@ -405,7 +418,7 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
||||
q.add_log_cmd("PLOC Supervisor: Set shutdown timeout")
|
||||
command = pack_set_shutdown_timeout_command(object_id.as_bytes)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
if op_code in OpCodes.FACTORY_FLASH:
|
||||
if op_code in OpCode.FACTORY_FLASH:
|
||||
q.add_log_cmd(f"{prefix}: {Info.FACTORY_FLASH}")
|
||||
command = object_id.as_bytes + struct.pack("!I", SupvActionId.FACTORY_FLASH)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
@ -434,7 +447,7 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
||||
if op_code == "54":
|
||||
q.add_log_cmd("PLOC Supervisor: Logging request counters")
|
||||
command = object_id.as_bytes + struct.pack(
|
||||
"!I", SupvActionId.LOGGING_REQUEST_COUNTERS
|
||||
"!I", SupvActionId.REQUEST_LOGGING_COUNTERS
|
||||
)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
if op_code == "55":
|
||||
@ -462,7 +475,7 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
||||
q.add_log_cmd("PLOC Supervisor: Continue update")
|
||||
command = object_id.as_bytes + struct.pack("!I", SupvActionId.CONTINUE_UPDATE)
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||
if op_code in OpCodes.MEM_CHECK:
|
||||
if op_code == OpCode.MEM_CHECK:
|
||||
custom_data = bytearray()
|
||||
update_file = get_update_file()
|
||||
memory_id = int(input("Specify memory ID: "))
|
||||
@ -472,8 +485,8 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
||||
custom_data.extend(struct.pack("!B", memory_id))
|
||||
custom_data.extend(struct.pack("!I", start_address))
|
||||
q.add_log_cmd(
|
||||
f"{prefix}: {Info.MEM_CHECK} for file {update_file} at memory ID {memory_id} at start "
|
||||
f"address {start_address}"
|
||||
f"{prefix}: {Info.MEM_CHECK} for file {update_file} at memory ID"
|
||||
f" {memory_id} at start address {start_address}"
|
||||
)
|
||||
command = create_action_cmd(
|
||||
object_id.as_bytes, SupvActionId.MEM_CHECK, custom_data
|
||||
@ -481,6 +494,20 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
||||
q.add_pus_tc(command)
|
||||
|
||||
|
||||
def prompt_set_id() -> SetId:
|
||||
for set_id in SetId:
|
||||
print(f"{set_id}: {set_id.name}")
|
||||
while True:
|
||||
set_id = int(input("Please select the set ID to request: "))
|
||||
try:
|
||||
set_id_typed = SetId(set_id)
|
||||
except ValueError:
|
||||
_LOGGER.warning("invalid set ID, try again")
|
||||
continue
|
||||
break
|
||||
return set_id_typed
|
||||
|
||||
|
||||
def pack_sel_boot_image_cmd(
|
||||
object_id: bytes, mem: int, bp0: int, bp1: int, bp2: int
|
||||
) -> bytearray:
|
||||
@ -545,9 +572,9 @@ def get_latchup_id() -> int:
|
||||
description_string = "Description".ljust(description_column_width)
|
||||
print(f"{key_string} | {description_string}")
|
||||
print(separator_string)
|
||||
for key in latchup_id_dict:
|
||||
for key in LATCHUP_ID_DICT:
|
||||
key_string = key.ljust(key_column_width)
|
||||
description_string = latchup_id_dict[key].ljust(description_column_width)
|
||||
description_string = LATCHUP_ID_DICT[key].ljust(description_column_width)
|
||||
print(f"{key_string} | {description_string}")
|
||||
return int(input("Specify latchup ID: "))
|
||||
|
||||
@ -676,10 +703,10 @@ def pack_set_gpio_cmd(object_id: bytes) -> bytearray:
|
||||
port = int(input("Specify port: 0x"), 16)
|
||||
pin = int(input("Specify pin: 0x"), 16)
|
||||
val = int(input("Specify val: 0x"), 16)
|
||||
command = object_id + struct.pack("!I", SupvActionId.SET_GPIO)
|
||||
command = command + struct.pack("!B", port)
|
||||
command = command + struct.pack("!B", pin)
|
||||
command = command + struct.pack("!B", val)
|
||||
command = bytearray(object_id + struct.pack("!I", SupvActionId.SET_GPIO))
|
||||
command.append(port)
|
||||
command.append(pin)
|
||||
command.append(val)
|
||||
return bytearray(command)
|
||||
|
||||
|
||||
@ -701,59 +728,182 @@ def pack_logging_set_topic(object_id: bytes) -> bytearray:
|
||||
|
||||
def get_update_file() -> str:
|
||||
_LOGGER.info("Specify update file ")
|
||||
input_helper = InputHelper(update_file_dict)
|
||||
input_helper = InputHelper(UPDATE_FILE_DICT)
|
||||
key = input_helper.get_key()
|
||||
if key == HARDCODED:
|
||||
file = HARDCODED_FILE
|
||||
elif key == MANUAL_INPUT:
|
||||
file = input("Ploc Supervisor: Specify absolute name of update file: ")
|
||||
else:
|
||||
file = update_file_dict[key][1]
|
||||
file = UPDATE_FILE_DICT[key][1]
|
||||
return file
|
||||
|
||||
|
||||
def get_event_buffer_path() -> str:
|
||||
_LOGGER.info("Specify path where to store event buffer file ")
|
||||
input_helper = InputHelper(event_buffer_path_dict)
|
||||
input_helper = InputHelper(EVENT_BUFFER_PATH_DICT)
|
||||
key = input_helper.get_key()
|
||||
if key == MANUAL_INPUT:
|
||||
file = input("Ploc Supervisor: Specify path: ")
|
||||
else:
|
||||
file = event_buffer_path_dict[key][1]
|
||||
file = EVENT_BUFFER_PATH_DICT[key][1]
|
||||
return file
|
||||
|
||||
|
||||
class SocState(enum.IntEnum):
|
||||
OFF = 0
|
||||
BOOTING = 1
|
||||
OPERATIONAL = 2
|
||||
SHUTDOWN = 3
|
||||
|
||||
|
||||
def handle_supv_hk_data(set_id: int, hk_data: bytes, pw: PrintWrapper):
|
||||
current_idx = 0
|
||||
if set_id == SetIds.HK_REPORT:
|
||||
pass
|
||||
elif set_id == SetIds.BOOT_STATUS_REPORT:
|
||||
fmt_str = "!BBIIBBBBBB"
|
||||
inc_len = struct.calcsize(fmt_str)
|
||||
(
|
||||
soc_state,
|
||||
power_cycles,
|
||||
boot_after_ms,
|
||||
boot_timeout_ms,
|
||||
active_nvm,
|
||||
bp_0_state,
|
||||
bp_1_state,
|
||||
bp_2_state,
|
||||
boot_state,
|
||||
boot_cycles,
|
||||
) = struct.unpack(fmt_str, hk_data[0 : 0 + inc_len])
|
||||
current_idx += inc_len
|
||||
pw.dlog(
|
||||
f"SoC state (0:off, 1:booting, 2:update, 3:operating, 4:shutdown, 5:reset): {soc_state}"
|
||||
)
|
||||
pw.dlog(f"Power Cycles {power_cycles}")
|
||||
pw.dlog(f"Boot after {boot_after_ms} ms | Boot timeout {boot_timeout_ms} ms")
|
||||
pw.dlog(f"Active NVM: {active_nvm}")
|
||||
pw.dlog(
|
||||
f"BP0 State {bp_0_state} | BP1 State {bp_1_state} | BP2 State {bp_2_state}"
|
||||
)
|
||||
pw.dlog(f"Boot State {boot_state} | Boot Cycles {boot_cycles}")
|
||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 10)
|
||||
if set_id == SetId.HK_REPORT:
|
||||
handle_hk_report(hk_data, pw)
|
||||
elif set_id == SetId.BOOT_STATUS_REPORT:
|
||||
handle_boot_report(hk_data, pw)
|
||||
elif set_id == SetId.ADC_REPORT:
|
||||
handle_adc_report(hk_data)
|
||||
elif set_id == SetId.COUNTERS_REPORT:
|
||||
handle_counters_report(hk_data)
|
||||
else:
|
||||
pw.dlog(f"PLOC SUPV: HK handling not implemented for set ID {set_id}")
|
||||
pw.dlog(f"Raw Data: 0x[{hk_data.hex(sep=',')}]")
|
||||
|
||||
|
||||
def handle_hk_report(hk_data: bytes, pw: PrintWrapper):
|
||||
fmt_str = "!IIIQIIIIIBBBB"
|
||||
inc_len = struct.calcsize(fmt_str)
|
||||
(
|
||||
temp_ps,
|
||||
temp_pl,
|
||||
temp_sup,
|
||||
uptime,
|
||||
cpu_load,
|
||||
avail_heap,
|
||||
num_tcs,
|
||||
num_tms,
|
||||
soc_state,
|
||||
nvm_0_1_state,
|
||||
nvm_3_state,
|
||||
mission_io_state,
|
||||
fmc_state,
|
||||
) = struct.unpack(fmt_str, hk_data[:inc_len])
|
||||
pw.dlog(f"Temp PS {temp_ps} C | Temp PL {temp_pl} C | Temp SUP {temp_sup} C")
|
||||
pw.dlog(f"Uptime {uptime} | CPU Load {cpu_load} | Avail Heap {avail_heap}")
|
||||
pw.dlog(f"Number TCs {num_tcs} | Number TMs {num_tms}")
|
||||
pw.dlog(f"SOC state {SocState(soc_state)}")
|
||||
pw.dlog(f"NVM 01 State {nvm_0_1_state}")
|
||||
pw.dlog(f"NVM 3 State {nvm_3_state}")
|
||||
pw.dlog(f"Mission IO state {mission_io_state}")
|
||||
pw.dlog(f"FMC state {fmc_state}")
|
||||
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[inc_len:], 13))
|
||||
|
||||
|
||||
def handle_boot_report(hk_data: bytes, pw: PrintWrapper):
|
||||
current_idx = 0
|
||||
fmt_str = "!BBIIBBBBBB"
|
||||
inc_len = struct.calcsize(fmt_str)
|
||||
(
|
||||
soc_state,
|
||||
power_cycles,
|
||||
boot_after_ms,
|
||||
boot_timeout_ms,
|
||||
active_nvm,
|
||||
bp_0_state,
|
||||
bp_1_state,
|
||||
bp_2_state,
|
||||
boot_state,
|
||||
boot_cycles,
|
||||
) = struct.unpack(fmt_str, hk_data[0 : 0 + inc_len])
|
||||
current_idx += inc_len
|
||||
pw.dlog(
|
||||
"SoC state (0:off, 1:booting, 2:update, 3:operating, 4:shutdown, 5:reset):"
|
||||
f" {soc_state}"
|
||||
)
|
||||
pw.dlog(f"Power Cycles {power_cycles}")
|
||||
pw.dlog(f"Boot after {boot_after_ms} ms | Boot timeout {boot_timeout_ms} ms")
|
||||
pw.dlog(f"Active NVM: {active_nvm}")
|
||||
pw.dlog(f"BP0 State {bp_0_state} | BP1 State {bp_1_state} | BP2 State {bp_2_state}")
|
||||
pw.dlog(f"Boot State {boot_state} | Boot Cycles {boot_cycles}")
|
||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 10)
|
||||
|
||||
|
||||
def handle_adc_report(hk_data: bytes):
|
||||
if len(hk_data) < 64:
|
||||
_LOGGER.warning("ADC report smaller than 64 bytes")
|
||||
current_idx = 0
|
||||
adc_raw = []
|
||||
adc_eng = []
|
||||
for _ in range(16):
|
||||
adc_raw.append(struct.unpack("!H", hk_data[current_idx : current_idx + 2])[0])
|
||||
current_idx += 2
|
||||
for _ in range(16):
|
||||
adc_eng.append(struct.unpack("!H", hk_data[current_idx : current_idx + 2])[0])
|
||||
current_idx += 2
|
||||
|
||||
print(f"{'Index'.ljust(10)} | {'ADC RAW'.ljust(10)} | {'ADC ENG'.ljust(10)}")
|
||||
for i in range(16):
|
||||
print(f"{i: >10} | {adc_raw[i]: >10} | {adc_eng[i]: >10}")
|
||||
|
||||
|
||||
def handle_counters_report(hk_data: bytes):
|
||||
current_idx = 0
|
||||
signature = struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0]
|
||||
current_idx += 4
|
||||
latchup_counters = []
|
||||
for _ in range(7):
|
||||
latchup_counters.append(
|
||||
struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0]
|
||||
)
|
||||
current_idx += 4
|
||||
fmt_str = "!IIIIIIIIIIIIIIIIIIII"
|
||||
inc_len = struct.calcsize(fmt_str)
|
||||
(
|
||||
adc_deviation_triggers_cnt,
|
||||
tc_received_cnt,
|
||||
tm_available_cnt,
|
||||
supervisor_boots,
|
||||
mpsoc_boots,
|
||||
mpsoc_boot_failed_attempts,
|
||||
mpsoc_powerup,
|
||||
mpsoc_updates,
|
||||
mpsoc_heartbeat_resets,
|
||||
cpu_wdt_resets,
|
||||
ps_heartbeats_lost,
|
||||
pl_heartbeats_lost,
|
||||
eb_task_lost,
|
||||
bm_task_lost,
|
||||
lm_task_lost,
|
||||
am_task_lost,
|
||||
tctmm_task_lost,
|
||||
mm_task_lost,
|
||||
hk_task_lost,
|
||||
dl_task_lost,
|
||||
) = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
||||
current_idx += inc_len
|
||||
_redwire_tasks_lost = []
|
||||
for _ in range(3):
|
||||
_redwire_tasks_lost.append(
|
||||
struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0]
|
||||
)
|
||||
print(f"Signature: {signature}")
|
||||
print(f"Latchup Counters: {latchup_counters}")
|
||||
print(f"ADC Deviation Triggers Count: {adc_deviation_triggers_cnt}")
|
||||
print(f"TCs received: {tc_received_cnt} | TMs Available: {tm_available_cnt}")
|
||||
print(f"Supervisor Boots: {supervisor_boots} | MPSoC boots: {mpsoc_boots}")
|
||||
print(f"MPSoC boot failed attempts: {mpsoc_boot_failed_attempts}")
|
||||
print(f"MPSoC powerup: {mpsoc_powerup}")
|
||||
print(f"MPSoC updates: {mpsoc_updates}")
|
||||
print(f"MPSoC heartbeat resets: {mpsoc_heartbeat_resets}")
|
||||
print(f"CPU WDT resets: {cpu_wdt_resets}")
|
||||
print(f"PS heartbeats lost: {ps_heartbeats_lost}")
|
||||
print(f"PL heartbeats lost: {pl_heartbeats_lost}")
|
||||
print(f"EB task lost: {eb_task_lost}")
|
||||
print(f"BM task lost: {bm_task_lost}")
|
||||
print(f"LM task lost: {lm_task_lost}")
|
||||
print(f"AM task lost: {am_task_lost}")
|
||||
print(f"TCTMM task lost: {tctmm_task_lost}")
|
||||
print(f"MM task lost: {mm_task_lost}")
|
||||
print(f"HK task lost: {hk_task_lost}")
|
||||
print(f"DL task lost: {dl_task_lost}")
|
||||
|
@ -9,19 +9,19 @@ from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
from tmtccmd.config import TmtcDefinitionWrapper
|
||||
|
||||
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
||||
make_sid,
|
||||
generate_one_diag_command,
|
||||
enable_periodic_hk_command_with_interval,
|
||||
disable_periodic_hk_command,
|
||||
)
|
||||
from tmtccmd.tc.pus_11_tc_sched import (
|
||||
from tmtccmd.pus.s11_tc_sched import (
|
||||
create_enable_tc_sched_cmd,
|
||||
create_time_tagged_cmd,
|
||||
)
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode, Subservice
|
||||
from tmtccmd.tc.pus_20_fsfw_param import (
|
||||
from tmtccmd.pus.s200_fsfw_mode import Subservice, pack_mode_data, Mode
|
||||
from tmtccmd.pus.s20_fsfw_param import (
|
||||
create_scalar_double_parameter,
|
||||
create_load_param_cmd,
|
||||
create_scalar_boolean_parameter,
|
||||
@ -35,25 +35,33 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
class OpCode:
|
||||
SWITCH_HPA_ON_PROC = ["0", "proc_hpa"]
|
||||
SWITCH_ON = ["2", "on"]
|
||||
SWITCH_OFF = ["3", "off"]
|
||||
NORMAL_SSR = ["4", "nml_ssr"]
|
||||
NORMAL_DRO = ["5", "nml_dro"]
|
||||
NORMAL_X8 = ["6", "nml_x8"]
|
||||
NORMAL_TX = ["7", "nml_tx"]
|
||||
NORMAL_MPA = ["8", "nml_mpa"]
|
||||
NORMAL_HPA = ["9", "nml_hpa"]
|
||||
SWITCH_ON = "on"
|
||||
SWITCH_OFF = "off"
|
||||
NORMAL_SSR = "nml_ssr"
|
||||
NORMAL_DRO = "nml_dro"
|
||||
NORMAL_X8 = "nml_x8"
|
||||
NORMAL_TX = "nml_tx"
|
||||
NORMAL_MPA = "nml_mpa"
|
||||
NORMAL_HPA = "nml_hpa"
|
||||
NORMAL_CUSTOM = "nml_custom"
|
||||
|
||||
ENABLE_HK = ["enable_hk"]
|
||||
DISABLE_HK = ["disable_hk"]
|
||||
REQ_OS_HK = ["hk_os"]
|
||||
ENABLE_HK = "enable_hk"
|
||||
DISABLE_HK = "disable_hk"
|
||||
REQ_OS_HK = "hk_os"
|
||||
|
||||
INJECT_SSR_TO_DRO_FAILURE = ["10", "inject_ssr_dro_fault"]
|
||||
INJECT_DRO_TO_X8_FAILURE = ["11", "inject_dro_x8_fault"]
|
||||
INJECT_X8_TO_TX_FAILURE = ["12", "inject_x8_tx_fault"]
|
||||
INJECT_TX_TO_MPA_FAILURE = ["13", "inject_tx_mpa_fault"]
|
||||
INJECT_MPA_TO_HPA_FAILURE = ["14", "inject_mpa_hpa_fault"]
|
||||
INJECT_ALL_ON_FAILURE = ["15", "inject_all_on_fault"]
|
||||
DISABLE_ORDER_CHECKING = "disable_order_checking"
|
||||
ENABLE_ORDER_CHECKING = "enable_order_checking"
|
||||
|
||||
UPDATE_I_UPPER_LIMIT = "update_i_upper_limit"
|
||||
UPDATE_V_LOWER_LIMIT = "update_v_lower_limit"
|
||||
UPDATE_V_UPPER_LIMIT = "update_v_upper_limit"
|
||||
|
||||
INJECT_SSR_TO_DRO_FAILURE = "inject_ssr_dro_fault"
|
||||
INJECT_DRO_TO_X8_FAILURE = "inject_dro_x8_fault"
|
||||
INJECT_X8_TO_TX_FAILURE = "inject_x8_tx_fault"
|
||||
INJECT_TX_TO_MPA_FAILURE = "inject_tx_mpa_fault"
|
||||
INJECT_MPA_TO_HPA_FAILURE = "inject_mpa_hpa_fault"
|
||||
INJECT_ALL_ON_FAILURE = "inject_all_on_fault"
|
||||
|
||||
|
||||
class Info:
|
||||
@ -66,10 +74,16 @@ class Info:
|
||||
NORMAL_TX = f"{NORMAL}, TX on"
|
||||
NORMAL_MPA = f"{NORMAL}, MPA on"
|
||||
NORMAL_HPA = f"{NORMAL}, HPA on"
|
||||
NORMAL_CUSTOM = f"{NORMAL}, Custom Channel Settings"
|
||||
REQ_OS_HK = "Request One Shot HK"
|
||||
SWITCH_HPA_ON_PROC = "Switch HPA on procedure"
|
||||
ENABLE_HK = "Enable HK"
|
||||
DISABLE_HK = "Disable HK"
|
||||
UPDATE_I_UPPER_LIMIT = "Update upper current parameter"
|
||||
UPDATE_V_LOWER_LIMIT = "Update lower voltage parameter"
|
||||
UPDATE_V_UPPER_LIMIT = "Update upper voltage parameter"
|
||||
DISABLE_ORDER_CHECKING = "Disable order checks"
|
||||
ENABLE_ORDER_CHECKING = "Enable order checks"
|
||||
|
||||
|
||||
class SetId(enum.IntEnum):
|
||||
@ -85,7 +99,41 @@ class NormalSubmodesMask(enum.IntEnum):
|
||||
HPA_ON = 5
|
||||
|
||||
|
||||
class ParamIds(enum.IntEnum):
|
||||
class SubmodeForNormalMode(enum.IntEnum):
|
||||
NONE = 0
|
||||
SSR_ON = 1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
|
||||
DRO_ON = 1 << NormalSubmodesMask.DRO_ON | (
|
||||
1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
|
||||
)
|
||||
X8_ON = (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
)
|
||||
TX_ON = (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
| (1 << NormalSubmodesMask.TX_ON)
|
||||
)
|
||||
MPA_ON = (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
| (1 << NormalSubmodesMask.TX_ON)
|
||||
| (1 << NormalSubmodesMask.MPA_ON)
|
||||
)
|
||||
HPA_ON = (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
| (1 << NormalSubmodesMask.TX_ON)
|
||||
| (1 << NormalSubmodesMask.MPA_ON)
|
||||
| (1 << NormalSubmodesMask.HPA_ON)
|
||||
)
|
||||
|
||||
|
||||
class ParamId(enum.IntEnum):
|
||||
NEG_V_LOWER_BOUND = 0
|
||||
NEG_V_UPPER_BOUND = 1
|
||||
|
||||
@ -122,6 +170,17 @@ class ParamIds(enum.IntEnum):
|
||||
INJECT_MPA_TO_HPA_FAILURE = 34
|
||||
INJECT_ALL_ON_FAILURE = 35
|
||||
|
||||
DISABLE_ORDER_CHECK_CHANNELS = 40
|
||||
|
||||
|
||||
class DevSelect(enum.IntEnum):
|
||||
SSR_NEG_V = 0
|
||||
DRO = 1
|
||||
X8 = 2
|
||||
TX = 3
|
||||
MPA = 4
|
||||
HPA = 5
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
def add_pl_pcdu_cmds(defs: TmtcDefinitionWrapper):
|
||||
@ -135,8 +194,12 @@ def add_pl_pcdu_cmds(defs: TmtcDefinitionWrapper):
|
||||
oce.add(keys=OpCode.NORMAL_TX, info=Info.NORMAL_TX)
|
||||
oce.add(keys=OpCode.NORMAL_MPA, info=Info.NORMAL_MPA)
|
||||
oce.add(keys=OpCode.NORMAL_HPA, info=Info.NORMAL_HPA)
|
||||
oce.add(keys=OpCode.NORMAL_CUSTOM, info=Info.NORMAL_CUSTOM)
|
||||
oce.add(keys=OpCode.REQ_OS_HK, info=Info.REQ_OS_HK)
|
||||
oce.add(keys=OpCode.ENABLE_HK, info=Info.ENABLE_HK)
|
||||
oce.add(keys=OpCode.UPDATE_V_LOWER_LIMIT, info=Info.UPDATE_V_LOWER_LIMIT)
|
||||
oce.add(keys=OpCode.UPDATE_V_UPPER_LIMIT, info=Info.UPDATE_V_UPPER_LIMIT)
|
||||
oce.add(keys=OpCode.UPDATE_I_UPPER_LIMIT, info=Info.UPDATE_I_UPPER_LIMIT)
|
||||
oce.add(
|
||||
keys=OpCode.INJECT_SSR_TO_DRO_FAILURE,
|
||||
info="Inject failure SSR to DRO transition",
|
||||
@ -158,15 +221,17 @@ def add_pl_pcdu_cmds(defs: TmtcDefinitionWrapper):
|
||||
info="Inject failure in MPA to HPA transition",
|
||||
)
|
||||
oce.add(keys=OpCode.INJECT_ALL_ON_FAILURE, info="Inject failure in all on mode")
|
||||
oce.add(keys=OpCode.DISABLE_ORDER_CHECKING, info=Info.DISABLE_ORDER_CHECKING)
|
||||
oce.add(keys=OpCode.ENABLE_ORDER_CHECKING, info=Info.ENABLE_ORDER_CHECKING)
|
||||
defs.add_service(CustomServiceList.PL_PCDU.value, "PL PCDU", oce)
|
||||
|
||||
|
||||
def pack_pl_pcdu_commands( # noqa C901: Complexity is okay here.
|
||||
q: DefaultPusQueueHelper, op_code: str
|
||||
): # noqa C901: Complexity is okay here.
|
||||
if op_code in OpCode.SWITCH_ON:
|
||||
if op_code == OpCode.SWITCH_ON:
|
||||
pack_pl_pcdu_mode_cmd(q=q, info=Info.SWITCH_ON, mode=Mode.ON, submode=0)
|
||||
if op_code in OpCode.SWITCH_OFF:
|
||||
if op_code == OpCode.SWITCH_OFF:
|
||||
pack_pl_pcdu_mode_cmd(q=q, info=Info.SWITCH_OFF, mode=Mode.OFF, submode=0)
|
||||
if op_code in OpCode.ENABLE_HK:
|
||||
interval = float(
|
||||
@ -178,13 +243,13 @@ def pack_pl_pcdu_commands( # noqa C901: Complexity is okay here.
|
||||
q.add_log_cmd(f"Enable PL PCDU HK with interval of {interval} seconds")
|
||||
for cmd in cmds:
|
||||
q.add_pus_tc(cmd)
|
||||
if op_code in OpCode.DISABLE_HK:
|
||||
if op_code == OpCode.DISABLE_HK:
|
||||
cmd = disable_periodic_hk_command(
|
||||
diag=True, sid=make_sid(PL_PCDU_ID, SetId.ADC)
|
||||
)
|
||||
q.add_log_cmd("Disabling PL PCDU HK")
|
||||
q.add_pus_tc(cmd)
|
||||
if op_code in OpCode.NORMAL_SSR:
|
||||
if op_code == OpCode.NORMAL_SSR:
|
||||
pack_pl_pcdu_mode_cmd(
|
||||
q=q,
|
||||
info=Info.NORMAL_SSR,
|
||||
@ -193,54 +258,118 @@ def pack_pl_pcdu_commands( # noqa C901: Complexity is okay here.
|
||||
NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
|
||||
),
|
||||
)
|
||||
if op_code in OpCode.NORMAL_DRO:
|
||||
if op_code == OpCode.NORMAL_DRO:
|
||||
pack_pl_pcdu_mode_cmd(
|
||||
q=q,
|
||||
info=Info.NORMAL_DRO,
|
||||
mode=Mode.NORMAL,
|
||||
submode=submode_mask_to_submode(NormalSubmodesMask.DRO_ON),
|
||||
)
|
||||
if op_code in OpCode.NORMAL_X8:
|
||||
if op_code == OpCode.NORMAL_X8:
|
||||
pack_pl_pcdu_mode_cmd(
|
||||
q=q,
|
||||
info=Info.NORMAL_X8,
|
||||
mode=Mode.NORMAL,
|
||||
submode=submode_mask_to_submode(NormalSubmodesMask.X8_ON),
|
||||
)
|
||||
if op_code in OpCode.NORMAL_TX:
|
||||
if op_code == OpCode.NORMAL_TX:
|
||||
pack_pl_pcdu_mode_cmd(
|
||||
q=q,
|
||||
info=Info.NORMAL_TX,
|
||||
mode=Mode.NORMAL,
|
||||
submode=submode_mask_to_submode(NormalSubmodesMask.TX_ON),
|
||||
)
|
||||
if op_code in OpCode.NORMAL_MPA:
|
||||
if op_code == OpCode.NORMAL_MPA:
|
||||
pack_pl_pcdu_mode_cmd(
|
||||
q=q,
|
||||
info=Info.NORMAL_MPA,
|
||||
mode=Mode.NORMAL,
|
||||
submode=submode_mask_to_submode(NormalSubmodesMask.MPA_ON),
|
||||
)
|
||||
if op_code in OpCode.NORMAL_HPA:
|
||||
if op_code == OpCode.NORMAL_HPA:
|
||||
pack_pl_pcdu_mode_cmd(
|
||||
q=q,
|
||||
info=Info.NORMAL_HPA,
|
||||
mode=Mode.NORMAL,
|
||||
submode=submode_mask_to_submode(NormalSubmodesMask.HPA_ON),
|
||||
)
|
||||
if op_code in OpCode.REQ_OS_HK:
|
||||
|
||||
if op_code == OpCode.NORMAL_CUSTOM:
|
||||
pack_pl_pcdu_mode_cmd(
|
||||
q=q,
|
||||
info=Info.NORMAL_CUSTOM,
|
||||
mode=Mode.NORMAL,
|
||||
submode=prompt_custom_normal_submode(),
|
||||
)
|
||||
if op_code == OpCode.REQ_OS_HK:
|
||||
q.add_log_cmd(f"PL PCDU: {Info.REQ_OS_HK}")
|
||||
q.add_pus_tc(
|
||||
generate_one_diag_command(
|
||||
sid=make_sid(object_id=PL_PCDU_ID, set_id=SetId.ADC)
|
||||
)
|
||||
)
|
||||
if op_code in OpCode.SWITCH_HPA_ON_PROC:
|
||||
if op_code == OpCode.DISABLE_ORDER_CHECKING:
|
||||
q.add_log_cmd(Info.DISABLE_ORDER_CHECKING)
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_boolean_parameter(
|
||||
PL_PCDU_ID, 0, ParamId.DISABLE_ORDER_CHECK_CHANNELS, True
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if op_code == OpCode.ENABLE_ORDER_CHECKING:
|
||||
q.add_log_cmd(Info.ENABLE_ORDER_CHECKING)
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_boolean_parameter(
|
||||
PL_PCDU_ID, 0, ParamId.DISABLE_ORDER_CHECK_CHANNELS, False
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if op_code == OpCode.UPDATE_I_UPPER_LIMIT:
|
||||
q.add_log_cmd(Info.UPDATE_I_UPPER_LIMIT)
|
||||
print("Select device to update lower current limit for: ")
|
||||
param_id = dev_select_to_upper_i_update_param_id(dev_select_prompt(True))
|
||||
new_param_value = float(
|
||||
input("Please specify new parameter value as a double: ")
|
||||
)
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_double_parameter(PL_PCDU_ID, 0, param_id, new_param_value)
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.UPDATE_V_LOWER_LIMIT:
|
||||
q.add_log_cmd(Info.UPDATE_V_LOWER_LIMIT)
|
||||
print("Select device to update lower voltage limit for: ")
|
||||
param_id = dev_select_to_lower_u_update_param_id(dev_select_prompt(False))
|
||||
new_param_value = float(
|
||||
input("Please specify new parameter value as a double: ")
|
||||
)
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_double_parameter(PL_PCDU_ID, 0, param_id, new_param_value)
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.UPDATE_V_UPPER_LIMIT:
|
||||
q.add_log_cmd(Info.UPDATE_V_UPPER_LIMIT)
|
||||
print("Select device to update upper voltage limit for: ")
|
||||
param_id = dev_select_to_upper_u_update_param_id(dev_select_prompt(False))
|
||||
new_param_value = float(
|
||||
input("Please specify new parameter value as a double: ")
|
||||
)
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_double_parameter(PL_PCDU_ID, 0, param_id, new_param_value)
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.SWITCH_HPA_ON_PROC:
|
||||
hpa_on_procedure(q)
|
||||
if op_code in OpCode.INJECT_ALL_ON_FAILURE:
|
||||
if op_code == OpCode.INJECT_ALL_ON_FAILURE:
|
||||
pack_failure_injection_cmd(
|
||||
q=q,
|
||||
param_id=ParamIds.INJECT_ALL_ON_FAILURE,
|
||||
param_id=ParamId.INJECT_ALL_ON_FAILURE,
|
||||
print_str="All On",
|
||||
)
|
||||
|
||||
@ -250,7 +379,7 @@ def hpa_on_procedure(q: DefaultPusQueueHelper):
|
||||
if delay_dro_to_x8 is None:
|
||||
delay_dro_to_x8 = 900
|
||||
q.add_log_cmd(
|
||||
f"Starting procedure to switch on PL PCDU HPA with DRO to X8 "
|
||||
"Starting procedure to switch on PL PCDU HPA with DRO to X8 "
|
||||
f"delay of {delay_dro_to_x8} seconds"
|
||||
)
|
||||
pl_pcdu_on = PusTelecommand(
|
||||
@ -383,41 +512,17 @@ def request_wait_time() -> Optional[float]:
|
||||
|
||||
def submode_mask_to_submode(on_tgt: NormalSubmodesMask) -> int:
|
||||
if on_tgt == NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON:
|
||||
return 1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
|
||||
return SubmodeForNormalMode.SSR_ON
|
||||
if on_tgt == NormalSubmodesMask.DRO_ON:
|
||||
return 1 << NormalSubmodesMask.DRO_ON | (
|
||||
1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
|
||||
)
|
||||
return SubmodeForNormalMode.DRO_ON
|
||||
if on_tgt == NormalSubmodesMask.X8_ON:
|
||||
return (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
)
|
||||
return SubmodeForNormalMode.X8_ON
|
||||
if on_tgt == NormalSubmodesMask.TX_ON:
|
||||
return (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
| (1 << NormalSubmodesMask.TX_ON)
|
||||
)
|
||||
return SubmodeForNormalMode.TX_ON
|
||||
if on_tgt == NormalSubmodesMask.MPA_ON:
|
||||
return (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
| (1 << NormalSubmodesMask.TX_ON)
|
||||
| (1 << NormalSubmodesMask.MPA_ON)
|
||||
)
|
||||
return SubmodeForNormalMode.MPA_ON
|
||||
if on_tgt == NormalSubmodesMask.HPA_ON:
|
||||
return (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
| (1 << NormalSubmodesMask.TX_ON)
|
||||
| (1 << NormalSubmodesMask.MPA_ON)
|
||||
| (1 << NormalSubmodesMask.HPA_ON)
|
||||
)
|
||||
return SubmodeForNormalMode.HPA_ON
|
||||
|
||||
|
||||
def pack_wait_time_cmd(q: DefaultPusQueueHelper, param_id: int, print_str: str):
|
||||
@ -500,3 +605,100 @@ def handle_plpcdu_hk(pw: PrintWrapper, set_id: int, hk_data: bytes):
|
||||
FsfwTmTcPrinter.get_validity_buffer(
|
||||
validity_buffer=hk_data[current_idx:], num_vars=3
|
||||
)
|
||||
|
||||
|
||||
def dev_select_prompt(skip_ssr: bool) -> DevSelect:
|
||||
while True:
|
||||
for dev in DevSelect:
|
||||
if skip_ssr and dev == DevSelect.SSR_NEG_V:
|
||||
continue
|
||||
print(f"{dev}: {dev.name}")
|
||||
dev_select = int(input("Select device by index: "))
|
||||
try:
|
||||
return DevSelect(dev_select)
|
||||
except IndexError:
|
||||
_LOGGER.warn("Invalid paramter index, try again.")
|
||||
continue
|
||||
|
||||
|
||||
def dev_select_to_upper_i_update_param_id(dev_select: DevSelect) -> ParamId:
|
||||
param_id = None
|
||||
if dev_select == DevSelect.DRO:
|
||||
param_id = ParamId.DRO_I_UPPER_BOUND
|
||||
elif dev_select == DevSelect.X8:
|
||||
param_id = ParamId.X8_I_UPPER_BOUND
|
||||
elif dev_select == DevSelect.TX:
|
||||
param_id = ParamId.TX_I_UPPER_BOUND
|
||||
elif dev_select == DevSelect.MPA:
|
||||
param_id = ParamId.MPA_I_UPPER_BOUND
|
||||
elif dev_select == DevSelect.HPA:
|
||||
param_id = ParamId.HPA_I_UPPER_BOUND
|
||||
if param_id is None:
|
||||
raise ValueError("invalid parameter ID")
|
||||
return param_id
|
||||
|
||||
|
||||
def dev_select_to_lower_u_update_param_id(dev_select: DevSelect) -> ParamId:
|
||||
param_id = None
|
||||
if dev_select == DevSelect.SSR_NEG_V:
|
||||
param_id = ParamId.NEG_V_LOWER_BOUND
|
||||
if dev_select == DevSelect.DRO:
|
||||
param_id = ParamId.DRO_U_LOWER_BOUND
|
||||
elif dev_select == DevSelect.X8:
|
||||
param_id = ParamId.X8_U_LOWER_BOUND
|
||||
elif dev_select == DevSelect.TX:
|
||||
param_id = ParamId.TX_U_LOWER_BOUND
|
||||
elif dev_select == DevSelect.MPA:
|
||||
param_id = ParamId.MPA_U_LOWER_BOUND
|
||||
elif dev_select == DevSelect.HPA:
|
||||
param_id = ParamId.HPA_U_LOWER_BOUND
|
||||
if param_id is None:
|
||||
raise ValueError("invalid parameter ID")
|
||||
return param_id
|
||||
|
||||
|
||||
def dev_select_to_upper_u_update_param_id(dev_select: DevSelect) -> ParamId:
|
||||
param_id = None
|
||||
if dev_select == DevSelect.SSR_NEG_V:
|
||||
param_id = ParamId.NEG_V_UPPER_BOUND
|
||||
if dev_select == DevSelect.DRO:
|
||||
param_id = ParamId.DRO_U_UPPER_BOUND
|
||||
elif dev_select == DevSelect.X8:
|
||||
param_id = ParamId.X8_U_UPPER_BOUND
|
||||
elif dev_select == DevSelect.TX:
|
||||
param_id = ParamId.TX_U_UPPER_BOUND
|
||||
elif dev_select == DevSelect.MPA:
|
||||
param_id = ParamId.MPA_U_UPPER_BOUND
|
||||
elif dev_select == DevSelect.HPA:
|
||||
param_id = ParamId.HPA_U_UPPER_BOUND
|
||||
if param_id is None:
|
||||
raise ValueError("invalid parameter ID")
|
||||
return param_id
|
||||
|
||||
|
||||
def prompt_custom_normal_submode() -> int:
|
||||
print("Prompting custom submode.")
|
||||
submode = 0
|
||||
|
||||
def prompt_channel(submode: int, channel_str: str, mask: NormalSubmodesMask) -> int:
|
||||
while True:
|
||||
channel_on = input(f" {channel_str} ON? [y/n]: ")
|
||||
if channel_on in ["y", "1", "yes"]:
|
||||
submode |= 1 << mask
|
||||
elif channel_on in ["n", "0", "no"]:
|
||||
pass
|
||||
else:
|
||||
_LOGGER.warning("invalid input, try again")
|
||||
continue
|
||||
break
|
||||
return submode
|
||||
|
||||
submode = prompt_channel(
|
||||
submode, "SSR", NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
|
||||
)
|
||||
submode = prompt_channel(submode, "DRO", NormalSubmodesMask.DRO_ON)
|
||||
submode = prompt_channel(submode, "X8", NormalSubmodesMask.X8_ON)
|
||||
submode = prompt_channel(submode, "TX", NormalSubmodesMask.TX_ON)
|
||||
submode = prompt_channel(submode, "MPA", NormalSubmodesMask.MPA_ON)
|
||||
submode = prompt_channel(submode, "HPA", NormalSubmodesMask.HPA_ON)
|
||||
return submode
|
@ -14,9 +14,9 @@ from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Mode, pack_mode_data
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_data
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import generate_one_hk_command, make_sid
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
|
||||
|
@ -5,10 +5,10 @@ from spacepackets.ecss import PusTelecommand
|
||||
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Mode, pack_mode_data, Subservice
|
||||
from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_data, Subservice
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
from tmtccmd.config import OpCodeEntry, TmtcDefinitionWrapper
|
||||
from eive_tmtc.config.object_ids import SCEX_HANDLER_ID
|
||||
|
||||
@ -17,17 +17,20 @@ USE_SCEX_CONF_FILE = True
|
||||
|
||||
|
||||
class OpCode:
|
||||
PING = ["0", "ping"]
|
||||
ION_CMD = ["1", "ion"]
|
||||
TEMP_CMD = ["2", "temp"]
|
||||
EXP_STATUS_CMD = ["3", "expstatus"]
|
||||
PING = "ping"
|
||||
ION_CMD = "ion"
|
||||
TEMP_CMD = "temp"
|
||||
EXP_STATUS_CMD = "expstatus"
|
||||
|
||||
ONE_CELLS_CMD = ["4", "onecell"]
|
||||
ALL_CELLS_CMD = ["5", "allcells"]
|
||||
FRAM = ["6", "fram"]
|
||||
ONE_CELLS_CMD = "onecell"
|
||||
ALL_CELLS_CMD = "allcells"
|
||||
FRAM = "fram"
|
||||
|
||||
SWITCH_ON = ["7", "on"]
|
||||
SWITCH_OFF = ["8", "off"]
|
||||
ON = "on"
|
||||
SWITCH_ON = "on"
|
||||
OFF = "off"
|
||||
SWITCH_OFF = OFF
|
||||
NORMAL = "normal"
|
||||
|
||||
|
||||
class ActionId(enum.IntEnum):
|
||||
@ -53,6 +56,7 @@ class Info:
|
||||
|
||||
SWITCH_ON = "Switch Scex on"
|
||||
SWITCH_OFF = "Switch Scex off"
|
||||
NORMAL = "Switch SCEX to normal mode"
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
@ -66,8 +70,9 @@ def add_scex_cmds(defs: TmtcDefinitionWrapper):
|
||||
|
||||
oce.add(keys=OpCode.ALL_CELLS_CMD, info=Info.ALL_CELLS_CMD)
|
||||
oce.add(keys=OpCode.FRAM, info=Info.FRAM)
|
||||
oce.add(keys=OpCode.SWITCH_ON, info=Info.SWITCH_ON)
|
||||
oce.add(keys=OpCode.SWITCH_OFF, info=Info.SWITCH_OFF)
|
||||
oce.add(keys=OpCode.ON, info=Info.SWITCH_ON)
|
||||
oce.add(keys=OpCode.OFF, info=Info.SWITCH_OFF)
|
||||
oce.add(keys=OpCode.NORMAL, info=Info.NORMAL)
|
||||
|
||||
defs.add_service(
|
||||
name=CustomServiceList.SCEX.value, info="SCEX Device", op_code_entry=oce
|
||||
@ -78,7 +83,7 @@ def add_scex_cmds(defs: TmtcDefinitionWrapper):
|
||||
def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
||||
op_code = p.op_code
|
||||
q = p.queue_helper
|
||||
if op_code in OpCode.SWITCH_ON:
|
||||
if op_code == OpCode.ON:
|
||||
q.add_log_cmd(Info.SWITCH_ON)
|
||||
q.add_pus_tc(
|
||||
PusTelecommand(
|
||||
@ -87,7 +92,16 @@ def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
||||
app_data=pack_mode_data(SCEX_HANDLER_ID, Mode.ON, 0),
|
||||
)
|
||||
)
|
||||
if op_code in OpCode.SWITCH_OFF:
|
||||
if op_code == OpCode.NORMAL:
|
||||
q.add_log_cmd(Info.NORMAL)
|
||||
q.add_pus_tc(
|
||||
PusTelecommand(
|
||||
service=200,
|
||||
subservice=Subservice.TC_MODE_COMMAND,
|
||||
app_data=pack_mode_data(SCEX_HANDLER_ID, Mode.NORMAL, 0),
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.OFF:
|
||||
q.add_log_cmd(Info.SWITCH_OFF)
|
||||
q.add_pus_tc(
|
||||
PusTelecommand(
|
||||
@ -96,20 +110,20 @@ def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
||||
app_data=pack_mode_data(SCEX_HANDLER_ID, Mode.OFF, 0),
|
||||
)
|
||||
)
|
||||
if op_code in OpCode.PING:
|
||||
if op_code == OpCode.PING:
|
||||
q.add_log_cmd(Info.PING)
|
||||
app_data = bytes([0])
|
||||
q.add_pus_tc(create_action_cmd(SCEX_HANDLER_ID, ActionId.PING, app_data))
|
||||
if op_code in OpCode.ION_CMD:
|
||||
if op_code == OpCode.ION_CMD:
|
||||
q.add_log_cmd(Info.ION_CMD)
|
||||
app_data = bytes([0])
|
||||
q.add_pus_tc(create_action_cmd(SCEX_HANDLER_ID, ActionId.ION_CMD, app_data))
|
||||
if op_code in OpCode.TEMP_CMD:
|
||||
if op_code == OpCode.TEMP_CMD:
|
||||
q.add_log_cmd(Info.TEMP_CMD)
|
||||
app_data = bytes([0])
|
||||
q.add_pus_tc(create_action_cmd(SCEX_HANDLER_ID, ActionId.TEMP_CMD, app_data))
|
||||
|
||||
if op_code in OpCode.EXP_STATUS_CMD:
|
||||
if op_code == OpCode.EXP_STATUS_CMD:
|
||||
q.add_log_cmd(Info.EXP_STATUS_CMD)
|
||||
app_data = bytes([0])
|
||||
q.add_pus_tc(
|
||||
@ -117,7 +131,7 @@ def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
||||
)
|
||||
|
||||
# one cell
|
||||
if op_code in OpCode.ONE_CELLS_CMD:
|
||||
if op_code == OpCode.ONE_CELLS_CMD:
|
||||
q.add_log_cmd(Info.ONE_CELLS_CMD)
|
||||
app_data = bytearray([0])
|
||||
|
||||
@ -131,8 +145,7 @@ def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
||||
cell_select = int(cell_select)
|
||||
if cell_select < 1 or cell_select > 10:
|
||||
print(
|
||||
f"Invalid cell number {cell_select}, "
|
||||
f"Please enter a valid number: "
|
||||
f"Invalid cell number {cell_select}, Please enter a valid number: "
|
||||
)
|
||||
continue
|
||||
cn = cell_select - 1
|
||||
@ -165,7 +178,7 @@ def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
||||
create_action_cmd(SCEX_HANDLER_ID, ActionId.ONE_CELLS_CMD, app_data)
|
||||
)
|
||||
|
||||
if op_code in OpCode.ALL_CELLS_CMD:
|
||||
if op_code == OpCode.ALL_CELLS_CMD:
|
||||
q.add_log_cmd(Info.ALL_CELLS_CMD)
|
||||
app_data = bytearray([0])
|
||||
|
||||
@ -197,7 +210,7 @@ def pack_scex_cmds(p: ServiceProviderParams): # noqa C901
|
||||
create_action_cmd(SCEX_HANDLER_ID, ActionId.ALL_CELLS_CMD, app_data)
|
||||
)
|
||||
|
||||
if op_code in OpCode.FRAM:
|
||||
if op_code == OpCode.FRAM:
|
||||
q.add_log_cmd(Info.FRAM)
|
||||
app_data = bytes([0])
|
||||
q.add_pus_tc(create_action_cmd(SCEX_HANDLER_ID, ActionId.FRAM, app_data))
|
||||
|
@ -7,12 +7,12 @@ from spacepackets.ecss import PusTelecommand
|
||||
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Subservice as ModeSubservice
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
from tmtccmd.pus.s200_fsfw_mode import Subservice as ModeSubservice
|
||||
|
||||
|
||||
class ModeId:
|
||||
class ModeId(enum.IntEnum):
|
||||
OFF = 0
|
||||
SUPV_ONLY = 10
|
||||
MPSOC_STREAM = 11
|
||||
|
@ -0,0 +1,2 @@
|
||||
from .subsystem import add_eps_subsystem_cmds
|
||||
from .pwr_ctrl import pwr_cmd_defs
|
||||
|
@ -19,7 +19,7 @@ from eive_tmtc.tmtc.power.common_power import (
|
||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
import eive_tmtc.gomspace.gomspace_common as gs
|
||||
from eive_tmtc.config.object_ids import ACU_HANDLER_ID
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
|
@ -11,12 +11,12 @@ from tmtccmd.config.tmtc import (
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Subservice as ModeSubservices
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import generate_one_hk_command, make_sid
|
||||
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
|
||||
from tmtccmd.pus.s200_fsfw_mode import Subservice as ModeSubservices
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
|
||||
|
||||
|
@ -16,15 +16,15 @@ from eive_tmtc.gomspace.gomspace_common import (
|
||||
from eive_tmtc.gomspace.gomspace_pdu_definitions import OUT_ENABLE_LIST
|
||||
from spacepackets.ecss import PusTelecommand
|
||||
from tmtccmd.config import OpCodeEntry
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
||||
make_sid,
|
||||
generate_one_diag_command,
|
||||
generate_one_hk_command,
|
||||
enable_periodic_hk_command_with_interval,
|
||||
disable_periodic_hk_command,
|
||||
)
|
||||
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
from tmtccmd.util import ObjectIdU32, ObjectIdBase
|
||||
|
||||
|
||||
@ -200,7 +200,8 @@ def pack_common_gomspace_cmds( # noqa C901: Complexity is okay here.
|
||||
if op_code in GomspaceOpCode.SAVE_TABLE_DEFAULT:
|
||||
source_table = int(
|
||||
input(
|
||||
"Source table [0: Board Config, 1: Module Config, 2: Calibration Parameter]: "
|
||||
"Source table [0: Board Config, 1: Module Config, 2: Calibration"
|
||||
" Parameter]: "
|
||||
)
|
||||
)
|
||||
if source_table not in [0, 1, 2]:
|
||||
@ -215,8 +216,8 @@ def pack_common_gomspace_cmds( # noqa C901: Complexity is okay here.
|
||||
if op_code in GomspaceOpCode.LOAD_TABLE:
|
||||
target_table = int(
|
||||
input(
|
||||
"Target table ID [0: Board Config, 1: Module Config, 2: Calibration Parameter, "
|
||||
"4: HK TM]: "
|
||||
"Target table ID [0: Board Config, 1: Module Config, 2: Calibration"
|
||||
" Parameter, 4: HK TM]: "
|
||||
)
|
||||
)
|
||||
if target_table not in [0, 1, 2, 4]:
|
||||
@ -224,8 +225,8 @@ def pack_common_gomspace_cmds( # noqa C901: Complexity is okay here.
|
||||
if target_table != 4:
|
||||
source_table = int(
|
||||
input(
|
||||
"Source table (file or default) [0: Board Config, 1: Module Config, "
|
||||
"2: Calibration Parameter, value + 4 for default table]: "
|
||||
"Source table (file or default) [0: Board Config, 1: Module Config,"
|
||||
" 2: Calibration Parameter, value + 4 for default table]: "
|
||||
)
|
||||
)
|
||||
if source_table not in [0, 1, 2, 4, 5, 6]:
|
||||
|
@ -11,7 +11,7 @@ from eive_tmtc.tmtc.power.common_power import (
|
||||
pack_common_power_cmds,
|
||||
SetId,
|
||||
)
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from eive_tmtc.gomspace.gomspace_common import (
|
||||
TableEntry,
|
||||
Channel,
|
||||
@ -28,10 +28,12 @@ from tmtccmd.util import ObjectIdU32
|
||||
|
||||
|
||||
class P60OpCode:
|
||||
STACK_3V3_ON = ["stack_3v3_on", "1"]
|
||||
STACK_3V3_OFF = ["stack_3v3_off", "2"]
|
||||
STACK_5V_ON = ["stack_5v_on", "3"]
|
||||
STACK_5V_OFF = ["stack_5v_off", "4"]
|
||||
STACK_3V3_ON = "stack_3v3_on"
|
||||
STACK_3V3_OFF = "stack_3v3_off"
|
||||
STACK_5V_ON = "stack_5v_on"
|
||||
STACK_5V_OFF = "stack_5v_off"
|
||||
ACU_OFF = "acu_off"
|
||||
ACU_ON = "acu_on"
|
||||
TEST = ["test", "0"]
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@ from spacepackets.ecss import PusTelecommand
|
||||
|
||||
from tmtccmd.config import OpCodeEntry, TmtcDefinitionWrapper
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@ from eive_tmtc.tmtc.power.common_power import (
|
||||
from spacepackets.ecss import PusTelecommand
|
||||
from tmtccmd.config import OpCodeEntry, TmtcDefinitionWrapper
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
|
||||
|
||||
|
@ -32,12 +32,12 @@ from eive_tmtc.config.object_ids import PCDU_HANDLER_ID
|
||||
|
||||
from eive_tmtc.tmtc.power.p60dock import P60OpCode, P60Info, p60_dock_req_hk_cmds
|
||||
from eive_tmtc.tmtc.power.acu import add_acu_cmds, acu_req_hk_cmds
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
||||
create_request_one_diag_command,
|
||||
make_sid,
|
||||
)
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
|
||||
|
||||
class SetId(enum.IntEnum):
|
||||
|
302
eive_tmtc/tmtc/power/pwr_ctrl.py
Normal file
302
eive_tmtc/tmtc/power/pwr_ctrl.py
Normal file
@ -0,0 +1,302 @@
|
||||
import datetime
|
||||
import enum
|
||||
import logging
|
||||
import struct
|
||||
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from eive_tmtc.config.object_ids import PWR_CONTROLLER
|
||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
from tmtccmd.config.tmtc import (
|
||||
tmtc_definitions_provider,
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from tmtccmd.tmtc.queue import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_command
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
||||
generate_one_hk_command,
|
||||
make_sid,
|
||||
enable_periodic_hk_command_with_interval,
|
||||
disable_periodic_hk_command,
|
||||
)
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
|
||||
from tmtccmd.pus.s20_fsfw_param import create_load_param_cmd
|
||||
|
||||
from tmtccmd.pus.s20_fsfw_param_defs import (
|
||||
create_scalar_float_parameter,
|
||||
create_scalar_double_parameter,
|
||||
)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SetId(enum.IntEnum):
|
||||
CORE_HK_SET = 0
|
||||
ENABLE_PL_SET = 1
|
||||
|
||||
|
||||
# class ActionId(enum.IntEnum):
|
||||
|
||||
|
||||
class ParamId(enum.IntEnum):
|
||||
BATTERY_INTERNAL_RESISTANCE = 0
|
||||
BATTERY_MAXIMUM_CAPACITY = 1
|
||||
COULOMB_COUNTER_VOLTAGE_UPPER_THRESHOLD = 2
|
||||
MAX_ALLOWED_TIME_DIFF = 3
|
||||
PAYLOAD_OP_LIMIT_ON = 4
|
||||
PAYLOAD_OP_LIMIT_LOW = 5
|
||||
HIGHER_MODES_LIMIT = 6
|
||||
|
||||
|
||||
class OpCodes:
|
||||
OFF = ["mode_off"]
|
||||
ON = ["mode_on"]
|
||||
NML = ["mode_normal"]
|
||||
SET_PARAMETER = ["set_parameter"]
|
||||
REQUEST_CORE_HK = ["core_hk"]
|
||||
ENABLE_CORE_HK = ["core_enable_hk"]
|
||||
DISABLE_CORE_HK = ["core_disable_hk"]
|
||||
REQUEST_ENABLE_PL_HK = ["enable_pl_hk"]
|
||||
ENABLE_ENABLE_PL_HK = ["enable_pl_enable_hk"]
|
||||
DISABLE_ENABLE_PL_HK = ["enable_pl_disable_hk"]
|
||||
|
||||
|
||||
class Info:
|
||||
OFF = "PWR Ctrl Mode to OFF"
|
||||
ON = "PWR Ctrl Mode to ON"
|
||||
NML = "PWR Ctrl Mode to NORMAL"
|
||||
SET_PARAMETER = "Set Parameter"
|
||||
REQUEST_CORE_HK = "Request Core HK once"
|
||||
ENABLE_CORE_HK = "Enable Core HK Data Generation"
|
||||
DISABLE_CORE_HK = "Disable Core HK Data Generation"
|
||||
REQUEST_ENABLE_PL_HK = "Request Enable PL HK once"
|
||||
ENABLE_ENABLE_PL_HK = "Enable Enable PL HK Data Generation"
|
||||
DISABLE_ENABLE_PL_HK = "Disable Enable PL HK Data Generation"
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
def pwr_cmd_defs(defs: TmtcDefinitionWrapper):
|
||||
oce = OpCodeEntry()
|
||||
oce.add(keys=OpCodes.OFF, info=Info.OFF)
|
||||
oce.add(keys=OpCodes.ON, info=Info.ON)
|
||||
oce.add(keys=OpCodes.NML, info=Info.NML)
|
||||
oce.add(keys=OpCodes.SET_PARAMETER, info=Info.SET_PARAMETER)
|
||||
oce.add(keys=OpCodes.REQUEST_CORE_HK, info=Info.REQUEST_CORE_HK)
|
||||
oce.add(keys=OpCodes.ENABLE_CORE_HK, info=Info.ENABLE_CORE_HK)
|
||||
oce.add(keys=OpCodes.DISABLE_CORE_HK, info=Info.DISABLE_CORE_HK)
|
||||
oce.add(keys=OpCodes.REQUEST_ENABLE_PL_HK, info=Info.REQUEST_ENABLE_PL_HK)
|
||||
oce.add(keys=OpCodes.ENABLE_ENABLE_PL_HK, info=Info.ENABLE_ENABLE_PL_HK)
|
||||
oce.add(keys=OpCodes.DISABLE_ENABLE_PL_HK, info=Info.DISABLE_ENABLE_PL_HK)
|
||||
defs.add_service(
|
||||
name=CustomServiceList.PWR_CTRL.value, info="PWR Controller", op_code_entry=oce
|
||||
)
|
||||
|
||||
|
||||
@service_provider(CustomServiceList.PWR_CTRL.value)
|
||||
def pack_acs_ctrl_command(p: ServiceProviderParams):
|
||||
op_code = p.op_code
|
||||
q = p.queue_helper
|
||||
if op_code in OpCodes.OFF:
|
||||
q.add_log_cmd(f"{Info.OFF}")
|
||||
q.add_pus_tc(pack_mode_command(PWR_CONTROLLER, Mode.OFF, 0))
|
||||
elif op_code in OpCodes.ON:
|
||||
q.add_log_cmd(f"{Info.ON}")
|
||||
q.add_pus_tc(pack_mode_command(PWR_CONTROLLER, Mode.ON, 0))
|
||||
elif op_code in OpCodes.NML:
|
||||
q.add_log_cmd(f"{Info.NML}")
|
||||
q.add_pus_tc(pack_mode_command(PWR_CONTROLLER, Mode.NORMAL, 0))
|
||||
elif op_code in OpCodes.SET_PARAMETER:
|
||||
q.add_log_cmd(f"{Info.SET_PARAMETER}")
|
||||
set_pwr_ctrl_param(q)
|
||||
elif op_code in OpCodes.REQUEST_CORE_HK:
|
||||
q.add_log_cmd(Info.REQUEST_CORE_HK)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(make_sid(PWR_CONTROLLER, SetId.CORE_HK_SET))
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_CORE_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
q.add_log_cmd(Info.ENABLE_CORE_HK)
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(PWR_CONTROLLER, SetId.CORE_HK_SET), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif op_code in OpCodes.DISABLE_CORE_HK:
|
||||
q.add_log_cmd(Info.DISABLE_CORE_HK)
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(
|
||||
False, make_sid(PWR_CONTROLLER, SetId.CORE_HK_SET)
|
||||
)
|
||||
)
|
||||
elif op_code in OpCodes.REQUEST_ENABLE_PL_HK:
|
||||
q.add_log_cmd(Info.REQUEST_ENABLE_PL_HK)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(make_sid(PWR_CONTROLLER, SetId.ENABLE_PL_SET))
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_ENABLE_PL_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
q.add_log_cmd(Info.ENABLE_ENABLE_PL_HK)
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(PWR_CONTROLLER, SetId.ENABLE_PL_SET), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif op_code in OpCodes.DISABLE_ENABLE_PL_HK:
|
||||
q.add_log_cmd(Info.DISABLE_ENABLE_PL_HK)
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(
|
||||
False, make_sid(PWR_CONTROLLER, SetId.ENABLE_PL_SET)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def set_pwr_ctrl_param(q: DefaultPusQueueHelper):
|
||||
for val in ParamId:
|
||||
print("{:<2}: {:<20}".format(val, val.name))
|
||||
param = int(input("Specify parameter to set \n" ""))
|
||||
match param:
|
||||
case ParamId.BATTERY_INTERNAL_RESISTANCE:
|
||||
value = float(input("Specify parameter value to set [Ohm]: "))
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_float_parameter(
|
||||
object_id=PWR_CONTROLLER,
|
||||
domain_id=0,
|
||||
unique_id=ParamId.BATTERY_INTERNAL_RESISTANCE,
|
||||
parameter=value,
|
||||
)
|
||||
)
|
||||
)
|
||||
case ParamId.BATTERY_MAXIMUM_CAPACITY:
|
||||
value = float(input("Specify parameter value to set [Ah]: "))
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_float_parameter(
|
||||
object_id=PWR_CONTROLLER,
|
||||
domain_id=0,
|
||||
unique_id=ParamId.BATTERY_MAXIMUM_CAPACITY,
|
||||
parameter=value,
|
||||
)
|
||||
)
|
||||
)
|
||||
case ParamId.COULOMB_COUNTER_VOLTAGE_UPPER_THRESHOLD:
|
||||
value = float(input("Specify parameter value to set [V]: "))
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_float_parameter(
|
||||
object_id=PWR_CONTROLLER,
|
||||
domain_id=0,
|
||||
unique_id=ParamId.COULOMB_COUNTER_VOLTAGE_UPPER_THRESHOLD,
|
||||
parameter=value,
|
||||
)
|
||||
)
|
||||
)
|
||||
case ParamId.MAX_ALLOWED_TIME_DIFF:
|
||||
value = float(input("Specify parameter value to set [s]: "))
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_double_parameter(
|
||||
object_id=PWR_CONTROLLER,
|
||||
domain_id=0,
|
||||
unique_id=ParamId.MAX_ALLOWED_TIME_DIFF,
|
||||
parameter=value,
|
||||
)
|
||||
)
|
||||
)
|
||||
case ParamId.PAYLOAD_OP_LIMIT_ON:
|
||||
value = float(input("Specify parameter value to set [1]: "))
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_float_parameter(
|
||||
object_id=PWR_CONTROLLER,
|
||||
domain_id=0,
|
||||
unique_id=ParamId.PAYLOAD_OP_LIMIT_ON,
|
||||
parameter=value,
|
||||
)
|
||||
)
|
||||
)
|
||||
case ParamId.PAYLOAD_OP_LIMIT_LOW:
|
||||
value = float(input("Specify parameter value to set [1]: "))
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_float_parameter(
|
||||
object_id=PWR_CONTROLLER,
|
||||
domain_id=0,
|
||||
unique_id=ParamId.PAYLOAD_OP_LIMIT_LOW,
|
||||
parameter=value,
|
||||
)
|
||||
)
|
||||
)
|
||||
case ParamId.HIGHER_MODES_LIMIT:
|
||||
value = float(input("Specify parameter value to set [1]: "))
|
||||
q.add_pus_tc(
|
||||
create_load_param_cmd(
|
||||
create_scalar_float_parameter(
|
||||
object_id=PWR_CONTROLLER,
|
||||
domain_id=0,
|
||||
unique_id=ParamId.HIGHER_MODES_LIMIT,
|
||||
parameter=value,
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def handle_pwr_ctrl_hk_data(
|
||||
pw: PrintWrapper,
|
||||
set_id: int,
|
||||
hk_data: bytes,
|
||||
packet_time: datetime.datetime,
|
||||
):
|
||||
pw.ilog(_LOGGER, f"Received PWR CTRL HK with packet time {packet_time}")
|
||||
match set_id:
|
||||
case SetId.CORE_HK_SET:
|
||||
handle_core_hk_data(pw, hk_data)
|
||||
case SetId.ENABLE_PL_SET:
|
||||
handle_enable_pl_data(pw, hk_data)
|
||||
|
||||
|
||||
def handle_core_hk_data(pw: PrintWrapper, hk_data: bytes):
|
||||
pw.dlog("Received Core HK Set")
|
||||
fmt_int16 = "!h"
|
||||
fmt_float = "!f"
|
||||
inc_len_int16 = struct.calcsize(fmt_int16)
|
||||
inc_len_float = struct.calcsize(fmt_float)
|
||||
if len(hk_data) < inc_len_int16 + 2 * inc_len_float:
|
||||
pw.dlog("Received HK set too small")
|
||||
return
|
||||
current_idx = 0
|
||||
total_battery_current = struct.unpack(
|
||||
fmt_int16, hk_data[current_idx : current_idx + inc_len_int16]
|
||||
)[0]
|
||||
current_idx += inc_len_int16
|
||||
open_circuit_voltage_charge = struct.unpack(
|
||||
fmt_float, hk_data[current_idx : current_idx + inc_len_float]
|
||||
)[0]
|
||||
current_idx += inc_len_float
|
||||
coulomb_counter_charge = struct.unpack(
|
||||
fmt_float, hk_data[current_idx : current_idx + inc_len_float]
|
||||
)[0]
|
||||
current_idx += inc_len_float
|
||||
pw.dlog(f"Total Battery Current: {total_battery_current} [mA]")
|
||||
pw.dlog(f"Open Circuit Voltage Charge: {open_circuit_voltage_charge*100:8.3f} [%]")
|
||||
pw.dlog(f"Coulomb Counter Charge: {coulomb_counter_charge*100:8.3f} [%]")
|
||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3)
|
||||
|
||||
|
||||
def handle_enable_pl_data(pw: PrintWrapper, hk_data: bytes):
|
||||
pw.dlog("Received Enable PL HK Set")
|
||||
fmt_uint16 = "!B"
|
||||
inc_len_uint16 = struct.calcsize(fmt_uint16)
|
||||
if len(hk_data) < inc_len_uint16:
|
||||
pw.dlog("Received HK set too small")
|
||||
return
|
||||
current_idx = 0
|
||||
pl_use_allowed = struct.unpack(
|
||||
fmt_uint16, hk_data[current_idx : current_idx + inc_len_uint16]
|
||||
)[0]
|
||||
current_idx += inc_len_uint16
|
||||
pw.dlog(f"PL Use Allowed: {pl_use_allowed}")
|
||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=1)
|
68
eive_tmtc/tmtc/power/subsystem.py
Normal file
68
eive_tmtc/tmtc/power/subsystem.py
Normal file
@ -0,0 +1,68 @@
|
||||
import enum
|
||||
from typing import Tuple, Dict
|
||||
|
||||
from spacepackets.ecss import PusTelecommand
|
||||
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
||||
from eive_tmtc.config.object_ids import EPS_SUBSYSTEM_ID
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from tmtccmd.config.tmtc import (
|
||||
tmtc_definitions_provider,
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.pus.s200_fsfw_mode import Subservice as ModeSubservices, Mode
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
|
||||
|
||||
class OpCode(str, enum.Enum):
|
||||
OFF = "off"
|
||||
NML = "normal"
|
||||
REPORT_ALL_MODES = "all_modes"
|
||||
|
||||
|
||||
class Info(str, enum.Enum):
|
||||
OFF = "Off Mode Command"
|
||||
NML = "Normal Mode Command"
|
||||
REPORT_ALL_MODES = "Report All Modes Recursively"
|
||||
|
||||
|
||||
HANDLER_LIST: Dict[str, Tuple[int, int, str]] = {
|
||||
OpCode.OFF: (Mode.OFF, 0, Info.OFF),
|
||||
OpCode.NML: (Mode.NORMAL, 0, Info.NML),
|
||||
}
|
||||
|
||||
|
||||
@service_provider(CustomServiceList.EPS_SS.value)
|
||||
def build_eps_subsystem_cmd(p: ServiceProviderParams):
|
||||
op_code = p.op_code
|
||||
q = p.queue_helper
|
||||
info_prefix = "EPS Subsystem"
|
||||
if op_code in OpCode.REPORT_ALL_MODES:
|
||||
q.add_log_cmd(f"{info_prefix}: {Info.REPORT_ALL_MODES}")
|
||||
q.add_pus_tc(
|
||||
PusTelecommand(
|
||||
service=200,
|
||||
subservice=ModeSubservices.TC_MODE_ANNOUNCE_RECURSIVE,
|
||||
app_data=EPS_SUBSYSTEM_ID,
|
||||
)
|
||||
)
|
||||
mode_info_tup = HANDLER_LIST.get(op_code)
|
||||
if mode_info_tup is None:
|
||||
return
|
||||
pack_mode_cmd_with_info(
|
||||
object_id=EPS_SUBSYSTEM_ID,
|
||||
info=f"{info_prefix}: {mode_info_tup[2]}",
|
||||
mode=mode_info_tup[0],
|
||||
submode=mode_info_tup[1],
|
||||
q=q,
|
||||
)
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
def add_eps_subsystem_cmds(defs: TmtcDefinitionWrapper):
|
||||
oce = OpCodeEntry()
|
||||
for op_code, (_, _, info) in HANDLER_LIST.items():
|
||||
oce.add(op_code, info)
|
||||
oce.add(OpCode.REPORT_ALL_MODES, Info.REPORT_ALL_MODES)
|
||||
defs.add_service(CustomServiceList.EPS_SS, "EPS Subsystem", oce)
|
@ -75,8 +75,8 @@ class WdtInfo:
|
||||
self.pw.dlog(wdt_info)
|
||||
for idx in range(len(self.wdt_reboots_list)):
|
||||
self.pw.dlog(
|
||||
f"{WDT_LIST[idx].ljust(5)} | "
|
||||
f"{self.wdt_reboots_list[idx]:010} | {self.time_pings_left_list[idx]:010}",
|
||||
f"{WDT_LIST[idx].ljust(5)} | {self.wdt_reboots_list[idx]:010} |"
|
||||
f" {self.time_pings_left_list[idx]:010}",
|
||||
)
|
||||
|
||||
def parse(self, wdt_data: bytes, current_idx: int) -> int:
|
||||
@ -327,8 +327,9 @@ def handle_p60_hk_data(pw: PrintWrapper, set_id: int, hk_data: bytes):
|
||||
)
|
||||
pw.dlog(misc_info)
|
||||
batt_info = (
|
||||
f"Batt Temp 0 {batt_temp_0 / 10.0} | Batt Temp 1 {batt_temp_1 / 10.0} | "
|
||||
f"Charge Current {batt_charge_current} | Discharge Current {batt_discharge_current}"
|
||||
f"Batt Temp 0 {batt_temp_0 / 10.0} | Batt Temp 1 {batt_temp_1 / 10.0} |"
|
||||
f" Charge Current {batt_charge_current} | Discharge Current"
|
||||
f" {batt_discharge_current}"
|
||||
)
|
||||
pw.dlog(batt_info)
|
||||
pw.dlog(
|
||||
@ -419,12 +420,12 @@ def handle_acu_hk_data(pw: PrintWrapper, set_id: int, hk_data: bytes):
|
||||
)
|
||||
pw.dlog(f"Boot Cause {boot_cause} | Reset Cause {reset_cause}")
|
||||
pw.dlog(
|
||||
f"Ground WDT: Reboot Count {wdt_cnt_gnd} | Time Left {wdt_gnd_time_left} sec"
|
||||
f"Ground WDT: Reboot Count {wdt_cnt_gnd} | Time Left"
|
||||
f" {wdt_gnd_time_left} sec"
|
||||
)
|
||||
|
||||
pw.dlog(
|
||||
"ACU Dev Types: 0:FRAM|1:ADC|2:ADC|3:DAC|4:DAC|"
|
||||
"5:DAC|6:TempSens|7:Reserved"
|
||||
"ACU Dev Types: 0:FRAM|1:ADC|2:ADC|3:DAC|4:DAC|5:DAC|6:TempSens|7:Reserved"
|
||||
)
|
||||
dev_parser.print(pw=pw)
|
||||
FsfwTmTcPrinter.get_validity_buffer(
|
||||
@ -474,7 +475,8 @@ def pdu_config_table_handler(
|
||||
pw.dlog("[tcs, syrlinks, str, mgt, sus-n, scex, ploc, acs-a, unused]")
|
||||
elif obj_id.as_bytes == PDU_2_HANDLER_ID:
|
||||
pw.dlog(
|
||||
"[obc, pl-pcdu-bat-nom, rw, heaters, sus-r, sa-depl, pl-pcdu-bat-red, acs-b, pl-cam]"
|
||||
"[obc, pl-pcdu-bat-nom, rw, heaters, sus-r, sa-depl, pl-pcdu-bat-red,"
|
||||
" acs-b, pl-cam]"
|
||||
)
|
||||
out_on_cnt = unpack_array_in_data(custom_data, 0x52, 2, 9, "H")
|
||||
out_off_cnt = unpack_array_in_data(custom_data, 0x64, 2, 9, "H")
|
||||
|
@ -17,9 +17,9 @@ from tmtccmd.config.tmtc import (
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.tc import service_provider, DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.tmtc import service_provider, DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
|
||||
|
||||
class OpCode:
|
||||
|
@ -7,14 +7,14 @@ from tmtccmd.config.tmtc import (
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from eive_tmtc.config.object_ids import EIVE_SYSTEM_ID
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import (
|
||||
from tmtccmd.pus.s200_fsfw_mode import (
|
||||
create_mode_command,
|
||||
create_announce_mode_recursive_command,
|
||||
)
|
||||
from tmtccmd.tc.pus_8_fsfw_funccmd import create_action_cmd
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
|
||||
|
||||
class SystemMode:
|
||||
|
@ -6,8 +6,8 @@ from tmtccmd.config.tmtc import (
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Mode
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode
|
||||
|
||||
|
||||
class InfoAssy:
|
||||
|
92
eive_tmtc/tmtc/tcs/ctrl.py
Normal file
92
eive_tmtc/tmtc/tcs/ctrl.py
Normal file
@ -0,0 +1,92 @@
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from eive_tmtc.config.object_ids import TCS_CONTROLLER
|
||||
from eive_tmtc.tmtc.tcs import CtrlSetId
|
||||
from eive_tmtc.tmtc.tcs.brd_assy import pack_tcs_ass_cmds
|
||||
from tmtccmd.config.tmtc import (
|
||||
tmtc_definitions_provider,
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
||||
make_sid,
|
||||
generate_one_hk_command,
|
||||
create_request_one_diag_command,
|
||||
create_request_one_hk_command,
|
||||
create_enable_periodic_hk_command_with_interval_with_diag,
|
||||
)
|
||||
|
||||
|
||||
class OpCode:
|
||||
REQUEST_PRIMARY_TEMP_SET = "temp"
|
||||
ENABLE_TEMP_SET = "enable_temp_set"
|
||||
REQUEST_DEVICE_TEMP_SET = "temp_devs"
|
||||
REQUEST_DEVICE_SUS_SET = "temp_sus"
|
||||
REQUEST_HEATER_INFO = "heater_info"
|
||||
REQUEST_TCS_CTRL_INFO = "tcs_ctrl_info"
|
||||
|
||||
|
||||
class Info:
|
||||
ENABLE_TEMP_SET = "Enable Primary Temperature Set"
|
||||
REQUEST_PRIMARY_TEMP_SET = "Request HK set of primary sensor temperatures"
|
||||
REQUEST_DEVICE_TEMP_SET = "Request HK set of device sensor temperatures"
|
||||
REQUEST_DEVICE_SUS_SET = "Request HK set of the SUS temperatures"
|
||||
REQUEST_HEATER_INFO = "Request heater information"
|
||||
REQUEST_TCS_CTRL_INFO = "Request TCS controller information"
|
||||
|
||||
|
||||
def pack_tcs_ctrl_commands(q: DefaultPusQueueHelper, op_code: str):
|
||||
if op_code == OpCode.REQUEST_PRIMARY_TEMP_SET:
|
||||
sensor_set_sid = make_sid(TCS_CONTROLLER, CtrlSetId.PRIMARY_SENSORS)
|
||||
q.add_log_cmd(Info.REQUEST_PRIMARY_TEMP_SET)
|
||||
q.add_pus_tc(generate_one_hk_command(sensor_set_sid))
|
||||
if op_code == OpCode.REQUEST_DEVICE_TEMP_SET:
|
||||
q.add_log_cmd(Info.REQUEST_DEVICE_TEMP_SET)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(make_sid(TCS_CONTROLLER, CtrlSetId.DEVICE_SENSORS))
|
||||
)
|
||||
if op_code == OpCode.REQUEST_DEVICE_SUS_SET:
|
||||
q.add_log_cmd(Info.REQUEST_DEVICE_SUS_SET)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(
|
||||
make_sid(TCS_CONTROLLER, CtrlSetId.SUS_TEMP_SENSORS)
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.REQUEST_HEATER_INFO:
|
||||
q.add_log_cmd(Info.REQUEST_HEATER_INFO)
|
||||
q.add_pus_tc(
|
||||
create_request_one_diag_command(
|
||||
make_sid(TCS_CONTROLLER, CtrlSetId.HEATER_INFO)
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.REQUEST_TCS_CTRL_INFO:
|
||||
q.add_log_cmd(Info.REQUEST_TCS_CTRL_INFO)
|
||||
q.add_pus_tc(
|
||||
create_request_one_hk_command(
|
||||
make_sid(TCS_CONTROLLER, CtrlSetId.TCS_CTRL_INFO)
|
||||
)
|
||||
)
|
||||
if op_code == OpCode.ENABLE_TEMP_SET:
|
||||
interval_seconds = float(input("Please specify interval in seconds: "))
|
||||
cmds = create_enable_periodic_hk_command_with_interval_with_diag(
|
||||
False, make_sid(TCS_CONTROLLER, CtrlSetId.PRIMARY_SENSORS), interval_seconds
|
||||
)
|
||||
for cmd in cmds:
|
||||
q.add_pus_tc(cmd)
|
||||
pack_tcs_ass_cmds(q, op_code)
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
def add_tcs_ctrl_cmds(defs: TmtcDefinitionWrapper):
|
||||
oce = OpCodeEntry()
|
||||
oce.add(keys=OpCode.ENABLE_TEMP_SET, info=Info.ENABLE_TEMP_SET)
|
||||
oce.add(keys=OpCode.REQUEST_PRIMARY_TEMP_SET, info=Info.REQUEST_PRIMARY_TEMP_SET)
|
||||
oce.add(keys=OpCode.REQUEST_DEVICE_TEMP_SET, info=Info.REQUEST_DEVICE_TEMP_SET)
|
||||
oce.add(keys=OpCode.REQUEST_DEVICE_SUS_SET, info=Info.REQUEST_DEVICE_SUS_SET)
|
||||
oce.add(keys=OpCode.REQUEST_HEATER_INFO, info=Info.REQUEST_HEATER_INFO)
|
||||
oce.add(keys=OpCode.REQUEST_TCS_CTRL_INFO, info=Info.REQUEST_TCS_CTRL_INFO)
|
||||
defs.add_service(
|
||||
name=CustomServiceList.TCS_CTRL,
|
||||
info="TCS controller",
|
||||
op_code_entry=oce,
|
||||
)
|
@ -6,3 +6,22 @@ class CtrlSetId(enum.IntEnum):
|
||||
DEVICE_SENSORS = 1
|
||||
SUS_TEMP_SENSORS = 2
|
||||
HEATER_INFO = 4
|
||||
TCS_CTRL_INFO = 5
|
||||
|
||||
|
||||
class TcsSubmode(enum.IntEnum):
|
||||
DEFAULT = 0
|
||||
NO_HEATER_CTRL = 1
|
||||
|
||||
|
||||
class Heater(enum.IntEnum):
|
||||
HEATER_0_PLOC_PROC_BRD = 0
|
||||
HEATER_1_PCDU_BRD = 1
|
||||
HEATER_2_ACS_BRD = 2
|
||||
HEATER_3_OBC_BRD = 3
|
||||
HEATER_4_CAMERA = 4
|
||||
HEATER_5_STR = 5
|
||||
HEATER_6_DRO = 6
|
||||
HEATER_7_SYRLINKS = 7
|
||||
NUMBER_OF_SWITCHES = 8
|
||||
NONE = 0xFF
|
||||
|
@ -7,31 +7,20 @@ import enum
|
||||
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from eive_tmtc.config.object_ids import get_object_ids
|
||||
from eive_tmtc.tmtc.tcs.defs import Heater
|
||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.util.obj_id import ObjectIdU32
|
||||
from tmtccmd.pus.s201_fsfw_health import (
|
||||
pack_set_health_cmd_data,
|
||||
FsfwHealth,
|
||||
Subservice,
|
||||
)
|
||||
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
|
||||
|
||||
class Heater(enum.IntEnum):
|
||||
HEATER_0_PLOC_PROC_BRD = 0
|
||||
HEATER_1_PCDU_BRD = 1
|
||||
HEATER_2_ACS_BRD = 2
|
||||
HEATER_3_OBC_BRD = 3
|
||||
HEATER_4_CAMERA = 4
|
||||
HEATER_5_STR = 5
|
||||
HEATER_6_DRO = 6
|
||||
HEATER_7_SYRLINKS = 7
|
||||
NUMBER_OF_SWITCHES = 8
|
||||
|
||||
|
||||
HEATER_LOCATION = [
|
||||
"PLOC Processing Board",
|
||||
"PCDU PDU",
|
||||
|
@ -8,9 +8,9 @@ from spacepackets.ecss import PusTelecommand
|
||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Mode, pack_mode_data, Subservice
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_data, Subservice
|
||||
import eive_tmtc.config.object_ids as oids
|
||||
from eive_tmtc.config.object_ids import get_object_ids
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
|
@ -1,6 +1,5 @@
|
||||
from .defs import CtrlSetId
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from eive_tmtc.config.object_ids import TCS_CONTROLLER, TCS_SUBSYSTEM_ID
|
||||
from eive_tmtc.config.object_ids import TCS_SUBSYSTEM_ID
|
||||
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
||||
from eive_tmtc.tmtc.tcs.brd_assy import pack_tcs_ass_cmds
|
||||
from tmtccmd.config.tmtc import (
|
||||
@ -8,76 +7,30 @@ from tmtccmd.config.tmtc import (
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Mode, create_announce_mode_recursive_command
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
make_sid,
|
||||
generate_one_hk_command,
|
||||
create_enable_periodic_hk_command_with_interval,
|
||||
create_request_one_diag_command,
|
||||
)
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode, create_announce_mode_recursive_command
|
||||
|
||||
|
||||
class OpCodeSys:
|
||||
OFF = ["off"]
|
||||
NML = ["nml"]
|
||||
REQUEST_PRIMARY_TEMP_SET = ["temp"]
|
||||
ENABLE_TEMP_SET = "enable_temp_set"
|
||||
REQUEST_DEVICE_TEMP_SET = ["temp_devs"]
|
||||
REQUEST_DEVICE_SUS_SET = ["temp_sus"]
|
||||
REQUEST_HEATER_INFO = "heater_info"
|
||||
class OpCode:
|
||||
OFF = "off"
|
||||
NML = "nml"
|
||||
ANNOUNCE_MODES = "announce_modes"
|
||||
|
||||
|
||||
class InfoSys:
|
||||
OFF = "Switch TCS subsystem OFF"
|
||||
NML = "Switch TCS subsystem NORMAL (nominal)"
|
||||
ENABLE_TEMP_SET = "Enable Primary Temperature Set"
|
||||
REQUEST_PRIMARY_TEMP_SET = "Request HK set of primary sensor temperatures"
|
||||
REQUEST_DEVICE_TEMP_SET = "Request HK set of device sensor temperatures"
|
||||
REQUEST_DEVICE_SUS_SET = "Request HK set of the SUS temperatures"
|
||||
REQUEST_HEATER_INFO = "Request heater information"
|
||||
ANNOUNCE_MODES = "Announce Modes recursively"
|
||||
|
||||
|
||||
def pack_tcs_sys_commands(q: DefaultPusQueueHelper, op_code: str):
|
||||
if op_code in OpCodeSys.REQUEST_PRIMARY_TEMP_SET:
|
||||
sensor_set_sid = make_sid(TCS_CONTROLLER, CtrlSetId.PRIMARY_SENSORS)
|
||||
q.add_log_cmd(InfoSys.REQUEST_PRIMARY_TEMP_SET)
|
||||
q.add_pus_tc(generate_one_hk_command(sensor_set_sid))
|
||||
if op_code in OpCodeSys.REQUEST_DEVICE_TEMP_SET:
|
||||
q.add_log_cmd(InfoSys.REQUEST_DEVICE_TEMP_SET)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(make_sid(TCS_CONTROLLER, CtrlSetId.DEVICE_SENSORS))
|
||||
)
|
||||
if op_code in OpCodeSys.REQUEST_DEVICE_SUS_SET:
|
||||
q.add_log_cmd(InfoSys.REQUEST_DEVICE_SUS_SET)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(
|
||||
make_sid(TCS_CONTROLLER, CtrlSetId.SUS_TEMP_SENSORS)
|
||||
)
|
||||
)
|
||||
if op_code == OpCodeSys.REQUEST_HEATER_INFO:
|
||||
q.add_log_cmd(InfoSys.REQUEST_HEATER_INFO)
|
||||
q.add_pus_tc(
|
||||
create_request_one_diag_command(
|
||||
make_sid(TCS_CONTROLLER, CtrlSetId.HEATER_INFO)
|
||||
)
|
||||
)
|
||||
if op_code in OpCodeSys.OFF:
|
||||
if op_code == OpCode.OFF:
|
||||
q.add_log_cmd(InfoSys.OFF)
|
||||
pack_mode_cmd_with_info(TCS_SUBSYSTEM_ID, Mode.OFF, 0, q, InfoSys.OFF)
|
||||
if op_code in OpCodeSys.NML:
|
||||
if op_code == OpCode.NML:
|
||||
q.add_log_cmd(InfoSys.NML)
|
||||
pack_mode_cmd_with_info(TCS_SUBSYSTEM_ID, Mode.NORMAL, 0, q, InfoSys.OFF)
|
||||
if op_code == OpCodeSys.ENABLE_TEMP_SET:
|
||||
interval_seconds = float(input("Please specify interval in seconds: "))
|
||||
cmds = create_enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(TCS_CONTROLLER, CtrlSetId.PRIMARY_SENSORS), interval_seconds
|
||||
)
|
||||
for cmd in cmds:
|
||||
q.add_pus_tc(cmd)
|
||||
if op_code == OpCodeSys.ANNOUNCE_MODES:
|
||||
if op_code == OpCode.ANNOUNCE_MODES:
|
||||
q.add_log_cmd(InfoSys.ANNOUNCE_MODES)
|
||||
q.add_pus_tc(create_announce_mode_recursive_command(TCS_SUBSYSTEM_ID))
|
||||
pack_tcs_ass_cmds(q, op_code)
|
||||
@ -86,20 +39,11 @@ def pack_tcs_sys_commands(q: DefaultPusQueueHelper, op_code: str):
|
||||
@tmtc_definitions_provider
|
||||
def add_tcs_subsystem_cmds(defs: TmtcDefinitionWrapper):
|
||||
oce = OpCodeEntry()
|
||||
oce.add(keys=OpCodeSys.OFF, info=InfoSys.OFF)
|
||||
oce.add(keys=OpCodeSys.NML, info=InfoSys.NML)
|
||||
oce.add(
|
||||
keys=OpCodeSys.REQUEST_PRIMARY_TEMP_SET, info=InfoSys.REQUEST_PRIMARY_TEMP_SET
|
||||
)
|
||||
oce.add(
|
||||
keys=OpCodeSys.REQUEST_DEVICE_TEMP_SET, info=InfoSys.REQUEST_DEVICE_TEMP_SET
|
||||
)
|
||||
oce.add(keys=OpCodeSys.REQUEST_DEVICE_SUS_SET, info=InfoSys.REQUEST_DEVICE_SUS_SET)
|
||||
oce.add(keys=OpCodeSys.REQUEST_HEATER_INFO, info=InfoSys.REQUEST_HEATER_INFO)
|
||||
oce.add(keys=OpCodeSys.ANNOUNCE_MODES, info=InfoSys.ANNOUNCE_MODES)
|
||||
oce.add(keys=OpCodeSys.ENABLE_TEMP_SET, info=InfoSys.ENABLE_TEMP_SET)
|
||||
oce.add(keys=OpCode.OFF, info=InfoSys.OFF)
|
||||
oce.add(keys=OpCode.NML, info=InfoSys.NML)
|
||||
oce.add(keys=OpCode.ANNOUNCE_MODES, info=InfoSys.ANNOUNCE_MODES)
|
||||
defs.add_service(
|
||||
name=CustomServiceList.TCS,
|
||||
info="TCS",
|
||||
name=CustomServiceList.TCS_SS,
|
||||
info="TCS subsystem",
|
||||
op_code_entry=oce,
|
||||
)
|
||||
|
@ -1,7 +1,11 @@
|
||||
import dataclasses
|
||||
import datetime
|
||||
import enum
|
||||
import logging
|
||||
import struct
|
||||
|
||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
from eive_tmtc.tmtc.tcs.defs import Heater
|
||||
from tmtccmd.fsfw import validity_buffer_list
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
from .defs import CtrlSetId
|
||||
@ -11,7 +15,46 @@ from .heater import HEATER_LOCATION
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def handle_thermal_controller_hk_data(
|
||||
class ThermalComponent(enum.IntEnum):
|
||||
NONE = 0
|
||||
ACS_BOARD = 1
|
||||
MGT = 2
|
||||
RW = 3
|
||||
STR = 4
|
||||
IF_BOARD = 5
|
||||
TCS_BOARD = 6
|
||||
OBC = 7
|
||||
LEGACY_OBCIF_BOARD = 8
|
||||
SBAND_TRANSCEIVER = 9
|
||||
PCDUP60_BOARD = 10
|
||||
PCDUACU = 11
|
||||
PCDUPDU = 12
|
||||
PLPCDU_BOARD = 13
|
||||
PLOCMISSION_BOARD = 14
|
||||
PLOCPROCESSING_BOARD = 15
|
||||
DAC = 16
|
||||
CAMERA = 17
|
||||
DRO = 18
|
||||
X8 = 19
|
||||
HPA = 20
|
||||
TX = 21
|
||||
MPA = 22
|
||||
SCEX_BOARD = 23
|
||||
NUM_ENTRIES = 24
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class TcsCtrlComponentInfo:
|
||||
component: ThermalComponent
|
||||
# Heater on or off?
|
||||
state: bool
|
||||
used_sensor_idx: int
|
||||
used_heater: Heater
|
||||
start_time: datetime.datetime
|
||||
end_time: datetime.datetime
|
||||
|
||||
|
||||
def handle_thermal_controller_hk_data( # noqa C901: complexity is okay.
|
||||
object_id: ObjectIdU32, pw: PrintWrapper, set_id: int, hk_data: bytes
|
||||
):
|
||||
# need a better solutuon for this is this is used again..
|
||||
@ -119,5 +162,50 @@ def handle_thermal_controller_hk_data(
|
||||
)
|
||||
current_draw = struct.unpack("!H", hk_data[8:10])[0]
|
||||
print(f"Heater Power Channel Current Draw: {current_draw} mA")
|
||||
elif set_id == CtrlSetId.TCS_CTRL_INFO:
|
||||
pw.dlog("Received TCS CTRL information set")
|
||||
current_idx = 0
|
||||
heater_states = hk_data[0 : ThermalComponent.NUM_ENTRIES]
|
||||
current_idx += ThermalComponent.NUM_ENTRIES
|
||||
used_sensor_idx = hk_data[
|
||||
current_idx : current_idx + ThermalComponent.NUM_ENTRIES
|
||||
]
|
||||
current_idx += ThermalComponent.NUM_ENTRIES
|
||||
used_heater_idx = hk_data[
|
||||
current_idx : current_idx + ThermalComponent.NUM_ENTRIES
|
||||
]
|
||||
current_idx += ThermalComponent.NUM_ENTRIES
|
||||
start_and_end_time_fmt_str = "!IIIIIIIIIIIIIIIIIIIIIIII"
|
||||
data_len = struct.calcsize(start_and_end_time_fmt_str)
|
||||
start_times = struct.unpack(
|
||||
start_and_end_time_fmt_str, hk_data[current_idx : current_idx + data_len]
|
||||
)
|
||||
current_idx += data_len
|
||||
end_times = struct.unpack(
|
||||
start_and_end_time_fmt_str, hk_data[current_idx : current_idx + data_len]
|
||||
)
|
||||
current_idx += data_len
|
||||
component_list = []
|
||||
for i in range(ThermalComponent.NUM_ENTRIES):
|
||||
info = TcsCtrlComponentInfo(
|
||||
component=ThermalComponent(i),
|
||||
state=bool(heater_states[i]),
|
||||
used_sensor_idx=used_sensor_idx[i],
|
||||
used_heater=Heater(used_heater_idx[i]),
|
||||
start_time=datetime.datetime.fromtimestamp(
|
||||
start_times[i], datetime.timezone.utc
|
||||
),
|
||||
end_time=datetime.datetime.fromtimestamp(
|
||||
end_times[i], datetime.timezone.utc
|
||||
),
|
||||
)
|
||||
component_str = f"{info.component!r}".ljust(46)
|
||||
state_str = "ON" if info.state else "OFF"
|
||||
pw.dlog(
|
||||
f"{component_str}: {state_str.ljust(4)} | Sensor Index "
|
||||
f"{info.used_sensor_idx} | {info.used_heater!r} | Start "
|
||||
f"{info.start_time} | End {info.end_time}"
|
||||
)
|
||||
component_list.append(info)
|
||||
else:
|
||||
_LOGGER.warning(f"Unimplemented set ID {set_id}")
|
||||
|
@ -17,9 +17,9 @@ from tmtccmd.config.tmtc import (
|
||||
OpCodeEntry,
|
||||
)
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import Mode, pack_mode_data
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import create_request_one_hk_command, make_sid
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_data
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import create_request_one_hk_command, make_sid
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
|
||||
|
||||
|
@ -1,25 +1,32 @@
|
||||
from spacepackets.ecss import PusTelecommand, PusService
|
||||
import struct
|
||||
import datetime
|
||||
import math
|
||||
|
||||
from spacepackets.ecss import PusService, PusTelecommand
|
||||
from tmtccmd.config import CoreServiceList
|
||||
from tmtccmd.config.tmtc import (
|
||||
tmtc_definitions_provider,
|
||||
TmtcDefinitionWrapper,
|
||||
OpCodeEntry,
|
||||
TmtcDefinitionWrapper,
|
||||
tmtc_definitions_provider,
|
||||
)
|
||||
from tmtccmd.pus.s11_tc_sched import create_time_tagged_cmd
|
||||
from tmtccmd.pus.s17_test import create_service_17_ping_command
|
||||
from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
|
||||
|
||||
class OpCodes:
|
||||
PING = "ping"
|
||||
TRIGGER_EVENT = "trig_event"
|
||||
PING_WITH_DATA = "ping_with_data"
|
||||
SCHEDULE_PING = "sched_ping"
|
||||
|
||||
|
||||
class Info:
|
||||
PING = "Simple Ping and Connection Test"
|
||||
TRIGGER_EVENT = "Trigger an event"
|
||||
PING_WITH_DATA = "Ping with data. Size of sent data is sent back"
|
||||
SCHEDULE_PING = "Schedule a ping"
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
@ -28,6 +35,7 @@ def add_test_defs(defs: TmtcDefinitionWrapper):
|
||||
oce.add(keys=OpCodes.PING, info=Info.PING)
|
||||
oce.add(keys=OpCodes.TRIGGER_EVENT, info=Info.TRIGGER_EVENT)
|
||||
oce.add(keys=OpCodes.PING_WITH_DATA, info=Info.PING_WITH_DATA)
|
||||
oce.add(keys=OpCodes.SCHEDULE_PING, info=Info.SCHEDULE_PING)
|
||||
|
||||
defs.add_service(
|
||||
name=CoreServiceList.SERVICE_17_ALT,
|
||||
@ -46,6 +54,21 @@ def pack_test_command(p: ServiceProviderParams):
|
||||
if info.op_code == OpCodes.TRIGGER_EVENT:
|
||||
q.add_log_cmd("Sending PUS TC Event Trigger [17, 128]")
|
||||
q.add_pus_tc(PusTelecommand(service=PusService.S17_TEST, subservice=128))
|
||||
if info.op_code == OpCodes.SCHEDULE_PING:
|
||||
q.add_log_cmd("Sending scheduled PUS ping")
|
||||
# Generate a UNIX timestamp 30 seconds in the future using the datetime API with a UTC timezone
|
||||
now = datetime.datetime.now(tz=datetime.timezone.utc)
|
||||
second_offset_to_now = input("Please specify offset to now in seconds: ")
|
||||
now += datetime.timedelta(seconds=int(second_offset_to_now))
|
||||
unix_stamp = struct.pack("!I", math.floor(now.timestamp()))
|
||||
print(f"Sending ping scheuled at {now}")
|
||||
ping = PusTelecommand(service=PusService.S17_TEST, subservice=128)
|
||||
q.add_pus_tc(
|
||||
create_time_tagged_cmd(
|
||||
release_time=unix_stamp,
|
||||
tc_to_insert=ping,
|
||||
)
|
||||
)
|
||||
if info.op_code == OpCodes.PING_WITH_DATA:
|
||||
q.add_log_cmd("Sending Ping With Data, Size Reported Back [17, 129]")
|
||||
while True:
|
||||
|
@ -10,8 +10,8 @@ from tmtccmd.config.tmtc import (
|
||||
OpCodeEntry,
|
||||
)
|
||||
|
||||
from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
|
||||
|
||||
class Subservice(enum.IntEnum):
|
||||
|
@ -3,6 +3,7 @@ import enum
|
||||
import logging
|
||||
import math
|
||||
import struct
|
||||
from typing import Tuple
|
||||
|
||||
from eive_tmtc.config.object_ids import (
|
||||
HK_TM_STORE,
|
||||
@ -15,24 +16,29 @@ from eive_tmtc.config.object_ids import (
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from tmtccmd.config import TmtcDefinitionWrapper
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider, OpCodeEntry
|
||||
from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.tmtc import service_provider
|
||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||
from dateutil.parser import parse
|
||||
|
||||
from spacepackets.ecss import PusService # noqa
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from spacepackets.ecss.pus_15_tm_storage import Subservice
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
|
||||
|
||||
class CustomSubservice(enum.IntEnum):
|
||||
DELETE_BY_TIME_RANGE = 128
|
||||
|
||||
|
||||
class OpCode:
|
||||
RETRIEVAL_BY_TIME_RANGE = "retrieval_time_range"
|
||||
DELETE_UP_TO = "delete_up_to"
|
||||
DELETE_BY_TIME_RANGE = "delete_time_range"
|
||||
|
||||
|
||||
class Info:
|
||||
RETRIEVAL_BY_TIME_RANGE = "Dump Telemetry Packets by time range"
|
||||
DELETE_UP_TO = "Delete Telemetry Packets up to time"
|
||||
DELETE_BY_TIME_RANGE = "Delete Telemetry by time range"
|
||||
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@ -43,7 +49,7 @@ def pack_tm_store_commands(p: ServiceProviderParams):
|
||||
q = p.queue_helper
|
||||
o = p.op_code
|
||||
if o == OpCode.DELETE_UP_TO:
|
||||
obj_id, store_string = store_select_prompt()
|
||||
obj_id, _ = store_select_prompt()
|
||||
app_data = bytearray(obj_id.as_bytes)
|
||||
delete_up_to_time = time_prompt("Determining deletion end time")
|
||||
end_stamp = int(math.floor(delete_up_to_time.timestamp()))
|
||||
@ -58,7 +64,7 @@ def pack_tm_store_commands(p: ServiceProviderParams):
|
||||
)
|
||||
elif o == OpCode.RETRIEVAL_BY_TIME_RANGE:
|
||||
q.add_log_cmd(Info.RETRIEVAL_BY_TIME_RANGE)
|
||||
obj_id, store_string = store_select_prompt()
|
||||
obj_id, _ = store_select_prompt()
|
||||
app_data = bytearray(obj_id.as_bytes)
|
||||
start_of_dump_time = time_prompt("Determining retrieval start time")
|
||||
start_stamp = int(math.floor(start_of_dump_time.timestamp()))
|
||||
@ -78,6 +84,28 @@ def pack_tm_store_commands(p: ServiceProviderParams):
|
||||
app_data=app_data,
|
||||
)
|
||||
)
|
||||
elif o == OpCode.DELETE_BY_TIME_RANGE:
|
||||
q.add_log_cmd(Info.DELETE_BY_TIME_RANGE)
|
||||
obj_id, _ = store_select_prompt()
|
||||
app_data = bytearray(obj_id.as_bytes)
|
||||
start_of_dump_time = time_prompt("Determining deletion start time")
|
||||
start_stamp = int(math.floor(start_of_dump_time.timestamp()))
|
||||
end_of_dump_time = time_prompt("Determining deletion end time")
|
||||
end_stamp = int(math.floor(end_of_dump_time.timestamp()))
|
||||
app_data.extend(struct.pack("!I", start_stamp))
|
||||
app_data.extend(struct.pack("!I", end_stamp))
|
||||
q.add_log_cmd(Info.DELETE_BY_TIME_RANGE)
|
||||
q.add_log_cmd(f"Selected Store: {obj_id}")
|
||||
q.add_log_cmd(
|
||||
f"Deletion from time {start_of_dump_time} up to time {end_of_dump_time}"
|
||||
)
|
||||
q.add_pus_tc(
|
||||
PusTelecommand(
|
||||
service=15,
|
||||
subservice=CustomSubservice.DELETE_BY_TIME_RANGE,
|
||||
app_data=app_data,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
@ -85,6 +113,7 @@ def add_persistent_tm_store_cmd_defs(defs: TmtcDefinitionWrapper):
|
||||
oce = OpCodeEntry()
|
||||
oce.add(keys=OpCode.DELETE_UP_TO, info=Info.DELETE_UP_TO)
|
||||
oce.add(keys=OpCode.RETRIEVAL_BY_TIME_RANGE, info=Info.RETRIEVAL_BY_TIME_RANGE)
|
||||
oce.add(keys=OpCode.DELETE_BY_TIME_RANGE, info=Info.DELETE_BY_TIME_RANGE)
|
||||
defs.add_service(
|
||||
CustomServiceList.TM_STORE, "Persistent TM Store", op_code_entry=oce
|
||||
)
|
||||
@ -130,6 +159,8 @@ def time_prompt(info_str: str) -> datetime.datetime:
|
||||
return time_prompt_fully_manually()
|
||||
elif time_input_key == 2:
|
||||
return time_prompt_offset_from_now()
|
||||
else:
|
||||
raise ValueError()
|
||||
|
||||
|
||||
def time_prompt_fully_manually() -> datetime.datetime:
|
||||
@ -148,8 +179,8 @@ def time_prompt_offset_from_now() -> datetime.datetime:
|
||||
seconds_offset = math.floor(
|
||||
float(
|
||||
input(
|
||||
"Please enter the time as a offset from now in seconds. Negative offset is "
|
||||
"allowed: "
|
||||
"Please enter the time as a offset from now in seconds. Negative offset"
|
||||
" is allowed: "
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -160,7 +191,7 @@ def time_prompt_offset_from_now() -> datetime.datetime:
|
||||
return time_now_with_offset
|
||||
|
||||
|
||||
def store_select_prompt() -> (ObjectIdU32, str):
|
||||
def store_select_prompt() -> Tuple[ObjectIdU32, str]:
|
||||
obj_id_dict = get_object_ids()
|
||||
print("Available TM stores:")
|
||||
for k, v in STORE_DICT.items():
|
||||
|
43
eive_tmtc/tmtc/wdt.py
Normal file
43
eive_tmtc/tmtc/wdt.py
Normal file
@ -0,0 +1,43 @@
|
||||
import enum
|
||||
from tmtccmd.config.tmtc import (
|
||||
OpCodeEntry,
|
||||
TmtcDefinitionWrapper,
|
||||
tmtc_definitions_provider,
|
||||
)
|
||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from eive_tmtc.config.object_ids import XIPHOS_WDT_ID
|
||||
|
||||
|
||||
class OpCode:
|
||||
ENABLE = "enable"
|
||||
DISABLE = "disable"
|
||||
|
||||
|
||||
class Info:
|
||||
ENABLE = "Enable WDT"
|
||||
DISABLE = "Disable WDT"
|
||||
|
||||
|
||||
class ActionId(enum.IntEnum):
|
||||
ENABLE = 0
|
||||
DISABLE = 1
|
||||
|
||||
|
||||
def pack_wdt_commands(q: DefaultPusQueueHelper, op_code: str):
|
||||
if op_code == OpCode.ENABLE:
|
||||
q.add_pus_tc(create_action_cmd(XIPHOS_WDT_ID, ActionId.ENABLE))
|
||||
if op_code == OpCode.DISABLE:
|
||||
q.add_pus_tc(create_action_cmd(XIPHOS_WDT_ID, ActionId.DISABLE))
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
def add_xiphos_wdt_defs(defs: TmtcDefinitionWrapper):
|
||||
oce = OpCodeEntry()
|
||||
oce.add(keys=OpCode.ENABLE, info=Info.ENABLE)
|
||||
oce.add(keys=OpCode.DISABLE, info=Info.DISABLE)
|
||||
defs.add_service(
|
||||
CustomServiceList.XIPHOS_WDT, info="Xiphos Watchdog Timer", op_code_entry=oce
|
||||
)
|
42
lint.py
42
lint.py
@ -1,42 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
exclude_dirs_flag = ""
|
||||
if not os.path.exists("setup.cfg"):
|
||||
exclude_dirs_flag = (
|
||||
"--exclude .git,__pycache__,docs/conf.py,old,build,dist,venv"
|
||||
)
|
||||
additional_flags_both_steps = "--count --statistics"
|
||||
additional_flags_first_step = "--select=E9,F63,F7,F82 --show-source"
|
||||
python_exe = ""
|
||||
if os.name == "nt":
|
||||
python_exe = "py -m"
|
||||
flake8_first_step_cmd = (
|
||||
f"{python_exe} flake8 . {additional_flags_both_steps} "
|
||||
f"{additional_flags_first_step} {exclude_dirs_flag}"
|
||||
)
|
||||
status = os.system(flake8_first_step_cmd)
|
||||
if os.name == "nt":
|
||||
if status != 0:
|
||||
print(f"Flake8 linter errors with status {status}")
|
||||
else:
|
||||
if os.WEXITSTATUS(status) != 0:
|
||||
print(f"Flake8 linter errors with status {status}")
|
||||
sys.exit(0)
|
||||
additional_flags_second_step = (
|
||||
'--exit-zero --max-complexity=10 --per-file-ignores="__init__.py:F401"'
|
||||
)
|
||||
if not os.path.exists("setup.cfg"):
|
||||
additional_flags_second_step += " --max-line-length=100"
|
||||
flake8_second_step_cmd = (
|
||||
f"{python_exe} flake8 . {additional_flags_both_steps} {additional_flags_second_step}"
|
||||
f" {exclude_dirs_flag}"
|
||||
)
|
||||
os.system(flake8_second_step_cmd)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
||||
name = "eive-tmtc"
|
||||
description = "TMTC Commander EIVE"
|
||||
readme = "README.md"
|
||||
dynamic = ["version"]
|
||||
version = "5.13.0"
|
||||
requires-python = ">=3.10"
|
||||
license = {text = "Apache-2.0"}
|
||||
authors = [
|
||||
@ -29,9 +29,9 @@ classifiers = [
|
||||
"Topic :: Scientific/Engineering"
|
||||
]
|
||||
dependencies = [
|
||||
"tmtccmd ~= 5.0.0rc0",
|
||||
"tmtccmd ~= 7.0",
|
||||
"python-dateutil ~= 2.8",
|
||||
# tmtccmd @ git+https://github.com/robamu-org/tmtccmd@<gitRev>#egg=tmtccmd
|
||||
# "tmtccmd @ git+https://github.com/robamu-org/tmtccmd@main"
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
@ -40,9 +40,11 @@ dependencies = [
|
||||
[tool.setuptools]
|
||||
include-package-data = true
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
version = {attr = "eive_tmtc.__version__"}
|
||||
|
||||
# Auto-Discovery is problematic for some reason, so use custom-discovery
|
||||
[tool.setuptools.packages]
|
||||
find = {}
|
||||
|
||||
[tool.ruff]
|
||||
ignore = ["E501"]
|
||||
[tool.ruff.extend-per-file-ignores]
|
||||
"__init__.py" = ["F401"]
|
||||
|
@ -3,11 +3,11 @@ Checklist for new releases
|
||||
|
||||
# Pre-Release
|
||||
|
||||
1. Bump version inside the `eive_tmtc/__init__.py` file.
|
||||
1. Bump version inside the `pyproject.toml` file.
|
||||
2. Update `CHANGELOG.md`: Convert `unreleased` section into version section
|
||||
with date and new `unreleased`section.
|
||||
3. Run auto-formatter with `black .`
|
||||
4. Run linter with `flake8 .`
|
||||
4. Run linter with `ruff .`
|
||||
|
||||
# Post-Release
|
||||
|
||||
|
12
setup.py
12
setup.py
@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
We do the package handling in the static setup.cfg but include an empty setup.py
|
||||
to allow editable installs https://packaging.python.org/tutorials/packaging-projects/
|
||||
and provide extensibility
|
||||
"""
|
||||
try:
|
||||
from setuptools import setup
|
||||
except ImportError:
|
||||
from distutils.core import setup
|
||||
|
||||
setup()
|
368
tmtcc.py
368
tmtcc.py
@ -2,100 +2,61 @@
|
||||
import logging
|
||||
import sys
|
||||
import time
|
||||
import traceback
|
||||
from importlib.metadata import version
|
||||
from pathlib import Path
|
||||
from typing import cast
|
||||
from typing import Tuple
|
||||
|
||||
from spacepackets.ccsds import SPACE_PACKET_HEADER_SIZE
|
||||
import tmtccmd
|
||||
from spacepackets.cfdp import (
|
||||
ConditionCode,
|
||||
ChecksumType,
|
||||
TransmissionMode,
|
||||
PduHolder,
|
||||
DirectiveType,
|
||||
PduFactory,
|
||||
PduType,
|
||||
)
|
||||
from tmtccmd.logging import add_colorlog_console_logger
|
||||
from tmtccmd.cfdp import CfdpUserBase, TransactionId
|
||||
from tmtccmd.cfdp.defs import CfdpRequestType
|
||||
from tmtccmd.cfdp.handler import CfdpInCcsdsHandler
|
||||
from spacepackets.ecss import PusVerificator
|
||||
from spacepackets.version import get_version as get_sp_version
|
||||
from tmtccmd import BackendBase
|
||||
from tmtccmd.cfdp.handler import RemoteEntityCfgTable
|
||||
from eive_tmtc.cfdp.handler import CfdpInCcsdsHandler
|
||||
from tmtccmd.cfdp.mib import (
|
||||
DefaultFaultHandlerBase,
|
||||
LocalEntityCfg,
|
||||
IndicationCfg,
|
||||
LocalEntityCfg,
|
||||
RemoteEntityCfg,
|
||||
)
|
||||
from tmtccmd.cfdp.user import (
|
||||
TransactionFinishedParams,
|
||||
MetadataRecvParams,
|
||||
FileSegmentRecvdParams,
|
||||
from tmtccmd.config import (
|
||||
SetupWrapper,
|
||||
default_json_path,
|
||||
params_to_procedure_conversion,
|
||||
)
|
||||
from tmtccmd.tc.handler import SendCbParams
|
||||
|
||||
try:
|
||||
import spacepackets
|
||||
except ImportError as error:
|
||||
print(error)
|
||||
print("Python spacepackets module could not be imported")
|
||||
print(
|
||||
'Install with "cd spacepackets && python3 -m pip intall -e ." for interative installation'
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
import tmtccmd
|
||||
except ImportError:
|
||||
run_tmtc_commander = None
|
||||
initialize_tmtc_commander = None
|
||||
tb = traceback.format_exc()
|
||||
print(tb)
|
||||
print("Python tmtccmd submodule could not be imported")
|
||||
sys.exit(1)
|
||||
|
||||
from spacepackets.ecss import PusVerificator
|
||||
from tmtccmd import TcHandlerBase, BackendBase
|
||||
from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider
|
||||
from tmtccmd.config.args import (
|
||||
PreArgsParsingWrapper,
|
||||
ProcedureParamsWrapper,
|
||||
SetupParams,
|
||||
)
|
||||
from tmtccmd.core import BackendRequest
|
||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||
|
||||
from tmtccmd.logging import add_colorlog_console_logger
|
||||
from tmtccmd.logging.pus import (
|
||||
RawTmtcTimedLogWrapper,
|
||||
RegularTmtcLogWrapper,
|
||||
TimedLogWhen,
|
||||
)
|
||||
from tmtccmd.pus import VerificationWrapper
|
||||
from tmtccmd.tm import SpecificApidHandlerBase, GenericApidHandlerBase, CcsdsTmHandler
|
||||
from tmtccmd.core import BackendRequest
|
||||
from tmtccmd.logging import get_current_time_string
|
||||
from tmtccmd.tc import (
|
||||
ProcedureWrapper,
|
||||
FeedWrapper,
|
||||
TcProcedureType,
|
||||
TcQueueEntryType,
|
||||
DefaultPusQueueHelper,
|
||||
QueueWrapper,
|
||||
)
|
||||
from tmtccmd.config import (
|
||||
default_json_path,
|
||||
SetupWrapper,
|
||||
params_to_procedure_conversion,
|
||||
)
|
||||
from tmtccmd.config.args import (
|
||||
SetupParams,
|
||||
PreArgsParsingWrapper,
|
||||
ProcedureParamsWrapper,
|
||||
)
|
||||
from tmtccmd.tmtc import CcsdsTmHandler, GenericApidHandlerBase, SpecificApidHandlerBase
|
||||
from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider
|
||||
|
||||
from eive_tmtc import APP_LOGGER
|
||||
from eive_tmtc import __version__
|
||||
from eive_tmtc.cfdp.fault_handler import EiveCfdpFaultHandler
|
||||
from eive_tmtc.cfdp.tm import CfdpInCcsdsWrapper
|
||||
from eive_tmtc.cfdp.user import EiveCfdpUser, EiveCheckTimerProvider
|
||||
from eive_tmtc.config.definitions import (
|
||||
PUS_APID,
|
||||
CFDP_APID,
|
||||
CFDP_LOCAL_ENTITY_ID,
|
||||
CFDP_REMOTE_ENTITY_ID,
|
||||
PUS_APID,
|
||||
)
|
||||
from eive_tmtc.config.hook import EiveHookObject
|
||||
from eive_tmtc.pus_tm.factory_hook import pus_factory_hook
|
||||
from eive_tmtc.pus_tc.procedure_packer import handle_default_procedure
|
||||
from eive_tmtc.pus_tc.tc_handler import TcHandler
|
||||
from eive_tmtc.pus_tm.hk_handler import HkFilter
|
||||
from eive_tmtc.pus_tm.pus_demux import pus_factory_hook
|
||||
|
||||
_LOGGER = APP_LOGGER
|
||||
_LOG_LEVEL = logging.INFO
|
||||
@ -105,77 +66,33 @@ ROTATING_TIMED_LOGGER_INTERVAL_WHEN = TimedLogWhen.PER_MINUTE
|
||||
ROTATING_TIMED_LOGGER_INTERVAL = 30
|
||||
|
||||
|
||||
class EiveCfdpFaultHandler(DefaultFaultHandlerBase):
|
||||
def notice_of_suspension_cb(self, cond: ConditionCode):
|
||||
pass
|
||||
|
||||
def notice_of_cancellation_cb(self, cond: ConditionCode):
|
||||
pass
|
||||
|
||||
def abandoned_cb(self, cond: ConditionCode):
|
||||
pass
|
||||
|
||||
def ignore_cb(self, cond: ConditionCode):
|
||||
pass
|
||||
|
||||
|
||||
class EiveCfdpUser(CfdpUserBase):
|
||||
def transaction_indication(self, transaction_id: TransactionId):
|
||||
_LOGGER.info(f"CFDP User: Start of File {transaction_id}")
|
||||
|
||||
def eof_sent_indication(self, transaction_id: TransactionId):
|
||||
_LOGGER.info(f"CFDP User: EOF sent for {transaction_id}")
|
||||
|
||||
def transaction_finished_indication(self, params: TransactionFinishedParams):
|
||||
_LOGGER.info(f"CFDP User: {params.transaction_id} finished")
|
||||
|
||||
def metadata_recv_indication(self, params: MetadataRecvParams):
|
||||
pass
|
||||
|
||||
def file_segment_recv_indication(self, params: FileSegmentRecvdParams):
|
||||
pass
|
||||
|
||||
def report_indication(self, transaction_id: TransactionId, status_report: any):
|
||||
pass
|
||||
|
||||
def suspended_indication(
|
||||
self, transaction_id: TransactionId, cond_code: ConditionCode
|
||||
):
|
||||
pass
|
||||
|
||||
def resumed_indication(self, transaction_id: TransactionId, progress: int):
|
||||
pass
|
||||
|
||||
def fault_indication(
|
||||
self, transaction_id: TransactionId, cond_code: ConditionCode, progress: int
|
||||
):
|
||||
pass
|
||||
|
||||
def abandoned_indication(
|
||||
self, transaction_id: TransactionId, cond_code: ConditionCode, progress: int
|
||||
):
|
||||
pass
|
||||
|
||||
def eof_recv_indication(self, transaction_id: TransactionId):
|
||||
pass
|
||||
|
||||
|
||||
class PusHandler(SpecificApidHandlerBase):
|
||||
def __init__(
|
||||
self,
|
||||
wrapper: VerificationWrapper,
|
||||
printer: FsfwTmTcPrinter,
|
||||
raw_logger: RawTmtcTimedLogWrapper,
|
||||
hk_level: int,
|
||||
):
|
||||
super().__init__(PUS_APID, None)
|
||||
self.printer = printer
|
||||
self.verif_wrapper = wrapper
|
||||
self.raw_logger = raw_logger
|
||||
self.hk_level = hk_level
|
||||
self.these_objs_hk_only = []
|
||||
self.hk_filter = HkFilter(object_ids=self.these_objs_hk_only, set_ids=[])
|
||||
|
||||
def handle_tm(self, packet: bytes, _user_args: any):
|
||||
# with open("tc.bin", "wb") as of:
|
||||
# of.write(packet)
|
||||
pus_factory_hook(packet, self.verif_wrapper, self.printer, self.raw_logger)
|
||||
pus_factory_hook(
|
||||
packet,
|
||||
self.verif_wrapper,
|
||||
self.printer,
|
||||
self.raw_logger,
|
||||
self.hk_level,
|
||||
self.hk_filter,
|
||||
)
|
||||
|
||||
|
||||
class UnknownApidHandler(GenericApidHandlerBase):
|
||||
@ -190,158 +107,18 @@ class CustomCcsdsTmHandler(CcsdsTmHandler):
|
||||
_LOGGER.debug(f"Received packet {packet.hex(sep=',')} with APID {apid}")
|
||||
|
||||
|
||||
class CfdpInCcsdsWrapper(SpecificApidHandlerBase):
|
||||
def __init__(self, cfdp_in_ccsds_handler: CfdpInCcsdsHandler):
|
||||
super().__init__(CFDP_APID, None)
|
||||
self.handler = cfdp_in_ccsds_handler
|
||||
|
||||
def handle_tm(self, packet: bytes, _user_args: any):
|
||||
# Ignore the space packet header. Its only purpose is to use the same protocol and
|
||||
# have a seaprate APID for space packets. If this function is called, the APID is correct.
|
||||
pdu = packet[SPACE_PACKET_HEADER_SIZE:]
|
||||
pdu_base = PduFactory.from_raw(pdu)
|
||||
if pdu_base.pdu_type == PduType.FILE_DATA:
|
||||
_LOGGER.info("Received File Data PDU TM")
|
||||
else:
|
||||
if pdu_base.directive_type == DirectiveType.FINISHED_PDU:
|
||||
_LOGGER.info("Received Finished PDU TM")
|
||||
else:
|
||||
_LOGGER.info(
|
||||
f"Received File Directive PDU with type {pdu_base.directive_type!r} TM"
|
||||
)
|
||||
self.handler.pass_pdu_packet(pdu_base)
|
||||
|
||||
|
||||
class TcHandler(TcHandlerBase):
|
||||
def __init__(
|
||||
self,
|
||||
seq_count_provider: FileSeqCountProvider,
|
||||
cfdp_in_ccsds_wrapper: CfdpInCcsdsWrapper,
|
||||
pus_verificator: PusVerificator,
|
||||
high_level_file_logger: logging.Logger,
|
||||
raw_pus_logger: RawTmtcTimedLogWrapper,
|
||||
gui: bool,
|
||||
):
|
||||
super().__init__()
|
||||
self.cfdp_handler_started = False
|
||||
self.cfdp_dest_id = CFDP_REMOTE_ENTITY_ID
|
||||
self.seq_count_provider = seq_count_provider
|
||||
self.pus_verificator = pus_verificator
|
||||
self.high_level_file_logger = high_level_file_logger
|
||||
self.pus_raw_logger = raw_pus_logger
|
||||
self.gui = gui
|
||||
self.queue_helper = DefaultPusQueueHelper(
|
||||
queue_wrapper=QueueWrapper.empty(),
|
||||
default_pus_apid=PUS_APID,
|
||||
seq_cnt_provider=seq_count_provider,
|
||||
pus_verificator=pus_verificator,
|
||||
tc_sched_timestamp_len=4,
|
||||
)
|
||||
self.cfdp_in_ccsds_wrapper = cfdp_in_ccsds_wrapper
|
||||
|
||||
def cfdp_done(self) -> bool:
|
||||
if self.cfdp_handler_started:
|
||||
if not self.cfdp_in_ccsds_wrapper.handler.put_request_pending():
|
||||
self.cfdp_handler_started = False
|
||||
return True
|
||||
return False
|
||||
|
||||
def feed_cb(self, info: ProcedureWrapper, wrapper: FeedWrapper):
|
||||
self.queue_helper.queue_wrapper = wrapper.queue_wrapper
|
||||
if info.proc_type == TcProcedureType.DEFAULT:
|
||||
handle_default_procedure(self, info.to_def_procedure(), self.queue_helper)
|
||||
elif info.proc_type == TcProcedureType.CFDP:
|
||||
self.handle_cfdp_procedure(info)
|
||||
|
||||
def send_cb(self, send_params: SendCbParams):
|
||||
entry_helper = send_params.entry
|
||||
if entry_helper.is_tc:
|
||||
if entry_helper.entry_type == TcQueueEntryType.PUS_TC:
|
||||
pus_tc_wrapper = entry_helper.to_pus_tc_entry()
|
||||
# pus_tc_wrapper.pus_tc.apid = PUS_APID
|
||||
raw_tc = pus_tc_wrapper.pus_tc.pack()
|
||||
self.pus_raw_logger.log_tc(pus_tc_wrapper.pus_tc)
|
||||
tc_info_string = f"Sent {pus_tc_wrapper.pus_tc}"
|
||||
_LOGGER.info(tc_info_string)
|
||||
self.high_level_file_logger.info(
|
||||
f"{get_current_time_string(True)}: {tc_info_string}"
|
||||
)
|
||||
# with open("tc.bin", "wb") as of:
|
||||
# of.write(raw_tc)
|
||||
send_params.com_if.send(raw_tc)
|
||||
elif entry_helper.entry_type == TcQueueEntryType.CCSDS_TC:
|
||||
cfdp_packet_in_ccsds = entry_helper.to_space_packet_entry()
|
||||
send_params.com_if.send(cfdp_packet_in_ccsds.space_packet.pack())
|
||||
# TODO: Log raw CFDP packets similarly to how PUS packets are logged.
|
||||
# - Log full raw format including space packet wrapper
|
||||
# - Log context information: Transaction ID, and PDU type and directive
|
||||
# Could re-use file logger. Should probably do that
|
||||
# print(f"sending packet: [{cfdp_packet_in_ccsds.space_packet.pack()}]")
|
||||
# with open(f"cfdp_packet_{self.cfdp_counter}", "wb") as of:
|
||||
# of.write(cfdp_packet_in_ccsds.space_packet.pack())
|
||||
# self.cfdp_counter += 1
|
||||
elif entry_helper.entry_type == TcQueueEntryType.LOG:
|
||||
log_entry = entry_helper.to_log_entry()
|
||||
_LOGGER.info(log_entry.log_str)
|
||||
self.high_level_file_logger.info(log_entry.log_str)
|
||||
|
||||
def handle_cfdp_procedure(self, info: ProcedureWrapper):
|
||||
cfdp_procedure = info.to_cfdp_procedure()
|
||||
if cfdp_procedure.cfdp_request_type == CfdpRequestType.PUT:
|
||||
if (
|
||||
not self.cfdp_in_ccsds_wrapper.handler.put_request_pending()
|
||||
and not self.cfdp_handler_started
|
||||
):
|
||||
put_req = cfdp_procedure.request_wrapper.to_put_request()
|
||||
put_req.cfg.destination_id = self.cfdp_dest_id
|
||||
_LOGGER.info(
|
||||
f"CFDP: Starting file put request with parameters:\n{put_req}"
|
||||
)
|
||||
self.cfdp_in_ccsds_wrapper.handler.cfdp_handler.put_request(put_req)
|
||||
self.cfdp_handler_started = True
|
||||
|
||||
for source_pair, dest_pair in self.cfdp_in_ccsds_wrapper.handler:
|
||||
pdu, sp = source_pair
|
||||
pdu = cast(PduHolder, pdu)
|
||||
if pdu.is_file_directive:
|
||||
if pdu.pdu_directive_type == DirectiveType.METADATA_PDU:
|
||||
metadata = pdu.to_metadata_pdu()
|
||||
self.queue_helper.add_log_cmd(
|
||||
f"CFDP Source: Sending Metadata PDU for file with size "
|
||||
f"{metadata.file_size}"
|
||||
)
|
||||
elif pdu.pdu_directive_type == DirectiveType.EOF_PDU:
|
||||
self.queue_helper.add_log_cmd(
|
||||
"CFDP Source: Sending EOF PDU"
|
||||
)
|
||||
else:
|
||||
fd_pdu = pdu.to_file_data_pdu()
|
||||
self.queue_helper.add_log_cmd(
|
||||
f"CFDP Source: Sending File Data PDU for segment at offset "
|
||||
f"{fd_pdu.offset} with length {len(fd_pdu.file_data)}"
|
||||
)
|
||||
self.queue_helper.add_ccsds_tc(sp)
|
||||
self.cfdp_in_ccsds_wrapper.handler.confirm_source_packet_sent()
|
||||
self.cfdp_in_ccsds_wrapper.handler.source_handler.state_machine()
|
||||
|
||||
def queue_finished_cb(self, info: ProcedureWrapper):
|
||||
if info is not None:
|
||||
if info.proc_type == TcQueueEntryType.PUS_TC:
|
||||
def_proc = info.to_def_procedure()
|
||||
_LOGGER.info(
|
||||
f"Finished queue for service {def_proc.service} and op code {def_proc.op_code}"
|
||||
)
|
||||
elif info.proc_type == TcProcedureType.CFDP:
|
||||
_LOGGER.info("Finished CFDP queue")
|
||||
|
||||
|
||||
def setup_params() -> SetupWrapper:
|
||||
def setup_params() -> Tuple[SetupWrapper, int]:
|
||||
hook_obj = EiveHookObject(default_json_path())
|
||||
params = SetupParams()
|
||||
parser_wrapper = PreArgsParsingWrapper()
|
||||
parser_wrapper.create_default_parent_parser()
|
||||
parser_wrapper.create_default_parser()
|
||||
parser_wrapper.add_def_proc_and_cfdp_as_subparsers()
|
||||
tmtc_parser, cfdp_parser = parser_wrapper.add_def_proc_and_cfdp_as_subparsers()
|
||||
tmtc_parser.add_argument(
|
||||
"--hk",
|
||||
help="HK output level",
|
||||
default=2,
|
||||
)
|
||||
post_arg_parsing_wrapper = parser_wrapper.parse(
|
||||
setup_params=params, hook_obj=hook_obj
|
||||
)
|
||||
@ -352,13 +129,17 @@ def setup_params() -> SetupWrapper:
|
||||
post_arg_parsing_wrapper.set_params_with_prompts(proc_param_wrapper)
|
||||
else:
|
||||
post_arg_parsing_wrapper.set_params_without_prompts(proc_param_wrapper)
|
||||
if hasattr(post_arg_parsing_wrapper.args_raw, "hk"):
|
||||
hk_level = int(post_arg_parsing_wrapper.args_raw.hk)
|
||||
else:
|
||||
hk_level = 0
|
||||
params.apid = PUS_APID
|
||||
if params.com_if is None:
|
||||
raise ValueError("could not determine a COM interface.")
|
||||
setup_wrapper = SetupWrapper(
|
||||
hook_obj=hook_obj, setup_params=params, proc_param_wrapper=proc_param_wrapper
|
||||
)
|
||||
return setup_wrapper
|
||||
return setup_wrapper, hk_level
|
||||
|
||||
|
||||
def setup_cfdp_handler() -> CfdpInCcsdsWrapper:
|
||||
@ -368,15 +149,27 @@ def setup_cfdp_handler() -> CfdpInCcsdsWrapper:
|
||||
indication_cfg=IndicationCfg(),
|
||||
default_fault_handlers=fh_base,
|
||||
)
|
||||
remote_cfg = RemoteEntityCfg(
|
||||
self_as_remote = RemoteEntityCfg(
|
||||
closure_requested=False,
|
||||
entity_id=CFDP_REMOTE_ENTITY_ID,
|
||||
entity_id=CFDP_LOCAL_ENTITY_ID,
|
||||
max_file_segment_len=990,
|
||||
check_limit=None,
|
||||
max_packet_len=1024,
|
||||
check_limit=5,
|
||||
crc_on_transmission=False,
|
||||
crc_type=ChecksumType.CRC_32,
|
||||
default_transmission_mode=TransmissionMode.UNACKNOWLEDGED,
|
||||
)
|
||||
remote_cfg = RemoteEntityCfg(
|
||||
closure_requested=False,
|
||||
entity_id=CFDP_REMOTE_ENTITY_ID,
|
||||
max_file_segment_len=990,
|
||||
max_packet_len=1024,
|
||||
check_limit=5,
|
||||
crc_on_transmission=False,
|
||||
crc_type=ChecksumType.CRC_32,
|
||||
default_transmission_mode=TransmissionMode.UNACKNOWLEDGED,
|
||||
)
|
||||
check_timer_provider = EiveCheckTimerProvider()
|
||||
cfdp_seq_count_provider = FileSeqCountProvider(
|
||||
max_bit_width=16, file_name=Path("seqcnt_cfdp_transaction.txt")
|
||||
)
|
||||
@ -386,7 +179,8 @@ def setup_cfdp_handler() -> CfdpInCcsdsWrapper:
|
||||
cfdp_user = EiveCfdpUser()
|
||||
cfdp_in_ccsds_handler = CfdpInCcsdsHandler(
|
||||
cfg=cfdp_cfg,
|
||||
remote_cfgs=[remote_cfg],
|
||||
check_timer_provider=check_timer_provider,
|
||||
remote_cfg_table=RemoteEntityCfgTable([remote_cfg, self_as_remote]),
|
||||
ccsds_apid=CFDP_APID,
|
||||
ccsds_seq_cnt_provider=cfdp_ccsds_seq_count_provider,
|
||||
cfdp_seq_cnt_provider=cfdp_seq_count_provider,
|
||||
@ -400,12 +194,13 @@ def setup_tmtc_handlers(
|
||||
printer: FsfwTmTcPrinter,
|
||||
raw_logger: RawTmtcTimedLogWrapper,
|
||||
gui: bool,
|
||||
) -> (CcsdsTmHandler, TcHandler):
|
||||
hk_level: int,
|
||||
) -> Tuple[CcsdsTmHandler, TcHandler]:
|
||||
cfdp_in_ccsds_wrapper = setup_cfdp_handler()
|
||||
verification_wrapper = VerificationWrapper(
|
||||
verificator, _LOGGER, printer.file_logger
|
||||
)
|
||||
pus_handler = PusHandler(verification_wrapper, printer, raw_logger)
|
||||
pus_handler = PusHandler(verification_wrapper, printer, raw_logger, hk_level)
|
||||
ccsds_handler = CustomCcsdsTmHandler(generic_handler=UnknownApidHandler(None))
|
||||
ccsds_handler.add_apid_handler(pus_handler)
|
||||
ccsds_handler.add_apid_handler(cfdp_in_ccsds_wrapper)
|
||||
@ -416,7 +211,7 @@ def setup_tmtc_handlers(
|
||||
high_level_file_logger=printer.file_logger,
|
||||
raw_pus_logger=raw_logger,
|
||||
gui=gui,
|
||||
cfdp_in_ccsds_wrapper=cfdp_in_ccsds_wrapper,
|
||||
cfdp_in_ccsds_handler=cfdp_in_ccsds_wrapper.handler,
|
||||
)
|
||||
return ccsds_handler, tc_handler
|
||||
|
||||
@ -438,13 +233,13 @@ def setup_backend(
|
||||
|
||||
|
||||
def main(): # noqa C901: Complexity okay here.
|
||||
print(f"-- eive tmtc v{__version__} --")
|
||||
print(f"-- spacepackets v{spacepackets.__version__} --")
|
||||
print(f"-- eive tmtc v{version('eive-tmtc')} --")
|
||||
print(f"-- spacepackets v{get_sp_version()} --")
|
||||
add_colorlog_console_logger(_LOGGER)
|
||||
# TODO: -V CLI argument to enable this?
|
||||
_LOGGER.setLevel(_LOG_LEVEL)
|
||||
try:
|
||||
setup_wrapper = setup_params()
|
||||
setup_wrapper, hk_level = setup_params()
|
||||
except KeyboardInterrupt as e:
|
||||
_LOGGER.info(f"{e}. Exiting")
|
||||
sys.exit(0)
|
||||
@ -457,7 +252,7 @@ def main(): # noqa C901: Complexity okay here.
|
||||
)
|
||||
pus_verificator = PusVerificator()
|
||||
ccsds_handler, tc_handler = setup_tmtc_handlers(
|
||||
pus_verificator, printer, raw_logger, setup_wrapper.params.use_gui
|
||||
pus_verificator, printer, raw_logger, setup_wrapper.params.use_gui, hk_level
|
||||
)
|
||||
|
||||
tmtccmd.setup(setup_wrapper)
|
||||
@ -467,13 +262,16 @@ def main(): # noqa C901: Complexity okay here.
|
||||
try:
|
||||
while True:
|
||||
state = tmtc_backend.periodic_op(None)
|
||||
tc_handler.cfdp_in_ccsds_wrapper.handler.fsm()
|
||||
tc_handler.cfdp_in_ccsds_handler.state_machine()
|
||||
if state.request == BackendRequest.TERMINATION_NO_ERROR:
|
||||
sys.exit(0)
|
||||
elif state.request == BackendRequest.DELAY_IDLE:
|
||||
_LOGGER.info("TMTC Client in IDLE mode")
|
||||
time.sleep(3.0)
|
||||
elif state.request == BackendRequest.DELAY_LISTENER:
|
||||
if tc_handler.proxy_op:
|
||||
time.sleep(0.1)
|
||||
continue
|
||||
if tc_handler.cfdp_done():
|
||||
_LOGGER.info("CFDP transaction done, closing client")
|
||||
sys.exit(0)
|
||||
|
Reference in New Issue
Block a user