From a9204fb042061daffddc5965030242dfd33dce17 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 6 Feb 2025 13:07:36 +0100 Subject: [PATCH] Fix EM build: Use BPX Batt dummy --- CMakeLists.txt | 26 ++++++------- bsp_q7s/em/emObjectFactory.cpp | 11 +++--- bsp_q7s/objectFactory.cpp | 9 ++--- bsp_q7s/simple/simple.cpp | 4 +- dummies/BatteryDummy.cpp | 54 ++++++++++++++++++++++++++ dummies/BatteryDummy.h | 52 +++++++++++++++++++++++++ dummies/CMakeLists.txt | 1 + dummies/SyrlinksDummy.cpp | 11 +++--- dummies/SyrlinksDummy.h | 3 +- dummies/helperFactory.cpp | 15 +++++-- linux/com/SyrlinksComHandler.h | 2 +- linux/ipcore/PtmeIF.h | 2 +- linux/ipcore/VirtualChannelIF.h | 2 +- linux/payload/ScexDleParser.cpp | 4 +- linux/payload/plocMpsocHelpers.h | 2 +- linux/power/CspComIF.h | 2 +- linux/tcs/Max31865RtdPolling.h | 2 +- mission/acs/str/StarTrackerHandler.cpp | 2 +- mission/memory/SdCardMountedIF.h | 2 +- mission/power/BpxBatteryHandler.h | 2 +- mission/power/bpxBattDefs.h | 2 + mission/tmtc/PersistentTmStore.cpp | 4 +- scripts/auto-formatter.sh | 2 +- scripts/q7s-cp.py | 4 +- tmtc | 2 +- 25 files changed, 172 insertions(+), 50 deletions(-) create mode 100644 dummies/BatteryDummy.cpp create mode 100644 dummies/BatteryDummy.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ca77c1d1..ed3c3a99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,13 +70,13 @@ if(EIVE_Q7S_EM) set(OBSW_Q7S_EM 1 CACHE STRING "Q7S EM configuration") - set(INIT_VAL 0) + set(OBSW_Q7S_FM 0) set(OBSW_STAR_TRACKER_GROUND_CONFIG 1) else() set(OBSW_Q7S_EM 0 CACHE STRING "Q7S EM configuration") - set(INIT_VAL 1) + set(OBSW_Q7S_FM 1) set(OBSW_STAR_TRACKER_GROUND_CONFIG 0) endif() @@ -87,19 +87,19 @@ set(OBSW_ADD_TMTC_UDP_SERVER 0 CACHE STRING "Add UDP TMTC Server") set(OBSW_ADD_MGT - ${INIT_VAL} + ${OBSW_Q7S_FM} CACHE STRING "Add MGT module") set(OBSW_ADD_BPX_BATTERY_HANDLER - 1 + ${OBSW_Q7S_FM} CACHE STRING "Add BPX battery module") set(OBSW_ADD_STAR_TRACKER 1 CACHE STRING "Add Startracker module") set(OBSW_ADD_SUN_SENSORS - ${INIT_VAL} + ${OBSW_Q7S_FM} CACHE STRING "Add sun sensor module") set(OBSW_ADD_SUS_BOARD_ASS - ${INIT_VAL} + ${OBSW_Q7S_FM} CACHE STRING "Add sun sensor board assembly") set(OBSW_ADD_THERMAL_TEMP_INSERTER ${OBSW_Q7S_EM} @@ -108,7 +108,7 @@ set(OBSW_ADD_ACS_BOARD 1 CACHE STRING "Add ACS board module") set(OBSW_ADD_GPS_CTRL - ${INIT_VAL} + ${OBSW_Q7S_FM} CACHE STRING "Add GPS controllers") set(OBSW_ADD_CCSDS_IP_CORES 1 @@ -129,25 +129,25 @@ set(OBSW_ADD_PLOC_SUPERVISOR 1 CACHE STRING "Add PLOC supervisor handler") set(OBSW_ADD_SA_DEPL - ${INIT_VAL} + ${OBSW_Q7S_FM} CACHE STRING "Add SA deployment handler") set(OBSW_ADD_PLOC_MPSOC 1 CACHE STRING "Add MPSoC handler") set(OBSW_ADD_ACS_CTRL - ${INIT_VAL} + ${OBSW_Q7S_FM} CACHE STRING "Add ACS controller") set(OBSW_ADD_RTD_DEVICES - ${INIT_VAL} + ${OBSW_Q7S_FM} CACHE STRING "Add RTD devices") set(OBSW_ADD_RAD_SENSORS - ${INIT_VAL} + ${OBSW_Q7S_FM} CACHE STRING "Add Rad Sensor module") set(OBSW_ADD_PL_PCDU 1 CACHE STRING "Add Payload PCDU modukle") set(OBSW_ADD_SYRLINKS - 1 + ${OBSW_Q7S_FM} CACHE STRING "Add Syrlinks module") set(OBSW_ADD_TMP_DEVICES 1 @@ -159,7 +159,7 @@ set(OBSW_ADD_GOMSPACE_ACU ${INIT_VAL} CACHE STRING "Add GomSpace ACU submodule") set(OBSW_ADD_RW - ${INIT_VAL} + ${OBSW_Q7S_FM} CACHE STRING "Add RW modules") set(OBSW_ADD_SCEX_DEVICE 1 diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 949f969b..0c0c3fae 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -117,10 +117,11 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_BPX_BATTERY_HANDLER == 1 createBpxBatteryComponent(enableHkSets, battAndImtqI2cDev); #endif - createPowerController(true, enableHkSets); dummy::createDummies(dummyCfg, *pwrSwitcher, gpioComIF, enableHkSets); + createPowerController(true, enableHkSets); + new CoreController(objects::CORE_CONTROLLER, enableHkSets); auto* stackHandler = new Stack5VHandler(*pwrSwitcher); @@ -143,10 +144,6 @@ void ObjectFactory::produce(void* args) { createImtqComponents(pwrSwitcher, enableHkSets, battAndImtqI2cDev); #endif -#if OBSW_ADD_SYRLINKS == 1 - createSyrlinksComponents(pwrSwitcher); -#endif /* OBSW_ADD_SYRLINKS == 1 */ - #if OBSW_ADD_RW == 1 createReactionWheelComponents(gpioComIF, pwrSwitcher); #endif @@ -155,6 +152,10 @@ void ObjectFactory::produce(void* args) { createStrComponents(pwrSwitcher, *SdCardManager::instance()); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ +#if OBSW_ADD_SYRLINKS == 1 + createSyrlinksComponents(pwrSwitcher); +#endif + #if OBSW_ADD_PL_PCDU == 1 createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher, *stackHandler); #endif diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index e1ef0816..bbd63632 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -598,14 +598,13 @@ void ObjectFactory::createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitc } void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) { + new SyrlinksComHandler(objects::SYRLINKS_COM_HANDLER); + auto* syrlinksAssy = new SyrlinksAssembly(objects::SYRLINKS_ASSY); + syrlinksAssy->connectModeTreeParent(satsystem::com::SUBSYSTEM); auto* syrlinksUartCookie = new SerialCookie(objects::SYRLINKS_HANDLER, q7s::UART_SYRLINKS_DEV, serial::SYRLINKS_BAUD, syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL); syrlinksUartCookie->setParityEven(); - - new SyrlinksComHandler(objects::SYRLINKS_COM_HANDLER); - auto* syrlinksAssy = new SyrlinksAssembly(objects::SYRLINKS_ASSY); - syrlinksAssy->connectModeTreeParent(satsystem::com::SUBSYSTEM); auto syrlinksFdir = new SyrlinksFdir(objects::SYRLINKS_HANDLER); auto syrlinksHandler = new SyrlinksHandler(objects::SYRLINKS_HANDLER, objects::SYRLINKS_COM_HANDLER, @@ -840,7 +839,7 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) { Levels::LOW); gpioCookiePdec->addGpio(gpioIds::PDEC_RESET, gpio); gpioChecker(args.gpioComIF.addGpios(gpioCookiePdec), "PDEC"); - struct UioNames uioNames {}; + struct UioNames uioNames{}; uioNames.configMemory = q7s::UIO_PDEC_CONFIG_MEMORY; uioNames.ramMemory = q7s::UIO_PDEC_RAM; uioNames.registers = q7s::UIO_PDEC_REGISTERS; diff --git a/bsp_q7s/simple/simple.cpp b/bsp_q7s/simple/simple.cpp index 1362ef23..ac39c7ac 100644 --- a/bsp_q7s/simple/simple.cpp +++ b/bsp_q7s/simple/simple.cpp @@ -10,7 +10,9 @@ int simple::simple() { std::cout << "-- Q7S Simple Application --" << std::endl; #if Q7S_SIMPLE_ADD_FILE_SYSTEM_TEST == 1 - { FileSystemTest fileSystemTest; } + { + FileSystemTest fileSystemTest; + } #endif #if TE0720_GPIO_TEST diff --git a/dummies/BatteryDummy.cpp b/dummies/BatteryDummy.cpp new file mode 100644 index 00000000..ca35581c --- /dev/null +++ b/dummies/BatteryDummy.cpp @@ -0,0 +1,54 @@ +#include "BatteryDummy.h" + +BatteryDummy::BatteryDummy(DhbConfig cfg) + : FreshDeviceHandlerBase(cfg), cfgSet(this), hkSet(this) {} + +void BatteryDummy::performDeviceOperation(uint8_t opCode) {} + +LocalPoolDataSetBase* BatteryDummy::getDataSetHandle(sid_t sid) { + if (sid == hkSet.getSid()) { + return &hkSet; + } + if (sid == cfgSet.getSid()) { + return &cfgSet; + } + return nullptr; +} + +ReturnValue_t BatteryDummy::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) { + localDataPoolMap.emplace(bpxBat::BATT_TEMP_1, &battTemp1); + localDataPoolMap.emplace(bpxBat::BATT_TEMP_2, &battTemp2); + localDataPoolMap.emplace(bpxBat::BATT_TEMP_3, &battTemp3); + localDataPoolMap.emplace(bpxBat::BATT_TEMP_4, &battTemp4); + localDataPoolMap.emplace(bpxBat::CHARGE_CURRENT, &chargeCurrent); + localDataPoolMap.emplace(bpxBat::DISCHARGE_CURRENT, &dischargeCurrent); + localDataPoolMap.emplace(bpxBat::HEATER_CURRENT, &heaterCurrent); + localDataPoolMap.emplace(bpxBat::BATT_VOLTAGE, &battVolt); + localDataPoolMap.emplace(bpxBat::REBOOT_COUNTER, &rebootCounter); + localDataPoolMap.emplace(bpxBat::BOOTCAUSE, &bootCause); + + localDataPoolMap.emplace(bpxBat::BATTERY_HEATER_MODE, &battheatMode); + localDataPoolMap.emplace(bpxBat::BATTHEAT_LOW_LIMIT, &battheatLow); + localDataPoolMap.emplace(bpxBat::BATTHEAT_HIGH_LIMIT, &battheatHigh); + + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(hkSet.getSid(), true, 20.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(cfgSet.getSid(), false, 30.0)); + return returnvalue::OK; +} + +ReturnValue_t BatteryDummy::checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t* msToReachTheMode) { + return returnvalue::OK; +} + +ReturnValue_t BatteryDummy::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, + const uint8_t* data, size_t size) { + return returnvalue::OK; +} + +ReturnValue_t BatteryDummy::handleCommandMessage(CommandMessage* message) { + return returnvalue::FAILED; +} \ No newline at end of file diff --git a/dummies/BatteryDummy.h b/dummies/BatteryDummy.h new file mode 100644 index 00000000..fcd82152 --- /dev/null +++ b/dummies/BatteryDummy.h @@ -0,0 +1,52 @@ +#pragma once + +#include "fsfw/devicehandlers/FreshDeviceHandlerBase.h" +#include "mission/power/bpxBattDefs.h" + +/// @brief +class BatteryDummy : public FreshDeviceHandlerBase { + public: + BatteryDummy(DhbConfig cfg); + + private: + /** + * Periodic helper executed function, implemented by child class. + */ + void performDeviceOperation(uint8_t opCode) override; + + /** + * Implemented by child class. Handle all command messages which are + * not health, mode, action or housekeeping messages. + * @param message + * @return + */ + ReturnValue_t handleCommandMessage(CommandMessage* message) override; + + // HK manager abstract functions. + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; + + // Mode abstract functions + ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t* msToReachTheMode) override; + // Action override. Forward to user. + ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, + const uint8_t* data, size_t size) override; + + BpxBatteryCfg cfgSet; + BpxBatteryHk hkSet; + PoolEntry chargeCurrent = PoolEntry({0}); + PoolEntry dischargeCurrent = PoolEntry({0}); + PoolEntry heaterCurrent = PoolEntry({0}); + PoolEntry battVolt = PoolEntry({0}); + PoolEntry battTemp1 = PoolEntry({10}, true); + PoolEntry battTemp2 = PoolEntry({10}, true); + PoolEntry battTemp3 = PoolEntry({10}, true); + PoolEntry battTemp4 = PoolEntry({10}, true); + PoolEntry rebootCounter = PoolEntry({0}); + PoolEntry bootCause = PoolEntry({0}); + PoolEntry battheatMode = PoolEntry({0}); + PoolEntry battheatLow = PoolEntry({0}); + PoolEntry battheatHigh = PoolEntry({0}); +}; \ No newline at end of file diff --git a/dummies/CMakeLists.txt b/dummies/CMakeLists.txt index bc8ab837..ed1b198b 100644 --- a/dummies/CMakeLists.txt +++ b/dummies/CMakeLists.txt @@ -29,4 +29,5 @@ target_sources( PlocSupervisorDummy.cpp helperFactory.cpp MgmRm3100Dummy.cpp + BatteryDummy.cpp Tmp1075Dummy.cpp) diff --git a/dummies/SyrlinksDummy.cpp b/dummies/SyrlinksDummy.cpp index 9ae3c2f0..5deb1d9d 100644 --- a/dummies/SyrlinksDummy.cpp +++ b/dummies/SyrlinksDummy.cpp @@ -2,14 +2,15 @@ #include -SyrlinksDummy::SyrlinksDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) - : DeviceHandlerBase(objectId, comif, comCookie) {} +SyrlinksDummy::SyrlinksDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie, + DeviceHandlerFailureIsolation *fdir) + : DeviceHandlerBase(objectId, comif, comCookie, fdir) {} SyrlinksDummy::~SyrlinksDummy() {} -void SyrlinksDummy::doStartUp() {} +void SyrlinksDummy::doStartUp() { setMode(MODE_ON); } -void SyrlinksDummy::doShutDown() {} +void SyrlinksDummy::doShutDown() { setMode(MODE_OFF); } ReturnValue_t SyrlinksDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; @@ -36,7 +37,7 @@ ReturnValue_t SyrlinksDummy::interpretDeviceReply(DeviceCommandId_t id, const ui void SyrlinksDummy::fillCommandAndReplyMap() {} -uint32_t SyrlinksDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } +uint32_t SyrlinksDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 1000; } ReturnValue_t SyrlinksDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { diff --git a/dummies/SyrlinksDummy.h b/dummies/SyrlinksDummy.h index 02d7095e..216a7021 100644 --- a/dummies/SyrlinksDummy.h +++ b/dummies/SyrlinksDummy.h @@ -11,7 +11,8 @@ class SyrlinksDummy : public DeviceHandlerBase { static const uint8_t SIMPLE_COMMAND_DATA = 1; static const uint8_t PERIODIC_REPLY_DATA = 2; - SyrlinksDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); + SyrlinksDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie, + DeviceHandlerFailureIsolation *fdir); virtual ~SyrlinksDummy(); protected: diff --git a/dummies/helperFactory.cpp b/dummies/helperFactory.cpp index 667ab620..92fce21b 100644 --- a/dummies/helperFactory.cpp +++ b/dummies/helperFactory.cpp @@ -1,6 +1,7 @@ #include "helperFactory.h" #include +#include #include #include #include @@ -30,6 +31,8 @@ #include #include #include +#include +#include #include #include @@ -49,7 +52,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio new ComIFDummy(objects::DUMMY_COM_IF); auto* comCookieDummy = new ComCookieDummy(); if (cfg.addBpxBattDummy) { - new BpxDummy(objects::BPX_BATT_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + new BatteryDummy(DhbConfig(objects::BPX_BATT_HANDLER)); } if (cfg.addCoreCtrlCfg) { new CoreControllerDummy(objects::CORE_CONTROLLER); @@ -74,9 +77,13 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio strDummy->connectModeTreeParent(*strAssy); } if (cfg.addSyrlinksDummies) { - auto* syrlinksDummy = - new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - syrlinksDummy->connectModeTreeParent(satsystem::com::SUBSYSTEM); + auto* syrlinksAssy = new SyrlinksAssembly(objects::SYRLINKS_ASSY); + syrlinksAssy->connectModeTreeParent(satsystem::com::SUBSYSTEM); + + auto syrlinksFdir = new SyrlinksFdir(objects::SYRLINKS_HANDLER); + auto* syrlinksDummy = new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, + comCookieDummy, syrlinksFdir); + syrlinksDummy->connectModeTreeParent(*syrlinksAssy); } auto* imtqAssy = new ImtqAssembly(objects::IMTQ_ASSY); imtqAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); diff --git a/linux/com/SyrlinksComHandler.h b/linux/com/SyrlinksComHandler.h index bab1af48..5c87ff79 100644 --- a/linux/com/SyrlinksComHandler.h +++ b/linux/com/SyrlinksComHandler.h @@ -28,7 +28,7 @@ class SyrlinksComHandler : public DeviceCommunicationIF, MutexIF *lock; SemaphoreIF *semaphore; int serialPort = 0; - struct termios tty {}; + struct termios tty{}; Countdown replyTimeout = Countdown(2000); std::array recBuf{}; SimpleRingBuffer ringBuf; diff --git a/linux/ipcore/PtmeIF.h b/linux/ipcore/PtmeIF.h index a5ea0c95..ab7259d1 100644 --- a/linux/ipcore/PtmeIF.h +++ b/linux/ipcore/PtmeIF.h @@ -14,7 +14,7 @@ */ class PtmeIF { public: - virtual ~PtmeIF(){}; + virtual ~PtmeIF() {}; virtual bool containsVc(uint8_t vcId) const = 0; virtual VirtualChannelIF* getVirtChannel(uint8_t vcId) = 0; diff --git a/linux/ipcore/VirtualChannelIF.h b/linux/ipcore/VirtualChannelIF.h index a8a60a06..2b421e1c 100644 --- a/linux/ipcore/VirtualChannelIF.h +++ b/linux/ipcore/VirtualChannelIF.h @@ -15,7 +15,7 @@ */ class VirtualChannelIF : public DirectTmSinkIF { public: - virtual ~VirtualChannelIF(){}; + virtual ~VirtualChannelIF() {}; virtual ReturnValue_t initialize() = 0; virtual void cancelTransfer() = 0; diff --git a/linux/payload/ScexDleParser.cpp b/linux/payload/ScexDleParser.cpp index 2de84872..9c2facd3 100644 --- a/linux/payload/ScexDleParser.cpp +++ b/linux/payload/ScexDleParser.cpp @@ -2,6 +2,6 @@ ScexDleParser::ScexDleParser(SimpleRingBuffer &decodeRingBuf, DleEncoder &decoder, BufPair encodedBuf, BufPair decodedBuf) - : DleParser(decodeRingBuf, decoder, encodedBuf, decodedBuf){}; + : DleParser(decodeRingBuf, decoder, encodedBuf, decodedBuf) {}; -ScexDleParser::~ScexDleParser(){}; +ScexDleParser::~ScexDleParser() {}; diff --git a/linux/payload/plocMpsocHelpers.h b/linux/payload/plocMpsocHelpers.h index 35e34b11..6f59f4ce 100644 --- a/linux/payload/plocMpsocHelpers.h +++ b/linux/payload/plocMpsocHelpers.h @@ -858,7 +858,7 @@ class FlashBasePusCmd { class FlashReadPusCmd : public FlashBasePusCmd { public: - FlashReadPusCmd(){}; + FlashReadPusCmd() {}; ReturnValue_t extractFields(const uint8_t* commandData, size_t commandDataLen) override { ReturnValue_t result = FlashBasePusCmd::extractFields(commandData, commandDataLen); diff --git a/linux/power/CspComIF.h b/linux/power/CspComIF.h index 615064c2..f50d2958 100644 --- a/linux/power/CspComIF.h +++ b/linux/power/CspComIF.h @@ -53,7 +53,7 @@ class CspComIF : public DeviceCommunicationIF, public SystemObject { typedef uint8_t node_t; struct ReplyInfo { - ReplyInfo(size_t maxLen) : replyBuf(maxLen){}; + ReplyInfo(size_t maxLen) : replyBuf(maxLen) {}; std::vector replyBuf; size_t replyLen = 0; }; diff --git a/linux/tcs/Max31865RtdPolling.h b/linux/tcs/Max31865RtdPolling.h index e865d66d..04260a51 100644 --- a/linux/tcs/Max31865RtdPolling.h +++ b/linux/tcs/Max31865RtdPolling.h @@ -12,7 +12,7 @@ #include "fsfw/devicehandlers/DeviceCommunicationIF.h" struct Max31865ReaderCookie : public CookieIF { - Max31865ReaderCookie(){}; + Max31865ReaderCookie() {}; Max31865ReaderCookie(object_id_t handlerId_, uint8_t idx_, const std::string& locString_, SpiCookie* spiCookie_) : idx(idx_), handlerId(handlerId_), locString(locString_), spiCookie(spiCookie_) {} diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index a6c12670..7ef1c4b6 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -2099,7 +2099,7 @@ void StarTrackerHandler::preparePowerRequest() { void StarTrackerHandler::prepareSwitchToBootloaderCmd() { uint32_t length = 0; - struct RebootActionRequest rebootReq {}; + struct RebootActionRequest rebootReq{}; prv_arc_pack_reboot_action_req(&rebootReq, commandBuffer, &length); rawPacket = commandBuffer; rawPacketLen = length; diff --git a/mission/memory/SdCardMountedIF.h b/mission/memory/SdCardMountedIF.h index 1e76b9b7..e66ab87a 100644 --- a/mission/memory/SdCardMountedIF.h +++ b/mission/memory/SdCardMountedIF.h @@ -8,7 +8,7 @@ class SdCardMountedIF { public: - virtual ~SdCardMountedIF(){}; + virtual ~SdCardMountedIF() {}; virtual const char* getCurrentMountPrefix() const = 0; virtual bool isSdCardUsable(std::optional sdCard) = 0; virtual std::optional getPreferredSdCard() const = 0; diff --git a/mission/power/BpxBatteryHandler.h b/mission/power/BpxBatteryHandler.h index d01691a9..ef8390ee 100644 --- a/mission/power/BpxBatteryHandler.h +++ b/mission/power/BpxBatteryHandler.h @@ -32,8 +32,8 @@ class BpxBatteryHandler : public DeviceHandlerBase { BpxBatteryHk hkSet; DeviceCommandId_t lastCmd = DeviceHandlerIF::NO_COMMAND_ID; - BpxBatteryCfg cfgSet; std::array cmdBuf = {}; + BpxBatteryCfg cfgSet; PoolEntry chargeCurrent = PoolEntry({0}); PoolEntry dischargeCurrent = PoolEntry({0}); PoolEntry heaterCurrent = PoolEntry({0}); diff --git a/mission/power/bpxBattDefs.h b/mission/power/bpxBattDefs.h index 0e167f07..c25a025e 100644 --- a/mission/power/bpxBattDefs.h +++ b/mission/power/bpxBattDefs.h @@ -199,6 +199,7 @@ class BpxBatteryHk : public StaticLocalDataSet { private: friend class BpxBatteryHandler; + friend class BatteryDummy; /** * Constructor for data creator * @param hkOwner @@ -238,6 +239,7 @@ class BpxBatteryCfg : public StaticLocalDataSet { private: friend class BpxBatteryHandler; + friend class BatteryDummy; /** * Constructor for data creator * @param hkOwner diff --git a/mission/tmtc/PersistentTmStore.cpp b/mission/tmtc/PersistentTmStore.cpp index 0ba690c2..099f6448 100644 --- a/mission/tmtc/PersistentTmStore.cpp +++ b/mission/tmtc/PersistentTmStore.cpp @@ -59,7 +59,7 @@ ReturnValue_t PersistentTmStore::buildDumpSet(uint32_t fromUnixSeconds, uint32_t continue; } const path& file = fileOrDir.path(); - struct tm fileTime {}; + struct tm fileTime{}; if (pathToTime(file, fileTime) != returnvalue::OK) { sif::error << "Time extraction for file " << file << "failed" << std::endl; continue; @@ -294,7 +294,7 @@ void PersistentTmStore::deleteFromUpTo(uint32_t startUnixTime, uint32_t endUnixT continue; } // Convert file time to the UNIX epoch - struct tm fileTime {}; + struct tm fileTime{}; if (pathToTime(file.path(), fileTime) != returnvalue::OK) { sif::error << "Time extraction for " << file << " failed" << std::endl; continue; diff --git a/scripts/auto-formatter.sh b/scripts/auto-formatter.sh index 7cefa8fd..dea617c5 100755 --- a/scripts/auto-formatter.sh +++ b/scripts/auto-formatter.sh @@ -29,7 +29,7 @@ else echo "No ${cmake_fmt} tool found, not formatting CMake files" fi -cpp_format="clang-format" +cpp_format="clang-format-19" file_selectors="( -iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp )" file_excludes="( -not -iname translateObjects.cpp -not -iname translateEvents.cpp )" if command -v ${cpp_format} &> /dev/null; then diff --git a/scripts/q7s-cp.py b/scripts/q7s-cp.py index 76ef2353..c3be26d1 100755 --- a/scripts/q7s-cp.py +++ b/scripts/q7s-cp.py @@ -84,6 +84,8 @@ def build_cmd(args): cmd = "scp " if args.recursive: cmd += "-r " + # Necessary to avoid some errors related to SFTP server of OBSW. + cmd += "-O " address = "" port_args = "" target = args.target @@ -99,7 +101,7 @@ def build_cmd(args): target = args.target else: if target == "": - target = f"/tmp" + target = "/tmp" else: target = args.target # accepted_key_rsa_args = "-o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa" diff --git a/tmtc b/tmtc index 9a06c64d..82b388e2 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 9a06c64dfac3f4283c2d5af72a9c095f4726480b +Subproject commit 82b388e23e8745c8671b8dfb1a55e443f59bf274