Compare commits
127 Commits
mueller/fm
...
main
Author | SHA1 | Date |
---|---|---|
Robin Müller | 81905090b2 | |
Robin Müller | 8a9e079790 | |
Robin Müller | f63ae969a7 | |
Robin Müller | a9ccd5e146 | |
Robin Müller | 40c7b5e7d8 | |
Robin Müller | a68a3503a1 | |
Robin Müller | dd1f1050da | |
Robin Müller | 75e592fc10 | |
Robin Müller | f12a31b710 | |
Robin Müller | 5e0c6b2c41 | |
Robin Müller | 438e543203 | |
Robin Müller | 278b878525 | |
Robin Müller | 5f59186ace | |
Robin Müller | 45c1ba70e3 | |
Robin Müller | 9eedbe3810 | |
Robin Müller | cafd8a7e52 | |
Robin Müller | e1d2849436 | |
Robin Müller | d7be5f3464 | |
Robin Müller | 3a31c175c4 | |
Robin Müller | 02046f043c | |
Robin Müller | 42cdca76b6 | |
Robin Müller | 50211e0f75 | |
Robin Müller | f6ab970529 | |
Robin Müller | 6e86dfab19 | |
Robin Müller | 22ecffc30e | |
Robin Müller | 475f8e1656 | |
Robin Müller | 9e4f2add7d | |
Robin Müller | 886c966420 | |
Robin Müller | a329824f8e | |
Robin Müller | d4264ee75d | |
Robin Müller | 2b2527d814 | |
Robin Müller | 3b9df4adda | |
Robin Müller | be0aedb3ae | |
Robin Müller | ec2a500e0c | |
Robin Müller | ed6a9bf82f | |
Robin Müller | bfd54520c9 | |
Robin Müller | b76ad023a5 | |
Robin Müller | 3265f5258c | |
Robin Müller | 3b473d8dba | |
Robin Müller | 64a58c65dd | |
Robin Müller | c9383ca20b | |
Robin Müller | f89ca50bcb | |
Robin Müller | 9a8cca1821 | |
Robin Müller | eebe169fa7 | |
Robin Müller | e678dae989 | |
Robin Müller | daa68d335a | |
Robin Müller | ecb2a751ab | |
Robin Müller | 586388b3f0 | |
Robin Müller | ad5169743a | |
Robin Müller | d1df2cd694 | |
Robin Müller | 4e93be0db3 | |
Robin Müller | c251d2b3c8 | |
Robin Müller | f87e0854fd | |
Robin Müller | e769d38d2c | |
Robin Müller | 4cb00a2bb3 | |
Robin Müller | 19078aa5fe | |
Robin Müller | 4b511d8d30 | |
Robin Müller | e296554827 | |
Robin Müller | 6f9a866e9c | |
Robin Müller | 87c7542015 | |
Robin Müller | 3f0367fdb2 | |
Robin Müller | b5ac8cded7 | |
Robin Müller | e0837683fe | |
Robin Müller | 75e0ef60ce | |
Robin Müller | 91711bd928 | |
Robin Müller | efe60b703b | |
Robin Müller | 9b450f5049 | |
Robin Müller | 6d43fa8911 | |
Robin Müller | 9c9daffbbc | |
Robin Müller | dd866790f3 | |
Robin Müller | b1e704cd11 | |
Robin Müller | 68857b9d4e | |
Robin Müller | de90bfaa34 | |
Robin Müller | 8f644cecea | |
Robin Müller | 0459173362 | |
Robin Müller | 346bb5c7c0 | |
Robin Müller | ca4e451e26 | |
Robin Müller | 1272fa0cca | |
Robin Müller | 56d6de17a6 | |
Robin Müller | 88228f9f4b | |
Robin Müller | 94f2dd3c01 | |
Robin Müller | 522e69d5da | |
Robin Müller | 7fcea4ea07 | |
Robin Müller | bd10232224 | |
Robin Müller | 459ee67f19 | |
Robin Müller | 3b32fa79c1 | |
Robin Müller | c403abfa9f | |
Robin Müller | 8070e2da4f | |
Robin Müller | 0679490199 | |
Robin Müller | 19bcc35831 | |
Robin Müller | 8340d28170 | |
Robin Müller | acbf958660 | |
Robin Müller | bb833172d0 | |
Robin Müller | 51f07ce7bf | |
Robin Müller | da04e96278 | |
Robin Müller | 5c7e47bae0 | |
Robin Müller | ab4807d702 | |
Robin Müller | 37812a033b | |
Robin Müller | f56f47ed75 | |
Robin Müller | 27be8d18dc | |
Robin Müller | 5bb72c9804 | |
Robin Müller | dc107a5090 | |
Robin Müller | f2e21bb359 | |
Robin Müller | b37d801afe | |
Robin Müller | f0782e4445 | |
Robin Müller | b0cd790c78 | |
Robin Müller | dd7a9dfafd | |
Robin Müller | 6f7be65811 | |
Robin Müller | 4fd6f35374 | |
Robin Müller | 43e611950b | |
Robin Müller | beeb699c17 | |
Robin Müller | 1a94f31d69 | |
Robin Müller | 2d171b2c36 | |
Robin Müller | 9defef2756 | |
Robin Müller | 84ce93a012 | |
Robin Müller | b97a23ff8c | |
Robin Müller | d644a45c34 | |
Robin Müller | d07e0e6465 | |
Robin Müller | e6e2e1a935 | |
Robin Müller | 46123172ae | |
Robin Müller | 3ed1b6f9f1 | |
Robin Müller | a59d467e1d | |
Robin Müller | f4a346d2a8 | |
Robin Müller | af618f5652 | |
Robin Müller | 77791efcbc | |
Robin Müller | d7923fe18b | |
Robin Müller | fbe10e4624 |
|
@ -7,12 +7,6 @@
|
||||||
[submodule "fsfw"]
|
[submodule "fsfw"]
|
||||||
path = fsfw
|
path = fsfw
|
||||||
url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw.git
|
url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw.git
|
||||||
[submodule "tmtc/tmtccmd"]
|
|
||||||
path = tmtc/tmtccmd
|
|
||||||
url = https://github.com/robamu-org/tmtccmd.git
|
|
||||||
[submodule "tmtc/common_tmtc"]
|
[submodule "tmtc/common_tmtc"]
|
||||||
path = tmtc/common_tmtc
|
path = tmtc/common_tmtc
|
||||||
url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-example-tmtc-common.git
|
url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-example-tmtc-common.git
|
||||||
[submodule "tmtc/spacepackets"]
|
|
||||||
path = tmtc/spacepackets
|
|
||||||
url = https://github.com/robamu-org/py-spacepackets.git
|
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CMakeSharedSettings">
|
<component name="CMakeSharedSettings">
|
||||||
<configurations>
|
<configurations>
|
||||||
<configuration PROFILE_NAME="Debug" ENABLED="true" CONFIG_NAME="Debug" />
|
<configuration PROFILE_NAME="Debug" ENABLED="true" CONFIG_NAME="Debug" NO_GENERATOR="true" />
|
||||||
<configuration PROFILE_NAME="Debug Linux" ENABLED="true" GENERATION_DIR="cmake-build-debug-linux" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DFSFW_OSAL=linux" />
|
<configuration PROFILE_NAME="Debug Linux" ENABLED="true" GENERATION_DIR="cmake-build-debug-linux" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DFSFW_OSAL=linux" NO_GENERATOR="true" />
|
||||||
<configuration PROFILE_NAME="Release" ENABLED="true" CONFIG_NAME="Release" />
|
<configuration PROFILE_NAME="Release" ENABLED="true" CONFIG_NAME="Release" NO_GENERATOR="true" />
|
||||||
<configuration PROFILE_NAME="Debug Clang" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DCMAKE_TOOLCHAIN_FILE=cmake/ClangToolchain.cmake" />
|
<configuration PROFILE_NAME="Debug Clang" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DCMAKE_TOOLCHAIN_FILE=cmake/ClangToolchain.cmake" />
|
||||||
</configurations>
|
</configurations>
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="example" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="fsfw-example-hosted" TARGET_NAME="fsfw-example-hosted" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="fsfw-example-hosted" RUN_TARGET_NAME="fsfw-example-hosted">
|
||||||
|
<method v="2">
|
||||||
|
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
|
@ -1,7 +0,0 @@
|
||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="fsfw-example-hosted" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="fsfw-example-hosted" TARGET_NAME="fsfw-example-hosted" CONFIG_NAME="Release" RUN_TARGET_PROJECT_NAME="fsfw-example-hosted" RUN_TARGET_NAME="fsfw-example-hosted">
|
|
||||||
<method v="2">
|
|
||||||
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
|
||||||
</method>
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
|
@ -106,10 +106,7 @@ add_subdirectory(${COMMON_PATH})
|
||||||
# ##############################################################################
|
# ##############################################################################
|
||||||
|
|
||||||
# Add libraries for all sources.
|
# Add libraries for all sources.
|
||||||
target_link_libraries(
|
target_link_libraries(${TARGET_NAME} PRIVATE ${LIB_FSFW_NAME} ${LIB_OS_NAME})
|
||||||
${TARGET_NAME} PRIVATE ${LIB_FSFW_NAME} ${LIB_OS_NAME}
|
|
||||||
# ${LIB_FSFW_HAL_NAME}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Add include paths for all sources.
|
# Add include paths for all sources.
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
|
|
22
README.md
22
README.md
|
@ -1,4 +1,4 @@
|
||||||
<img align="center" src="https://egit.irs.uni-stuttgart.de/fsfw/fsfw-example-common/raw/branch/master/doc/images/FSFW_Logo_V3_bw.png" width="50%">
|
<img align="center" src="https://egit.irs.uni-stuttgart.de/fsfw/fsfw/raw/branch/master/misc/logo/FSFW_Logo_V3_bw.png" width="50%">
|
||||||
|
|
||||||
# <a id="top"></a> <a name="linux"></a> FSFW Example Application
|
# <a id="top"></a> <a name="linux"></a> FSFW Example Application
|
||||||
|
|
||||||
|
@ -52,6 +52,11 @@ the host abstraction layer of the FSFW.
|
||||||
This demo provides the opportunity to to test functionality of the
|
This demo provides the opportunity to to test functionality of the
|
||||||
FSFW on a host computer without the need of setting up external embedded hardware.
|
FSFW on a host computer without the need of setting up external embedded hardware.
|
||||||
|
|
||||||
|
After cloning, make sure to clone and initialize the submodules
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git submodule update --init
|
||||||
|
```
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
|
@ -72,16 +77,19 @@ When the software is running, it opens a TCP oder UDP server, depending on the c
|
||||||
on port 7301. You can send PUS telecommands to that port to interactively command the
|
on port 7301. You can send PUS telecommands to that port to interactively command the
|
||||||
software.
|
software.
|
||||||
|
|
||||||
For a quick test, install the `tmtccmd` Python package first and use `py` instead
|
The following steps set up a virtual environment, install all the dependencies, and then use
|
||||||
of `python3` on Windows:
|
the `tmtcc.py` utility to send a ping telecommand to the running OBSW
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd tmtccmd
|
cd tmtc
|
||||||
python3 -m pip install -r requirements.txt
|
python3 -m venv venv
|
||||||
|
cd deps/tmtccmd
|
||||||
|
pip install .[gui]
|
||||||
```
|
```
|
||||||
|
|
||||||
Now you can command the software using the `tmtccli.py` and `tmtcgui.py` command.
|
Now you can command the software using the `tmtcc.py` command for the CLI mode and `tmtcc.py -g`
|
||||||
For example, you can use `tmtccli.py -s 17 -o 0` to send a ping command.
|
for the GUI mode inside the virtual environment. For example, you can use `tmtcc.py -s 17 -o 0`
|
||||||
|
to send a ping command.
|
||||||
|
|
||||||
## <a id="prereqsetup"></a> Setting up Prerequisites
|
## <a id="prereqsetup"></a> Setting up Prerequisites
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,17 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
|
||||||
environment {
|
environment {
|
||||||
BUILDDIR = 'build-Debug'
|
BUILDDIR = 'cmake-build-debug'
|
||||||
|
}
|
||||||
|
agent {
|
||||||
|
docker { image 'fsfw-ci:d3'}
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Create Docker') {
|
stage('Clean') {
|
||||||
agent {
|
|
||||||
dockerfile {
|
|
||||||
dir 'automation'
|
|
||||||
additionalBuildArgs '--no-cache'
|
|
||||||
reuseNode true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
sh 'rm -rf $BUILDDIR'
|
sh 'rm -rf $BUILDDIR'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Configure') {
|
stage('Configure') {
|
||||||
agent {
|
|
||||||
dockerfile {
|
|
||||||
dir 'automation'
|
|
||||||
reuseNode true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
dir(BUILDDIR) {
|
dir(BUILDDIR) {
|
||||||
sh 'cmake -DFSFW_OSAL=host ..'
|
sh 'cmake -DFSFW_OSAL=host ..'
|
||||||
|
@ -30,15 +19,9 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
agent {
|
|
||||||
dockerfile {
|
|
||||||
dir 'automation'
|
|
||||||
reuseNode true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
dir(BUILDDIR) {
|
dir(BUILDDIR) {
|
||||||
sh 'cmake --build . -j'
|
sh 'cmake --build . -j4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <bsp_hosted/fsfwconfig/objects/systemObjectList.h>
|
#include <bsp_hosted/fsfwconfig/objects/systemObjectList.h>
|
||||||
#include <bsp_hosted/fsfwconfig/pollingsequence/pollingSequenceFactory.h>
|
#include <bsp_hosted/fsfwconfig/pollingsequence/pollingSequenceFactory.h>
|
||||||
#include <fsfw/modes/HasModesIF.h>
|
#include <fsfw/modes/HasModesIF.h>
|
||||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
#include <fsfw/retval.h>
|
||||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||||
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||||
#include <fsfw/tasks/PeriodicTaskIF.h>
|
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||||
|
@ -41,18 +41,34 @@ void InitMission::createTasks() {
|
||||||
PeriodicTaskIF* distributerTask = taskFactory->createPeriodicTask(
|
PeriodicTaskIF* distributerTask = taskFactory->createPeriodicTask(
|
||||||
"DIST", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.1, deadlineMissedFunc);
|
"DIST", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.1, deadlineMissedFunc);
|
||||||
ReturnValue_t result = distributerTask->addComponent(objects::CCSDS_DISTRIBUTOR);
|
ReturnValue_t result = distributerTask->addComponent(objects::CCSDS_DISTRIBUTOR);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("CCSDS distributor", objects::CCSDS_DISTRIBUTOR);
|
task::printInitError("CCSDS distributor", objects::CCSDS_DISTRIBUTOR);
|
||||||
}
|
}
|
||||||
result = distributerTask->addComponent(objects::PUS_DISTRIBUTOR);
|
result = distributerTask->addComponent(objects::PUS_DISTRIBUTOR);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("PUS distributor", objects::PUS_DISTRIBUTOR);
|
task::printInitError("PUS distributor", objects::PUS_DISTRIBUTOR);
|
||||||
}
|
}
|
||||||
|
result = distributerTask->addComponent(objects::CFDP_DISTRIBUTOR);
|
||||||
|
if (result != returnvalue::OK) {
|
||||||
|
task::printInitError("CFDP distributor", objects::CFDP_DISTRIBUTOR);
|
||||||
|
}
|
||||||
result = distributerTask->addComponent(objects::TM_FUNNEL);
|
result = distributerTask->addComponent(objects::TM_FUNNEL);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("TM funnel", objects::TM_FUNNEL);
|
task::printInitError("TM funnel", objects::TM_FUNNEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OBSW_ADD_CFDP_COMPONENTS == 1
|
||||||
|
#ifdef __unix__
|
||||||
|
currPrio = 50;
|
||||||
|
#endif
|
||||||
|
PeriodicTaskIF* cfdpTask = taskFactory->createPeriodicTask(
|
||||||
|
"CFDP Handler", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, deadlineMissedFunc);
|
||||||
|
result = cfdpTask->addComponent(objects::CFDP_HANDLER);
|
||||||
|
if (result != returnvalue::OK) {
|
||||||
|
task::printInitError("CFDP Handler", objects::CFDP_HANDLER);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __unix__
|
#ifdef __unix__
|
||||||
currPrio = 50;
|
currPrio = 50;
|
||||||
#endif
|
#endif
|
||||||
|
@ -60,7 +76,7 @@ void InitMission::createTasks() {
|
||||||
PeriodicTaskIF* udpBridgeTask = taskFactory->createPeriodicTask(
|
PeriodicTaskIF* udpBridgeTask = taskFactory->createPeriodicTask(
|
||||||
"TCPIP_TMTC_BRIDGE", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, deadlineMissedFunc);
|
"TCPIP_TMTC_BRIDGE", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, deadlineMissedFunc);
|
||||||
result = udpBridgeTask->addComponent(objects::TCPIP_TMTC_BRIDGE);
|
result = udpBridgeTask->addComponent(objects::TCPIP_TMTC_BRIDGE);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("TMTC bridge", objects::TCPIP_TMTC_BRIDGE);
|
task::printInitError("TMTC bridge", objects::TCPIP_TMTC_BRIDGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +86,7 @@ void InitMission::createTasks() {
|
||||||
PeriodicTaskIF* udpPollingTask = taskFactory->createPeriodicTask(
|
PeriodicTaskIF* udpPollingTask = taskFactory->createPeriodicTask(
|
||||||
"TMTC_POLLING", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc);
|
"TMTC_POLLING", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc);
|
||||||
result = udpPollingTask->addComponent(objects::TCPIP_TMTC_POLLING_TASK);
|
result = udpPollingTask->addComponent(objects::TCPIP_TMTC_POLLING_TASK);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("TMTC polling", objects::TCPIP_TMTC_POLLING_TASK);
|
task::printInitError("TMTC polling", objects::TCPIP_TMTC_POLLING_TASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +96,7 @@ void InitMission::createTasks() {
|
||||||
PeriodicTaskIF* eventTask = taskFactory->createPeriodicTask(
|
PeriodicTaskIF* eventTask = taskFactory->createPeriodicTask(
|
||||||
"EVENT", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.100, deadlineMissedFunc);
|
"EVENT", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.100, deadlineMissedFunc);
|
||||||
result = eventTask->addComponent(objects::EVENT_MANAGER);
|
result = eventTask->addComponent(objects::EVENT_MANAGER);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("Event Manager", objects::EVENT_MANAGER);
|
task::printInitError("Event Manager", objects::EVENT_MANAGER);
|
||||||
}
|
}
|
||||||
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
|
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
|
||||||
|
@ -93,7 +109,7 @@ void InitMission::createTasks() {
|
||||||
FixedTimeslotTaskIF* timeslotDemoTask = taskFactory->createFixedTimeslotTask(
|
FixedTimeslotTaskIF* timeslotDemoTask = taskFactory->createFixedTimeslotTask(
|
||||||
"PST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, deadlineMissedFunc);
|
"PST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, deadlineMissedFunc);
|
||||||
result = pst::pollingSequenceExamples(timeslotDemoTask);
|
result = pst::pollingSequenceExamples(timeslotDemoTask);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "InitMission::createTasks: Timeslot demo task initialization failed!"
|
sif::error << "InitMission::createTasks: Timeslot demo task initialization failed!"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
@ -108,7 +124,7 @@ void InitMission::createTasks() {
|
||||||
PeriodicTaskIF* readerTask = taskFactory->createPeriodicTask(
|
PeriodicTaskIF* readerTask = taskFactory->createPeriodicTask(
|
||||||
"READER_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, deadlineMissedFunc);
|
"READER_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, deadlineMissedFunc);
|
||||||
result = readerTask->addComponent(objects::TEST_DUMMY_4);
|
result = readerTask->addComponent(objects::TEST_DUMMY_4);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("Dummy 4", objects::TEST_DUMMY_4);
|
task::printInitError("Dummy 4", objects::TEST_DUMMY_4);
|
||||||
}
|
}
|
||||||
#endif /* OBSW_ADD_TASK_EXAMPLE == 1 */
|
#endif /* OBSW_ADD_TASK_EXAMPLE == 1 */
|
||||||
|
@ -121,7 +137,7 @@ void InitMission::createTasks() {
|
||||||
PeriodicTaskIF* pusVerification = taskFactory->createPeriodicTask(
|
PeriodicTaskIF* pusVerification = taskFactory->createPeriodicTask(
|
||||||
"PUS_VERIF_1", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, deadlineMissedFunc);
|
"PUS_VERIF_1", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, deadlineMissedFunc);
|
||||||
result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
|
result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("PUS 1", objects::PUS_SERVICE_1_VERIFICATION);
|
task::printInitError("PUS 1", objects::PUS_SERVICE_1_VERIFICATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,15 +147,15 @@ void InitMission::createTasks() {
|
||||||
PeriodicTaskIF* pusHighPrio = taskFactory->createPeriodicTask(
|
PeriodicTaskIF* pusHighPrio = taskFactory->createPeriodicTask(
|
||||||
"PUS_HIGH_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, deadlineMissedFunc);
|
"PUS_HIGH_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, deadlineMissedFunc);
|
||||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("PUS 2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
task::printInitError("PUS 2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||||
}
|
}
|
||||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
result = pusHighPrio->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("PUS 5", objects::PUS_SERVICE_5_EVENT_REPORTING);
|
task::printInitError("PUS 5", objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||||
}
|
}
|
||||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
|
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("PUS 9", objects::PUS_SERVICE_9_TIME_MGMT);
|
task::printInitError("PUS 9", objects::PUS_SERVICE_9_TIME_MGMT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,23 +165,23 @@ void InitMission::createTasks() {
|
||||||
PeriodicTaskIF* pusMedPrio = taskFactory->createPeriodicTask(
|
PeriodicTaskIF* pusMedPrio = taskFactory->createPeriodicTask(
|
||||||
"PUS_MED_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.6, deadlineMissedFunc);
|
"PUS_MED_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.6, deadlineMissedFunc);
|
||||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("PUS 3", objects::PUS_SERVICE_3_HOUSEKEEPING);
|
task::printInitError("PUS 3", objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||||
}
|
}
|
||||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("PUS 8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
task::printInitError("PUS 8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||||
}
|
}
|
||||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("PUS 20", objects::PUS_SERVICE_20_PARAMETERS);
|
task::printInitError("PUS 20", objects::PUS_SERVICE_20_PARAMETERS);
|
||||||
}
|
}
|
||||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("PUS 200", objects::PUS_SERVICE_200_MODE_MGMT);
|
task::printInitError("PUS 200", objects::PUS_SERVICE_200_MODE_MGMT);
|
||||||
}
|
}
|
||||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_11_TC_SCHEDULER);
|
result = pusMedPrio->addComponent(objects::PUS_SERVICE_11_TC_SCHEDULER);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("PUS 11", objects::PUS_SERVICE_11_TC_SCHEDULER);
|
task::printInitError("PUS 11", objects::PUS_SERVICE_11_TC_SCHEDULER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +191,7 @@ void InitMission::createTasks() {
|
||||||
PeriodicTaskIF* pusLowPrio = taskFactory->createPeriodicTask(
|
PeriodicTaskIF* pusLowPrio = taskFactory->createPeriodicTask(
|
||||||
"PUS_LOW_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.2, deadlineMissedFunc);
|
"PUS_LOW_PRIO", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.2, deadlineMissedFunc);
|
||||||
result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
|
result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("PUS 17", objects::PUS_SERVICE_17_TEST);
|
task::printInitError("PUS 17", objects::PUS_SERVICE_17_TEST);
|
||||||
}
|
}
|
||||||
#endif /* OBSW_ADD_PUS_STACK == 1 */
|
#endif /* OBSW_ADD_PUS_STACK == 1 */
|
||||||
|
@ -190,7 +206,7 @@ void InitMission::createTasks() {
|
||||||
FixedTimeslotTaskIF* testDevicesTimeslotTask = taskFactory->createFixedTimeslotTask(
|
FixedTimeslotTaskIF* testDevicesTimeslotTask = taskFactory->createFixedTimeslotTask(
|
||||||
"PST_TEST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc);
|
"PST_TEST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, deadlineMissedFunc);
|
||||||
result = pst::pollingSequenceDevices(testDevicesTimeslotTask);
|
result = pst::pollingSequenceDevices(testDevicesTimeslotTask);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "InitMission::createTasks: Test PST initialization failed!" << std::endl;
|
sif::error << "InitMission::createTasks: Test PST initialization failed!" << std::endl;
|
||||||
#else
|
#else
|
||||||
|
@ -208,7 +224,7 @@ void InitMission::createTasks() {
|
||||||
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
|
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
|
||||||
}
|
}
|
||||||
result = assemblyTask->addComponent(objects::TEST_ASSEMBLY);
|
result = assemblyTask->addComponent(objects::TEST_ASSEMBLY);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
|
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
|
||||||
}
|
}
|
||||||
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */
|
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */
|
||||||
|
@ -220,7 +236,7 @@ void InitMission::createTasks() {
|
||||||
PeriodicTaskIF* controllerTask = taskFactory->createPeriodicTask(
|
PeriodicTaskIF* controllerTask = taskFactory->createPeriodicTask(
|
||||||
"TEST_CTRL", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, deadlineMissedFunc);
|
"TEST_CTRL", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, deadlineMissedFunc);
|
||||||
result = controllerTask->addComponent(objects::TEST_CONTROLLER);
|
result = controllerTask->addComponent(objects::TEST_CONTROLLER);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("Controller Task", objects::TEST_CONTROLLER);
|
task::printInitError("Controller Task", objects::TEST_CONTROLLER);
|
||||||
}
|
}
|
||||||
#endif /* OBSW_ADD_CONTROLLER_DEMO == 1 */
|
#endif /* OBSW_ADD_CONTROLLER_DEMO == 1 */
|
||||||
|
@ -230,7 +246,7 @@ void InitMission::createTasks() {
|
||||||
PeriodicTaskIF* testTask = TaskFactory::instance()->createPeriodicTask(
|
PeriodicTaskIF* testTask = TaskFactory::instance()->createPeriodicTask(
|
||||||
"TEST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, deadlineMissedFunc);
|
"TEST_TASK", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, deadlineMissedFunc);
|
||||||
result = testTask->addComponent(objects::TEST_TASK);
|
result = testTask->addComponent(objects::TEST_TASK);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
task::printInitError("Test Task", objects::TEST_TASK);
|
task::printInitError("Test Task", objects::TEST_TASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,6 +263,10 @@ void InitMission::createTasks() {
|
||||||
eventTask->startTask();
|
eventTask->startTask();
|
||||||
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
|
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
|
||||||
|
|
||||||
|
#if OBSW_ADD_CFDP_COMPONENTS == 1
|
||||||
|
cfdpTask->startTask();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if OBSW_ADD_PUS_STACK == 1
|
#if OBSW_ADD_PUS_STACK == 1
|
||||||
pusVerification->startTask();
|
pusVerification->startTask();
|
||||||
pusHighPrio->startTask();
|
pusHighPrio->startTask();
|
||||||
|
|
|
@ -2,13 +2,14 @@
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
#include "bsp_hosted/fsfwconfig/objects/systemObjectList.h"
|
#include "bsp_hosted/fsfwconfig/objects/systemObjectList.h"
|
||||||
#include "bsp_hosted/fsfwconfig/tmtc/apid.h"
|
|
||||||
#include "commonConfig.h"
|
#include "commonConfig.h"
|
||||||
#include "example/core/GenericFactory.h"
|
#include "example/core/GenericFactory.h"
|
||||||
#include "example/test/FsfwTestTask.h"
|
#include "example/test/FsfwTestTask.h"
|
||||||
#include "example/utility/TmFunnel.h"
|
#include "example/utility/TmFunnel.h"
|
||||||
#include "fsfw/storagemanager/PoolManager.h"
|
#include "fsfw/storagemanager/PoolManager.h"
|
||||||
|
#include "fsfw/tcdistribution/CcsdsDistributor.h"
|
||||||
#include "fsfw/tmtcservices/CommandingServiceBase.h"
|
#include "fsfw/tmtcservices/CommandingServiceBase.h"
|
||||||
|
#include "fsfw_hal/host/HostFilesystem.h"
|
||||||
|
|
||||||
#if OBSW_USE_TCP_SERVER == 0
|
#if OBSW_USE_TCP_SERVER == 0
|
||||||
#include <fsfw/osal/common/UdpTcPollingTask.h>
|
#include <fsfw/osal/common/UdpTcPollingTask.h>
|
||||||
|
@ -18,28 +19,41 @@
|
||||||
#include "fsfw/osal/common/TcpTmTcServer.h"
|
#include "fsfw/osal/common/TcpTmTcServer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if OBSW_ADD_CFDP_COMPONENTS == 1
|
||||||
|
// These CFDP containers are user supplied because their size might differ depending on
|
||||||
|
// which system the example is run on
|
||||||
|
namespace cfdp {
|
||||||
|
PacketInfoList<128> PACKET_INFO;
|
||||||
|
PacketInfoListBase* PACKET_LIST_PTR = &PACKET_INFO;
|
||||||
|
LostSegmentsList<128> LOST_SEGMENTS;
|
||||||
|
LostSegmentsListBase* LOST_SEGMENTS_PTR = &LOST_SEGMENTS;
|
||||||
|
} // namespace cfdp
|
||||||
|
#endif
|
||||||
|
|
||||||
void ObjectFactory::produce(void* args) {
|
void ObjectFactory::produce(void* args) {
|
||||||
Factory::setStaticFrameworkObjectIds();
|
Factory::setStaticFrameworkObjectIds();
|
||||||
|
StorageManagerIF* tcStore;
|
||||||
|
StorageManagerIF* tmStore;
|
||||||
#if OBSW_ADD_CORE_COMPONENTS == 1
|
#if OBSW_ADD_CORE_COMPONENTS == 1
|
||||||
{
|
{
|
||||||
LocalPool::LocalPoolConfig poolCfg = {{16, 100}, {32, 50}, {64, 40},
|
LocalPool::LocalPoolConfig poolCfg = {{100, 16}, {50, 32}, {40, 64},
|
||||||
{128, 30}, {1024, 20}, {2048, 10}};
|
{30, 128}, {20, 1024}, {10, 2048}};
|
||||||
new PoolManager(objects::TC_STORE, poolCfg);
|
tcStore = new PoolManager(objects::TC_STORE, poolCfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
LocalPool::LocalPoolConfig poolCfg = {{16, 100}, {32, 50}, {64, 40},
|
LocalPool::LocalPoolConfig poolCfg = {{100, 16}, {50, 32}, {40, 64},
|
||||||
{128, 30}, {1024, 20}, {2048, 10}};
|
{30, 128}, {20, 1024}, {10, 2048}};
|
||||||
new PoolManager(objects::TM_STORE, poolCfg);
|
tmStore = new PoolManager(objects::TM_STORE, poolCfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
LocalPool::LocalPoolConfig poolCfg = {{16, 100}, {32, 50}, {64, 40},
|
LocalPool::LocalPoolConfig poolCfg = {{100, 16}, {50, 32}, {40, 64},
|
||||||
{128, 30}, {1024, 20}, {2048, 10}};
|
{30, 128}, {20, 1024}, {10, 2048}};
|
||||||
new PoolManager(objects::IPC_STORE, poolCfg);
|
new PoolManager(objects::IPC_STORE, poolCfg);
|
||||||
}
|
}
|
||||||
ObjectFactory::produceGenericObjects();
|
PusTmFunnel* funnel;
|
||||||
|
CcsdsDistributor* ccsdsDistrib;
|
||||||
// TMTC Reception via TCP/IP socket
|
// TMTC Reception via TCP/IP socket
|
||||||
#if OBSW_USE_TCP_SERVER == 0
|
#if OBSW_USE_TCP_SERVER == 0
|
||||||
auto tmtcBridge = new UdpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR);
|
auto tmtcBridge = new UdpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR);
|
||||||
|
@ -51,7 +65,9 @@ void ObjectFactory::produce(void* args) {
|
||||||
tmtcBridge->setMaxNumberOfPacketsStored(50);
|
tmtcBridge->setMaxNumberOfPacketsStored(50);
|
||||||
auto tmtcServer = new TcpTmTcServer(objects::TCPIP_TMTC_POLLING_TASK, objects::TCPIP_TMTC_BRIDGE);
|
auto tmtcServer = new TcpTmTcServer(objects::TCPIP_TMTC_POLLING_TASK, objects::TCPIP_TMTC_BRIDGE);
|
||||||
sif::info << "Opening TCP TMTC server on port " << tmtcServer->getTcpPort() << std::endl;
|
sif::info << "Opening TCP TMTC server on port " << tmtcServer->getTcpPort() << std::endl;
|
||||||
|
// TODO: Set the set of valid space packet IDs. Otherwise, parsing might fail
|
||||||
#endif
|
#endif
|
||||||
|
ObjectFactory::produceGenericObjects(&funnel, *tmtcBridge, &ccsdsDistrib, *tcStore, *tmStore);
|
||||||
|
|
||||||
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
|
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#define OBSW_TASK_PERIODIC_EVENT 0
|
#define OBSW_TASK_PERIODIC_EVENT 0
|
||||||
// Use a TCP server instead of a UDP server for TMTC reception
|
// Use a TCP server instead of a UDP server for TMTC reception
|
||||||
#define OBSW_USE_TCP_SERVER 1
|
#define OBSW_USE_TCP_SERVER 0
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#ifndef FSFW_EXAMPLE_HOSTED_DEFINITIONS_H
|
||||||
|
#define FSFW_EXAMPLE_HOSTED_DEFINITIONS_H
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
namespace cfg {
|
||||||
|
static constexpr uint32_t OBSW_MAX_SCHEDULED_TCS = 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // FSFW_EXAMPLE_HOSTED_DEFINITIONS_H
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief Auto-generated event translation file. Contains 78 translations.
|
* @brief Auto-generated event translation file. Contains 79 translations.
|
||||||
* @details
|
* @details
|
||||||
* Generated on: 2022-05-20 09:11:07
|
* Generated on: 2022-07-27 19:41:37
|
||||||
*/
|
*/
|
||||||
#include "translateEvents.h"
|
#include "translateEvents.h"
|
||||||
|
|
||||||
|
@ -81,6 +81,7 @@ const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST";
|
||||||
const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED";
|
const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED";
|
||||||
const char *CLOCK_SET_STRING = "CLOCK_SET";
|
const char *CLOCK_SET_STRING = "CLOCK_SET";
|
||||||
const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE";
|
const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE";
|
||||||
|
const char *TC_DELETION_FAILED_STRING = "TC_DELETION_FAILED";
|
||||||
const char *TEST_STRING = "TEST";
|
const char *TEST_STRING = "TEST";
|
||||||
const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER";
|
const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER";
|
||||||
|
|
||||||
|
@ -238,6 +239,8 @@ const char *translateEvents(Event event) {
|
||||||
return CLOCK_SET_STRING;
|
return CLOCK_SET_STRING;
|
||||||
case (8901):
|
case (8901):
|
||||||
return CLOCK_SET_FAILURE_STRING;
|
return CLOCK_SET_FAILURE_STRING;
|
||||||
|
case (9100):
|
||||||
|
return TC_DELETION_FAILED_STRING;
|
||||||
case (9700):
|
case (9700):
|
||||||
return TEST_STRING;
|
return TEST_STRING;
|
||||||
case (10600):
|
case (10600):
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/**
|
/**
|
||||||
* @brief Auto-generated object translation file.
|
* @brief Auto-generated object translation file.
|
||||||
* @details
|
* @details
|
||||||
* Contains 39 translations.
|
* Contains 40 translations.
|
||||||
* Generated on: 2022-05-20 09:16:37
|
* Generated on: 2022-07-27 19:41:37
|
||||||
*/
|
*/
|
||||||
#include "translateObjects.h"
|
#include "translateObjects.h"
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ const char *TC_STORE_STRING = "TC_STORE";
|
||||||
const char *TM_STORE_STRING = "TM_STORE";
|
const char *TM_STORE_STRING = "TM_STORE";
|
||||||
const char *IPC_STORE_STRING = "IPC_STORE";
|
const char *IPC_STORE_STRING = "IPC_STORE";
|
||||||
const char *TIME_STAMPER_STRING = "TIME_STAMPER";
|
const char *TIME_STAMPER_STRING = "TIME_STAMPER";
|
||||||
|
const char *TC_VERIFICATOR_STRING = "TC_VERIFICATOR";
|
||||||
const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
|
const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
|
||||||
const char *TCPIP_TMTC_BRIDGE_STRING = "TCPIP_TMTC_BRIDGE";
|
const char *TCPIP_TMTC_BRIDGE_STRING = "TCPIP_TMTC_BRIDGE";
|
||||||
const char *TCPIP_TMTC_POLLING_TASK_STRING = "TCPIP_TMTC_POLLING_TASK";
|
const char *TCPIP_TMTC_POLLING_TASK_STRING = "TCPIP_TMTC_POLLING_TASK";
|
||||||
|
@ -100,6 +101,8 @@ const char *translateObject(object_id_t object) {
|
||||||
return IPC_STORE_STRING;
|
return IPC_STORE_STRING;
|
||||||
case 0x53500010:
|
case 0x53500010:
|
||||||
return TIME_STAMPER_STRING;
|
return TIME_STAMPER_STRING;
|
||||||
|
case 0x53500020:
|
||||||
|
return TC_VERIFICATOR_STRING;
|
||||||
case 0x53ffffff:
|
case 0x53ffffff:
|
||||||
return FSFW_OBJECTS_END_STRING;
|
return FSFW_OBJECTS_END_STRING;
|
||||||
case 0x62000300:
|
case 0x62000300:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_
|
#ifndef POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_
|
||||||
#define POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_
|
#define POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_
|
||||||
|
|
||||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
#include <fsfw/retval.h>
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
#ifndef FSFWCONFIG_TMTC_APID_H_
|
|
||||||
#define FSFWCONFIG_TMTC_APID_H_
|
|
||||||
|
|
||||||
#include <commonConfig.h>
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
namespace apid {
|
|
||||||
static const uint16_t APID = COMMON_APID;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* FSFWCONFIG_TMTC_APID_H_ */
|
|
|
@ -20,27 +20,40 @@ def main():
|
||||||
print("-- Python CMake build configurator utility --")
|
print("-- Python CMake build configurator utility --")
|
||||||
|
|
||||||
print("Parsing command line arguments..")
|
print("Parsing command line arguments..")
|
||||||
parser = argparse.ArgumentParser(description="Processing arguments for CMake build configuration.")
|
parser = argparse.ArgumentParser(
|
||||||
parser.add_argument(
|
description="Processing arguments for CMake build configuration."
|
||||||
"-o", "--osal", type=str, choices=["freertos", "linux", "rtems", "host"],
|
|
||||||
help="FSFW OSAL. Valid arguments: host, linux, rtems, freertos"
|
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-b", "--buildtype", type=str, choices=["debug", "release", "size", "reldeb"],
|
"-o",
|
||||||
help="CMake build type. Valid arguments: debug, release, size, reldeb (Release with Debug Information)",
|
"--osal",
|
||||||
default="debug"
|
type=str,
|
||||||
|
choices=["freertos", "linux", "rtems", "host"],
|
||||||
|
help="FSFW OSAL. Valid arguments: host, linux, rtems, freertos",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"-b",
|
||||||
|
"--buildtype",
|
||||||
|
type=str,
|
||||||
|
choices=["debug", "release", "size", "reldeb"],
|
||||||
|
help="CMake build type. Valid arguments: debug, release, size, reldeb (Release with Debug Information)",
|
||||||
|
default="debug",
|
||||||
)
|
)
|
||||||
parser.add_argument("-l", "--builddir", type=str, help="Specify build directory.")
|
parser.add_argument("-l", "--builddir", type=str, help="Specify build directory.")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-g", "--generator", type=str, help="CMake Generator", choices=["make", "ninja"]
|
"-g", "--generator", type=str, help="CMake Generator", choices=["make", "ninja"]
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-t", "--target-bsp", type=str, help="Target BSP, combination of architecture and machine"
|
"-t",
|
||||||
|
"--target-bsp",
|
||||||
|
type=str,
|
||||||
|
help="Target BSP, combination of architecture and machine",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-d", "--defines",
|
"-d",
|
||||||
|
"--defines",
|
||||||
help="Additional custom defines passed to CMake (supply without -D prefix!)",
|
help="Additional custom defines passed to CMake (supply without -D prefix!)",
|
||||||
nargs="*", type=str
|
nargs="*",
|
||||||
|
type=str,
|
||||||
)
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
@ -53,15 +66,15 @@ def main():
|
||||||
|
|
||||||
if args.generator is None:
|
if args.generator is None:
|
||||||
generator = determine_build_generator()
|
generator = determine_build_generator()
|
||||||
generator_cmake_arg = f"-G \"{generator}\""
|
generator_cmake_arg = f'-G "{generator}"'
|
||||||
else:
|
else:
|
||||||
if args.generator == "make":
|
if args.generator == "make":
|
||||||
if os.name == 'nt':
|
if os.name == "nt":
|
||||||
generator_cmake_arg = '-G "MinGW Makefiles"'
|
generator_cmake_arg = '-G "MinGW Makefiles"'
|
||||||
else:
|
else:
|
||||||
generator_cmake_arg = '-G "Unix Makefiles"'
|
generator_cmake_arg = '-G "Unix Makefiles"'
|
||||||
elif args.generator == 'ninja':
|
elif args.generator == "ninja":
|
||||||
generator_cmake_arg = '-G Ninja'
|
generator_cmake_arg = "-G Ninja"
|
||||||
else:
|
else:
|
||||||
generator_cmake_arg = args.generator
|
generator_cmake_arg = args.generator
|
||||||
|
|
||||||
|
@ -73,14 +86,14 @@ def main():
|
||||||
|
|
||||||
cmake_build_type = determine_build_type(args.buildtype)
|
cmake_build_type = determine_build_type(args.buildtype)
|
||||||
|
|
||||||
cmake_target_cfg_cmd = ''
|
cmake_target_cfg_cmd = ""
|
||||||
|
|
||||||
define_string = ""
|
define_string = ""
|
||||||
if args.defines is not None:
|
if args.defines is not None:
|
||||||
define_list = args.defines[0].split()
|
define_list = args.defines[0].split()
|
||||||
for define in define_list:
|
for define in define_list:
|
||||||
define_string += f"-D{define} "
|
define_string += f"-D{define} "
|
||||||
|
|
||||||
if args.builddir is None:
|
if args.builddir is None:
|
||||||
cmake_build_folder = determine_build_folder(cmake_build_type)
|
cmake_build_folder = determine_build_folder(cmake_build_type)
|
||||||
else:
|
else:
|
||||||
|
@ -88,8 +101,10 @@ def main():
|
||||||
|
|
||||||
build_path = source_location + os.path.sep + cmake_build_folder
|
build_path = source_location + os.path.sep + cmake_build_folder
|
||||||
if os.path.isdir(build_path):
|
if os.path.isdir(build_path):
|
||||||
remove_old_dir = input(f"{cmake_build_folder} folder already exists. "
|
remove_old_dir = input(
|
||||||
f"Remove old directory? [y/n]: ")
|
f"{cmake_build_folder} folder already exists. "
|
||||||
|
f"Remove old directory? [y/n]: "
|
||||||
|
)
|
||||||
if str(remove_old_dir).lower() in ["yes", "y", 1]:
|
if str(remove_old_dir).lower() in ["yes", "y", 1]:
|
||||||
remove_old_dir = True
|
remove_old_dir = True
|
||||||
else:
|
else:
|
||||||
|
@ -108,11 +123,13 @@ def main():
|
||||||
print(f"Navigating into build directory: {build_path}")
|
print(f"Navigating into build directory: {build_path}")
|
||||||
os.chdir(cmake_build_folder)
|
os.chdir(cmake_build_folder)
|
||||||
|
|
||||||
cmake_command = f"cmake {generator_cmake_arg} -DFSFW_OSAL=\"{cmake_fsfw_osal}\" " \
|
cmake_command = (
|
||||||
f"-DCMAKE_BUILD_TYPE=\"{cmake_build_type}\" {cmake_target_cfg_cmd} " \
|
f'cmake {generator_cmake_arg} -DFSFW_OSAL="{cmake_fsfw_osal}" '
|
||||||
f"{define_string} {source_location}"
|
f'-DCMAKE_BUILD_TYPE="{cmake_build_type}" {cmake_target_cfg_cmd} '
|
||||||
|
f"{define_string} {source_location}"
|
||||||
|
)
|
||||||
# Remove redundant spaces
|
# Remove redundant spaces
|
||||||
cmake_command = ' '.join(cmake_command.split())
|
cmake_command = " ".join(cmake_command.split())
|
||||||
print("Running CMake command (without +): ")
|
print("Running CMake command (without +): ")
|
||||||
print(f"+ {cmake_command}")
|
print(f"+ {cmake_command}")
|
||||||
os.system(cmake_command)
|
os.system(cmake_command)
|
||||||
|
@ -121,8 +138,10 @@ def main():
|
||||||
|
|
||||||
def determine_build_generator() -> str:
|
def determine_build_generator() -> str:
|
||||||
print("No generator specified. ")
|
print("No generator specified. ")
|
||||||
print("Please select from the following list of build types or type "
|
print(
|
||||||
"in desired system directly [h for help]: ")
|
"Please select from the following list of build types or type "
|
||||||
|
"in desired system directly [h for help]: "
|
||||||
|
)
|
||||||
while True:
|
while True:
|
||||||
user_input = input("Enter your selection: ")
|
user_input = input("Enter your selection: ")
|
||||||
if user_input == "h":
|
if user_input == "h":
|
||||||
|
@ -136,11 +155,15 @@ def determine_build_generator() -> str:
|
||||||
|
|
||||||
|
|
||||||
def determine_build_folder(cmake_build_type: str) -> str:
|
def determine_build_folder(cmake_build_type: str) -> str:
|
||||||
confirm = input(f"No build folder specified. Set to build type name {cmake_build_type}? [y/n]: ")
|
confirm = input(
|
||||||
|
f"No build folder specified. Set to build type name {cmake_build_type}? [y/n]: "
|
||||||
|
)
|
||||||
if confirm in ["yes", "y", 1]:
|
if confirm in ["yes", "y", 1]:
|
||||||
return cmake_build_type
|
return cmake_build_type
|
||||||
else:
|
else:
|
||||||
new_folder_name = input("Please enter folder name, will be created in source folder: ")
|
new_folder_name = input(
|
||||||
|
"Please enter folder name, will be created in source folder: "
|
||||||
|
)
|
||||||
return new_folder_name
|
return new_folder_name
|
||||||
|
|
||||||
|
|
||||||
|
@ -150,19 +173,18 @@ def determine_source_location() -> str:
|
||||||
index += 1
|
index += 1
|
||||||
os.chdir("..")
|
os.chdir("..")
|
||||||
if index >= 5:
|
if index >= 5:
|
||||||
print("Error: Could not find source directory (determined by looking for fsfw folder!)")
|
print(
|
||||||
|
"Error: Could not find source directory (determined by looking for fsfw folder!)"
|
||||||
|
)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
return os.getcwd()
|
return os.getcwd()
|
||||||
|
|
||||||
|
|
||||||
def determine_fsfw_osal() -> str:
|
def determine_fsfw_osal() -> str:
|
||||||
select_dict = dict({
|
select_dict = dict({1: "host", 2: "linux", 3: "freertos", 4: "rtems"})
|
||||||
1: "host",
|
print(
|
||||||
2: "linux",
|
"No build type specified. Please select from the following list of build types: "
|
||||||
3: "freertos",
|
)
|
||||||
4: "rtems"
|
|
||||||
})
|
|
||||||
print("No build type specified. Please select from the following list of build types: ")
|
|
||||||
for key, item in select_dict.items():
|
for key, item in select_dict.items():
|
||||||
print(f"{key}: {item}")
|
print(f"{key}: {item}")
|
||||||
select = input("Enter your selection: ")
|
select = input("Enter your selection: ")
|
||||||
|
@ -179,13 +201,12 @@ def determine_fsfw_osal() -> str:
|
||||||
|
|
||||||
def determine_build_type(build_type_arg) -> str:
|
def determine_build_type(build_type_arg) -> str:
|
||||||
if build_type_arg is None:
|
if build_type_arg is None:
|
||||||
select_dict = dict({
|
select_dict = dict(
|
||||||
1: "Debug",
|
{1: "Debug", 2: "Release", 3: "Release with Debug Information", 4: "Size"}
|
||||||
2: "Release",
|
)
|
||||||
3: "Release with Debug Information",
|
print(
|
||||||
4: "Size"
|
"No build type specified. Please select from the following list of build types"
|
||||||
})
|
)
|
||||||
print("No build type specified. Please select from the following list of build types")
|
|
||||||
for key, item in select_dict.items():
|
for key, item in select_dict.items():
|
||||||
print(f"{key}: {item}")
|
print(f"{key}: {item}")
|
||||||
select = input("Enter your selection: ")
|
select = input("Enter your selection: ")
|
||||||
|
@ -229,11 +250,10 @@ def determine_tgt_bsp(osal: str) -> str:
|
||||||
print("Target BSP set to arm/stm32h743zi-nucleo")
|
print("Target BSP set to arm/stm32h743zi-nucleo")
|
||||||
osal = "arm/stm32h743zi-nucleo"
|
osal = "arm/stm32h743zi-nucleo"
|
||||||
elif osal == "linux":
|
elif osal == "linux":
|
||||||
print("No target BSP specified. Please select from the following list of build types.")
|
print(
|
||||||
select_dict = dict({
|
"No target BSP specified. Please select from the following list of build types."
|
||||||
1: "arm/raspberrypi",
|
)
|
||||||
2: "none/hosted"
|
select_dict = dict({1: "arm/raspberrypi", 2: "none/hosted"})
|
||||||
})
|
|
||||||
for key, item in select_dict.items():
|
for key, item in select_dict.items():
|
||||||
print(f"{key}: {item}")
|
print(f"{key}: {item}")
|
||||||
select = input("Enter your selection: ")
|
select = input("Enter your selection: ")
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 8203995deb087c0a51ce7ec7fdc0f0f4f21d06ce
|
Subproject commit 5b2af728fdabdd8be6b802e022806f03f3d2a959
|
2
fsfw
2
fsfw
|
@ -1 +1 @@
|
||||||
Subproject commit f7cde800880f17bcfbed77aa4cd66fcb2a9b1ee3
|
Subproject commit bf311757a2fefd66955c9450a4377934b57be411
|
|
@ -11,11 +11,20 @@ from fsfwgen.parserbase.parser import FileParser
|
||||||
from fsfwgen.utility.csv_writer import CsvWriter
|
from fsfwgen.utility.csv_writer import CsvWriter
|
||||||
from fsfwgen.utility.printer import Printer
|
from fsfwgen.utility.printer import Printer
|
||||||
|
|
||||||
PACKET_CONTENT_DEFINITION_DESTINATION = ["../../mission/pus/servicepackets/",
|
PACKET_CONTENT_DEFINITION_DESTINATION = [
|
||||||
"../../fsfw/pus/servicepackets/"]
|
"../../mission/pus/servicepackets/",
|
||||||
|
"../../fsfw/pus/servicepackets/",
|
||||||
|
]
|
||||||
PACKET_CONTENT_CSV_NAME = "mib_packet_data_content.csv"
|
PACKET_CONTENT_CSV_NAME = "mib_packet_data_content.csv"
|
||||||
PACKET_CONTENT_HEADER_COLUMN = ["Service", "Subservice", "Packet Name", "Datatype", "Name",
|
PACKET_CONTENT_HEADER_COLUMN = [
|
||||||
"Size [Bytes]", "Comment"]
|
"Service",
|
||||||
|
"Subservice",
|
||||||
|
"Packet Name",
|
||||||
|
"Datatype",
|
||||||
|
"Name",
|
||||||
|
"Size [Bytes]",
|
||||||
|
"Comment",
|
||||||
|
]
|
||||||
|
|
||||||
SQL_DELETE_PACKET_DATA_CONTENT_CMD = """
|
SQL_DELETE_PACKET_DATA_CONTENT_CMD = """
|
||||||
DROP TABLE IF EXISTS PacketContent;
|
DROP TABLE IF EXISTS PacketContent;
|
||||||
|
@ -43,12 +52,17 @@ VALUES(?,?,?,?,?,?,?)
|
||||||
def main():
|
def main():
|
||||||
print("PacketContentParser: Parsing for header files.")
|
print("PacketContentParser: Parsing for header files.")
|
||||||
header_file_parser = FileListParser(PACKET_CONTENT_DEFINITION_DESTINATION)
|
header_file_parser = FileListParser(PACKET_CONTENT_DEFINITION_DESTINATION)
|
||||||
header_file_list = header_file_parser.parse_header_files(False, "Parsing packet data files: ")
|
header_file_list = header_file_parser.parse_header_files(
|
||||||
|
False, "Parsing packet data files: "
|
||||||
|
)
|
||||||
packet_content_parser = PacketContentParser(header_file_list)
|
packet_content_parser = PacketContentParser(header_file_list)
|
||||||
subservice_table = packet_content_parser.parse_files(True)
|
subservice_table = packet_content_parser.parse_files(True)
|
||||||
Printer.print_content(subservice_table, "PacketContentParser: Printing packet data table:")
|
Printer.print_content(
|
||||||
subservice_writer = CsvWriter(PACKET_CONTENT_CSV_NAME,
|
subservice_table, "PacketContentParser: Printing packet data table:"
|
||||||
subservice_table, PACKET_CONTENT_HEADER_COLUMN)
|
)
|
||||||
|
subservice_writer = CsvWriter(
|
||||||
|
PACKET_CONTENT_CSV_NAME, subservice_table, PACKET_CONTENT_HEADER_COLUMN
|
||||||
|
)
|
||||||
subservice_writer.write_to_csv()
|
subservice_writer.write_to_csv()
|
||||||
subservice_writer.move_csv("..")
|
subservice_writer.move_csv("..")
|
||||||
|
|
||||||
|
@ -67,7 +81,7 @@ class PacketContentParser(FileParser):
|
||||||
self.commentColumn = 6
|
self.commentColumn = 6
|
||||||
self.lastEntryColumn = 7
|
self.lastEntryColumn = 7
|
||||||
self.columnListLength = 8
|
self.columnListLength = 8
|
||||||
self.dictEntryList = list(range(self.columnListLength-1))
|
self.dictEntryList = list(range(self.columnListLength - 1))
|
||||||
|
|
||||||
self.datatypeMatch = False
|
self.datatypeMatch = False
|
||||||
self.ignoreFlag = False
|
self.ignoreFlag = False
|
||||||
|
@ -78,7 +92,9 @@ class PacketContentParser(FileParser):
|
||||||
self_print_parsing_info = args[0]
|
self_print_parsing_info = args[0]
|
||||||
|
|
||||||
# Read service from file name
|
# Read service from file name
|
||||||
self.dictEntryList[self.serviceColumn] = re.search('[0-9]{1,3}', file_name).group(0)
|
self.dictEntryList[self.serviceColumn] = re.search(
|
||||||
|
"[0-9]{1,3}", file_name
|
||||||
|
).group(0)
|
||||||
self.dictEntryList[self.subserviceColumn] = " "
|
self.dictEntryList[self.subserviceColumn] = " "
|
||||||
file = open(file_name, "r")
|
file = open(file_name, "r")
|
||||||
if self_print_parsing_info:
|
if self_print_parsing_info:
|
||||||
|
@ -96,15 +112,19 @@ class PacketContentParser(FileParser):
|
||||||
self.update_packet_content_sizes()
|
self.update_packet_content_sizes()
|
||||||
|
|
||||||
def scan_for_class_and_struct_match_and_handle_it(self, line):
|
def scan_for_class_and_struct_match_and_handle_it(self, line):
|
||||||
class_or_struct_match = re.search('[\s]*class[\s]*([\w]*)[\s]*.*[\s]*{[\s]*([^\n]*)', line)
|
class_or_struct_match = re.search(
|
||||||
|
"[\s]*class[\s]*([\w]*)[\s]*.*[\s]*{[\s]*([^\n]*)", line
|
||||||
|
)
|
||||||
if not class_or_struct_match:
|
if not class_or_struct_match:
|
||||||
class_or_struct_match = re.search(
|
class_or_struct_match = re.search(
|
||||||
'[\s]*struct[\s]*([\w]*)[\s]*.*[\s]*{[\s]*([^\n]*)', line)
|
"[\s]*struct[\s]*([\w]*)[\s]*.*[\s]*{[\s]*([^\n]*)", line
|
||||||
|
)
|
||||||
if class_or_struct_match:
|
if class_or_struct_match:
|
||||||
self.dictEntryList[self.classNameColumn] = class_or_struct_match.group(1)
|
self.dictEntryList[self.classNameColumn] = class_or_struct_match.group(1)
|
||||||
if class_or_struct_match.group(2):
|
if class_or_struct_match.group(2):
|
||||||
self.dictEntryList[self.subserviceColumn] = \
|
self.dictEntryList[
|
||||||
self.check_for_subservice_string(class_or_struct_match.group(2))
|
self.subserviceColumn
|
||||||
|
] = self.check_for_subservice_string(class_or_struct_match.group(2))
|
||||||
|
|
||||||
def scan_for_variable_match_and_handle_it(self, line):
|
def scan_for_variable_match_and_handle_it(self, line):
|
||||||
# Look for datatype definitions
|
# Look for datatype definitions
|
||||||
|
@ -117,26 +137,37 @@ class PacketContentParser(FileParser):
|
||||||
# First step: Search for possible parameter definitions
|
# First step: Search for possible parameter definitions
|
||||||
# Generic serialize element or datatypes
|
# Generic serialize element or datatypes
|
||||||
var_match = re.search(
|
var_match = re.search(
|
||||||
r'[\w]*(?:<)?[\s]*(uint32_t|uint8_t|uint16_t|ReturnValue_t|Mode_t|Submode_t|'
|
r"[\w]*(?:<)?[\s]*(uint32_t|uint8_t|uint16_t|ReturnValue_t|Mode_t|Submode_t|"
|
||||||
r'object_id_t|float|double|bool|ActionId_t|EventId_t|sid_t|ParameterId_t)'
|
r"object_id_t|float|double|bool|ActionId_t|EventId_t|sid_t|ParameterId_t)"
|
||||||
r'(?:>)?[\s]*([\w]*)[\s]*(?:[= 0-9]*)?[;](?:[\/!< ]*([^\n]*))?', line)
|
r"(?:>)?[\s]*([\w]*)[\s]*(?:[= 0-9]*)?[;](?:[\/!< ]*([^\n]*))?",
|
||||||
|
line,
|
||||||
|
)
|
||||||
if var_match:
|
if var_match:
|
||||||
# Debug printout
|
# Debug printout
|
||||||
# print(var_match.group(0))
|
# print(var_match.group(0))
|
||||||
self.handle_generic_variable_match(var_match)
|
self.handle_generic_variable_match(var_match)
|
||||||
# Serial Fixed Array List with Size Header
|
# Serial Fixed Array List with Size Header
|
||||||
else:
|
else:
|
||||||
var_match = re.search(r'[ \w]*<SerialFixedArrayListAdapter<([\w_, ()]*)>>'
|
var_match = re.search(
|
||||||
r'[\s]*([\w]*)[\s]*[;](?:[/!< ]*([^\n]*))?', line)
|
r"[ \w]*<SerialFixedArrayListAdapter<([\w_, ()]*)>>"
|
||||||
|
r"[\s]*([\w]*)[\s]*[;](?:[/!< ]*([^\n]*))?",
|
||||||
|
line,
|
||||||
|
)
|
||||||
if var_match:
|
if var_match:
|
||||||
self.handle_serial_fixed_array_match(var_match)
|
self.handle_serial_fixed_array_match(var_match)
|
||||||
# Serial Buffer, No length field
|
# Serial Buffer, No length field
|
||||||
if not var_match:
|
if not var_match:
|
||||||
var_match = re.search(r'[ \w]*<SerialBufferAdapter<([\w_,]*)>>'
|
var_match = re.search(
|
||||||
r'[\s]*([\w]*)[\s]*[;](?:[/!< ]*([^\n]*))?', line)
|
r"[ \w]*<SerialBufferAdapter<([\w_,]*)>>"
|
||||||
|
r"[\s]*([\w]*)[\s]*[;](?:[/!< ]*([^\n]*))?",
|
||||||
|
line,
|
||||||
|
)
|
||||||
if not var_match:
|
if not var_match:
|
||||||
var_match = re.search(r'[\w ]*(?:<)?(uint32_t|uint8_t|uint16_t)[\s]*\*'
|
var_match = re.search(
|
||||||
r'(?:>)?[\s]*([\w]*)[\s]*[;](?:[/!< ]*([^\n]*))?', line)
|
r"[\w ]*(?:<)?(uint32_t|uint8_t|uint16_t)[\s]*\*"
|
||||||
|
r"(?:>)?[\s]*([\w]*)[\s]*[;](?:[/!< ]*([^\n]*))?",
|
||||||
|
line,
|
||||||
|
)
|
||||||
if var_match:
|
if var_match:
|
||||||
self.handle_serial_buffer_match(var_match)
|
self.handle_serial_buffer_match(var_match)
|
||||||
# exclude size definition in serialize adapter or any definitions which are not parameter initializations
|
# exclude size definition in serialize adapter or any definitions which are not parameter initializations
|
||||||
|
@ -147,7 +178,7 @@ class PacketContentParser(FileParser):
|
||||||
|
|
||||||
def update_packet_content_table(self):
|
def update_packet_content_table(self):
|
||||||
self.index = self.index + 1
|
self.index = self.index + 1
|
||||||
dict_entry_tuple = tuple(self.dictEntryList[:self.columnListLength])
|
dict_entry_tuple = tuple(self.dictEntryList[: self.columnListLength])
|
||||||
if not self.ignoreFlag:
|
if not self.ignoreFlag:
|
||||||
self.mib_table.update({self.index: dict_entry_tuple})
|
self.mib_table.update({self.index: dict_entry_tuple})
|
||||||
else:
|
else:
|
||||||
|
@ -162,16 +193,20 @@ class PacketContentParser(FileParser):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
fixed_array_properties = re.search(
|
fixed_array_properties = re.search(
|
||||||
'([\w_]*)[\s]*,[\s]*([\w_()]*)[\s]*,[\s]*([\w_()]*)[\s]*', var_match.group(1))
|
"([\w_]*)[\s]*,[\s]*([\w_()]*)[\s]*,[\s]*([\w_()]*)[\s]*",
|
||||||
|
var_match.group(1),
|
||||||
|
)
|
||||||
if fixed_array_properties:
|
if fixed_array_properties:
|
||||||
type_of_next_buffer_size = fixed_array_properties.group(3)
|
type_of_next_buffer_size = fixed_array_properties.group(3)
|
||||||
self.index = self.index + 1
|
self.index = self.index + 1
|
||||||
self.dictEntryList[self.datatypeColumn] = type_of_next_buffer_size
|
self.dictEntryList[self.datatypeColumn] = type_of_next_buffer_size
|
||||||
self.dictEntryList[self.nameColumn] = "Size of following buffer"
|
self.dictEntryList[self.nameColumn] = "Size of following buffer"
|
||||||
dict_entry_tuple = tuple(self.dictEntryList[:self.columnListLength])
|
dict_entry_tuple = tuple(self.dictEntryList[: self.columnListLength])
|
||||||
self.mib_table.update({self.index: dict_entry_tuple})
|
self.mib_table.update({self.index: dict_entry_tuple})
|
||||||
self.handle_var_match(var_match)
|
self.handle_var_match(var_match)
|
||||||
self.dictEntryList[self.datatypeColumn] = fixed_array_properties.group(1) + " *"
|
self.dictEntryList[self.datatypeColumn] = (
|
||||||
|
fixed_array_properties.group(1) + " *"
|
||||||
|
)
|
||||||
self.handle_exporter_string(var_match.group(3))
|
self.handle_exporter_string(var_match.group(3))
|
||||||
|
|
||||||
def handle_serial_buffer_match(self, var_match):
|
def handle_serial_buffer_match(self, var_match):
|
||||||
|
@ -202,7 +237,9 @@ class PacketContentParser(FileParser):
|
||||||
self.mib_table.update({key: content})
|
self.mib_table.update({key: content})
|
||||||
|
|
||||||
def attempt_uint_match(self, content):
|
def attempt_uint_match(self, content):
|
||||||
self.datatypeMatch = re.search('uint([\d]{1,2})_t', content[self.datatypeColumn])
|
self.datatypeMatch = re.search(
|
||||||
|
"uint([\d]{1,2})_t", content[self.datatypeColumn]
|
||||||
|
)
|
||||||
if self.datatypeMatch:
|
if self.datatypeMatch:
|
||||||
content = list(content)
|
content = list(content)
|
||||||
content[self.sizeColumn] = round(int(self.datatypeMatch.group(1)) / 8)
|
content[self.sizeColumn] = round(int(self.datatypeMatch.group(1)) / 8)
|
||||||
|
@ -211,8 +248,9 @@ class PacketContentParser(FileParser):
|
||||||
|
|
||||||
def attempt_four_byte_match(self, content):
|
def attempt_four_byte_match(self, content):
|
||||||
self.datatypeMatch = re.search(
|
self.datatypeMatch = re.search(
|
||||||
r'object_id_t|ActionId_t|Mode_t|float|sid_t|ParameterId_t',
|
r"object_id_t|ActionId_t|Mode_t|float|sid_t|ParameterId_t",
|
||||||
content[self.datatypeColumn])
|
content[self.datatypeColumn],
|
||||||
|
)
|
||||||
if self.datatypeMatch:
|
if self.datatypeMatch:
|
||||||
content = list(content)
|
content = list(content)
|
||||||
content[self.sizeColumn] = 4
|
content[self.sizeColumn] = 4
|
||||||
|
@ -220,7 +258,7 @@ class PacketContentParser(FileParser):
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def attempt_eight_byte_match(self, content):
|
def attempt_eight_byte_match(self, content):
|
||||||
self.datatypeMatch = re.search('double', content[self.datatypeColumn])
|
self.datatypeMatch = re.search("double", content[self.datatypeColumn])
|
||||||
if self.datatypeMatch:
|
if self.datatypeMatch:
|
||||||
content = list(content)
|
content = list(content)
|
||||||
content[self.sizeColumn] = 8
|
content[self.sizeColumn] = 8
|
||||||
|
@ -228,7 +266,9 @@ class PacketContentParser(FileParser):
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def attempt_two_byte_match(self, content):
|
def attempt_two_byte_match(self, content):
|
||||||
self.datatypeMatch = re.search('ReturnValue_t|EventId_t', content[self.datatypeColumn])
|
self.datatypeMatch = re.search(
|
||||||
|
"ReturnValue_t|EventId_t", content[self.datatypeColumn]
|
||||||
|
)
|
||||||
if self.datatypeMatch:
|
if self.datatypeMatch:
|
||||||
content = list(content)
|
content = list(content)
|
||||||
content[self.sizeColumn] = 2
|
content[self.sizeColumn] = 2
|
||||||
|
@ -236,7 +276,7 @@ class PacketContentParser(FileParser):
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def attempt_one_byte_match(self, content):
|
def attempt_one_byte_match(self, content):
|
||||||
self.datatypeMatch = re.search('Submode_t|bool', content[self.datatypeColumn])
|
self.datatypeMatch = re.search("Submode_t|bool", content[self.datatypeColumn])
|
||||||
if self.datatypeMatch:
|
if self.datatypeMatch:
|
||||||
content = list(content)
|
content = list(content)
|
||||||
content[self.sizeColumn] = 1
|
content[self.sizeColumn] = 1
|
||||||
|
@ -244,7 +284,7 @@ class PacketContentParser(FileParser):
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def handle_uint_buffer_type(self, content):
|
def handle_uint_buffer_type(self, content):
|
||||||
if re.search('\*', content[self.datatypeColumn]):
|
if re.search("\*", content[self.datatypeColumn]):
|
||||||
content = list(content)
|
content = list(content)
|
||||||
content[self.sizeColumn] = "deduced"
|
content[self.sizeColumn] = "deduced"
|
||||||
content = tuple(content)
|
content = tuple(content)
|
||||||
|
@ -252,14 +292,22 @@ class PacketContentParser(FileParser):
|
||||||
|
|
||||||
# Used to scan exporter string for ignore flag or store any comments
|
# Used to scan exporter string for ignore flag or store any comments
|
||||||
def handle_exporter_string(self, match):
|
def handle_exporter_string(self, match):
|
||||||
exporter_string = re.search('[ /!<]*\[EXPORT[\w]*\][\s]*:[\s]*([^\n]*)', match)
|
exporter_string = re.search("[ /!<]*\[EXPORT[\w]*\][\s]*:[\s]*([^\n]*)", match)
|
||||||
if exporter_string:
|
if exporter_string:
|
||||||
type_string = re.search("\[TYPE|BUFFERTYPE\][\s]*([\w]*)[^\n|\[]*", exporter_string.group(0),
|
type_string = re.search(
|
||||||
re.IGNORECASE)
|
"\[TYPE|BUFFERTYPE\][\s]*([\w]*)[^\n|\[]*",
|
||||||
|
exporter_string.group(0),
|
||||||
|
re.IGNORECASE,
|
||||||
|
)
|
||||||
if type_string:
|
if type_string:
|
||||||
self.dictEntryList[self.datatypeColumn] = str(type_string.group(1)) + " *"
|
self.dictEntryList[self.datatypeColumn] = (
|
||||||
comment_string = re.search("\[COMMENT\][\s]*([\w]*)[^\n|\[]*", exporter_string.group(0),
|
str(type_string.group(1)) + " *"
|
||||||
re.IGNORECASE)
|
)
|
||||||
|
comment_string = re.search(
|
||||||
|
"\[COMMENT\][\s]*([\w]*)[^\n|\[]*",
|
||||||
|
exporter_string.group(0),
|
||||||
|
re.IGNORECASE,
|
||||||
|
)
|
||||||
if comment_string:
|
if comment_string:
|
||||||
self.dictEntryList[self.commentColumn] = comment_string.group(1)
|
self.dictEntryList[self.commentColumn] = comment_string.group(1)
|
||||||
self.check_for_ignore_string(exporter_string.group(0))
|
self.check_for_ignore_string(exporter_string.group(0))
|
||||||
|
@ -269,13 +317,15 @@ class PacketContentParser(FileParser):
|
||||||
# Used to transform comma separated subservice numbers into specific subservice numbers
|
# Used to transform comma separated subservice numbers into specific subservice numbers
|
||||||
def check_for_subservice_string(self, full_description):
|
def check_for_subservice_string(self, full_description):
|
||||||
subservice_info = re.search(
|
subservice_info = re.search(
|
||||||
r'^.*//[\s]*[!<]*[\s]*\[EXPORT[\w]*\][\s]*:[\s]*\[SUBSERVICE\][\s]*([^\n]*)',
|
r"^.*//[\s]*[!<]*[\s]*\[EXPORT[\w]*\][\s]*:[\s]*\[SUBSERVICE\][\s]*([^\n]*)",
|
||||||
full_description, re.IGNORECASE)
|
full_description,
|
||||||
description = ' '
|
re.IGNORECASE,
|
||||||
|
)
|
||||||
|
description = " "
|
||||||
if subservice_info:
|
if subservice_info:
|
||||||
description = self.handle_subservice_string(subservice_info)
|
description = self.handle_subservice_string(subservice_info)
|
||||||
if full_description == '':
|
if full_description == "":
|
||||||
description = ' '
|
description = " "
|
||||||
return description
|
return description
|
||||||
|
|
||||||
def check_for_ignore_string(self, string):
|
def check_for_ignore_string(self, string):
|
||||||
|
@ -286,8 +336,8 @@ class PacketContentParser(FileParser):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def handle_subservice_string(subservice_info):
|
def handle_subservice_string(subservice_info):
|
||||||
description = ' '
|
description = " "
|
||||||
subservice_list = [int(x) for x in subservice_info.group(1).split(',')]
|
subservice_list = [int(x) for x in subservice_info.group(1).split(",")]
|
||||||
subservice_number = len(subservice_list)
|
subservice_number = len(subservice_list)
|
||||||
for i in range(subservice_number):
|
for i in range(subservice_number):
|
||||||
description = description + str(subservice_list[i])
|
description = description + str(subservice_list[i])
|
||||||
|
@ -300,6 +350,3 @@ class PacketContentParser(FileParser):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -74,5 +74,6 @@
|
||||||
7905;0x1ee1;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
7905;0x1ee1;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
||||||
8900;0x22c4;CLOCK_SET;INFO;;fsfw/src/fsfw/pus/Service9TimeManagement.h
|
8900;0x22c4;CLOCK_SET;INFO;;fsfw/src/fsfw/pus/Service9TimeManagement.h
|
||||||
8901;0x22c5;CLOCK_SET_FAILURE;LOW;;fsfw/src/fsfw/pus/Service9TimeManagement.h
|
8901;0x22c5;CLOCK_SET_FAILURE;LOW;;fsfw/src/fsfw/pus/Service9TimeManagement.h
|
||||||
|
9100;0x238c;TC_DELETION_FAILED;MEDIUM;Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||||
9700;0x25e4;TEST;INFO;;fsfw/src/fsfw/pus/Service17Test.h
|
9700;0x25e4;TEST;INFO;;fsfw/src/fsfw/pus/Service17Test.h
|
||||||
10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
|
10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
|
||||||
|
|
|
|
@ -24,6 +24,7 @@
|
||||||
0x534f0200;TM_STORE
|
0x534f0200;TM_STORE
|
||||||
0x534f0300;IPC_STORE
|
0x534f0300;IPC_STORE
|
||||||
0x53500010;TIME_STAMPER
|
0x53500010;TIME_STAMPER
|
||||||
|
0x53500020;TC_VERIFICATOR
|
||||||
0x53ffffff;FSFW_OBJECTS_END
|
0x53ffffff;FSFW_OBJECTS_END
|
||||||
0x62000300;TCPIP_TMTC_BRIDGE
|
0x62000300;TCPIP_TMTC_BRIDGE
|
||||||
0x62000400;TCPIP_TMTC_POLLING_TASK
|
0x62000400;TCPIP_TMTC_POLLING_TASK
|
||||||
|
|
|
|
@ -21,8 +21,16 @@ DH_COMMAND_PACKET_DEFINITION_DESTINATION = "../../mission/devices/devicepackets/
|
||||||
DH_DEFINITION_DESTINATION = "../../mission/devices/"
|
DH_DEFINITION_DESTINATION = "../../mission/devices/"
|
||||||
DH_COMMANDS_CSV_NAME = "mib_device_commands.csv"
|
DH_COMMANDS_CSV_NAME = "mib_device_commands.csv"
|
||||||
DH_COMMAND_HEADER_COLUMNS = [
|
DH_COMMAND_HEADER_COLUMNS = [
|
||||||
"Device Handler", "Command Name", "Action ID", "Command Field Name", "Command Field Position",
|
"Device Handler",
|
||||||
"Command Field Type", "Command Field Option Name", "Command Field Option Value", "Comment"]
|
"Command Name",
|
||||||
|
"Action ID",
|
||||||
|
"Command Field Name",
|
||||||
|
"Command Field Position",
|
||||||
|
"Command Field Type",
|
||||||
|
"Command Field Option Name",
|
||||||
|
"Command Field Option Value",
|
||||||
|
"Comment",
|
||||||
|
]
|
||||||
|
|
||||||
SQL_DELETE_CMDTABLE_CMD = """
|
SQL_DELETE_CMDTABLE_CMD = """
|
||||||
DROP TABLE IF EXISTS DeviceHandlerCommand;
|
DROP TABLE IF EXISTS DeviceHandlerCommand;
|
||||||
|
@ -55,6 +63,7 @@ class DeviceCommandColumns(Enum):
|
||||||
"""
|
"""
|
||||||
Specifies order of MIB columns
|
Specifies order of MIB columns
|
||||||
"""
|
"""
|
||||||
|
|
||||||
DH_NAME = 0
|
DH_NAME = 0
|
||||||
NAME = 1
|
NAME = 1
|
||||||
ACTION_ID = 2
|
ACTION_ID = 2
|
||||||
|
@ -75,19 +84,27 @@ def main():
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
info_header_file_parser = FileListParser(DH_DEFINITION_DESTINATION)
|
info_header_file_parser = FileListParser(DH_DEFINITION_DESTINATION)
|
||||||
info_header_file_list = info_header_file_parser.\
|
info_header_file_list = info_header_file_parser.parse_header_files(
|
||||||
parse_header_files(False, "Parsing device handler informations:")
|
False, "Parsing device handler informations:"
|
||||||
|
)
|
||||||
dh_information_parser = DeviceHandlerInformationParser(info_header_file_list)
|
dh_information_parser = DeviceHandlerInformationParser(info_header_file_list)
|
||||||
dh_information_table = dh_information_parser.parse_files()
|
dh_information_table = dh_information_parser.parse_files()
|
||||||
Printer.print_content(dh_information_table, "Priting device handler command information table: ")
|
Printer.print_content(
|
||||||
|
dh_information_table, "Priting device handler command information table: "
|
||||||
|
)
|
||||||
|
|
||||||
header_file_parser = FileListParser(DH_COMMAND_PACKET_DEFINITION_DESTINATION)
|
header_file_parser = FileListParser(DH_COMMAND_PACKET_DEFINITION_DESTINATION)
|
||||||
header_file_list = \
|
header_file_list = header_file_parser.parse_header_files(
|
||||||
header_file_parser.parse_header_files(False, "Parsing device handler command files:")
|
False, "Parsing device handler command files:"
|
||||||
packet_subservice_parser = DeviceHandlerCommandParser(header_file_list, dh_information_table)
|
)
|
||||||
|
packet_subservice_parser = DeviceHandlerCommandParser(
|
||||||
|
header_file_list, dh_information_table
|
||||||
|
)
|
||||||
dh_command_table = packet_subservice_parser.parse_files()
|
dh_command_table = packet_subservice_parser.parse_files()
|
||||||
Printer.print_content(dh_command_table, "Printing device handler command table:")
|
Printer.print_content(dh_command_table, "Printing device handler command table:")
|
||||||
dh_command_writer = CsvWriter(DH_COMMANDS_CSV_NAME, dh_command_table, DH_COMMAND_HEADER_COLUMNS)
|
dh_command_writer = CsvWriter(
|
||||||
|
DH_COMMANDS_CSV_NAME, dh_command_table, DH_COMMAND_HEADER_COLUMNS
|
||||||
|
)
|
||||||
dh_command_writer.write_to_csv()
|
dh_command_writer.write_to_csv()
|
||||||
dh_command_writer.copy_csv()
|
dh_command_writer.copy_csv()
|
||||||
dh_command_writer.move_csv("..")
|
dh_command_writer.move_csv("..")
|
||||||
|
@ -120,7 +137,7 @@ class DeviceHandlerInformationParser(FileParser):
|
||||||
self_print_parsing_info = args[0]
|
self_print_parsing_info = args[0]
|
||||||
|
|
||||||
# Read device name from file name
|
# Read device name from file name
|
||||||
handler_match = re.search(r'([\w]*).h', file_name)
|
handler_match = re.search(r"([\w]*).h", file_name)
|
||||||
if not handler_match:
|
if not handler_match:
|
||||||
print("Device Command Parser: Configuration error, no handler name match !")
|
print("Device Command Parser: Configuration error, no handler name match !")
|
||||||
handler_name = handler_match.group(1)
|
handler_name = handler_match.group(1)
|
||||||
|
@ -145,8 +162,12 @@ class DeviceHandlerInformationParser(FileParser):
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
# Case insensitive matching of device command enums
|
# Case insensitive matching of device command enums
|
||||||
enum_match = re.search(r'[\s]*enum[\s]*([\w]*)[\s]*{[\s][/!<>]*[\s]*'
|
enum_match = re.search(
|
||||||
r'\[EXPORT[\w]*\][\s]*:[\s]*\[ENUM\]([^\n]*)', line, re.IGNORECASE)
|
r"[\s]*enum[\s]*([\w]*)[\s]*{[\s][/!<>]*[\s]*"
|
||||||
|
r"\[EXPORT[\w]*\][\s]*:[\s]*\[ENUM\]([^\n]*)",
|
||||||
|
line,
|
||||||
|
re.IGNORECASE,
|
||||||
|
)
|
||||||
if enum_match:
|
if enum_match:
|
||||||
self.command_enum_name = enum_match.group(1)
|
self.command_enum_name = enum_match.group(1)
|
||||||
self.command_scanning_pending = True
|
self.command_scanning_pending = True
|
||||||
|
@ -158,9 +179,11 @@ class DeviceHandlerInformationParser(FileParser):
|
||||||
self.__handle_command_enum_scanning(line)
|
self.__handle_command_enum_scanning(line)
|
||||||
|
|
||||||
def __handle_command_definition_scanning(self, line):
|
def __handle_command_definition_scanning(self, line):
|
||||||
command_match = \
|
command_match = re.search(
|
||||||
re.search(r'[\s]*static[\s]*const[\s]*DeviceCommandId_t[\s]*([\w]*)[\s]*=[\s]*'
|
r"[\s]*static[\s]*const[\s]*DeviceCommandId_t[\s]*([\w]*)[\s]*=[\s]*"
|
||||||
r'([\w]*)[\s]*;[\s]*[/!<>]*[\s]*\[EXPORT\][\s]*:[\s]*\[COMMAND\]', line)
|
r"([\w]*)[\s]*;[\s]*[/!<>]*[\s]*\[EXPORT\][\s]*:[\s]*\[COMMAND\]",
|
||||||
|
line,
|
||||||
|
)
|
||||||
if command_match:
|
if command_match:
|
||||||
command_name = command_match.group(1)
|
command_name = command_match.group(1)
|
||||||
command_id = command_match.group(2)
|
command_id = command_match.group(2)
|
||||||
|
@ -171,8 +194,11 @@ class DeviceHandlerInformationParser(FileParser):
|
||||||
if not self.command_scanning_pending:
|
if not self.command_scanning_pending:
|
||||||
# scanning enum finished
|
# scanning enum finished
|
||||||
# stores current command into command dictionary with command name as unique key
|
# stores current command into command dictionary with command name as unique key
|
||||||
command_tuple = self.command_value_name_list, self.command_value_list, \
|
command_tuple = (
|
||||||
self.command_comment_list
|
self.command_value_name_list,
|
||||||
|
self.command_value_list,
|
||||||
|
self.command_comment_list,
|
||||||
|
)
|
||||||
self.command_enum_dict.update({self.command_enum_name: command_tuple})
|
self.command_enum_dict.update({self.command_enum_name: command_tuple})
|
||||||
self.command_enum_name = ""
|
self.command_enum_name = ""
|
||||||
self.command_value_name_list = []
|
self.command_value_name_list = []
|
||||||
|
@ -180,13 +206,14 @@ class DeviceHandlerInformationParser(FileParser):
|
||||||
self.command_comment_list = []
|
self.command_comment_list = []
|
||||||
|
|
||||||
def __scan_command_entries(self, line):
|
def __scan_command_entries(self, line):
|
||||||
command_match = \
|
command_match = re.search(
|
||||||
re.search(r'[\s]*([\w]*)[\s]*=[\s]*([0-9]{1,3})[^/][\s]*[/!<>]*[\s]*([^\n]*)', line)
|
r"[\s]*([\w]*)[\s]*=[\s]*([0-9]{1,3})[^/][\s]*[/!<>]*[\s]*([^\n]*)", line
|
||||||
|
)
|
||||||
if command_match:
|
if command_match:
|
||||||
self.command_value_name_list.append(command_match.group(1))
|
self.command_value_name_list.append(command_match.group(1))
|
||||||
self.command_value_list.append(command_match.group(2))
|
self.command_value_list.append(command_match.group(2))
|
||||||
self.command_comment_list.append(command_match.group(3))
|
self.command_comment_list.append(command_match.group(3))
|
||||||
elif re.search(r'}[\s]*;', line):
|
elif re.search(r"}[\s]*;", line):
|
||||||
self.command_scanning_pending = False
|
self.command_scanning_pending = False
|
||||||
|
|
||||||
def _post_parsing_operation(self):
|
def _post_parsing_operation(self):
|
||||||
|
@ -197,6 +224,7 @@ class PendingScanType(Enum):
|
||||||
"""
|
"""
|
||||||
Specifies which scan type is performed in the device command parser.
|
Specifies which scan type is performed in the device command parser.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
NO_SCANNING = 0
|
NO_SCANNING = 0
|
||||||
STRUCT_SCAN = 1
|
STRUCT_SCAN = 1
|
||||||
CLASS_SCAN = 2
|
CLASS_SCAN = 2
|
||||||
|
@ -209,6 +237,7 @@ class DeviceHandlerCommandParser(FileParser):
|
||||||
packet definitions. A device handler info table must be passed which can be acquired
|
packet definitions. A device handler info table must be passed which can be acquired
|
||||||
by running the DH information parser.
|
by running the DH information parser.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, file_list, dh_information_table):
|
def __init__(self, file_list, dh_information_table):
|
||||||
super().__init__(file_list)
|
super().__init__(file_list)
|
||||||
# this table includes the current new table entry,
|
# this table includes the current new table entry,
|
||||||
|
@ -258,9 +287,12 @@ class DeviceHandlerCommandParser(FileParser):
|
||||||
self.__scan_command(line)
|
self.__scan_command(line)
|
||||||
|
|
||||||
def __scan_for_structs(self, line):
|
def __scan_for_structs(self, line):
|
||||||
struct_match = re.search(r'[\s]*struct[\s]*([\w]*)[\s]*{[\s]*[/!<>]*[\s]*'
|
struct_match = re.search(
|
||||||
r'\[EXPORT\][ :]*\[COMMAND\]'
|
r"[\s]*struct[\s]*([\w]*)[\s]*{[\s]*[/!<>]*[\s]*"
|
||||||
r'[\s]*([\w]*)[ :]*([\w]*)', line)
|
r"\[EXPORT\][ :]*\[COMMAND\]"
|
||||||
|
r"[\s]*([\w]*)[ :]*([\w]*)",
|
||||||
|
line,
|
||||||
|
)
|
||||||
if struct_match:
|
if struct_match:
|
||||||
# Scan a found command struct
|
# Scan a found command struct
|
||||||
self.__start_class_or_struct_scanning(struct_match)
|
self.__start_class_or_struct_scanning(struct_match)
|
||||||
|
@ -269,8 +301,11 @@ class DeviceHandlerCommandParser(FileParser):
|
||||||
|
|
||||||
def __scan_for_class(self, line):
|
def __scan_for_class(self, line):
|
||||||
# search for class command definition
|
# search for class command definition
|
||||||
class_match = re.search(r'[\s]*class[\s]*([\w]*)[\s]*[^{]*{[ /!<>]*\[EXPORT\][ :]*'
|
class_match = re.search(
|
||||||
r'\[COMMAND\][\s]*([\w]*)[ :]*([\w]*)', line)
|
r"[\s]*class[\s]*([\w]*)[\s]*[^{]*{[ /!<>]*\[EXPORT\][ :]*"
|
||||||
|
r"\[COMMAND\][\s]*([\w]*)[ :]*([\w]*)",
|
||||||
|
line,
|
||||||
|
)
|
||||||
if class_match:
|
if class_match:
|
||||||
self.__start_class_or_struct_scanning(class_match)
|
self.__start_class_or_struct_scanning(class_match)
|
||||||
self.scanning_pending = PendingScanType.CLASS_SCAN.value
|
self.scanning_pending = PendingScanType.CLASS_SCAN.value
|
||||||
|
@ -288,21 +323,27 @@ class DeviceHandlerCommandParser(FileParser):
|
||||||
if handler_name in self.dh_information_table:
|
if handler_name in self.dh_information_table:
|
||||||
(command_id_dict, self.enum_dict) = self.dh_information_table[handler_name]
|
(command_id_dict, self.enum_dict) = self.dh_information_table[handler_name]
|
||||||
if command_name in command_id_dict:
|
if command_name in command_id_dict:
|
||||||
self.dict_entry_list[Clmns.ACTION_ID.value] = command_id_dict[command_name]
|
self.dict_entry_list[Clmns.ACTION_ID.value] = command_id_dict[
|
||||||
|
command_name
|
||||||
|
]
|
||||||
|
|
||||||
def __scan_command(self, line):
|
def __scan_command(self, line):
|
||||||
datatype_match = False
|
datatype_match = False
|
||||||
if self.scanning_pending is PendingScanType.STRUCT_SCAN.value:
|
if self.scanning_pending is PendingScanType.STRUCT_SCAN.value:
|
||||||
datatype_match = \
|
datatype_match = re.search(
|
||||||
re.search(r'[\s]*(uint[0-9]{1,2}_t|float|double|bool|int|char)[\s]*([\w]*);'
|
r"[\s]*(uint[0-9]{1,2}_t|float|double|bool|int|char)[\s]*([\w]*);"
|
||||||
r'(?:[\s]*[/!<>]*[\s]*\[EXPORT\][: ]*(.*))?', line)
|
r"(?:[\s]*[/!<>]*[\s]*\[EXPORT\][: ]*(.*))?",
|
||||||
|
line,
|
||||||
|
)
|
||||||
elif self.scanning_pending is PendingScanType.CLASS_SCAN.value:
|
elif self.scanning_pending is PendingScanType.CLASS_SCAN.value:
|
||||||
datatype_match = re.search(
|
datatype_match = re.search(
|
||||||
r'[\s]*SerializeElement[\s]*<(uint[0-9]{1,2}_t|float|double|bool|int|char)[ >]*'
|
r"[\s]*SerializeElement[\s]*<(uint[0-9]{1,2}_t|float|double|bool|int|char)[ >]*"
|
||||||
r'([\w]*);(?:[ /!<>]*\[EXPORT\][: ]*(.*))?', line)
|
r"([\w]*);(?:[ /!<>]*\[EXPORT\][: ]*(.*))?",
|
||||||
|
line,
|
||||||
|
)
|
||||||
if datatype_match:
|
if datatype_match:
|
||||||
self.__handle_datatype_match(datatype_match)
|
self.__handle_datatype_match(datatype_match)
|
||||||
elif re.search(r'}[\s]*;', line):
|
elif re.search(r"}[\s]*;", line):
|
||||||
self.scanning_pending = PendingScanType.NO_SCANNING.value
|
self.scanning_pending = PendingScanType.NO_SCANNING.value
|
||||||
self.command_index = 0
|
self.command_index = 0
|
||||||
|
|
||||||
|
@ -318,11 +359,15 @@ class DeviceHandlerCommandParser(FileParser):
|
||||||
|
|
||||||
def __analyse_exporter_sequence(self, exporter_sequence):
|
def __analyse_exporter_sequence(self, exporter_sequence):
|
||||||
# This matches the exporter sequence pairs e.g. [ENUM] BLA [COMMENT] BLABLA [...] ...
|
# This matches the exporter sequence pairs e.g. [ENUM] BLA [COMMENT] BLABLA [...] ...
|
||||||
export_string_matches = re.search(r'(?:\[([\w]*)\][\s]*([^\[]*))?', exporter_sequence)
|
export_string_matches = re.search(
|
||||||
|
r"(?:\[([\w]*)\][\s]*([^\[]*))?", exporter_sequence
|
||||||
|
)
|
||||||
if export_string_matches:
|
if export_string_matches:
|
||||||
if len(export_string_matches.groups()) % 2 != 0:
|
if len(export_string_matches.groups()) % 2 != 0:
|
||||||
print("Device Command Parser: Error when analysing exporter sequence,"
|
print(
|
||||||
" check exporter string format")
|
"Device Command Parser: Error when analysing exporter sequence,"
|
||||||
|
" check exporter string format"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
count = 0
|
count = 0
|
||||||
while count < len(export_string_matches.groups()):
|
while count < len(export_string_matches.groups()):
|
||||||
|
@ -348,8 +393,7 @@ class DeviceHandlerCommandParser(FileParser):
|
||||||
enum_tuple = self.enum_dict[self.current_enum_name]
|
enum_tuple = self.enum_dict[self.current_enum_name]
|
||||||
for count in range(0, size_of_enum):
|
for count in range(0, size_of_enum):
|
||||||
self.__update_table_with_command_options(count, enum_tuple)
|
self.__update_table_with_command_options(count, enum_tuple)
|
||||||
self.command_index = \
|
self.command_index = self.command_index + 1
|
||||||
self.command_index + 1
|
|
||||||
else:
|
else:
|
||||||
self.__update_table_with_no_command_options()
|
self.__update_table_with_no_command_options()
|
||||||
self.index = self.index + 1
|
self.index = self.index + 1
|
||||||
|
@ -357,12 +401,16 @@ class DeviceHandlerCommandParser(FileParser):
|
||||||
|
|
||||||
def __update_table_with_command_options(self, count, enum_tuple):
|
def __update_table_with_command_options(self, count, enum_tuple):
|
||||||
enum_value_name_list, enum_value_list, enum_comment_list = enum_tuple
|
enum_value_name_list, enum_value_list, enum_comment_list = enum_tuple
|
||||||
self.dict_entry_list[Clmns.COMMAND_FIELD_OPTION_NAME.value] = \
|
self.dict_entry_list[
|
||||||
enum_value_name_list[count]
|
Clmns.COMMAND_FIELD_OPTION_NAME.value
|
||||||
self.dict_entry_list[Clmns.COMMAND_FIELD_OPTION_VALUE.value] = enum_value_list[count]
|
] = enum_value_name_list[count]
|
||||||
self.dict_entry_list[Clmns.COMMAND_FIELD_COMMENT.value] = enum_comment_list[count]
|
self.dict_entry_list[Clmns.COMMAND_FIELD_OPTION_VALUE.value] = enum_value_list[
|
||||||
self.dict_entry_list[Clmns.COMMAND_INDEX.value] = \
|
count
|
||||||
self.command_index
|
]
|
||||||
|
self.dict_entry_list[Clmns.COMMAND_FIELD_COMMENT.value] = enum_comment_list[
|
||||||
|
count
|
||||||
|
]
|
||||||
|
self.dict_entry_list[Clmns.COMMAND_INDEX.value] = self.command_index
|
||||||
dh_command_tuple = tuple(self.dict_entry_list)
|
dh_command_tuple = tuple(self.dict_entry_list)
|
||||||
self.index += 1
|
self.index += 1
|
||||||
self.mib_table.update({self.index: dh_command_tuple})
|
self.mib_table.update({self.index: dh_command_tuple})
|
||||||
|
@ -371,8 +419,7 @@ class DeviceHandlerCommandParser(FileParser):
|
||||||
self.dict_entry_list[Clmns.COMMAND_FIELD_OPTION_NAME.value] = ""
|
self.dict_entry_list[Clmns.COMMAND_FIELD_OPTION_NAME.value] = ""
|
||||||
self.dict_entry_list[Clmns.COMMAND_FIELD_OPTION_VALUE.value] = ""
|
self.dict_entry_list[Clmns.COMMAND_FIELD_OPTION_VALUE.value] = ""
|
||||||
self.dict_entry_list[Clmns.COMMAND_FIELD_COMMENT.value] = self.command_comment
|
self.dict_entry_list[Clmns.COMMAND_FIELD_COMMENT.value] = self.command_comment
|
||||||
self.dict_entry_list[Clmns.COMMAND_INDEX.value] = \
|
self.dict_entry_list[Clmns.COMMAND_INDEX.value] = self.command_index
|
||||||
self.command_index
|
|
||||||
dh_command_tuple = tuple(self.dict_entry_list)
|
dh_command_tuple = tuple(self.dict_entry_list)
|
||||||
self.mib_table.update({self.index: dh_command_tuple})
|
self.mib_table.update({self.index: dh_command_tuple})
|
||||||
self.command_index += 1
|
self.command_index += 1
|
||||||
|
|
Binary file not shown.
|
@ -49,7 +49,7 @@ SUBSYSTEM_DEFINITION_DESTINATIONS = [
|
||||||
HEADER_DEFINITION_DESTINATIONS = [
|
HEADER_DEFINITION_DESTINATIONS = [
|
||||||
f"{OBSW_ROOT_DIR}/bsp_hosted",
|
f"{OBSW_ROOT_DIR}/bsp_hosted",
|
||||||
f"{OBSW_ROOT_DIR}/fsfw/",
|
f"{OBSW_ROOT_DIR}/fsfw/",
|
||||||
f"{FSFW_CONFIG_ROOT}"
|
f"{FSFW_CONFIG_ROOT}",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,7 +83,9 @@ def parse_events(
|
||||||
header_file_name=CPP_H_FILENAME,
|
header_file_name=CPP_H_FILENAME,
|
||||||
)
|
)
|
||||||
if COPY_CPP_FILE:
|
if COPY_CPP_FILE:
|
||||||
LOGGER.info(f"EventParser: Copying CPP translation file to {CPP_COPY_DESTINATION}")
|
LOGGER.info(
|
||||||
|
f"EventParser: Copying CPP translation file to {CPP_COPY_DESTINATION}"
|
||||||
|
)
|
||||||
copy_file(CPP_FILENAME, CPP_COPY_DESTINATION)
|
copy_file(CPP_FILENAME, CPP_COPY_DESTINATION)
|
||||||
copy_file(CPP_H_FILENAME, CPP_COPY_DESTINATION)
|
copy_file(CPP_H_FILENAME, CPP_COPY_DESTINATION)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief Auto-generated event translation file. Contains 78 translations.
|
* @brief Auto-generated event translation file. Contains 79 translations.
|
||||||
* @details
|
* @details
|
||||||
* Generated on: 2022-05-20 09:11:07
|
* Generated on: 2022-07-27 19:41:37
|
||||||
*/
|
*/
|
||||||
#include "translateEvents.h"
|
#include "translateEvents.h"
|
||||||
|
|
||||||
|
@ -81,6 +81,7 @@ const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST";
|
||||||
const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED";
|
const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED";
|
||||||
const char *CLOCK_SET_STRING = "CLOCK_SET";
|
const char *CLOCK_SET_STRING = "CLOCK_SET";
|
||||||
const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE";
|
const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE";
|
||||||
|
const char *TC_DELETION_FAILED_STRING = "TC_DELETION_FAILED";
|
||||||
const char *TEST_STRING = "TEST";
|
const char *TEST_STRING = "TEST";
|
||||||
const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER";
|
const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER";
|
||||||
|
|
||||||
|
@ -238,6 +239,8 @@ const char *translateEvents(Event event) {
|
||||||
return CLOCK_SET_STRING;
|
return CLOCK_SET_STRING;
|
||||||
case (8901):
|
case (8901):
|
||||||
return CLOCK_SET_FAILURE_STRING;
|
return CLOCK_SET_FAILURE_STRING;
|
||||||
|
case (9100):
|
||||||
|
return TC_DELETION_FAILED_STRING;
|
||||||
case (9700):
|
case (9700):
|
||||||
return TEST_STRING;
|
return TEST_STRING;
|
||||||
case (10600):
|
case (10600):
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 6d423f7106e49f93743fb69e9436e1e652f9e001
|
Subproject commit b1e5a2d40a5f41b9020f2beb0b976035f91c6343
|
|
@ -47,7 +47,7 @@ from packetcontent.packet_content_parser import (
|
||||||
PACKET_CONTENT_HEADER_COLUMN,
|
PACKET_CONTENT_HEADER_COLUMN,
|
||||||
SQL_CREATE_PACKET_DATA_CONTENT_CMD,
|
SQL_CREATE_PACKET_DATA_CONTENT_CMD,
|
||||||
SQL_INSERT_PACKET_DATA_CMD,
|
SQL_INSERT_PACKET_DATA_CMD,
|
||||||
SQL_DELETE_PACKET_DATA_CONTENT_CMD
|
SQL_DELETE_PACKET_DATA_CONTENT_CMD,
|
||||||
)
|
)
|
||||||
from subservice.subservice_parser import (
|
from subservice.subservice_parser import (
|
||||||
SubserviceParser,
|
SubserviceParser,
|
||||||
|
@ -67,7 +67,7 @@ from devicecommands.device_command_parser import (
|
||||||
DH_COMMAND_HEADER_COLUMNS,
|
DH_COMMAND_HEADER_COLUMNS,
|
||||||
SQL_CREATE_CMDTABLE_CMD,
|
SQL_CREATE_CMDTABLE_CMD,
|
||||||
SQL_INSERT_INTO_CMDTABLE_CMD,
|
SQL_INSERT_INTO_CMDTABLE_CMD,
|
||||||
SQL_DELETE_CMDTABLE_CMD
|
SQL_DELETE_CMDTABLE_CMD,
|
||||||
)
|
)
|
||||||
from returnvalues.returnvalues_parser import (
|
from returnvalues.returnvalues_parser import (
|
||||||
InterfaceParser,
|
InterfaceParser,
|
||||||
|
@ -75,15 +75,16 @@ from returnvalues.returnvalues_parser import (
|
||||||
INTERFACE_DEFINITION_FILES,
|
INTERFACE_DEFINITION_FILES,
|
||||||
RETURNVALUE_DESTINATIONS,
|
RETURNVALUE_DESTINATIONS,
|
||||||
sql_retval_exporter,
|
sql_retval_exporter,
|
||||||
CSV_RETVAL_FILENAME
|
CSV_RETVAL_FILENAME,
|
||||||
)
|
)
|
||||||
from objects.objects import (
|
from objects.objects import (
|
||||||
ObjectDefinitionParser,
|
ObjectDefinitionParser,
|
||||||
OBJECTS_DEFINITIONS,
|
OBJECTS_DEFINITIONS,
|
||||||
export_object_file,
|
export_object_file,
|
||||||
CSV_OBJECT_FILENAME,
|
CSV_OBJECT_FILENAME,
|
||||||
sql_object_exporter
|
sql_object_exporter,
|
||||||
)
|
)
|
||||||
|
|
||||||
DO_EXPORT_MIB = True
|
DO_EXPORT_MIB = True
|
||||||
PRINT_TABLES_TO_CONSOLE = False
|
PRINT_TABLES_TO_CONSOLE = False
|
||||||
EXPORT_TO_CSV = True
|
EXPORT_TO_CSV = True
|
||||||
|
@ -146,7 +147,7 @@ def handle_subservices_generation():
|
||||||
|
|
||||||
|
|
||||||
def generate_subservice_table():
|
def generate_subservice_table():
|
||||||
""" Generate the subservice table. """
|
"""Generate the subservice table."""
|
||||||
subservice_header_parser = FileListParser(
|
subservice_header_parser = FileListParser(
|
||||||
destination_corrected(SUBSERVICE_DEFINITION_DESTINATION)
|
destination_corrected(SUBSERVICE_DEFINITION_DESTINATION)
|
||||||
)
|
)
|
||||||
|
@ -161,7 +162,11 @@ def generate_subservice_table():
|
||||||
def handle_packet_content_generation():
|
def handle_packet_content_generation():
|
||||||
print("MIB Exporter: Parsing packing content")
|
print("MIB Exporter: Parsing packing content")
|
||||||
packet_content_table = generate_packet_content_table()
|
packet_content_table = generate_packet_content_table()
|
||||||
print("MIB Exporter: Found " + str(len(packet_content_table)) + " packet content entries.")
|
print(
|
||||||
|
"MIB Exporter: Found "
|
||||||
|
+ str(len(packet_content_table))
|
||||||
|
+ " packet content entries."
|
||||||
|
)
|
||||||
if PRINT_TABLES_TO_CONSOLE:
|
if PRINT_TABLES_TO_CONSOLE:
|
||||||
print("MIB Exporter: Print packet content table: ")
|
print("MIB Exporter: Print packet content table: ")
|
||||||
Printer.print_content(packet_content_table)
|
Printer.print_content(packet_content_table)
|
||||||
|
@ -179,12 +184,12 @@ def handle_packet_content_generation():
|
||||||
SQL_CREATE_PACKET_DATA_CONTENT_CMD,
|
SQL_CREATE_PACKET_DATA_CONTENT_CMD,
|
||||||
SQL_INSERT_PACKET_DATA_CMD,
|
SQL_INSERT_PACKET_DATA_CMD,
|
||||||
packet_content_table,
|
packet_content_table,
|
||||||
SQL_DELETE_PACKET_DATA_CONTENT_CMD
|
SQL_DELETE_PACKET_DATA_CONTENT_CMD,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def generate_packet_content_table():
|
def generate_packet_content_table():
|
||||||
""" Generate packet content table """
|
"""Generate packet content table"""
|
||||||
packet_data_header_parser = FileListParser(
|
packet_data_header_parser = FileListParser(
|
||||||
destination_corrected(PACKET_CONTENT_DEFINITION_DESTINATION)
|
destination_corrected(PACKET_CONTENT_DEFINITION_DESTINATION)
|
||||||
)
|
)
|
||||||
|
@ -199,7 +204,11 @@ def generate_packet_content_table():
|
||||||
def handle_device_handler_command_generation():
|
def handle_device_handler_command_generation():
|
||||||
print("MIB Exporter: Parsing device handler commands.")
|
print("MIB Exporter: Parsing device handler commands.")
|
||||||
dh_command_table = generate_device_command_table()
|
dh_command_table = generate_device_command_table()
|
||||||
print("MIB Exporter: Found " + str(len(dh_command_table)) + " device handler command entries")
|
print(
|
||||||
|
"MIB Exporter: Found "
|
||||||
|
+ str(len(dh_command_table))
|
||||||
|
+ " device handler command entries"
|
||||||
|
)
|
||||||
if PRINT_TABLES_TO_CONSOLE:
|
if PRINT_TABLES_TO_CONSOLE:
|
||||||
print("MIB Exporter: Printing device handler command table: ")
|
print("MIB Exporter: Printing device handler command table: ")
|
||||||
Printer.print_content(dh_command_table)
|
Printer.print_content(dh_command_table)
|
||||||
|
@ -207,19 +216,23 @@ def handle_device_handler_command_generation():
|
||||||
device_command_writer = CsvWriter(
|
device_command_writer = CsvWriter(
|
||||||
DH_COMMANDS_CSV_NAME, dh_command_table, DH_COMMAND_HEADER_COLUMNS
|
DH_COMMANDS_CSV_NAME, dh_command_table, DH_COMMAND_HEADER_COLUMNS
|
||||||
)
|
)
|
||||||
print("MIB Exporter: Exporting device handler commands to " + DH_COMMANDS_CSV_NAME)
|
print(
|
||||||
|
"MIB Exporter: Exporting device handler commands to " + DH_COMMANDS_CSV_NAME
|
||||||
|
)
|
||||||
device_command_writer.write_to_csv()
|
device_command_writer.write_to_csv()
|
||||||
if EXPORT_TO_SQL:
|
if EXPORT_TO_SQL:
|
||||||
print("MIB Exporter: Exporting device handler commands to SQL")
|
print("MIB Exporter: Exporting device handler commands to SQL")
|
||||||
sql_writer = SqlWriter()
|
sql_writer = SqlWriter()
|
||||||
sql_writer.sql_writing_helper(
|
sql_writer.sql_writing_helper(
|
||||||
SQL_CREATE_CMDTABLE_CMD, SQL_INSERT_INTO_CMDTABLE_CMD, dh_command_table,
|
SQL_CREATE_CMDTABLE_CMD,
|
||||||
SQL_DELETE_CMDTABLE_CMD
|
SQL_INSERT_INTO_CMDTABLE_CMD,
|
||||||
|
dh_command_table,
|
||||||
|
SQL_DELETE_CMDTABLE_CMD,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def generate_device_command_table(print_info_table: bool = False):
|
def generate_device_command_table(print_info_table: bool = False):
|
||||||
""" Generate device command table """
|
"""Generate device command table"""
|
||||||
info_header_file_parser = FileListParser(
|
info_header_file_parser = FileListParser(
|
||||||
destination_corrected(DH_DEFINITION_DESTINATION)
|
destination_corrected(DH_DEFINITION_DESTINATION)
|
||||||
)
|
)
|
||||||
|
@ -228,11 +241,15 @@ def generate_device_command_table(print_info_table: bool = False):
|
||||||
)
|
)
|
||||||
dh_information_parser = DeviceHandlerInformationParser(info_header_file_list)
|
dh_information_parser = DeviceHandlerInformationParser(info_header_file_list)
|
||||||
dh_information_table = dh_information_parser.parse_files()
|
dh_information_table = dh_information_parser.parse_files()
|
||||||
print("MIB Exporter: Found " + str(len(dh_information_table)) +
|
print(
|
||||||
" device handler information entries.")
|
"MIB Exporter: Found "
|
||||||
|
+ str(len(dh_information_table))
|
||||||
|
+ " device handler information entries."
|
||||||
|
)
|
||||||
if print_info_table:
|
if print_info_table:
|
||||||
Printer.print_content(
|
Printer.print_content(
|
||||||
dh_information_table, "MIB Exporter: Priting device handler command information table: "
|
dh_information_table,
|
||||||
|
"MIB Exporter: Priting device handler command information table: ",
|
||||||
)
|
)
|
||||||
|
|
||||||
header_file_parser = FileListParser(
|
header_file_parser = FileListParser(
|
||||||
|
@ -270,7 +287,9 @@ def generate_returnvalue_table():
|
||||||
interfaces = interface_parser.parse_files()
|
interfaces = interface_parser.parse_files()
|
||||||
print("MIB Exporter: Found interfaces : " + str(len(interfaces)))
|
print("MIB Exporter: Found interfaces : " + str(len(interfaces)))
|
||||||
header_parser = FileListParser(destination_corrected(RETURNVALUE_DESTINATIONS))
|
header_parser = FileListParser(destination_corrected(RETURNVALUE_DESTINATIONS))
|
||||||
header_list = header_parser.parse_header_files(True, "MIB Exporter: Parsing header file list: ")
|
header_list = header_parser.parse_header_files(
|
||||||
|
True, "MIB Exporter: Parsing header file list: "
|
||||||
|
)
|
||||||
returnvalue_parser = ReturnValueParser(interfaces, header_list, False)
|
returnvalue_parser = ReturnValueParser(interfaces, header_list, False)
|
||||||
returnvalue_table = returnvalue_parser.parse_files(False)
|
returnvalue_table = returnvalue_parser.parse_files(False)
|
||||||
if PRINT_TABLES_TO_CONSOLE:
|
if PRINT_TABLES_TO_CONSOLE:
|
||||||
|
@ -323,7 +342,7 @@ def handle_external_file_running():
|
||||||
|
|
||||||
|
|
||||||
def update_globals():
|
def update_globals():
|
||||||
""" Updates the global variables """
|
"""Updates the global variables"""
|
||||||
g.PP = pprint.PrettyPrinter(indent=0, width=250)
|
g.PP = pprint.PrettyPrinter(indent=0, width=250)
|
||||||
g.doExportMIB = DO_EXPORT_MIB
|
g.doExportMIB = DO_EXPORT_MIB
|
||||||
g.executeSQLcommands = False
|
g.executeSQLcommands = False
|
||||||
|
|
|
@ -15,7 +15,13 @@ from fsfwgen.objects.objects import (
|
||||||
from fsfwgen.utility.printer import PrettyPrinter
|
from fsfwgen.utility.printer import PrettyPrinter
|
||||||
from fsfwgen.utility.file_management import copy_file
|
from fsfwgen.utility.file_management import copy_file
|
||||||
|
|
||||||
from definitions import BSP_HOSTED, DATABASE_NAME, OBSW_ROOT_DIR, ROOT_DIR, EXAMPLE_COMMON_DIR
|
from definitions import (
|
||||||
|
BSP_HOSTED,
|
||||||
|
DATABASE_NAME,
|
||||||
|
OBSW_ROOT_DIR,
|
||||||
|
ROOT_DIR,
|
||||||
|
EXAMPLE_COMMON_DIR,
|
||||||
|
)
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
LOGGER = get_console_logger()
|
||||||
DATE_TODAY = datetime.datetime.now()
|
DATE_TODAY = datetime.datetime.now()
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/**
|
/**
|
||||||
* @brief Auto-generated object translation file.
|
* @brief Auto-generated object translation file.
|
||||||
* @details
|
* @details
|
||||||
* Contains 39 translations.
|
* Contains 40 translations.
|
||||||
* Generated on: 2022-05-20 09:16:37
|
* Generated on: 2022-07-27 19:41:37
|
||||||
*/
|
*/
|
||||||
#include "translateObjects.h"
|
#include "translateObjects.h"
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ const char *TC_STORE_STRING = "TC_STORE";
|
||||||
const char *TM_STORE_STRING = "TM_STORE";
|
const char *TM_STORE_STRING = "TM_STORE";
|
||||||
const char *IPC_STORE_STRING = "IPC_STORE";
|
const char *IPC_STORE_STRING = "IPC_STORE";
|
||||||
const char *TIME_STAMPER_STRING = "TIME_STAMPER";
|
const char *TIME_STAMPER_STRING = "TIME_STAMPER";
|
||||||
|
const char *TC_VERIFICATOR_STRING = "TC_VERIFICATOR";
|
||||||
const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
|
const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
|
||||||
const char *TCPIP_TMTC_BRIDGE_STRING = "TCPIP_TMTC_BRIDGE";
|
const char *TCPIP_TMTC_BRIDGE_STRING = "TCPIP_TMTC_BRIDGE";
|
||||||
const char *TCPIP_TMTC_POLLING_TASK_STRING = "TCPIP_TMTC_POLLING_TASK";
|
const char *TCPIP_TMTC_POLLING_TASK_STRING = "TCPIP_TMTC_POLLING_TASK";
|
||||||
|
@ -100,6 +101,8 @@ const char *translateObject(object_id_t object) {
|
||||||
return IPC_STORE_STRING;
|
return IPC_STORE_STRING;
|
||||||
case 0x53500010:
|
case 0x53500010:
|
||||||
return TIME_STAMPER_STRING;
|
return TIME_STAMPER_STRING;
|
||||||
|
case 0x53500020:
|
||||||
|
return TC_VERIFICATOR_STRING;
|
||||||
case 0x53ffffff:
|
case 0x53ffffff:
|
||||||
return FSFW_OBJECTS_END_STRING;
|
return FSFW_OBJECTS_END_STRING;
|
||||||
case 0x62000300:
|
case 0x62000300:
|
||||||
|
|
|
@ -9,7 +9,13 @@ from fsfwgen.returnvalues.returnvalues_parser import InterfaceParser, ReturnValu
|
||||||
from fsfwgen.utility.sql_writer import SqlWriter
|
from fsfwgen.utility.sql_writer import SqlWriter
|
||||||
from fsfwgen.utility.printer import PrettyPrinter
|
from fsfwgen.utility.printer import PrettyPrinter
|
||||||
|
|
||||||
from definitions import BSP_HOSTED, DATABASE_NAME, ROOT_DIR, OBSW_ROOT_DIR, EXAMPLE_COMMON_DIR
|
from definitions import (
|
||||||
|
BSP_HOSTED,
|
||||||
|
DATABASE_NAME,
|
||||||
|
ROOT_DIR,
|
||||||
|
OBSW_ROOT_DIR,
|
||||||
|
EXAMPLE_COMMON_DIR,
|
||||||
|
)
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
LOGGER = get_console_logger()
|
||||||
EXPORT_TO_FILE = True
|
EXPORT_TO_FILE = True
|
||||||
|
|
|
@ -28,7 +28,13 @@ from fsfwgen.utility.printer import Printer
|
||||||
|
|
||||||
SUBSERVICE_DEFINITION_DESTINATION = ["../../mission/", "../../fsfw/pus/"]
|
SUBSERVICE_DEFINITION_DESTINATION = ["../../mission/", "../../fsfw/pus/"]
|
||||||
SUBSERVICE_CSV_NAME = "mib_subservices.csv"
|
SUBSERVICE_CSV_NAME = "mib_subservices.csv"
|
||||||
SUBSERVICE_COLUMN_HEADER = ["Service", "Subservice Name", "Subservice Number", "Type", "Comment"]
|
SUBSERVICE_COLUMN_HEADER = [
|
||||||
|
"Service",
|
||||||
|
"Subservice Name",
|
||||||
|
"Subservice Number",
|
||||||
|
"Type",
|
||||||
|
"Comment",
|
||||||
|
]
|
||||||
|
|
||||||
SQL_DELETE_SUBSVC_CMD = """
|
SQL_DELETE_SUBSVC_CMD = """
|
||||||
DROP TABLE IF EXISTS Subservice;
|
DROP TABLE IF EXISTS Subservice;
|
||||||
|
@ -55,6 +61,7 @@ class SubserviceColumns(Enum):
|
||||||
"""
|
"""
|
||||||
Specifies order of MIB columns
|
Specifies order of MIB columns
|
||||||
"""
|
"""
|
||||||
|
|
||||||
SERVICE = 0
|
SERVICE = 0
|
||||||
NAME = 1
|
NAME = 1
|
||||||
NUMBER = 2
|
NUMBER = 2
|
||||||
|
@ -71,12 +78,16 @@ def main():
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
header_parser = FileListParser(SUBSERVICE_DEFINITION_DESTINATION)
|
header_parser = FileListParser(SUBSERVICE_DEFINITION_DESTINATION)
|
||||||
header_file_list = header_parser.parse_header_files(False, "Parsing subservice header files: ")
|
header_file_list = header_parser.parse_header_files(
|
||||||
|
False, "Parsing subservice header files: "
|
||||||
|
)
|
||||||
packet_subservice_parser = SubserviceParser(header_file_list)
|
packet_subservice_parser = SubserviceParser(header_file_list)
|
||||||
subservice_table = packet_subservice_parser.parse_files()
|
subservice_table = packet_subservice_parser.parse_files()
|
||||||
Printer.print_content(subservice_table, "Printing subservice table:")
|
Printer.print_content(subservice_table, "Printing subservice table:")
|
||||||
print("Found " + str(len(subservice_table)) + " subservice entries.")
|
print("Found " + str(len(subservice_table)) + " subservice entries.")
|
||||||
subservice_writer = CsvWriter(SUBSERVICE_CSV_NAME, subservice_table, SUBSERVICE_COLUMN_HEADER)
|
subservice_writer = CsvWriter(
|
||||||
|
SUBSERVICE_CSV_NAME, subservice_table, SUBSERVICE_COLUMN_HEADER
|
||||||
|
)
|
||||||
subservice_writer.write_to_csv()
|
subservice_writer.write_to_csv()
|
||||||
subservice_writer.move_csv("..")
|
subservice_writer.move_csv("..")
|
||||||
|
|
||||||
|
@ -90,6 +101,7 @@ class SubserviceParser(FileParser):
|
||||||
"""
|
"""
|
||||||
This parser class can parse the subservice definitions.
|
This parser class can parse the subservice definitions.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, file_list: list):
|
def __init__(self, file_list: list):
|
||||||
super().__init__(file_list)
|
super().__init__(file_list)
|
||||||
# Column System allows reshuffling of table columns in constructor
|
# Column System allows reshuffling of table columns in constructor
|
||||||
|
@ -111,7 +123,7 @@ class SubserviceParser(FileParser):
|
||||||
self_print_parsing_info = args[0]
|
self_print_parsing_info = args[0]
|
||||||
|
|
||||||
# Read service from file name
|
# Read service from file name
|
||||||
service_match = re.search('Service[^0-9]*([0-9]{1,3})', file_name)
|
service_match = re.search("Service[^0-9]*([0-9]{1,3})", file_name)
|
||||||
if service_match:
|
if service_match:
|
||||||
self.dict_entry_list[Clmns.SERVICE.value] = service_match.group(1)
|
self.dict_entry_list[Clmns.SERVICE.value] = service_match.group(1)
|
||||||
self.dict_entry_list[Clmns.NAME.value] = " "
|
self.dict_entry_list[Clmns.NAME.value] = " "
|
||||||
|
@ -129,7 +141,7 @@ class SubserviceParser(FileParser):
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
# Case insensitive matching
|
# Case insensitive matching
|
||||||
enum_match = re.search(r'[\s]*enum[\s]*Subservice([^\n]*)', line, re.IGNORECASE)
|
enum_match = re.search(r"[\s]*enum[\s]*Subservice([^\n]*)", line, re.IGNORECASE)
|
||||||
if enum_match:
|
if enum_match:
|
||||||
self.subservice_enum_found = True
|
self.subservice_enum_found = True
|
||||||
if self.subservice_enum_found:
|
if self.subservice_enum_found:
|
||||||
|
@ -146,7 +158,7 @@ class SubserviceParser(FileParser):
|
||||||
subservice_match = self.__scan_subservices(line)
|
subservice_match = self.__scan_subservices(line)
|
||||||
if subservice_match:
|
if subservice_match:
|
||||||
self.index = self.index + 1
|
self.index = self.index + 1
|
||||||
dict_entry_tuple = tuple(self.dict_entry_list[:self.clmns_len])
|
dict_entry_tuple = tuple(self.dict_entry_list[: self.clmns_len])
|
||||||
self.mib_table.update({self.index: dict_entry_tuple})
|
self.mib_table.update({self.index: dict_entry_tuple})
|
||||||
self.__clear_tuple()
|
self.__clear_tuple()
|
||||||
|
|
||||||
|
@ -158,8 +170,9 @@ class SubserviceParser(FileParser):
|
||||||
self.possible_match_on_next_lines = False
|
self.possible_match_on_next_lines = False
|
||||||
|
|
||||||
def __scan_for_export_command(self, line: str) -> bool:
|
def __scan_for_export_command(self, line: str) -> bool:
|
||||||
command_string = re.search(r"([^\[]*)\[export\][: ]*\[([\w]*)\][\s]*([^\n]*)",
|
command_string = re.search(
|
||||||
line, re.IGNORECASE)
|
r"([^\[]*)\[export\][: ]*\[([\w]*)\][\s]*([^\n]*)", line, re.IGNORECASE
|
||||||
|
)
|
||||||
if command_string:
|
if command_string:
|
||||||
# Check whether there is a separated export command
|
# Check whether there is a separated export command
|
||||||
# (export command is not on same line as subservice definition)
|
# (export command is not on same line as subservice definition)
|
||||||
|
@ -179,9 +192,9 @@ class SubserviceParser(FileParser):
|
||||||
Strip whitespaces and comment symbols and add to comment buffer.
|
Strip whitespaces and comment symbols and add to comment buffer.
|
||||||
"""
|
"""
|
||||||
possible_multiline_comment = line.lstrip()
|
possible_multiline_comment = line.lstrip()
|
||||||
possible_multiline_comment = possible_multiline_comment.lstrip('/')
|
possible_multiline_comment = possible_multiline_comment.lstrip("/")
|
||||||
possible_multiline_comment = possible_multiline_comment.lstrip('<')
|
possible_multiline_comment = possible_multiline_comment.lstrip("<")
|
||||||
possible_multiline_comment = possible_multiline_comment.lstrip('!')
|
possible_multiline_comment = possible_multiline_comment.lstrip("!")
|
||||||
possible_multiline_comment = possible_multiline_comment.rstrip()
|
possible_multiline_comment = possible_multiline_comment.rstrip()
|
||||||
if len(possible_multiline_comment) > 0:
|
if len(possible_multiline_comment) > 0:
|
||||||
self.dict_entry_list[Clmns.COMMENT.value] += possible_multiline_comment
|
self.dict_entry_list[Clmns.COMMENT.value] += possible_multiline_comment
|
||||||
|
@ -192,8 +205,9 @@ class SubserviceParser(FileParser):
|
||||||
:param line:
|
:param line:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
subservice_match = \
|
subservice_match = re.search(
|
||||||
re.search(r"[\s]*([\w]*)[\s]*=[\s]*([0-9]{1,3})(?:,)?(?:[ /!<>]*([^\n]*))?", line)
|
r"[\s]*([\w]*)[\s]*=[\s]*([0-9]{1,3})(?:,)?(?:[ /!<>]*([^\n]*))?", line
|
||||||
|
)
|
||||||
if subservice_match:
|
if subservice_match:
|
||||||
self.dict_entry_list[Clmns.NAME.value] = subservice_match.group(1)
|
self.dict_entry_list[Clmns.NAME.value] = subservice_match.group(1)
|
||||||
self.dict_entry_list[Clmns.NUMBER.value] = subservice_match.group(2)
|
self.dict_entry_list[Clmns.NUMBER.value] = subservice_match.group(2)
|
||||||
|
@ -204,7 +218,7 @@ class SubserviceParser(FileParser):
|
||||||
return True
|
return True
|
||||||
# Check whether exporting was commanded on last lines
|
# Check whether exporting was commanded on last lines
|
||||||
return bool(self.possible_match_on_next_lines)
|
return bool(self.possible_match_on_next_lines)
|
||||||
if re.search(r'}[\s]*;', line):
|
if re.search(r"}[\s]*;", line):
|
||||||
self.subservice_enum_found = False
|
self.subservice_enum_found = False
|
||||||
return subservice_match
|
return subservice_match
|
||||||
|
|
||||||
|
@ -217,19 +231,19 @@ class SubserviceParser(FileParser):
|
||||||
return export_command_found
|
return export_command_found
|
||||||
|
|
||||||
def __scan_for_type(self, string) -> bool:
|
def __scan_for_type(self, string) -> bool:
|
||||||
type_match = re.search(r'\[reply\]|\[tm\]', string, re.IGNORECASE)
|
type_match = re.search(r"\[reply\]|\[tm\]", string, re.IGNORECASE)
|
||||||
if type_match:
|
if type_match:
|
||||||
self.dict_entry_list[Clmns.TYPE.value] = 'TM'
|
self.dict_entry_list[Clmns.TYPE.value] = "TM"
|
||||||
return True
|
return True
|
||||||
type_match = re.search(r'\[command\]|\[tc\]', string, re.IGNORECASE)
|
type_match = re.search(r"\[command\]|\[tc\]", string, re.IGNORECASE)
|
||||||
if type_match:
|
if type_match:
|
||||||
self.dict_entry_list[Clmns.TYPE.value] = 'TC'
|
self.dict_entry_list[Clmns.TYPE.value] = "TC"
|
||||||
return True
|
return True
|
||||||
self.dict_entry_list[Clmns.TYPE.value] = 'Unspecified'
|
self.dict_entry_list[Clmns.TYPE.value] = "Unspecified"
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def __scan_for_comment(self, comment_string):
|
def __scan_for_comment(self, comment_string):
|
||||||
comment_match = re.search(r':[\s]*\[[\w]*\][\s]*([^\n]*)', comment_string)
|
comment_match = re.search(r":[\s]*\[[\w]*\][\s]*([^\n]*)", comment_string)
|
||||||
if comment_match:
|
if comment_match:
|
||||||
self.dict_entry_list[Clmns.COMMENT.value] = comment_match.group(1)
|
self.dict_entry_list[Clmns.COMMENT.value] = comment_match.group(1)
|
||||||
|
|
||||||
|
|
|
@ -15,4 +15,4 @@ printToConsole = True
|
||||||
exportToCSV = True
|
exportToCSV = True
|
||||||
doCopyFile = False
|
doCopyFile = False
|
||||||
copyDestination = "."
|
copyDestination = "."
|
||||||
fileSeparator = ';'
|
fileSeparator = ";"
|
||||||
|
|
|
@ -3,4 +3,6 @@
|
||||||
/venv
|
/venv
|
||||||
|
|
||||||
/config/tmtc_config.json
|
/config/tmtc_config.json
|
||||||
/log/*.log
|
/seqcnt*.txt
|
||||||
|
|
||||||
|
/log
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="CFDP Test NAK No Closure" 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 filetest/cfdp_test.txt /tmp/hello-cpy.txt --no-closure -d 0.2" />
|
||||||
|
<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>
|
|
@ -0,0 +1,24 @@
|
||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="CFDP Test NAK With Closure" 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 filetest/cfdp_test.txt /tmp/hello-cpy.txt -d 0.2" />
|
||||||
|
<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>
|
|
@ -12,7 +12,7 @@
|
||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
|
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
|
||||||
<option name="PARAMETERS" value="-s 200 -o asm_to_normal -t 6 -l" />
|
<option name="PARAMETERS" value="-s 200 -o asm_to_normal -t 6 -l" />
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||||
<option name="EMULATE_TERMINAL" value="false" />
|
<option name="EMULATE_TERMINAL" value="false" />
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
|
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
|
||||||
<option name="PARAMETERS" value="-s 200 -o test -l" />
|
<option name="PARAMETERS" value="-s 200 -o test -l" />
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||||
<option name="EMULATE_TERMINAL" value="false" />
|
<option name="EMULATE_TERMINAL" value="false" />
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
|
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
|
||||||
<option name="PARAMETERS" value="-s 17 -o 0 -l" />
|
<option name="PARAMETERS" value="-s 17 -o 0 -d 5" />
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||||
<option name="EMULATE_TERMINAL" value="false" />
|
<option name="EMULATE_TERMINAL" value="false" />
|
||||||
<option name="MODULE_MODE" value="false" />
|
<option name="MODULE_MODE" value="false" />
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="PUS Scheduler Test" type="PythonConfigurationType" factoryName="Python" folderName="PUS">
|
||||||
|
<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="-s 11 -o test-insert -l" />
|
||||||
|
<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>
|
|
@ -12,7 +12,7 @@
|
||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
|
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
|
||||||
<option name="PARAMETERS" value="-s 3 -o 1 -l" />
|
<option name="PARAMETERS" value="-s 3 -o 1 -l" />
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||||
<option name="EMULATE_TERMINAL" value="false" />
|
<option name="EMULATE_TERMINAL" value="false" />
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
|
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
|
||||||
<option name="PARAMETERS" value="" />
|
<option name="PARAMETERS" value="" />
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||||
<option name="EMULATE_TERMINAL" value="true" />
|
<option name="EMULATE_TERMINAL" value="true" />
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcgui.py" />
|
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
|
||||||
<option name="PARAMETERS" value="" />
|
<option name="PARAMETERS" value="-g" />
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||||
<option name="EMULATE_TERMINAL" value="false" />
|
<option name="EMULATE_TERMINAL" value="false" />
|
||||||
<option name="MODULE_MODE" value="false" />
|
<option name="MODULE_MODE" value="false" />
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="TMTC Help" type="PythonConfigurationType" factoryName="Python">
|
||||||
|
<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="-h" />
|
||||||
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||||
|
<option name="EMULATE_TERMINAL" value="true" />
|
||||||
|
<option name="MODULE_MODE" value="false" />
|
||||||
|
<option name="REDIRECT_INPUT" value="false" />
|
||||||
|
<option name="INPUT_FILE" value="" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
|
@ -0,0 +1,24 @@
|
||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="TMTC Listener" type="PythonConfigurationType" factoryName="Python">
|
||||||
|
<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="-l" />
|
||||||
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||||
|
<option name="EMULATE_TERMINAL" value="true" />
|
||||||
|
<option name="MODULE_MODE" value="false" />
|
||||||
|
<option name="REDIRECT_INPUT" value="false" />
|
||||||
|
<option name="INPUT_FILE" value="" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
|
@ -0,0 +1,17 @@
|
||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="spacepackets unittests" type="tests" factoryName="Autodetect">
|
||||||
|
<module name="tmtc" />
|
||||||
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
<option name="PARENT_ENVS" value="true" />
|
||||||
|
<option name="SDK_HOME" value="" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/deps/spacepackets/tests" />
|
||||||
|
<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="_new_additionalArguments" value="""" />
|
||||||
|
<option name="_new_target" value=""$PROJECT_DIR$/deps/spacepackets/tests"" />
|
||||||
|
<option name="_new_targetType" value=""PATH"" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
|
@ -0,0 +1,17 @@
|
||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="tmtccmd unittest" type="tests" factoryName="Autodetect">
|
||||||
|
<module name="tmtc" />
|
||||||
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
<option name="PARENT_ENVS" value="true" />
|
||||||
|
<option name="SDK_HOME" value="" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/deps/tmtccmd" />
|
||||||
|
<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="_new_additionalArguments" value="""" />
|
||||||
|
<option name="_new_target" value=""$PROJECT_DIR$/deps/tmtccmd"" />
|
||||||
|
<option name="_new_targetType" value=""PATH"" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
|
@ -1 +1 @@
|
||||||
Subproject commit 3cca54f66fe72f292787499e1e9bf2497a2cfdbf
|
Subproject commit c9ae13c16f09cc2fa410b7cf7ee683b0b77e6b7b
|
|
@ -74,5 +74,6 @@
|
||||||
7905;0x1ee1;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
7905;0x1ee1;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
||||||
8900;0x22c4;CLOCK_SET;INFO;;fsfw/src/fsfw/pus/Service9TimeManagement.h
|
8900;0x22c4;CLOCK_SET;INFO;;fsfw/src/fsfw/pus/Service9TimeManagement.h
|
||||||
8901;0x22c5;CLOCK_SET_FAILURE;LOW;;fsfw/src/fsfw/pus/Service9TimeManagement.h
|
8901;0x22c5;CLOCK_SET_FAILURE;LOW;;fsfw/src/fsfw/pus/Service9TimeManagement.h
|
||||||
|
9100;0x238c;TC_DELETION_FAILED;MEDIUM;Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||||
9700;0x25e4;TEST;INFO;;fsfw/src/fsfw/pus/Service17Test.h
|
9700;0x25e4;TEST;INFO;;fsfw/src/fsfw/pus/Service17Test.h
|
||||||
10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
|
10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
|
||||||
|
|
|
|
@ -1,11 +1,25 @@
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
|
from common_tmtc.config.definitions import TM_SP_IDS
|
||||||
from common_tmtc.config.hook_implementation import CommonFsfwHookBase
|
from common_tmtc.config.hook_implementation import CommonFsfwHookBase
|
||||||
from tmtccmd.tc.definitions import TcQueueT
|
from common_tmtc.pus_tc.cmd_definitions import common_fsfw_service_op_code_dict
|
||||||
|
from tmtccmd.com_if import ComInterface
|
||||||
|
from tmtccmd.config import TmtcDefinitionWrapper
|
||||||
|
|
||||||
|
|
||||||
class FsfwHookBase(CommonFsfwHookBase):
|
class FsfwHookBase(CommonFsfwHookBase):
|
||||||
def pack_service_queue(self, service: int, op_code: str, service_queue: TcQueueT):
|
def get_tmtc_definitions(self) -> TmtcDefinitionWrapper:
|
||||||
from common_tmtc.pus_tc.tc_packing import common_service_queue_user
|
return common_fsfw_service_op_code_dict()
|
||||||
|
|
||||||
common_service_queue_user(
|
def assign_communication_interface(self, com_if_key: str) -> Optional[ComInterface]:
|
||||||
service=service, op_code=op_code, tc_queue=service_queue
|
from tmtccmd.config.com_if import (
|
||||||
|
create_com_interface_default,
|
||||||
|
create_com_interface_cfg_default,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
cfg = create_com_interface_cfg_default(
|
||||||
|
com_if_key=com_if_key,
|
||||||
|
json_cfg_path=self.cfg_path,
|
||||||
|
space_packet_ids=TM_SP_IDS,
|
||||||
|
)
|
||||||
|
return create_com_interface_default(cfg)
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
0x534f0200;TM_STORE
|
0x534f0200;TM_STORE
|
||||||
0x534f0300;IPC_STORE
|
0x534f0300;IPC_STORE
|
||||||
0x53500010;TIME_STAMPER
|
0x53500010;TIME_STAMPER
|
||||||
|
0x53500020;TC_VERIFICATOR
|
||||||
0x53ffffff;FSFW_OBJECTS_END
|
0x53ffffff;FSFW_OBJECTS_END
|
||||||
0x62000300;TCPIP_TMTC_BRIDGE
|
0x62000300;TCPIP_TMTC_BRIDGE
|
||||||
0x62000400;TCPIP_TMTC_POLLING_TASK
|
0x62000400;TCPIP_TMTC_POLLING_TASK
|
||||||
|
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
/*
|
||||||
|
!/*.sh
|
||||||
|
!/.gitignore
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
git clone https://github.com/us-irs/spacepackets-py.git
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
git clone https://github.com/robamu-org/tmtccmd.git
|
|
@ -0,0 +1 @@
|
||||||
|
hello world
|
Binary file not shown.
|
@ -1 +1 @@
|
||||||
tmtccmd >= 2.2.1
|
tmtccmd == 4.0.0a1
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 9ee7922bf7b7a678f8e5ebd5926001defac9a3d4
|
|
|
@ -1,6 +1,9 @@
|
||||||
{
|
{
|
||||||
"com_if": "tcp",
|
"com_if": "udp",
|
||||||
"tcpip_tcp_ip_addr": "127.0.0.1",
|
"tcpip_tcp_ip_addr": "127.0.0.1",
|
||||||
"tcpip_tcp_port": 7301,
|
"tcpip_tcp_port": 7301,
|
||||||
"tcpip_tcp_recv_max_size": 1500
|
"tcpip_tcp_recv_max_size": 1500,
|
||||||
|
"tcpip_udp_ip_addr": "127.0.0.1",
|
||||||
|
"tcpip_udp_port": 7301,
|
||||||
|
"tcpip_udp_recv_max_size": 1500
|
||||||
}
|
}
|
|
@ -0,0 +1,68 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
"""TMTC commander for FSFW Example"""
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
from spacepackets.ecss import PusVerificator
|
||||||
|
|
||||||
|
import tmtccmd
|
||||||
|
from common_tmtc.common import setup_params, setup_tmtc_handlers, setup_backend
|
||||||
|
from config.hook import FsfwHookBase
|
||||||
|
from tmtccmd import get_console_logger
|
||||||
|
from tmtccmd.core import BackendRequest
|
||||||
|
from tmtccmd.logging.pus import (
|
||||||
|
RegularTmtcLogWrapper,
|
||||||
|
RawTmtcTimedLogWrapper,
|
||||||
|
TimedLogWhen,
|
||||||
|
)
|
||||||
|
from tmtccmd.pus import VerificationWrapper
|
||||||
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
|
|
||||||
|
LOGGER = get_console_logger()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
setup_wrapper = setup_params(FsfwHookBase())
|
||||||
|
tmtc_logger = RegularTmtcLogWrapper()
|
||||||
|
printer = FsfwTmTcPrinter(tmtc_logger.logger)
|
||||||
|
raw_logger = RawTmtcTimedLogWrapper(when=TimedLogWhen.PER_HOUR, interval=2)
|
||||||
|
pus_verificator = PusVerificator()
|
||||||
|
verif_wrapper = VerificationWrapper(
|
||||||
|
console_logger=get_console_logger(),
|
||||||
|
file_logger=printer.file_logger,
|
||||||
|
pus_verificator=pus_verificator,
|
||||||
|
)
|
||||||
|
ccsds_handler, tc_handler = setup_tmtc_handlers(
|
||||||
|
verif_wrapper=verif_wrapper, raw_logger=raw_logger, printer=printer
|
||||||
|
)
|
||||||
|
tmtccmd.setup(setup_wrapper)
|
||||||
|
backend = setup_backend(
|
||||||
|
setup_wrapper=setup_wrapper, ccsds_handler=ccsds_handler, tc_handler=tc_handler
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
state = backend.periodic_op(None)
|
||||||
|
tc_handler.cfdp_in_ccsds_wrapper.handler.fsm()
|
||||||
|
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.cfdp_done():
|
||||||
|
LOGGER.info("CFDP transaction done, closing client")
|
||||||
|
sys.exit(0)
|
||||||
|
time.sleep(0.8)
|
||||||
|
elif state.request == BackendRequest.DELAY_CUSTOM:
|
||||||
|
if state.next_delay.total_seconds() < 0.5:
|
||||||
|
time.sleep(state.next_delay.total_seconds())
|
||||||
|
else:
|
||||||
|
time.sleep(0.5)
|
||||||
|
elif state.request == BackendRequest.CALL_NEXT:
|
||||||
|
pass
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
|
@ -1,23 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
"""TMTC commander for FSFW Example"""
|
|
||||||
from common_tmtc.tmtcc import (
|
|
||||||
tmtcc_post_args,
|
|
||||||
tmtcc_pre_args,
|
|
||||||
create_default_args_parser,
|
|
||||||
add_default_tmtccmd_args,
|
|
||||||
parse_default_input_arguments,
|
|
||||||
)
|
|
||||||
from config.hook import FsfwHookBase
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
tmtcc_pre_args()
|
|
||||||
hook_obj = FsfwHookBase(json_cfg_path="tmtc_conf.json")
|
|
||||||
arg_parser = create_default_args_parser()
|
|
||||||
add_default_tmtccmd_args(arg_parser)
|
|
||||||
args = parse_default_input_arguments(arg_parser, hook_obj)
|
|
||||||
tmtcc_post_args(hook_obj=hook_obj, use_gui=False, args=args)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit e24faa1500d96a8afa7f7aed32fcb020eb2e1335
|
|
|
@ -1,12 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
"""TMTC commander for the FSFW Example"""
|
|
||||||
from common_tmtc.tmtcc import tmtcc_post_args, tmtcc_pre_args
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
hook_obj = tmtcc_pre_args()
|
|
||||||
tmtcc_post_args(hook_obj=hook_obj, use_gui=True, args=None)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
Loading…
Reference in New Issue