Host Fixes and CMakeLists.txt update #229

Merged
meierj merged 8 commits from mueller/host-fixes-fsfw-update into develop 2022-04-28 17:16:14 +02:00
26 changed files with 797 additions and 751 deletions

3
.gitmodules vendored
View File

@ -1,6 +1,3 @@
[submodule "etl"]
path = thirdparty/etl
url = https://github.com/ETLCPP/etl.git
[submodule "arduino"] [submodule "arduino"]
path = arduino path = arduino
url = https://egit.irs.uni-stuttgart.de/eive/eive_arduino_interface.git url = https://egit.irs.uni-stuttgart.de/eive/eive_arduino_interface.git

View File

@ -9,24 +9,16 @@
################################################################################ ################################################################################
cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.13)
# set(CMAKE_VERBOSE TRUE)
set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0) set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0)
set(OBSW_VERSION_MINOR_IF_GIT_FAILS 0) set(OBSW_VERSION_MINOR_IF_GIT_FAILS 0)
set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0) set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") # set(CMAKE_VERBOSE TRUE)
option(EIVE_ADD_ETL_LIB "Add ETL library" ON)
option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
option(EIVE_HARDCODED_TOOLCHAIN_FILE "\ option(EIVE_HARDCODED_TOOLCHAIN_FILE "\
For Linux Board Target BSPs, a default toolchain file will be set. Should be set to OFF \ For Linux Board Target BSPs, a default toolchain file will be set. Should be set to OFF \
if a different toolchain file is set externally" ON if a different toolchain file is set externally" ON
) )
option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF)
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON)
set(OBSW_ADD_STAR_TRACKER 0)
set(OBSW_DEBUG_STARTRACKER 0)
if(NOT FSFW_OSAL) if(NOT FSFW_OSAL)
set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.") set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.")
@ -39,13 +31,35 @@ if(TGT_BSP)
elseif(TGT_BSP MATCHES "arm/q7s") elseif(TGT_BSP MATCHES "arm/q7s")
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON) option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON)
endif() endif()
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON)
else()
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" OFF)
endif() endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Perform steps like loading toolchain files where applicable. # Perform steps like loading toolchain files where applicable.
include(PreProjectConfig) include(PreProjectConfig)
include(EiveHelpers)
pre_project_config() pre_project_config()
# Project Name
project(eive-obsw)
# Specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
include(EiveHelpers)
option(EIVE_ADD_ETL_LIB "Add ETL library" ON)
option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
set(OBSW_ADD_STAR_TRACKER 0)
set(OBSW_DEBUG_STARTRACKER 0)
################################################################################
# Pre-Sources preparation
################################################################################
# Version handling # Version handling
set(GIT_VER_HANDLING_OK FALSE) set(GIT_VER_HANDLING_OK FALSE)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
@ -77,21 +91,6 @@ if(NOT GIT_VER_HANDLING_OK)
set(OBSW_VERSION_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS}) set(OBSW_VERSION_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS})
endif() endif()
# Check whether the user has already installed Catch2 first. This has to come before
# the project call. We could also exclude doing this when the Q7S primary OBSW is built..
find_package(Catch2 3 CONFIG QUIET)
# Project Name
project(eive-obsw)
################################################################################
# Pre-Sources preparation
################################################################################
# Specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Set names and variables # Set names and variables
set(OBSW_NAME ${CMAKE_PROJECT_NAME}) set(OBSW_NAME ${CMAKE_PROJECT_NAME})
set(WATCHDOG_NAME eive-watchdog) set(WATCHDOG_NAME eive-watchdog)
@ -250,30 +249,8 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(COMPILER_FLAGS "/permissive-") set(COMPILER_FLAGS "/permissive-")
endif() endif()
if (NOT(TGT_BSP MATCHES "arm/te0720-1cfa") AND NOT(TGT_BSP MATCHES "arm/q7s"))
# Not installed, so use FetchContent to download and provide Catch2
if(NOT Catch2_FOUND)
message(STATUS "Did not find a valid Catch2 installation. Using FetchContent to install it")
include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.0.0-preview4
)
FetchContent_MakeAvailable(Catch2)
#fixes regression -preview4, to be confirmed in later releases
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true")
set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true")
endif()
endif()
add_library(${LIB_EIVE_MISSION}) add_library(${LIB_EIVE_MISSION})
# Add main executable # Add main executable
add_executable(${OBSW_NAME}) add_executable(${OBSW_NAME})
if(EIVE_CREATE_UNIQUE_OBSW_BIN) if(EIVE_CREATE_UNIQUE_OBSW_BIN)
@ -301,12 +278,13 @@ target_include_directories(${WATCHDOG_NAME} PUBLIC
# unittests # unittests
add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL) add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL)
if(EIVE_ADD_ETL_LIB)
endif()
if(EIVE_ADD_JSON_LIB) if(EIVE_ADD_JSON_LIB)
add_subdirectory(${LIB_JSON_PATH}) add_subdirectory(${LIB_JSON_PATH})
endif() endif()
if(EIVE_ADD_LINUX_FILES) if(EIVE_ADD_LINUX_FILES)
add_subdirectory(${LIB_ARCSEC_PATH}) add_subdirectory(${LIB_ARCSEC_PATH})
add_subdirectory(${LINUX_PATH}) add_subdirectory(${LINUX_PATH})
@ -316,26 +294,52 @@ if(ADD_CSP_LIB)
add_subdirectory(${LIB_CSP_PATH}) add_subdirectory(${LIB_CSP_PATH})
endif() endif()
add_subdirectory(${COMMON_PATH}) add_subdirectory(${COMMON_PATH})
add_subdirectory(${LIB_LWGPS_PATH}) add_subdirectory(${LIB_LWGPS_PATH})
add_subdirectory(${FSFW_PATH}) add_subdirectory(${FSFW_PATH})
add_subdirectory(${LIB_EIVE_MISSION_PATH}) add_subdirectory(${LIB_EIVE_MISSION_PATH})
add_subdirectory(${TEST_PATH}) add_subdirectory(${TEST_PATH})
add_subdirectory(${UNITTEST_PATH}) add_subdirectory(${UNITTEST_PATH})
# This should have already been downloaded by the FSFW
# Still include it to be safe
include(FetchContent)
FetchContent_Declare(
etl
GIT_REPOSITORY https://github.com/ETLCPP/etl
GIT_TAG ${FSFW_ETL_LIB_VERSION}
)
FetchContent_MakeAvailable(etl)
# Use same Catch2 version as framework
if (NOT(TGT_BSP MATCHES "arm/te0720-1cfa") AND NOT(TGT_BSP MATCHES "arm/q7s"))
# Check whether the user has already installed Catch2 first
find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} CONFIG QUIET)
# Not installed, so use FetchContent to download and provide Catch2
if(NOT Catch2_FOUND)
message(STATUS "${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent")
include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG ${FSFW_CATCH2_LIB_VERSION}
)
FetchContent_MakeAvailable(Catch2)
#fixes regression -preview4, to be confirmed in later releases
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true")
set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true")
endif()
endif()
################################################################################ ################################################################################
# Post-Sources preparation # Post-Sources preparation
################################################################################ ################################################################################
# Add libraries # Add libraries
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
${LIB_FSFW_NAME} ${LIB_FSFW_NAME}
@ -374,7 +378,7 @@ endif()
if(EIVE_ADD_ETL_LIB) if(EIVE_ADD_ETL_LIB)
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
${LIB_ETL_NAME} etl
) )
endif() endif()

View File

@ -8,6 +8,8 @@
#include "commonConfig.h" #include "commonConfig.h"
#define OBSW_PRINT_MISSED_DEADLINES 1
#define OBSW_ADD_TEST_CODE 1 #define OBSW_ADD_TEST_CODE 1
/* These defines should be disabled for mission code but are useful for /* These defines should be disabled for mission code but are useful for
@ -20,6 +22,12 @@ debugging. */
// Set to 1 if telecommands are received via the PDEC IP Core // Set to 1 if telecommands are received via the PDEC IP Core
#define OBSW_TC_FROM_PDEC 0 #define OBSW_TC_FROM_PDEC 0
#define OBSW_SYRLINKS_SIMULATED 0
#define OBSW_INITIALIZE_SWITCHES 0
#define OBSW_TCP_SERVER_WIRETAPPING 0
#ifdef __cplusplus #ifdef __cplusplus
#include "objects/systemObjectList.h" #include "objects/systemObjectList.h"

