From 74b45f30a053da4e261cfc54a76b166ce887acbc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 30 Aug 2022 15:53:20 +0200 Subject: [PATCH 1/2] move to new DHB TM handler --- CMakeLists.txt | 5 +++-- fsfw | 2 +- linux/devices/GPSHyperionLinuxController.cpp | 2 +- linux/devices/Max31865RtdLowlevelHandler.cpp | 2 +- linux/devices/ploc/PlocSupervisorHandler.cpp | 2 +- linux/devices/startracker/StarTrackerHandler.cpp | 2 +- mission/controller/AcsController.cpp | 2 +- mission/devices/ACUHandler.cpp | 3 ++- mission/devices/GomspaceDeviceHandler.cpp | 6 ++++-- mission/devices/P60DockHandler.cpp | 7 +------ mission/devices/PDU1Handler.cpp | 5 +++-- mission/devices/PDU2Handler.cpp | 9 +++------ 12 files changed, 22 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 976bc6ee..9b8190ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -451,8 +451,9 @@ if(TGT_BSP MATCHES "arm/q7s") target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_GPS} ${LIB_ARCSEC}) endif() -target_link_libraries(${UNITTEST_NAME} PRIVATE Catch2 ${LIB_EIVE_MISSION} - rapidcsv ${LIB_DUMMIES} ${LIB_GOMSPACE_CLIENTS}) +target_link_libraries( + ${UNITTEST_NAME} PRIVATE Catch2 ${LIB_EIVE_MISSION} rapidcsv ${LIB_DUMMIES} + ${LIB_GOMSPACE_CLIENTS}) if(TGT_BSP MATCHES "arm/egse") target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_ARCSEC}) diff --git a/fsfw b/fsfw index 9a590a3f..21ac8661 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 9a590a3fcd81ed4dd48de503522b6d71f64205d2 +Subproject commit 21ac86619e2b1fecf71bd2aa0f09ecbd471c8531 diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 556db7ef..84200baf 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -87,7 +87,7 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool( localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry()); - poolManager.subscribeForRegularPeriodicPacket({gpsSet.getSid(), 30.0}); + poolManager.subscribeForRegularPeriodicPacket({gpsSet.getSid(), false, 30.0}); return returnvalue::OK; } diff --git a/linux/devices/Max31865RtdLowlevelHandler.cpp b/linux/devices/Max31865RtdLowlevelHandler.cpp index f2815f5f..1be2b1c2 100644 --- a/linux/devices/Max31865RtdLowlevelHandler.cpp +++ b/linux/devices/Max31865RtdLowlevelHandler.cpp @@ -311,7 +311,7 @@ ReturnValue_t Max31865RtdReader::readReceivedMessage(CookieIF* cookie, uint8_t** return returnvalue::FAILED; } auto* rtdCookie = dynamic_cast(cookie); - if(rtdCookie == nullptr) { + if (rtdCookie == nullptr) { return returnvalue::FAILED; } uint8_t* exchangePtr = rtdCookie->exchangeBuf.data(); diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 1cff8884..3846e4a4 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -417,7 +417,7 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d break; } case LOGGING_SET_TOPIC: { - if(commandData == nullptr or commandDataLen == 0) { + if (commandData == nullptr or commandDataLen == 0) { return HasActionsIF::INVALID_PARAMETERS; } uint8_t tpc = *(commandData); diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index 698887b8..47312934 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -1830,7 +1830,7 @@ ReturnValue_t StarTrackerHandler::handleChecksumReply() { } PoolReadGuard rg(&checksumSet); checksumSet.checksum = checksumReply.getChecksum(); - handleDeviceTM(&checksumSet, startracker::CHECKSUM); + handleDeviceTm(util::DataWrapper(checksumSet), startracker::CHECKSUM); #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 checksumReply.printChecksum(); #endif /* OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 */ diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index c6b3207e..09e91e26 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -45,7 +45,7 @@ ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localD localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_RM3100_UT, &mgm3PoolVec); localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_NT, &imtqMgmPoolVec); localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_ACT_STATUS, &imtqCalActStatus); - poolManager.subscribeForRegularPeriodicPacket({mgmData.getSid(), 5.0}); + poolManager.subscribeForRegularPeriodicPacket({mgmData.getSid(), false, 5.0}); return returnvalue::OK; } diff --git a/mission/devices/ACUHandler.cpp b/mission/devices/ACUHandler.cpp index f229d248..e86c0801 100644 --- a/mission/devices/ACUHandler.cpp +++ b/mission/devices/ACUHandler.cpp @@ -43,7 +43,8 @@ void ACUHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pack } void ACUHandler::letChildHandleConfigReply(DeviceCommandId_t id, const uint8_t *packet) { - handleDeviceTM(packet, ACU::CONFIG_TABLE_SIZE, id); + util::DataWrapper wrapper(packet, ACU::CONFIG_TABLE_SIZE); + handleDeviceTm(wrapper, id); } LocalPoolDataSetBase *ACUHandler::getDataSetHandle(sid_t sid) { diff --git a/mission/devices/GomspaceDeviceHandler.cpp b/mission/devices/GomspaceDeviceHandler.cpp index cc4786d0..9278ed77 100644 --- a/mission/devices/GomspaceDeviceHandler.cpp +++ b/mission/devices/GomspaceDeviceHandler.cpp @@ -177,7 +177,9 @@ ReturnValue_t GomspaceDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, switch (id) { case (GOMSPACE::PING): { SerializeElement replyTime = *packet; - handleDeviceTM(&replyTime, id, true); + util::DataWrapper wrapper; + wrapper.setSerializable(replyTime); + handleDeviceTm(wrapper, id, true); break; } case (GOMSPACE::PARAM_GET): { @@ -204,7 +206,7 @@ ReturnValue_t GomspaceDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, uint16_t address = cspGetParamReply.getAddress(); /* Pack relevant information into a tm packet */ ParamReply paramReply(action, tableId, address, payloadLength, tempPayloadBuffer); - handleDeviceTM(¶mReply, id, true); + handleDeviceTm(util::DataWrapper(paramReply), id, true); break; } case (GOMSPACE::PARAM_SET): { diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 4d4d4ed2..574efd81 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -24,11 +24,6 @@ ReturnValue_t P60DockHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) { void P60DockHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) { parseHkTableReply(packet); - /** - * Hk table will be sent to the commander if hk table request was not triggered by the - * P60DockHandler itself. - */ - handleDeviceTM(&coreHk, id, true); } void P60DockHandler::parseHkTableReply(const uint8_t *packet) { @@ -273,5 +268,5 @@ void P60DockHandler::printHkTableLatchups() { void P60DockHandler::setDebugMode(bool enable) { this->debugMode = enable; } void P60DockHandler::letChildHandleConfigReply(DeviceCommandId_t id, const uint8_t *packet) { - handleDeviceTM(packet, P60Dock::CONFIG_TABLE_SIZE, id); + handleDeviceTm(util::DataWrapper(packet, P60Dock::CONFIG_TABLE_SIZE), id); } diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index deb747db..e7a077ba 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -22,7 +22,6 @@ ReturnValue_t PDU1Handler::buildNormalDeviceCommand(DeviceCommandId_t *id) { void PDU1Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) { parseHkTableReply(packet); - handleDeviceTM(&coreHk, id, true); } void PDU1Handler::assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, void *args) { @@ -81,7 +80,9 @@ ReturnValue_t PDU1Handler::setParamCallback(SetParamMessageUnpacker &unpacker, } void PDU1Handler::letChildHandleConfigReply(DeviceCommandId_t id, const uint8_t *packet) { - handleDeviceTM(packet, PDU::CONFIG_TABLE_SIZE, id); + util::DataWrapper wrapper; + wrapper.setRawData({packet, PDU::CONFIG_TABLE_SIZE}); + handleDeviceTm(wrapper, id); } void PDU1Handler::parseHkTableReply(const uint8_t *packet) { diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index 65de91a7..9fb0fffe 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -22,15 +22,12 @@ ReturnValue_t PDU2Handler::buildNormalDeviceCommand(DeviceCommandId_t *id) { void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) { parseHkTableReply(packet); - /** - * Hk table will be sent to the commander if hk table request was not triggered by the - * PDU2Handler itself. - */ - handleDeviceTM(&coreHk, id, true); } void PDU2Handler::letChildHandleConfigReply(DeviceCommandId_t id, const uint8_t *packet) { - handleDeviceTM(packet, PDU::CONFIG_TABLE_SIZE, id); + util::DataWrapper wrapper; + wrapper.setRawData({packet, PDU::CONFIG_TABLE_SIZE}); + handleDeviceTm(wrapper, id); } void PDU2Handler::assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, void *args) { -- 2.43.0 From 4649ae2edb63cfeb07120a6b7e1717a4b2f9735b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 30 Aug 2022 16:06:17 +0200 Subject: [PATCH 2/2] minor tweaks --- fsfw | 2 +- mission/devices/ACUHandler.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fsfw b/fsfw index 21ac8661..141dcb1f 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 21ac86619e2b1fecf71bd2aa0f09ecbd471c8531 +Subproject commit 141dcb1f149b824b5bd6e5d3339ecb712835751e diff --git a/mission/devices/ACUHandler.cpp b/mission/devices/ACUHandler.cpp index e86c0801..727b4ae5 100644 --- a/mission/devices/ACUHandler.cpp +++ b/mission/devices/ACUHandler.cpp @@ -43,8 +43,7 @@ void ACUHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pack } void ACUHandler::letChildHandleConfigReply(DeviceCommandId_t id, const uint8_t *packet) { - util::DataWrapper wrapper(packet, ACU::CONFIG_TABLE_SIZE); - handleDeviceTm(wrapper, id); + handleDeviceTm(util::DataWrapper(packet, ACU::CONFIG_TABLE_SIZE), id); } LocalPoolDataSetBase *ACUHandler::getDataSetHandle(sid_t sid) { -- 2.43.0