View File

@ -1,7 +1,7 @@
#include <iostream> #include <iostream>
#include "InitMission.h" #include "InitMission.h"
#include "OBSWVersion.h" #include "commonConfig.h"
#include "fsfw/FSFWVersion.h" #include "fsfw/FSFWVersion.h"
#include "fsfw/tasks/TaskFactory.h" #include "fsfw/tasks/TaskFactory.h"
#ifdef WIN32 #ifdef WIN32
@ -19,9 +19,9 @@ static const char* COMPILE_PRINTOUT = "unknown OS";
int main(void) { int main(void) {
std::cout << "-- EIVE OBSW --" << std::endl; std::cout << "-- EIVE OBSW --" << std::endl;
std::cout << "-- Compiled for " << COMPILE_PRINTOUT << " --" << std::endl; std::cout << "-- Compiled for " << COMPILE_PRINTOUT << " --" << std::endl;
std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "." std::cout << "-- OBSW "
<< SW_REVISION << ", FSFW v" << FSFW_VERSION << "." << FSFW_SUBVERSION << "." << " v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --"
<< FSFW_REVISION << "--" << std::endl; << std::endl;
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
initmission::initMission(); initmission::initMission();

View File

@ -168,6 +168,9 @@ void ObjectFactory::produce(void* args) {
imtqHandler->setStartUpImmediately(); imtqHandler->setStartUpImmediately();
imtqHandler->setToGoToNormal(true); imtqHandler->setToGoToNormal(true);
#endif #endif
#if OBSW_DEBUG_IMTQ == 1
imtqHandler->setDebugMode(true);
#endif
#endif #endif
createReactionWheelComponents(gpioComIF); createReactionWheelComponents(gpioComIF);
@ -177,6 +180,9 @@ void ObjectFactory::produce(void* args) {
new BpxBatteryHandler(objects::BPX_BATT_HANDLER, objects::I2C_COM_IF, bpxI2cCookie); new BpxBatteryHandler(objects::BPX_BATT_HANDLER, objects::I2C_COM_IF, bpxI2cCookie);
bpxHandler->setStartUpImmediately(); bpxHandler->setStartUpImmediately();
bpxHandler->setToGoToNormalMode(true); bpxHandler->setToGoToNormalMode(true);
#if OBSW_DEBUG_BPX_BATT == 1
bpxHandler->setDebugMode(true);
#endif
#endif #endif
new FileSystemHandler(objects::FILE_SYSTEM_HANDLER); new FileSystemHandler(objects::FILE_SYSTEM_HANDLER);
@ -266,6 +272,12 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI
if (pwrSwitcher != nullptr) { if (pwrSwitcher != nullptr) {
*pwrSwitcher = pcduHandler; *pwrSwitcher = pcduHandler;
} }
#if OBSW_DEBUG_P60DOCK == 1
p60dockhandler->setDebugMode(true);
#endif
#if OBSW_DEBUG_ACU == 1
acuhandler->setDebugMode(true);
#endif
} }
void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
@ -632,6 +644,9 @@ void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) {
auto syrlinksHandler = new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, auto syrlinksHandler = new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF,
syrlinksUartCookie, pcdu::PDU1_CH1_SYRLINKS_12V); syrlinksUartCookie, pcdu::PDU1_CH1_SYRLINKS_12V);
syrlinksHandler->setPowerSwitcher(pwrSwitcher); syrlinksHandler->setPowerSwitcher(pwrSwitcher);
#if OBSW_DEBUG_SYRLINKS == 1
syrlinksHandler->setDebugMode(true);
#endif
} }
void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
@ -732,32 +747,35 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
auto rwHandler1 = auto rwHandler1 =
new RwHandler(objects::RW1, objects::SPI_COM_IF, rw1SpiCookie, gpioComIF, gpioIds::EN_RW1); new RwHandler(objects::RW1, objects::SPI_COM_IF, rw1SpiCookie, gpioComIF, gpioIds::EN_RW1);
rw1SpiCookie->setCallbackArgs(rwHandler1);
#if OBSW_DEBUG_RW == 1 #if OBSW_DEBUG_RW == 1
rwHandler1->setStartUpImmediately(); rwHandler1->setStartUpImmediately();
rwHandler1->setDebugMode(true);
#endif #endif
rw1SpiCookie->setCallbackArgs(rwHandler1);
rwHandler1->setStartUpImmediately();
auto rwHandler2 = auto rwHandler2 =
new RwHandler(objects::RW2, objects::SPI_COM_IF, rw2SpiCookie, gpioComIF, gpioIds::EN_RW2); new RwHandler(objects::RW2, objects::SPI_COM_IF, rw2SpiCookie, gpioComIF, gpioIds::EN_RW2);
rw2SpiCookie->setCallbackArgs(rwHandler2);
#if OBSW_DEBUG_RW == 1 #if OBSW_DEBUG_RW == 1
rwHandler2->setStartUpImmediately(); rwHandler2->setStartUpImmediately();
rwHandler2->setDebugMode(true);
#endif #endif
rw2SpiCookie->setCallbackArgs(rwHandler2);
auto rwHandler3 = auto rwHandler3 =
new RwHandler(objects::RW3, objects::SPI_COM_IF, rw3SpiCookie, gpioComIF, gpioIds::EN_RW3); new RwHandler(objects::RW3, objects::SPI_COM_IF, rw3SpiCookie, gpioComIF, gpioIds::EN_RW3);
rw3SpiCookie->setCallbackArgs(rwHandler3);
#if OBSW_DEBUG_RW == 1 #if OBSW_DEBUG_RW == 1
rwHandler3->setStartUpImmediately(); rwHandler3->setStartUpImmediately();
rwHandler3->setDebugMode(true);
#endif #endif
rw3SpiCookie->setCallbackArgs(rwHandler3);
auto rwHandler4 = auto rwHandler4 =
new RwHandler(objects::RW4, objects::SPI_COM_IF, rw4SpiCookie, gpioComIF, gpioIds::EN_RW4); new RwHandler(objects::RW4, objects::SPI_COM_IF, rw4SpiCookie, gpioComIF, gpioIds::EN_RW4);
rw4SpiCookie->setCallbackArgs(rwHandler4);
#if OBSW_DEBUG_RW == 1 #if OBSW_DEBUG_RW == 1
rwHandler4->setStartUpImmediately(); rwHandler4->setStartUpImmediately();
rwHandler4->setDebugMode(true);
#endif #endif
rw4SpiCookie->setCallbackArgs(rwHandler4);
#endif /* OBSW_ADD_RW == 1 */ #endif /* OBSW_ADD_RW == 1 */
} }

View File

@ -4,6 +4,10 @@
#include <cstdint> #include <cstdint>
#include "fsfw/version.h" #include "fsfw/version.h"
/* These defines should be disabled for mission code but are useful for
debugging. */
#define OBSW_VERBOSE_LEVEL 1
#define OBSW_ADD_LWGPS_TEST 0 #define OBSW_ADD_LWGPS_TEST 0
// Disable this for mission code. It allows exchanging TMTC packets via the Ethernet port // Disable this for mission code. It allows exchanging TMTC packets via the Ethernet port

View File

@ -267,6 +267,9 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
rtdFdir = new RtdFdir(rtdIds[idx]); rtdFdir = new RtdFdir(rtdIds[idx]);
rtds[idx]->setCustomFdir(rtdFdir); rtds[idx]->setCustomFdir(rtdFdir);
rtds[idx]->setDeviceIdx(idx + 3); rtds[idx]->setDeviceIdx(idx + 3);
#if OBSW_DEBUG_RTD == 1
rtds[idx]->setDebugMode(true);
#endif
} }
#if OBSW_TEST_RTD == 1 #if OBSW_TEST_RTD == 1

View File

@ -15,10 +15,6 @@
#include "commonConfig.h" #include "commonConfig.h"
#include "OBSWVersion.h" #include "OBSWVersion.h"
/* These defines should be disabled for mission code but are useful for
debugging. */
#define OBSW_VERBOSE_LEVEL 1
#define Q7S_EM 0 #define Q7S_EM 0
/*******************************************************************/ /*******************************************************************/
@ -185,7 +181,7 @@ debugging. */
#endif // RASPBERRY_PI #endif // RASPBERRY_PI
#define TCP_SERVER_WIRETAPPING 0 #define OBSW_TCP_SERVER_WIRETAPPING 0
/*******************************************************************/ /*******************************************************************/
/** CMake Defines */ /** CMake Defines */

View File

@ -111,9 +111,9 @@ void ObjectFactory::produceGenericObjects() {
tcpServer->setSpacePacketParsingOptions({common::PUS_PACKET_ID}); tcpServer->setSpacePacketParsingOptions({common::PUS_PACKET_ID});
sif::info << "Created TCP server for TMTC commanding with listener port " sif::info << "Created TCP server for TMTC commanding with listener port "
<< tcpServer->getTcpPort() << std::endl; << tcpServer->getTcpPort() << std::endl;
#if TCP_SERVER_WIRETAPPING == 1 #if OBSW_TCP_SERVER_WIRETAPPING == 1
tcpServer->enableWiretapping(true); tcpServer->enableWiretapping(true);
#endif /* TCP_SERVER_WIRETAPPING == 1 */ #endif /* OBSW_TCP_SERVER_WIRETAPPING == 1 */
#endif /* OBSW_USE_TMTC_TCP_BRIDGE == 0 */ #endif /* OBSW_USE_TMTC_TCP_BRIDGE == 0 */
tmtcBridge->setMaxNumberOfPacketsStored(70); tmtcBridge->setMaxNumberOfPacketsStored(70);
#endif /* OBSW_ADD_TCPIP_BRIDGE == 1 */ #endif /* OBSW_ADD_TCPIP_BRIDGE == 1 */

View File

@ -23,7 +23,8 @@ void ACUHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pack
parseHkTableReply(packet); parseHkTableReply(packet);
handleDeviceTM(&acuHkTableDataset, id, true); handleDeviceTM(&acuHkTableDataset, id, true);
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_ACU == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
acuHkTableDataset.read(); acuHkTableDataset.read();
float temperatureC_1 = acuHkTableDataset.temperature1.value * 0.1; float temperatureC_1 = acuHkTableDataset.temperature1.value * 0.1;
float temperatureC_2 = acuHkTableDataset.temperature2.value * 0.1; float temperatureC_2 = acuHkTableDataset.temperature2.value * 0.1;
@ -38,6 +39,7 @@ void ACUHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pack
acuHkTableDataset.commit(); acuHkTableDataset.commit();
#endif #endif
} }
}
LocalPoolDataSetBase *ACUHandler::getDataSetHandle(sid_t sid) { LocalPoolDataSetBase *ACUHandler::getDataSetHandle(sid_t sid) {
if (sid == acuHkTableDataset.getSid()) { if (sid == acuHkTableDataset.getSid()) {
@ -317,3 +319,5 @@ void ACUHandler::printChannelStats() {
<< static_cast<unsigned int>(acuHkTableDataset.currentInChannel5.value) << std::setw(15) << static_cast<unsigned int>(acuHkTableDataset.currentInChannel5.value) << std::setw(15)
<< std::right << acuHkTableDataset.voltageInChannel5.value << std::endl; << std::right << acuHkTableDataset.voltageInChannel5.value << std::endl;
} }
void ACUHandler::setDebugMode(bool enable) { this->debugMode = enable; }

View File

@ -15,6 +15,8 @@ class ACUHandler : public GomspaceDeviceHandler {
ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
virtual ~ACUHandler(); virtual ~ACUHandler();
void setDebugMode(bool enable);
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override; LocalDataPoolManager& poolManager) override;
@ -37,6 +39,7 @@ class ACUHandler : public GomspaceDeviceHandler {
static const DeviceCommandId_t PRINT_CHANNEL_STATS = 51; static const DeviceCommandId_t PRINT_CHANNEL_STATS = 51;
ACU::HkTableDataset acuHkTableDataset; ACU::HkTableDataset acuHkTableDataset;
bool debugMode = false;
/** /**
* @brief Function extracts the hk table information from the received csp packet and stores * @brief Function extracts the hk table information from the received csp packet and stores

View File

@ -197,7 +197,7 @@ ReturnValue_t BpxBatteryHandler::interpretDeviceReply(DeviceCommandId_t id, cons
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
return result; return result;
} }
#if OBSW_DEBUG_BPX_BATT == 1 if (debugMode) {
sif::info << "BPX Battery HK output:" << std::endl; sif::info << "BPX Battery HK output:" << std::endl;
sif::info << "Charge current [mA]: " << hkSet.chargeCurrent << std::endl; sif::info << "Charge current [mA]: " << hkSet.chargeCurrent << std::endl;
sif::info << "Discharge current [mA]: " << hkSet.dischargeCurrent << std::endl; sif::info << "Discharge current [mA]: " << hkSet.dischargeCurrent << std::endl;
@ -209,7 +209,7 @@ ReturnValue_t BpxBatteryHandler::interpretDeviceReply(DeviceCommandId_t id, cons
sif::info << "Battery Temperature 4 [C]: " << hkSet.battTemp4 << std::endl; sif::info << "Battery Temperature 4 [C]: " << hkSet.battTemp4 << std::endl;
sif::info << "Battery Reboot Counter: " << hkSet.rebootCounter << std::endl; sif::info << "Battery Reboot Counter: " << hkSet.rebootCounter << std::endl;
sif::info << "Battery Boot Cause: " << static_cast<int>(hkSet.bootcause.value) << std::endl; sif::info << "Battery Boot Cause: " << static_cast<int>(hkSet.bootcause.value) << std::endl;
#endif }
break; break;
} }
case (BpxBattery::PING): { case (BpxBattery::PING): {
@ -277,3 +277,5 @@ ReturnValue_t BpxBatteryHandler::initializeLocalDataPool(localpool::DataPool& lo
void BpxBatteryHandler::setToGoToNormalMode(bool enable) { void BpxBatteryHandler::setToGoToNormalMode(bool enable) {
this->goToNormalModeImmediately = enable; this->goToNormalModeImmediately = enable;
} }
void BpxBatteryHandler::setDebugMode(bool enable) { this->debugMode = enable; }

View File

@ -11,6 +11,7 @@ class BpxBatteryHandler : public DeviceHandlerBase {
virtual ~BpxBatteryHandler(); virtual ~BpxBatteryHandler();
void setToGoToNormalMode(bool enable); void setToGoToNormalMode(bool enable);
void setDebugMode(bool enable);
protected: protected:
enum class States { enum class States {
@ -20,6 +21,7 @@ class BpxBatteryHandler : public DeviceHandlerBase {
States state = States::CHECK_COM; States state = States::CHECK_COM;
bool commandExecuted = false; bool commandExecuted = false;
bool debugMode = false;
bool goToNormalModeImmediately = false; bool goToNormalModeImmediately = false;
uint8_t sentPingByte = BpxBattery::DEFAULT_PING_SENT_BYTE; uint8_t sentPingByte = BpxBattery::DEFAULT_PING_SENT_BYTE;
BpxBatteryHk hkSet; BpxBatteryHk hkSet;

View File

@ -687,7 +687,8 @@ void IMTQHandler::fillEngHkDataset(const uint8_t* packet) {
offset += 2; offset += 2;
engHkDataset.mcuTemperature = (*(packet + offset + 1) << 8 | *(packet + offset)); engHkDataset.mcuTemperature = (*(packet + offset + 1) << 8 | *(packet + offset));
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "IMTQ digital voltage: " << engHkDataset.digitalVoltageMv << " mV" << std::endl; sif::info << "IMTQ digital voltage: " << engHkDataset.digitalVoltageMv << " mV" << std::endl;
sif::info << "IMTQ analog voltage: " << engHkDataset.analogVoltageMv << " mV" << std::endl; sif::info << "IMTQ analog voltage: " << engHkDataset.analogVoltageMv << " mV" << std::endl;
sif::info << "IMTQ digital current: " << engHkDataset.digitalCurrentmA << " mA" << std::endl; sif::info << "IMTQ digital current: " << engHkDataset.digitalCurrentmA << " mA" << std::endl;
@ -701,6 +702,7 @@ void IMTQHandler::fillEngHkDataset(const uint8_t* packet) {
sif::info << "IMTQ coil MCU temperature: " << engHkDataset.mcuTemperature << " °C" << std::endl; sif::info << "IMTQ coil MCU temperature: " << engHkDataset.mcuTemperature << " °C" << std::endl;
#endif #endif
} }
}
void IMTQHandler::setToGoToNormal(bool enable) { this->goToNormalMode = enable; } void IMTQHandler::setToGoToNormal(bool enable) { this->goToNormalMode = enable; }
@ -755,7 +757,8 @@ void IMTQHandler::fillCalibratedMtmDataset(const uint8_t* packet) {
calMtmMeasurementSet.coilActuationStatus = (*(packet + offset + 3) << 24) | calMtmMeasurementSet.coilActuationStatus = (*(packet + offset + 3) << 24) |
(*(packet + offset + 2) << 16) | (*(packet + offset + 2) << 16) |
(*(packet + offset + 1) << 8) | (*(packet + offset)); (*(packet + offset + 1) << 8) | (*(packet + offset));
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "IMTQ calibrated MTM measurement X: " << calMtmMeasurementSet.mtmXnT << " nT" sif::info << "IMTQ calibrated MTM measurement X: " << calMtmMeasurementSet.mtmXnT << " nT"
<< std::endl; << std::endl;
sif::info << "IMTQ calibrated MTM measurement Y: " << calMtmMeasurementSet.mtmYnT << " nT" sif::info << "IMTQ calibrated MTM measurement Y: " << calMtmMeasurementSet.mtmYnT << " nT"
@ -766,6 +769,7 @@ void IMTQHandler::fillCalibratedMtmDataset(const uint8_t* packet) {
<< (unsigned int)calMtmMeasurementSet.coilActuationStatus.value << std::endl; << (unsigned int)calMtmMeasurementSet.coilActuationStatus.value << std::endl;
#endif #endif
} }
}
void IMTQHandler::fillRawMtmDataset(const uint8_t* packet) { void IMTQHandler::fillRawMtmDataset(const uint8_t* packet) {
PoolReadGuard rg(&rawMtmMeasurementSet); PoolReadGuard rg(&rawMtmMeasurementSet);
@ -785,14 +789,19 @@ void IMTQHandler::fillRawMtmDataset(const uint8_t* packet) {
rawMtmMeasurementSet.coilActuationStatus = (*(packet + offset + 3) << 24) | rawMtmMeasurementSet.coilActuationStatus = (*(packet + offset + 3) << 24) |
(*(packet + offset + 2) << 16) | (*(packet + offset + 2) << 16) |
(*(packet + offset + 1) << 8) | (*(packet + offset)); (*(packet + offset + 1) << 8) | (*(packet + offset));
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 if (debugMode) {
sif::info << "IMTQ raw MTM measurement X: " << rawMtmMeasurementSet.mtmXnT << " nT" << std::endl; #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "IMTQ raw MTM measurement Y: " << rawMtmMeasurementSet.mtmYnT << " nT" << std::endl; sif::info << "IMTQ raw MTM measurement X: " << rawMtmMeasurementSet.mtmXnT << " nT"
sif::info << "IMTQ raw MTM measurement Z: " << rawMtmMeasurementSet.mtmZnT << " nT" << std::endl; << std::endl;
sif::info << "IMTQ raw MTM measurement Y: " << rawMtmMeasurementSet.mtmYnT << " nT"
<< std::endl;
sif::info << "IMTQ raw MTM measurement Z: " << rawMtmMeasurementSet.mtmZnT << " nT"
<< std::endl;
sif::info << "IMTQ coil actuation status during MTM measurement: " sif::info << "IMTQ coil actuation status during MTM measurement: "
<< (unsigned int)rawMtmMeasurementSet.coilActuationStatus.value << std::endl; << (unsigned int)rawMtmMeasurementSet.coilActuationStatus.value << std::endl;
#endif #endif
} }
}
void IMTQHandler::handleSelfTestReply(const uint8_t* packet) { void IMTQHandler::handleSelfTestReply(const uint8_t* packet) {
uint16_t offset = 2; uint16_t offset = 2;
@ -954,7 +963,8 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) {
posXselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); posXselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset);
offset += 4; offset += 4;
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "IMTQ self test (INIT) err: " sif::info << "IMTQ self test (INIT) err: "
<< static_cast<unsigned int>(posXselfTestDataset.initErr.value) << std::endl; << static_cast<unsigned int>(posXselfTestDataset.initErr.value) << std::endl;
sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posXselfTestDataset.initRawMagX sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posXselfTestDataset.initRawMagX
@ -984,12 +994,12 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) {
sif::info << "IMTQ self test (+X) err: " sif::info << "IMTQ self test (+X) err: "
<< static_cast<unsigned int>(posXselfTestDataset.err.value) << std::endl; << static_cast<unsigned int>(posXselfTestDataset.err.value) << std::endl;
sif::info << "IMTQ self test (+X) raw magnetic field X: " << posXselfTestDataset.rawMagX << " nT" sif::info << "IMTQ self test (+X) raw magnetic field X: " << posXselfTestDataset.rawMagX
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (+X) raw magnetic field Y: " << posXselfTestDataset.rawMagY << " nT" sif::info << "IMTQ self test (+X) raw magnetic field Y: " << posXselfTestDataset.rawMagY
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (+X) raw magnetic field Z: " << posXselfTestDataset.rawMagZ << " nT" sif::info << "IMTQ self test (+X) raw magnetic field Z: " << posXselfTestDataset.rawMagZ
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (+X) calibrated magnetic field X: " << posXselfTestDataset.calMagX sif::info << "IMTQ self test (+X) calibrated magnetic field X: " << posXselfTestDataset.calMagX
<< " nT" << std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (+X) calibrated magnetic field Y: " << posXselfTestDataset.calMagY sif::info << "IMTQ self test (+X) calibrated magnetic field Y: " << posXselfTestDataset.calMagY
@ -1037,6 +1047,7 @@ void IMTQHandler::handlePositiveXSelfTestReply(const uint8_t* packet) {
<< posXselfTestDataset.finaCoilZTemperature << " °C" << std::endl; << posXselfTestDataset.finaCoilZTemperature << " °C" << std::endl;
#endif #endif
} }
}
void IMTQHandler::handleNegativeXSelfTestReply(const uint8_t* packet) { void IMTQHandler::handleNegativeXSelfTestReply(const uint8_t* packet) {
PoolReadGuard rg(&posXselfTestDataset); PoolReadGuard rg(&posXselfTestDataset);
@ -1164,7 +1175,8 @@ void IMTQHandler::handleNegativeXSelfTestReply(const uint8_t* packet) {
negXselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); negXselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset);
offset += 4; offset += 4;
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "IMTQ self test (INIT) err: " sif::info << "IMTQ self test (INIT) err: "
<< static_cast<unsigned int>(negXselfTestDataset.initErr.value) << std::endl; << static_cast<unsigned int>(negXselfTestDataset.initErr.value) << std::endl;
sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negXselfTestDataset.initRawMagX sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negXselfTestDataset.initRawMagX
@ -1194,12 +1206,12 @@ void IMTQHandler::handleNegativeXSelfTestReply(const uint8_t* packet) {
sif::info << "IMTQ self test (-X) err: " sif::info << "IMTQ self test (-X) err: "
<< static_cast<unsigned int>(negXselfTestDataset.err.value) << std::endl; << static_cast<unsigned int>(negXselfTestDataset.err.value) << std::endl;
sif::info << "IMTQ self test (-X) raw magnetic field X: " << negXselfTestDataset.rawMagX << " nT" sif::info << "IMTQ self test (-X) raw magnetic field X: " << negXselfTestDataset.rawMagX
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (-X) raw magnetic field Y: " << negXselfTestDataset.rawMagY << " nT" sif::info << "IMTQ self test (-X) raw magnetic field Y: " << negXselfTestDataset.rawMagY
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (-X) raw magnetic field Z: " << negXselfTestDataset.rawMagZ << " nT" sif::info << "IMTQ self test (-X) raw magnetic field Z: " << negXselfTestDataset.rawMagZ
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (-X) calibrated magnetic field X: " << negXselfTestDataset.calMagX sif::info << "IMTQ self test (-X) calibrated magnetic field X: " << negXselfTestDataset.calMagX
<< " nT" << std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (-X) calibrated magnetic field Y: " << negXselfTestDataset.calMagY sif::info << "IMTQ self test (-X) calibrated magnetic field Y: " << negXselfTestDataset.calMagY
@ -1247,6 +1259,7 @@ void IMTQHandler::handleNegativeXSelfTestReply(const uint8_t* packet) {
<< negXselfTestDataset.finaCoilZTemperature << " °C" << std::endl; << negXselfTestDataset.finaCoilZTemperature << " °C" << std::endl;
#endif #endif
} }
}
void IMTQHandler::handlePositiveYSelfTestReply(const uint8_t* packet) { void IMTQHandler::handlePositiveYSelfTestReply(const uint8_t* packet) {
PoolReadGuard rg(&posXselfTestDataset); PoolReadGuard rg(&posXselfTestDataset);
@ -1374,7 +1387,8 @@ void IMTQHandler::handlePositiveYSelfTestReply(const uint8_t* packet) {
posYselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); posYselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset);
offset += 4; offset += 4;
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "IMTQ self test (INIT) err: " sif::info << "IMTQ self test (INIT) err: "
<< static_cast<unsigned int>(posYselfTestDataset.initErr.value) << std::endl; << static_cast<unsigned int>(posYselfTestDataset.initErr.value) << std::endl;
sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posYselfTestDataset.initRawMagX sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posYselfTestDataset.initRawMagX
@ -1404,12 +1418,12 @@ void IMTQHandler::handlePositiveYSelfTestReply(const uint8_t* packet) {
sif::info << "IMTQ self test (+Y) err: " sif::info << "IMTQ self test (+Y) err: "
<< static_cast<unsigned int>(posYselfTestDataset.err.value) << std::endl; << static_cast<unsigned int>(posYselfTestDataset.err.value) << std::endl;
sif::info << "IMTQ self test (+Y) raw magnetic field X: " << posYselfTestDataset.rawMagX << " nT" sif::info << "IMTQ self test (+Y) raw magnetic field X: " << posYselfTestDataset.rawMagX
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (+Y) raw magnetic field Y: " << posYselfTestDataset.rawMagY << " nT" sif::info << "IMTQ self test (+Y) raw magnetic field Y: " << posYselfTestDataset.rawMagY
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (+Y) raw magnetic field Z: " << posYselfTestDataset.rawMagZ << " nT" sif::info << "IMTQ self test (+Y) raw magnetic field Z: " << posYselfTestDataset.rawMagZ
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (+Y) calibrated magnetic field X: " << posYselfTestDataset.calMagX sif::info << "IMTQ self test (+Y) calibrated magnetic field X: " << posYselfTestDataset.calMagX
<< " nT" << std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (+Y) calibrated magnetic field Y: " << posYselfTestDataset.calMagY sif::info << "IMTQ self test (+Y) calibrated magnetic field Y: " << posYselfTestDataset.calMagY
@ -1457,6 +1471,7 @@ void IMTQHandler::handlePositiveYSelfTestReply(const uint8_t* packet) {
<< posYselfTestDataset.finaCoilZTemperature << " °C" << std::endl; << posYselfTestDataset.finaCoilZTemperature << " °C" << std::endl;
#endif #endif
} }
}
void IMTQHandler::handleNegativeYSelfTestReply(const uint8_t* packet) { void IMTQHandler::handleNegativeYSelfTestReply(const uint8_t* packet) {
PoolReadGuard rg(&posXselfTestDataset); PoolReadGuard rg(&posXselfTestDataset);
@ -1584,7 +1599,8 @@ void IMTQHandler::handleNegativeYSelfTestReply(const uint8_t* packet) {
negYselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); negYselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset);
offset += 4; offset += 4;
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "IMTQ self test (INIT) err: " sif::info << "IMTQ self test (INIT) err: "
<< static_cast<unsigned int>(negYselfTestDataset.initErr.value) << std::endl; << static_cast<unsigned int>(negYselfTestDataset.initErr.value) << std::endl;
sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negYselfTestDataset.initRawMagX sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negYselfTestDataset.initRawMagX
@ -1614,12 +1630,12 @@ void IMTQHandler::handleNegativeYSelfTestReply(const uint8_t* packet) {
sif::info << "IMTQ self test (-Y) err: " sif::info << "IMTQ self test (-Y) err: "
<< static_cast<unsigned int>(negYselfTestDataset.err.value) << std::endl; << static_cast<unsigned int>(negYselfTestDataset.err.value) << std::endl;
sif::info << "IMTQ self test (-Y) raw magnetic field X: " << negYselfTestDataset.rawMagX << " nT" sif::info << "IMTQ self test (-Y) raw magnetic field X: " << negYselfTestDataset.rawMagX
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (-Y) raw magnetic field Y: " << negYselfTestDataset.rawMagY << " nT" sif::info << "IMTQ self test (-Y) raw magnetic field Y: " << negYselfTestDataset.rawMagY
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (-Y) raw magnetic field Z: " << negYselfTestDataset.rawMagZ << " nT" sif::info << "IMTQ self test (-Y) raw magnetic field Z: " << negYselfTestDataset.rawMagZ
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (-Y) calibrated magnetic field X: " << negYselfTestDataset.calMagX sif::info << "IMTQ self test (-Y) calibrated magnetic field X: " << negYselfTestDataset.calMagX
<< " nT" << std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (-Y) calibrated magnetic field Y: " << negYselfTestDataset.calMagY sif::info << "IMTQ self test (-Y) calibrated magnetic field Y: " << negYselfTestDataset.calMagY
@ -1667,6 +1683,7 @@ void IMTQHandler::handleNegativeYSelfTestReply(const uint8_t* packet) {
<< negYselfTestDataset.finaCoilZTemperature << " °C" << std::endl; << negYselfTestDataset.finaCoilZTemperature << " °C" << std::endl;
#endif #endif
} }
}
void IMTQHandler::handlePositiveZSelfTestReply(const uint8_t* packet) { void IMTQHandler::handlePositiveZSelfTestReply(const uint8_t* packet) {
PoolReadGuard rg(&posXselfTestDataset); PoolReadGuard rg(&posXselfTestDataset);
@ -1794,7 +1811,8 @@ void IMTQHandler::handlePositiveZSelfTestReply(const uint8_t* packet) {
posZselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); posZselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset);
offset += 4; offset += 4;
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "IMTQ self test (INIT) err: " sif::info << "IMTQ self test (INIT) err: "
<< static_cast<unsigned int>(posZselfTestDataset.initErr.value) << std::endl; << static_cast<unsigned int>(posZselfTestDataset.initErr.value) << std::endl;
sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posZselfTestDataset.initRawMagX sif::info << "IMTQ self test (INIT) raw magnetic field X: " << posZselfTestDataset.initRawMagX
@ -1824,12 +1842,12 @@ void IMTQHandler::handlePositiveZSelfTestReply(const uint8_t* packet) {
sif::info << "IMTQ self test (+Z) err: " sif::info << "IMTQ self test (+Z) err: "
<< static_cast<unsigned int>(posZselfTestDataset.err.value) << std::endl; << static_cast<unsigned int>(posZselfTestDataset.err.value) << std::endl;
sif::info << "IMTQ self test (+Z) raw magnetic field X: " << posZselfTestDataset.rawMagX << " nT" sif::info << "IMTQ self test (+Z) raw magnetic field X: " << posZselfTestDataset.rawMagX
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (+Z) raw magnetic field Y: " << posZselfTestDataset.rawMagY << " nT" sif::info << "IMTQ self test (+Z) raw magnetic field Y: " << posZselfTestDataset.rawMagY
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (+Z) raw magnetic field Z: " << posZselfTestDataset.rawMagZ << " nT" sif::info << "IMTQ self test (+Z) raw magnetic field Z: " << posZselfTestDataset.rawMagZ
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (+Z) calibrated magnetic field X: " << posZselfTestDataset.calMagX sif::info << "IMTQ self test (+Z) calibrated magnetic field X: " << posZselfTestDataset.calMagX
<< " nT" << std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (+Z) calibrated magnetic field Y: " << posZselfTestDataset.calMagY sif::info << "IMTQ self test (+Z) calibrated magnetic field Y: " << posZselfTestDataset.calMagY
@ -1877,6 +1895,7 @@ void IMTQHandler::handlePositiveZSelfTestReply(const uint8_t* packet) {
<< posZselfTestDataset.finaCoilZTemperature << " °C" << std::endl; << posZselfTestDataset.finaCoilZTemperature << " °C" << std::endl;
#endif #endif
} }
}
void IMTQHandler::handleNegativeZSelfTestReply(const uint8_t* packet) { void IMTQHandler::handleNegativeZSelfTestReply(const uint8_t* packet) {
PoolReadGuard rg(&posXselfTestDataset); PoolReadGuard rg(&posXselfTestDataset);
@ -2004,7 +2023,8 @@ void IMTQHandler::handleNegativeZSelfTestReply(const uint8_t* packet) {
negZselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset); negZselfTestDataset.finaCoilZTemperature = *(packet + offset + 1) << 8 | *(packet + offset);
offset += 4; offset += 4;
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_IMTQ == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "IMTQ self test (INIT) err: " sif::info << "IMTQ self test (INIT) err: "
<< static_cast<unsigned int>(negZselfTestDataset.initErr.value) << std::endl; << static_cast<unsigned int>(negZselfTestDataset.initErr.value) << std::endl;
sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negZselfTestDataset.initRawMagX sif::info << "IMTQ self test (INIT) raw magnetic field X: " << negZselfTestDataset.initRawMagX
@ -2034,12 +2054,12 @@ void IMTQHandler::handleNegativeZSelfTestReply(const uint8_t* packet) {
sif::info << "IMTQ self test (-Z) err: " sif::info << "IMTQ self test (-Z) err: "
<< static_cast<unsigned int>(negZselfTestDataset.err.value) << std::endl; << static_cast<unsigned int>(negZselfTestDataset.err.value) << std::endl;
sif::info << "IMTQ self test (-Z) raw magnetic field X: " << negZselfTestDataset.rawMagX << " nT" sif::info << "IMTQ self test (-Z) raw magnetic field X: " << negZselfTestDataset.rawMagX
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (-Z) raw magnetic field Y: " << negZselfTestDataset.rawMagY << " nT" sif::info << "IMTQ self test (-Z) raw magnetic field Y: " << negZselfTestDataset.rawMagY
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (-Z) raw magnetic field Z: " << negZselfTestDataset.rawMagZ << " nT" sif::info << "IMTQ self test (-Z) raw magnetic field Z: " << negZselfTestDataset.rawMagZ
<< std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (-Z) calibrated magnetic field X: " << negZselfTestDataset.calMagX sif::info << "IMTQ self test (-Z) calibrated magnetic field X: " << negZselfTestDataset.calMagX
<< " nT" << std::endl; << " nT" << std::endl;
sif::info << "IMTQ self test (-Z) calibrated magnetic field Y: " << negZselfTestDataset.calMagY sif::info << "IMTQ self test (-Z) calibrated magnetic field Y: " << negZselfTestDataset.calMagY
@ -2087,6 +2107,9 @@ void IMTQHandler::handleNegativeZSelfTestReply(const uint8_t* packet) {
<< negZselfTestDataset.finaCoilZTemperature << " °C" << std::endl; << negZselfTestDataset.finaCoilZTemperature << " °C" << std::endl;
#endif #endif
} }
}
void IMTQHandler::setDebugMode(bool enable) { this->debugMode = enable; }
void IMTQHandler::checkErrorByte(const uint8_t errorByte, const uint8_t step) { void IMTQHandler::checkErrorByte(const uint8_t errorByte, const uint8_t step) {
std::string stepString(""); std::string stepString("");

View File

@ -21,6 +21,8 @@ class IMTQHandler : public DeviceHandlerBase {
*/ */
void setToGoToNormal(bool enable); void setToGoToNormal(bool enable);
void setDebugMode(bool enable);
protected: protected:
void doStartUp() override; void doStartUp() override;
void doShutDown() override; void doShutDown() override;
@ -99,6 +101,7 @@ class IMTQHandler : public DeviceHandlerBase {
uint8_t commandBuffer[IMTQ::MAX_COMMAND_SIZE]; uint8_t commandBuffer[IMTQ::MAX_COMMAND_SIZE];
bool goToNormalMode = false; bool goToNormalMode = false;
bool debugMode = false;
enum class CommunicationStep { enum class CommunicationStep {
GET_ENG_HK_DATA, GET_ENG_HK_DATA,

View File

@ -399,12 +399,12 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply(DeviceCommandId_t id,
// calculate approximation // calculate approximation
float approxTemp = adcCode / 32.0 - 256.0; float approxTemp = adcCode / 32.0 - 256.0;
#if OBSW_DEBUG_RTD == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1 #if OBSW_VERBOSE_LEVEL >= 1
if (debugDivider->checkAndIncrement()) { if (debugDivider->checkAndIncrement()) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Max31865: ObjID " << std::hex << this->getObjectId() << " | RTD " << std::dec sif::info << "Max31865: ObjID " << std::hex << this->getObjectId() << " | RTD "
<< static_cast<int>(deviceIdx) << ": R[Ohm] " << rtdValue << std::dec << static_cast<int>(deviceIdx) << ": R[Ohm] " << rtdValue
<< " Ohms | Approx T[C]: " << approxTemp << std::endl; << " Ohms | Approx T[C]: " << approxTemp << std::endl;
#else #else
sif::printInfo("Max31685: Measured resistance is %f Ohms\n", rtdValue); sif::printInfo("Max31685: Measured resistance is %f Ohms\n", rtdValue);
@ -412,7 +412,8 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply(DeviceCommandId_t id,
#endif #endif
} }
#endif #endif
#endif }
PoolReadGuard pg(&sensorDataset); PoolReadGuard pg(&sensorDataset);
if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) { if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
// Configuration error // Configuration error
@ -530,3 +531,5 @@ void Max31865PT1000Handler::modeChanged() {
} }
void Max31865PT1000Handler::setDeviceIdx(uint8_t idx) { deviceIdx = idx; } void Max31865PT1000Handler::setDeviceIdx(uint8_t idx) { deviceIdx = idx; }
void Max31865PT1000Handler::setDebugMode(bool enable) { this->debugMode = enable; }

View File

@ -33,6 +33,8 @@ class Max31865PT1000Handler : public DeviceHandlerBase {
Max31865PT1000Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie); Max31865PT1000Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie);
virtual ~Max31865PT1000Handler(); virtual ~Max31865PT1000Handler();
void setDebugMode(bool enable);
// Configuration in 8 digit code: // Configuration in 8 digit code:
// 1. 1 for V_BIAS enabled, 0 for disabled // 1. 1 for V_BIAS enabled, 0 for disabled
// 2. 1 for Auto-conversion, 0 for off // 2. 1 for Auto-conversion, 0 for off
@ -85,6 +87,7 @@ class Max31865PT1000Handler : public DeviceHandlerBase {
private: private:
uint8_t switchId = 0; uint8_t switchId = 0;
bool instantNormal = false; bool instantNormal = false;
bool debugMode = false;
bool warningSwitch = true; bool warningSwitch = true;
enum class InternalState { enum class InternalState {

View File

@ -24,50 +24,6 @@ void P60DockHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *
* P60DockHandler itself. * P60DockHandler itself.
*/ */
handleDeviceTM(&coreHk, id, true); handleDeviceTM(&coreHk, id, true);
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_P60DOCK == 1
p60dockHkTableDataset.read();
sif::info << "P60 Dock: ACU VCC switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateAcuVcc.value)
<< std::endl;
sif::info << "P60 Dock: PDU1 VCC switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu1Vcc.value)
<< std::endl;
sif::info << "P60 Dock: PDU2 VCC switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu2Vcc.value)
<< std::endl;
sif::info << "P60 Dock: ACU VBAT switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateAcuVbat.value)
<< std::endl;
sif::info << "P60 Dock: PDU1 VBAT switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu1Vbat.value)
<< std::endl;
sif::info << "P60 Dock: PDU2 VBAT switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu2Vbat.value)
<< std::endl;
sif::info << "P60 Dock: Stack VBAT switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateStackVbat.value)
<< std::endl;
sif::info << "P60 Dock: Stack 3V3 switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateStack3V3.value)
<< std::endl;
sif::info << "P60 Dock: Stack 5V switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateStack5V.value)
<< std::endl;
float temperatureC = p60dockHkTableDataset.temperature1.value * 0.1;
sif::info << "P60 Dock: Temperature 1: " << temperatureC << " °C" << std::endl;
temperatureC = p60dockHkTableDataset.temperature2.value * 0.1;
sif::info << "P60 Dock: Temperature 2: " << temperatureC << " °C" << std::endl;
sif::info << "P60 Dock: Watchdog Timer seconds left before reboot: "
<< p60dockHkTableDataset.wdtGndLeft << " seconds" << std::endl;
sif::info << "P60 Dock: CSP 1, pings left before reboot: "
<< (int)p60dockHkTableDataset.wdtCspLeft1.value << std::endl;
sif::info << "P60 Dock: CSP 2, pings left before reboot: "
<< (int)p60dockHkTableDataset.wdtCspLeft1.value << std::endl;
p60dockHkTableDataset.commit();
#endif
} }
void P60DockHandler::parseHkTableReply(const uint8_t *packet) { void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
@ -362,3 +318,5 @@ void P60DockHandler::printHkTableLatchups() {
genericPrintoutHandler("X3 VBAT", hk::X3_IDLE_VBAT); genericPrintoutHandler("X3 VBAT", hk::X3_IDLE_VBAT);
genericPrintoutHandler("X3 VCC", hk::X3_IDLE_VCC); genericPrintoutHandler("X3 VCC", hk::X3_IDLE_VCC);
} }
void P60DockHandler::setDebugMode(bool enable) { this->debugMode = enable; }

View File

@ -24,6 +24,8 @@ class P60DockHandler : public GomspaceDeviceHandler {
P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
virtual ~P60DockHandler(); virtual ~P60DockHandler();
void setDebugMode(bool enable);
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override; LocalDataPoolManager& poolManager) override;
@ -50,6 +52,7 @@ class P60DockHandler : public GomspaceDeviceHandler {
P60Dock::CoreHkSet coreHk; P60Dock::CoreHkSet coreHk;
P60Dock::HkTableDataset auxHk; P60Dock::HkTableDataset auxHk;
bool firstHk = true; bool firstHk = true;
bool debugMode = false;
static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16; static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16;
PoolEntry<int16_t> hkCurrents = PoolEntry<int16_t>(P60Dock::hk::CHNLS_LEN); PoolEntry<int16_t> hkCurrents = PoolEntry<int16_t>(P60Dock::hk::CHNLS_LEN);

View File

@ -2,7 +2,9 @@
#include <fsfw/src/fsfw/datapool/PoolReadGuard.h> #include <fsfw/src/fsfw/datapool/PoolReadGuard.h>
#ifdef FSFW_OSAL_LINUX #include "OBSWConfig.h"
#ifdef XIPHOS_Q7S
#include <fsfw_hal/linux/UnixFileGuard.h> #include <fsfw_hal/linux/UnixFileGuard.h>
#include <fsfw_hal/linux/spi/SpiComIF.h> #include <fsfw_hal/linux/spi/SpiComIF.h>
#include <fsfw_hal/linux/spi/SpiCookie.h> #include <fsfw_hal/linux/spi/SpiCookie.h>
@ -663,7 +665,7 @@ ReturnValue_t PayloadPcduHandler::handleDoubleParamUpdate(std::string key,
return params.writeJsonFile(); return params.writeJsonFile();
} }
#ifdef FSFW_OSAL_LINUX #ifdef XIPHOS_Q7S
ReturnValue_t PayloadPcduHandler::extConvAsTwoCallback(SpiComIF* comIf, SpiCookie* cookie, ReturnValue_t PayloadPcduHandler::extConvAsTwoCallback(SpiComIF* comIf, SpiCookie* cookie,
const uint8_t* sendData, size_t sendLen, const uint8_t* sendData, size_t sendLen,
void* args) { void* args) {

View File

@ -68,10 +68,9 @@ class PayloadPcduHandler : public DeviceHandlerBase {
void setToGoToNormalModeImmediately(bool enable); void setToGoToNormalModeImmediately(bool enable);
void enablePeriodicPrintout(bool enable, uint8_t divider); void enablePeriodicPrintout(bool enable, uint8_t divider);
#ifdef XIPHOS_Q7S
static ReturnValue_t extConvAsTwoCallback(SpiComIF* comIf, SpiCookie* cookie, static ReturnValue_t extConvAsTwoCallback(SpiComIF* comIf, SpiCookie* cookie,
const uint8_t* sendData, size_t sendLen, void* args); const uint8_t* sendData, size_t sendLen, void* args);
#ifdef FSFW_OSAL_LINUX
static ReturnValue_t transferAsTwo(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData, static ReturnValue_t transferAsTwo(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData,
size_t sendLen, bool tempOnly); size_t sendLen, bool tempOnly);
#endif #endif

View File

@ -341,13 +341,16 @@ void RwHandler::handleResetStatusReply(const uint8_t* packet) {
lastResetStatusSet.lastResetStatus = resetStatus; lastResetStatusSet.lastResetStatus = resetStatus;
} }
lastResetStatusSet.currentResetStatus = resetStatus; lastResetStatusSet.currentResetStatus = resetStatus;
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "RwHandler::handleResetStatusReply: Last reset status: " sif::info << "RwHandler::handleResetStatusReply: Last reset status: "
<< static_cast<unsigned int>(lastResetStatusSet.lastResetStatus.value) << std::endl; << static_cast<unsigned int>(lastResetStatusSet.lastResetStatus.value) << std::endl;
sif::info << "RwHandler::handleResetStatusReply: Current reset status: " sif::info << "RwHandler::handleResetStatusReply: Current reset status: "
<< static_cast<unsigned int>(lastResetStatusSet.currentResetStatus.value) << std::endl; << static_cast<unsigned int>(lastResetStatusSet.currentResetStatus.value)
<< std::endl;
#endif #endif
} }
}
void RwHandler::handleGetRwStatusReply(const uint8_t* packet) { void RwHandler::handleGetRwStatusReply(const uint8_t* packet) {
PoolReadGuard rg(&statusSet); PoolReadGuard rg(&statusSet);
@ -371,28 +374,32 @@ void RwHandler::handleGetRwStatusReply(const uint8_t* packet) {
sif::error << "RwHandler::handleGetRwStatusReply: Reaction wheel in error state" << std::endl; sif::error << "RwHandler::handleGetRwStatusReply: Reaction wheel in error state" << std::endl;
} }
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "RwHandler::handleGetRwStatusReply: Current speed is: " << statusSet.currSpeed sif::info << "RwHandler::handleGetRwStatusReply: Current speed is: " << statusSet.currSpeed
<< " * 0.1 RPM" << std::endl; << " * 0.1 RPM" << std::endl;
sif::info << "RwHandler::handleGetRwStatusReply: Reference speed is: " << statusSet.referenceSpeed sif::info << "RwHandler::handleGetRwStatusReply: Reference speed is: "
<< " * 0.1 RPM" << std::endl; << statusSet.referenceSpeed << " * 0.1 RPM" << std::endl;
sif::info << "RwHandler::handleGetRwStatusReply: State is: " sif::info << "RwHandler::handleGetRwStatusReply: State is: "
<< (unsigned int)statusSet.state.value << std::endl; << (unsigned int)statusSet.state.value << std::endl;
sif::info << "RwHandler::handleGetRwStatusReply: clc mode is: " sif::info << "RwHandler::handleGetRwStatusReply: clc mode is: "
<< (unsigned int)statusSet.clcMode.value << std::endl; << (unsigned int)statusSet.clcMode.value << std::endl;
#endif #endif
} }
}
void RwHandler::handleTemperatureReply(const uint8_t* packet) { void RwHandler::handleTemperatureReply(const uint8_t* packet) {
PoolReadGuard rg(&temperatureSet); PoolReadGuard rg(&temperatureSet);
uint8_t offset = 2; uint8_t offset = 2;
temperatureSet.temperatureCelcius = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | temperatureSet.temperatureCelcius = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 |
*(packet + offset + 1) << 8 | *(packet + offset); *(packet + offset + 1) << 8 | *(packet + offset);
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "RwHandler::handleTemperatureReply: Temperature: " sif::info << "RwHandler::handleTemperatureReply: Temperature: "
<< temperatureSet.temperatureCelcius << " °C" << std::endl; << temperatureSet.temperatureCelcius << " °C" << std::endl;
#endif #endif
} }
}
void RwHandler::handleGetTelemetryReply(const uint8_t* packet) { void RwHandler::handleGetTelemetryReply(const uint8_t* packet) {
PoolReadGuard rg(&tmDataset); PoolReadGuard rg(&tmDataset);
@ -468,7 +475,8 @@ void RwHandler::handleGetTelemetryReply(const uint8_t* packet) {
offset += 4; offset += 4;
tmDataset.spiTotalNumOfErrors = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | tmDataset.spiTotalNumOfErrors = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 |
*(packet + offset + 1) << 8 | *(packet + offset); *(packet + offset + 1) << 8 | *(packet + offset);
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1 if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "RwHandler::handleGetTelemetryReply: Last reset status: " sif::info << "RwHandler::handleGetTelemetryReply: Last reset status: "
<< static_cast<unsigned int>(tmDataset.lastResetStatus.value) << std::endl; << static_cast<unsigned int>(tmDataset.lastResetStatus.value) << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: MCU temperature: " << tmDataset.mcuTemperature sif::info << "RwHandler::handleGetTelemetryReply: MCU temperature: " << tmDataset.mcuTemperature
@ -518,3 +526,6 @@ void RwHandler::handleGetTelemetryReply(const uint8_t* packet) {
<< tmDataset.spiTotalNumOfErrors << std::endl; << tmDataset.spiTotalNumOfErrors << std::endl;
#endif #endif
} }
}
void RwHandler::setDebugMode(bool enable) { this->debugMode = enable; }

View File

@ -30,6 +30,9 @@ class RwHandler : public DeviceHandlerBase {
*/ */
RwHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, LinuxLibgpioIF* gpioComIF, RwHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, LinuxLibgpioIF* gpioComIF,
gpioId_t enableGpio); gpioId_t enableGpio);
void setDebugMode(bool enable);
virtual ~RwHandler(); virtual ~RwHandler();
static const uint8_t INTERFACE_ID = CLASS_ID::RW_HANDLER; static const uint8_t INTERFACE_ID = CLASS_ID::RW_HANDLER;
@ -86,6 +89,7 @@ class RwHandler : public DeviceHandlerBase {
LinuxLibgpioIF* gpioComIF = nullptr; LinuxLibgpioIF* gpioComIF = nullptr;
gpioId_t enableGpio = gpio::NO_GPIO; gpioId_t enableGpio = gpio::NO_GPIO;
bool debugMode = false;
RwDefinitions::TemperatureSet temperatureSet; RwDefinitions::TemperatureSet temperatureSet;
RwDefinitions::StatusSet statusSet; RwDefinitions::StatusSet statusSet;

View File

@ -166,12 +166,12 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic
return RETURN_OK; return RETURN_OK;
} }
case (syrlinks::ENABLE_DEBUG): { case (syrlinks::ENABLE_DEBUG): {
debug = true; debugMode = true;
rawPacketLen = 0; rawPacketLen = 0;
return RETURN_OK; return RETURN_OK;
} }
case (syrlinks::DISABLE_DEBUG): { case (syrlinks::DISABLE_DEBUG): {
debug = false; debugMode = false;
rawPacketLen = 0; rawPacketLen = 0;
return RETURN_OK; return RETURN_OK;
} }
@ -363,7 +363,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
tempBasebandBoard = calcTempVal(rawTempBasebandBoard); tempBasebandBoard = calcTempVal(rawTempBasebandBoard);
temperatureSet.temperatureBasebandBoard = tempBasebandBoard; temperatureSet.temperatureBasebandBoard = tempBasebandBoard;
PoolReadGuard rg(&temperatureSet); PoolReadGuard rg(&temperatureSet);
if (debug) { if (debugMode) {
sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C"
<< std::endl; << std::endl;
} }
@ -394,7 +394,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier); tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier);
PoolReadGuard rg(&temperatureSet); PoolReadGuard rg(&temperatureSet);
temperatureSet.temperaturePowerAmplifier = tempPowerAmplifier; temperatureSet.temperaturePowerAmplifier = tempPowerAmplifier;
if (debug) { if (debugMode) {
sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C" sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C"
<< std::endl; << std::endl;
} }
@ -540,8 +540,8 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
offset += 6; offset += 6;
rxDataset.rxDataRate = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset)); rxDataset.rxDataRate = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 if (debugMode) {
if (debug) { #if OBSW_VERBOSE_LEVEL >= 1
sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value
<< std::endl; << std::endl;
sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl; sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl;
@ -551,14 +551,14 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
sif::info << "Syrlinks RX Demod Eb: " << rxDataset.rxDemodEb << std::endl; sif::info << "Syrlinks RX Demod Eb: " << rxDataset.rxDemodEb << std::endl;
sif::info << "Syrlinks RX Demod N0: " << rxDataset.rxDemodN0 << std::endl; sif::info << "Syrlinks RX Demod N0: " << rxDataset.rxDemodN0 << std::endl;
sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl; sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl;
}
#endif #endif
} }
}
void SyrlinksHkHandler::parseLclConfigReply(const uint8_t* packet) { void SyrlinksHkHandler::parseLclConfigReply(const uint8_t* packet) {
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
uint8_t lclConfig = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset)); uint8_t lclConfig = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
if (debug) { if (debugMode) {
sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: " sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: "
<< static_cast<unsigned int>(lclConfig) << std::endl; << static_cast<unsigned int>(lclConfig) << std::endl;
} }
@ -568,24 +568,20 @@ void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) {
PoolReadGuard readHelper(&txDataset); PoolReadGuard readHelper(&txDataset);
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
txDataset.txStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset)); txDataset.txStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
#if OBSW_DEBUG_SYRLINKS == 1 if (debugMode) {
if (debug) {
sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value
<< std::endl; << std::endl;
} }
#endif
} }
void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) { void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) {
PoolReadGuard readHelper(&txDataset); PoolReadGuard readHelper(&txDataset);
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset)); txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
#if OBSW_DEBUG_SYRLINKS == 1 if (debugMode) {
if (debug) {
sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value
<< std::endl; << std::endl;
} }
#endif
} }
void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) { void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) {
@ -593,11 +589,9 @@ void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) {
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
txDataset.txAgcValue = agcValueHighByte << 8 | txDataset.txAgcValue = agcValueHighByte << 8 |
convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset)); convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
#if OBSW_DEBUG_SYRLINKS == 1 if (debugMode) {
if (debug) {
sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl; sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl;
} }
#endif
} }
void SyrlinksHkHandler::parseAgcHighByte(const uint8_t* packet) { void SyrlinksHkHandler::parseAgcHighByte(const uint8_t* packet) {
@ -654,3 +648,5 @@ void SyrlinksHkHandler::prepareCommand(std::string command, DeviceCommandId_t co
rememberCommandId = commandId; rememberCommandId = commandId;
rawPacket = commandBuffer; rawPacket = commandBuffer;
} }
void SyrlinksHkHandler::setDebugMode(bool enable) { this->debugMode = enable; }

View File

@ -28,6 +28,8 @@ class SyrlinksHkHandler : public DeviceHandlerBase {
*/ */
void setModeNormal(); void setModeNormal();
void setDebugMode(bool enable);
protected: protected:
void doStartUp() override; void doStartUp() override;
void doShutDown() override; void doShutDown() override;
@ -95,6 +97,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase {
const power::Switch_t powerSwitch = power::NO_SWITCH; const power::Switch_t powerSwitch = power::NO_SWITCH;
bool debugMode = false;
uint8_t agcValueHighByte = 0; uint8_t agcValueHighByte = 0;
uint16_t rawTempPowerAmplifier = 0; uint16_t rawTempPowerAmplifier = 0;
uint16_t rawTempBasebandBoard = 0; uint16_t rawTempBasebandBoard = 0;
@ -107,8 +110,6 @@ class SyrlinksHkHandler : public DeviceHandlerBase {
StartupState startupState = StartupState::OFF; StartupState startupState = StartupState::OFF;
bool debug = false;
/** /**
* This object is used to store the id of the next command to execute. This controls the * This object is used to store the id of the next command to execute. This controls the
* read out of multiple registers which can not be fetched with one single command. * read out of multiple registers which can not be fetched with one single command.

1
thirdparty/etl vendored

@ -1 +0,0 @@
Subproject commit c308dc427b7a34e54f33860fb2e244564b2740b4