From df712c71000fa129a95bd2a6311a78a8109713e3 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Fri, 25 Mar 2022 17:48:38 +0100 Subject: [PATCH 0001/2058] scex reader task started --- bsp_linux_board/InitMission.cpp | 8 ++++++++ bsp_linux_board/ObjectFactory.cpp | 2 ++ linux/boardtest/UartTestClass.cpp | 1 + linux/devices/CMakeLists.txt | 3 +++ linux/devices/ScexUartReader.cpp | 18 ++++++++++++++++++ linux/devices/ScexUartReader.h | 18 ++++++++++++++++++ linux/fsfwconfig/objects/systemObjectList.h | 2 ++ 7 files changed, 52 insertions(+) create mode 100644 linux/devices/ScexUartReader.cpp create mode 100644 linux/devices/ScexUartReader.h diff --git a/bsp_linux_board/InitMission.cpp b/bsp_linux_board/InitMission.cpp index 6dfe3af1..0a242209 100644 --- a/bsp_linux_board/InitMission.cpp +++ b/bsp_linux_board/InitMission.cpp @@ -228,7 +228,15 @@ void initmission::createTestTasks(TaskFactory& factory, if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("UART_TEST", objects::UART_TEST); } + PeriodicTaskIF* scexReaderTask = factory.createPeriodicTask( + "SCEX_UART_READER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); + result = scexReaderTask->addComponent(objects::SCEX_UART_READER); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("SCEX_UART_READER", objects::SCEX_UART_READER); + } + #endif /* RPI_ADD_GPIO_TEST == 1 */ + taskVec.push_back(scexReaderTask); taskVec.push_back(testTask); bool startTestPst = true; diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp index 18da8896..7df6b116 100644 --- a/bsp_linux_board/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -1,3 +1,4 @@ +#include #include "ObjectFactory.h" #include "OBSWConfig.h" @@ -182,6 +183,7 @@ void ObjectFactory::createTestTasks() { #endif #if OBSW_ADD_UART_TEST_CODE == 1 + new ScexUartReader(objects::SCEX_UART_READER); new UartTestClass(objects::UART_TEST); #else new UartComIF(objects::UART_COM_IF); diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 9c51ed8a..bfa735e9 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -197,6 +197,7 @@ void UartTestClass::scexPeriodic() { sif::info << "Received " << bytesRead << " bytes from the Solar Cell Experiment:" << std::endl; arrayprinter::print(recBuf.data(), bytesRead, OutputType::HEX, false); + break; } } while (bytesRead > 0); } diff --git a/linux/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt index 7d39837d..1130e7cd 100644 --- a/linux/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -4,4 +4,7 @@ if(EIVE_BUILD_GPSD_GPS_HANDLER) ) endif() +target_sources(${OBSW_NAME} PRIVATE + ScexUartReader.cpp +) add_subdirectory(startracker) diff --git a/linux/devices/ScexUartReader.cpp b/linux/devices/ScexUartReader.cpp new file mode 100644 index 00000000..4aa78357 --- /dev/null +++ b/linux/devices/ScexUartReader.cpp @@ -0,0 +1,18 @@ +#include "ScexUartReader.h" +#include + + +ScexUartReader::ScexUartReader(object_id_t objectId):SystemObject(objectId) { +} + +void ScexUartRead::start() { + semaphore->give(); +} +ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) { + std::cout<<"hallo welt"<take(); + while(true) { + semaphore->take(); + } + return RETURN_OK; +} diff --git a/linux/devices/ScexUartReader.h b/linux/devices/ScexUartReader.h new file mode 100644 index 00000000..70eafcf7 --- /dev/null +++ b/linux/devices/ScexUartReader.h @@ -0,0 +1,18 @@ +#ifndef LINUX_DEVICES_SCEXUARTREADER_H_ +#define LINUX_DEVICES_SCEXUARTREADER_H_ +#include +#include + + +class ScexUartReader: public SystemObject, //strg+shift+n +public ExecutableObjectIF, +public HasReturnvaluesIF { +public: + ScexUartReader(object_id_t objectId); +private: + ReturnValue_t performOperation(uint8_t operationCode = 0) override; + +}; + + +#endif /* LINUX_DEVICES_SCEXUARTREADER_H_ */ diff --git a/linux/fsfwconfig/objects/systemObjectList.h b/linux/fsfwconfig/objects/systemObjectList.h index a03e4d38..5fbc99d5 100644 --- a/linux/fsfwconfig/objects/systemObjectList.h +++ b/linux/fsfwconfig/objects/systemObjectList.h @@ -49,6 +49,7 @@ enum sourceObjects : uint32_t { UART_COM_IF = 0x49030003, SPI_COM_IF = 0x49020004, GPIO_IF = 0x49010005, + SCEX_UART_READER = 0x49010006, /* Custom device handler */ PCDU_HANDLER = 0x442000A1, @@ -57,6 +58,7 @@ enum sourceObjects : uint32_t { HEATER_HANDLER = 0x444100A4, RAD_SENSOR = 0x443200A5, + /* 0x54 ('T') for test handlers */ TEST_TASK = 0x54694269, LIBGPIOD_TEST = 0x54123456, From 35f2d2cb9cb5c6df84ca782c5d86c44c4c1fd004 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Fri, 8 Apr 2022 15:25:07 +0200 Subject: [PATCH 0002/2058] solve merge comflioct --- linux/devices/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/linux/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt index b88d59fc..b8568560 100644 --- a/linux/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -4,11 +4,8 @@ if(EIVE_BUILD_GPSD_GPS_HANDLER) ) endif() -<<<<<<< HEAD target_sources(${OBSW_NAME} PRIVATE ScexUartReader.cpp ) -======= add_subdirectory(ploc) ->>>>>>> origin/develop add_subdirectory(startracker) From 01d86a0c7b9e0e3dc8f1d63642d3860d45332662 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Fri, 8 Apr 2022 19:12:21 +0200 Subject: [PATCH 0003/2058] huge progress --- bsp_linux_board/InitMission.cpp | 13 +- bsp_linux_board/ObjectFactory.cpp | 7 +- linux/boardtest/UartTestClass.cpp | 183 ++++++++++++-------- linux/boardtest/UartTestClass.h | 11 +- linux/devices/ScexUartReader.cpp | 176 +++++++++++++++++-- linux/devices/ScexUartReader.h | 53 +++++- linux/fsfwconfig/objects/systemObjectList.h | 1 - 7 files changed, 339 insertions(+), 105 deletions(-) diff --git a/bsp_linux_board/InitMission.cpp b/bsp_linux_board/InitMission.cpp index 7814b61d..f634e8d6 100644 --- a/bsp_linux_board/InitMission.cpp +++ b/bsp_linux_board/InitMission.cpp @@ -229,14 +229,13 @@ void initmission::createTestTasks(TaskFactory& factory, initmission::printAddObjectError("UART_TEST", objects::UART_TEST); } PeriodicTaskIF* scexReaderTask = factory.createPeriodicTask( - "SCEX_UART_READER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); - result = scexReaderTask->addComponent(objects::SCEX_UART_READER); - if (result != HasReturnvaluesIF::RETURN_OK) { - initmission::printAddObjectError("SCEX_UART_READER", objects::SCEX_UART_READER); - } - -#endif /* RPI_ADD_GPIO_TEST == 1 */ + "SCEX_UART_READER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); + result = scexReaderTask->addComponent(objects::SCEX_UART_READER); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("SCEX_UART_READER", objects::SCEX_UART_READER); + } taskVec.push_back(scexReaderTask); +#endif /* RPI_ADD_GPIO_TEST == 1 */ taskVec.push_back(testTask); bool startTestPst = true; diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp index 76d35c6b..6bfa487f 100644 --- a/bsp_linux_board/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -1,6 +1,7 @@ -#include #include "ObjectFactory.h" +#include + #include "OBSWConfig.h" #include "devConf.h" #include "devices/addresses.h" @@ -198,8 +199,8 @@ void ObjectFactory::createTestTasks() { #endif #if OBSW_ADD_UART_TEST_CODE == 1 - new ScexUartReader(objects::SCEX_UART_READER); - new UartTestClass(objects::UART_TEST); + auto scexReader = new ScexUartReader(objects::SCEX_UART_READER); + new UartTestClass(objects::UART_TEST, scexReader); #else new UartComIF(objects::UART_COM_IF); #endif diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index bfa735e9..0941e423 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -3,6 +3,8 @@ #include // Error integer and strerror() function #include // Contains file controls like O_RDWR #include +#include +#include #include // write(), read(), close() #include "OBSWConfig.h" @@ -18,7 +20,11 @@ #define RPI_TEST_GPS_HANDLER 0 #endif -UartTestClass::UartTestClass(object_id_t objectId) : TestTask(objectId) { mode = TestModes::SCEX; } +UartTestClass::UartTestClass(object_id_t objectId, ScexUartReader* reader) + : TestTask(objectId), reader(reader) { + mode = TestModes::SCEX; + scexMode = ScexModes::READER_TASK; +} ReturnValue_t UartTestClass::initialize() { if (mode == TestModes::GPS) { @@ -127,100 +133,129 @@ void UartTestClass::gpsPeriodic() { } void UartTestClass::scexInit() { -#if defined(RASPBERRY_PI) - std::string devname = "/dev/serial0"; -#else - std::string devname = "/dev/ul-scex"; -#endif - /* Get file descriptor */ - serialPort = open(devname.c_str(), O_RDWR); - if (serialPort < 0) { - sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) - << std::endl; + if (reader == nullptr) { + sif::warning << "UartTestClass::scexInit: Reader invalid" << std::endl; return; } - // Setting up UART parameters - tty.c_cflag &= ~PARENB; // Clear parity bit - tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication - tty.c_cflag &= ~CSIZE; // Clear all the size bits - tty.c_cflag |= CS8; // 8 bits per byte - tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control - tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) + if (scexMode == ScexModes::SIMPLE) { +#if defined(RASPBERRY_PI) + std::string devname = "/dev/serial0"; +#else + std::string devname = "/dev/ul-scex"; +#endif + /* Get file descriptor */ + serialPort = open(devname.c_str(), O_RDWR); + if (serialPort < 0) { + sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + return; + } + // Setting up UART parameters + tty.c_cflag &= ~PARENB; // Clear parity bit + tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication + tty.c_cflag &= ~CSIZE; // Clear all the size bits + tty.c_cflag |= CS8; // 8 bits per byte + tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control + tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) - // Use non-canonical mode and clear echo flag - tty.c_lflag &= ~(ICANON | ECHO); + // Use non-canonical mode and clear echo flag + tty.c_lflag &= ~(ICANON | ECHO); - // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are - // received in one go - tty.c_cc[VTIME] = 1; // In units of 0.1 seconds - tty.c_cc[VMIN] = 255; // Read up to 255 bytes + // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are + // received in one go + tty.c_cc[VTIME] = 1; // In units of 0.1 seconds + tty.c_cc[VMIN] = 255; // Read up to 255 bytes - // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. + // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. #if !defined(XIPHOS_Q7S) - if (cfsetispeed(&tty, B57600) != 0) { - sif::warning << "UartTestClass::scexInit: Setting baud rate failed" << std::endl; - } + if (cfsetispeed(&tty, B57600) != 0) { + sif::warning << "UartTestClass::scexInit: Setting baud rate failed" << std::endl; + } #endif - if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { - sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) - << std::endl; + if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { + sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + } + // Flush received and unread data + tcflush(serialPort, TCIFLUSH); + } else { +#if defined(RASPBERRY_PI) + std::string devname = "/dev/serial0"; +#else + std::string devname = "/dev/ul-scex"; +#endif + uartCookie = + new UartCookie(this->getObjectId(), devname, UartModes::NON_CANONICAL, 57600, 4096); + reader->setDebugMode(true); + ReturnValue_t result = reader->initializeInterface(uartCookie); } - // Flush received and unread data - tcflush(serialPort, TCIFLUSH); } void UartTestClass::scexPeriodic() { - sif::info << "UartTestClass::scexInit: Sending ping command to SCEX" << std::endl; - int result = prepareScexPing(); - if (result != 0) { + if (reader == nullptr) { return; - }; - size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); - if (bytesWritten != encodedLen) { - sif::warning << "Sending ping command to solar experiment failed" << std::endl; } - // Read back reply immediately - int bytesRead = 0; - do { - bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), - static_cast(recBuf.size())); - if (bytesRead < 0) { - sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" << errno - << ", " << strerror(errno) << "]" << std::endl; - break; - } else if (bytesRead >= static_cast(recBuf.size())) { - sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough" - << std::endl; - } else if (bytesRead > 0) { - sif::info << "Received " << bytesRead - << " bytes from the Solar Cell Experiment:" << std::endl; - arrayprinter::print(recBuf.data(), bytesRead, OutputType::HEX, false); - break; + if (scexMode == ScexModes::SIMPLE) { + sif::info << "UartTestClass::scexInit: Sending ping command to SCEX" << std::endl; + // reader->sendMessage(nullptr, nullptr, 0); + uint8_t tmpCmdBuf[32] = {}; + size_t len = 0; + prepareScexPing(tmpCmdBuf, &len); + ReturnValue_t result = + dleEncoder.encode(tmpCmdBuf, len, cmdBuf.data(), cmdBuf.size(), &encodedLen, true); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; + return; } - } while (bytesRead > 0); + if (result != 0) { + return; + }; + size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); + if (bytesWritten != encodedLen) { + sif::warning << "Sending ping command to solar experiment failed" << std::endl; + } + + // Read back reply immediately + int bytesRead = 0; + do { + bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), + static_cast(recBuf.size())); + if (bytesRead < 0) { + sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" + << errno << ", " << strerror(errno) << "]" << std::endl; + break; + } else if (bytesRead >= static_cast(recBuf.size())) { + sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough" + << std::endl; + } else if (bytesRead > 0) { + sif::info << "Received " << bytesRead + << " bytes from the Solar Cell Experiment:" << std::endl; + arrayprinter::print(recBuf.data(), bytesRead, OutputType::HEX, false); + break; + } + } while (bytesRead > 0); + } else { + size_t len = 0; + prepareScexPing(cmdBuf.data(), &len); + reader->sendMessage(uartCookie, cmdBuf.data(), len); + } } -int UartTestClass::prepareScexPing() { - std::array tmpCmdBuf = {}; +int UartTestClass::prepareScexPing(uint8_t* cmdBuf, size_t* len) { // Send ping command - tmpCmdBuf[0] = scex::CMD_PING; + cmdBuf[0] = scex::CMD_PING; // These two fields are the packet counter and the total packet count. Those are 1 and 1 for each // telecommand so far - tmpCmdBuf[1] = 1; - tmpCmdBuf[2] = 1; + cmdBuf[1] = 1; + cmdBuf[2] = 1; uint16_t userDataLen = 0; - tmpCmdBuf[3] = (userDataLen >> 8) & 0xff; - tmpCmdBuf[4] = userDataLen & 0xff; - uint16_t crc = CRC::crc16ccitt(tmpCmdBuf.data(), 5); - tmpCmdBuf[5] = (crc >> 8) & 0xff; - tmpCmdBuf[6] = crc & 0xff; - ReturnValue_t result = - dleEncoder.encode(tmpCmdBuf.data(), 7, cmdBuf.data(), cmdBuf.size(), &encodedLen, true); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; - return -1; - } + cmdBuf[3] = (userDataLen >> 8) & 0xff; + cmdBuf[4] = userDataLen & 0xff; + uint16_t crc = CRC::crc16ccitt(cmdBuf, 5); + cmdBuf[5] = (crc >> 8) & 0xff; + cmdBuf[6] = crc & 0xff; + *len = 7; return 0; } diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index 786d01ce..17fdca59 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -2,6 +2,7 @@ #define LINUX_BOARDTEST_UARTTESTCLASS_H_ #include +#include #include // Contains POSIX terminal control definitions #include @@ -9,9 +10,11 @@ #include "lwgps/lwgps.h" #include "test/testtasks/TestTask.h" +class ScexUartReader; + class UartTestClass : public TestTask { public: - UartTestClass(object_id_t objectId); + UartTestClass(object_id_t objectId, ScexUartReader* reader); ReturnValue_t initialize() override; ReturnValue_t performOneShotAction() override; @@ -24,14 +27,17 @@ class UartTestClass : public TestTask { SCEX }; + enum ScexModes { SIMPLE, READER_TASK } scexMode; + void gpsInit(); void gpsPeriodic(); void scexInit(); void scexPeriodic(); - int prepareScexPing(); + int prepareScexPing(uint8_t* cmdBuf, size_t* len); TestModes mode = TestModes::GPS; DleEncoder dleEncoder = DleEncoder(); + UartCookie* uartCookie = nullptr; size_t encodedLen = 0; lwgps_t gpsData = {}; struct termios tty = {}; @@ -39,6 +45,7 @@ class UartTestClass : public TestTask { std::array cmdBuf = {}; std::array recBuf = {}; uint8_t recvCnt = 0; + ScexUartReader* reader = nullptr; }; #endif /* LINUX_BOARDTEST_UARTTESTCLASS_H_ */ diff --git a/linux/devices/ScexUartReader.cpp b/linux/devices/ScexUartReader.cpp index 4aa78357..a35f153f 100644 --- a/linux/devices/ScexUartReader.cpp +++ b/linux/devices/ScexUartReader.cpp @@ -1,18 +1,174 @@ #include "ScexUartReader.h" + +#include // Contains file controls like O_RDWR +#include +#include +#include +#include +#include +#include // write(), read(), close() + +#include // Error integer and strerror() function #include +#include "OBSWConfig.h" -ScexUartReader::ScexUartReader(object_id_t objectId):SystemObject(objectId) { +ScexUartReader::ScexUartReader(object_id_t objectId) + : SystemObject(objectId), ringBuffer(200 * 2048, true), sizesQueue(200) { + semaphore = SemaphoreFactory::instance()->createBinarySemaphore(); + semaphore->acquire(); + lock = MutexFactory::instance()->createMutex(); } -void ScexUartRead::start() { - semaphore->give(); -} +// void ScexUartRead::start() { /* semaphore->give(); */ } ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) { - std::cout<<"hallo welt"<take(); - while(true) { - semaphore->take(); - } - return RETURN_OK; + lock->lockMutex(); + state = States::IDLE; + lock->unlockMutex(); + while (true) { + semaphore->acquire(); + std::cout << "task was started" << std::endl; + int bytesRead = 0; + do { + bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), + static_cast(recBuf.size())); + if (bytesRead == 0) { + MutexGuard mg(lock); + States currentState = state; + if (currentState == States::FINISH) { + state = States::IDLE; + break; + } + } else if (bytesRead < 0) { + sif::warning << "ScexUartReader::performOperation: read call failed with error [" << errno + << ", " << strerror(errno) << "]" << std::endl; + break; + } else if (bytesRead >= static_cast(recBuf.size())) { + sif::error << "ScexUartReader::performOperation: Receive buffer too small" << std::endl; + } else if (bytesRead > 0) { + MutexGuard mg(lock); + sizesQueue.insert(bytesRead); + ReturnValue_t result = ringBuffer.writeData(recBuf.data(), bytesRead); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "ScexUartReader::performOperation: Writing into ring buffer failed" + << std::endl; + } + if (debugMode) { + sif::info << "Received " << bytesRead + << " bytes from the Solar Cell Experiment:" << std::endl; + arrayprinter::print(recBuf.data(), bytesRead, OutputType::HEX, false); + } + break; + } + } while (bytesRead > 0); + // task block comes here + std::cout << "done" << std::endl; + } + return RETURN_OK; +} + +ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) { + UartCookie *uartCookie = dynamic_cast(cookie); + if (uartCookie) { + return RETURN_FAILED; + } + std::string devname = uartCookie->getDeviceFile(); + /* Get file descriptor */ + serialPort = open(devname.c_str(), O_RDWR); + if (serialPort < 0) { + sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + return HasReturnvaluesIF::RETURN_FAILED; + } + // Setting up UART parameters + tty.c_cflag &= ~PARENB; // Clear parity bit + tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication + tty.c_cflag &= ~CSIZE; // Clear all the size bits + tty.c_cflag |= CS8; // 8 bits per byte + tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control + tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) + + // Use non-canonical mode and clear echo flag + tty.c_lflag &= ~(ICANON | ECHO); + + // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are + // received in one go + tty.c_cc[VTIME] = 20; // Read for up to 2 seconds + tty.c_cc[VMIN] = 0; // Read as much as there is available + + // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. +#if !defined(XIPHOS_Q7S) + if (cfsetispeed(&tty, B57600) != 0) { + sif::warning << "ScexUartReader::initializeInterface: Setting baud rate failed" << std::endl; + } +#endif + + if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { + sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + } + // Flush received and unread data + tcflush(serialPort, TCIFLUSH); + return RETURN_OK; +} + +ReturnValue_t ScexUartReader::sendMessage(CookieIF *cookie, const uint8_t *sendData, + size_t sendLen) { + lock->lockMutex(); + if (state == States::NOT_READY or state == States::RUNNING) { + lock->unlockMutex(); + return HasReturnvaluesIF::RETURN_FAILED; + } + state = States::RUNNING; + lock->unlockMutex(); + size_t encodedLen = 0; + ReturnValue_t result = + dleEncoder.encode(sendData, sendLen, cmdbuf.data(), cmdbuf.size(), &encodedLen, true); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; + return RETURN_FAILED; + } + size_t bytesWritten = write(serialPort, cmdbuf.data(), encodedLen); + if (bytesWritten != encodedLen) { + sif::warning << "Sending ping command to solar experiment failed" << std::endl; + return RETURN_FAILED; + } + result = semaphore->release(); + if (result != HasReturnvaluesIF::RETURN_OK) { + std::cout << "ScexUartReader::sendMessag: Releasing semaphore failed" << std::endl; + } + return RETURN_OK; +} + +ReturnValue_t ScexUartReader::getSendSuccess(CookieIF *cookie) { return RETURN_OK; } + +ReturnValue_t ScexUartReader::requestReceiveMessage(CookieIF *cookie, size_t requestLen) { + return RETURN_OK; +} + +void ScexUartReader::setDebugMode(bool enable) { this->debugMode = enable; } + +ReturnValue_t ScexUartReader::finish() { + MutexGuard mg(lock); + if (state == States::IDLE) { + return HasReturnvaluesIF::RETURN_FAILED; + } + state = States::FINISH; + return RETURN_OK; +} + +ReturnValue_t ScexUartReader::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, + size_t *size) { + MutexGuard mg(lock); + if (sizesQueue.empty()) { + *size = 0; + return RETURN_OK; + } + *size = sizesQueue.pop(); + *buffer = ipcBuffer.data(); + ReturnValue_t result = ringBuffer.readData(ipcBuffer.data(), *size, true); + if (result != RETURN_OK) { + sif::warning << "ScexUartReader::readReceivedMessage: Reading RingBuffer failed" << std::endl; + } + return RETURN_OK; } diff --git a/linux/devices/ScexUartReader.h b/linux/devices/ScexUartReader.h index 70eafcf7..13ff7d73 100644 --- a/linux/devices/ScexUartReader.h +++ b/linux/devices/ScexUartReader.h @@ -1,18 +1,55 @@ #ifndef LINUX_DEVICES_SCEXUARTREADER_H_ #define LINUX_DEVICES_SCEXUARTREADER_H_ + +#include +#include +#include +#include #include #include +#include +#include // Contains POSIX terminal control definitions +class SemaphoreIF; +class MutexIF; -class ScexUartReader: public SystemObject, //strg+shift+n -public ExecutableObjectIF, -public HasReturnvaluesIF { -public: - ScexUartReader(object_id_t objectId); -private: - ReturnValue_t performOperation(uint8_t operationCode = 0) override; +class ScexUartReader : public SystemObject, // strg+shift+n + public ExecutableObjectIF, + public DeviceCommunicationIF { + friend class UartTestClass; + public: + enum class States { NOT_READY, IDLE, RUNNING, FINISH }; + ScexUartReader(object_id_t objectId); + + ReturnValue_t finish(); + void setDebugMode(bool enable); + + private: + SemaphoreIF *semaphore; + bool debugMode = false; + MutexIF *lock; + int serialPort = 0; + States state = States::IDLE; + struct termios tty = {}; + bool doFinish = false; + DleEncoder dleEncoder = DleEncoder(); + SimpleRingBuffer ringBuffer; + DynamicFIFO sizesQueue; + Countdown finishCoutdown = Countdown(180 * 1000); + std::array cmdbuf = {}; + std::array recBuf = {}; + + std::array ipcBuffer = {}; + + ReturnValue_t performOperation(uint8_t operationCode = 0) override; + + // DeviceCommunicationIF implementation + ReturnValue_t initializeInterface(CookieIF *cookie) override; + ReturnValue_t sendMessage(CookieIF *cookie, const uint8_t *sendData, size_t sendLen) override; + ReturnValue_t getSendSuccess(CookieIF *cookie) override; + ReturnValue_t requestReceiveMessage(CookieIF *cookie, size_t requestLen) override; + ReturnValue_t readReceivedMessage(CookieIF *cookie, uint8_t **buffer, size_t *size) override; }; - #endif /* LINUX_DEVICES_SCEXUARTREADER_H_ */ diff --git a/linux/fsfwconfig/objects/systemObjectList.h b/linux/fsfwconfig/objects/systemObjectList.h index 5fbc99d5..3d8edba2 100644 --- a/linux/fsfwconfig/objects/systemObjectList.h +++ b/linux/fsfwconfig/objects/systemObjectList.h @@ -58,7 +58,6 @@ enum sourceObjects : uint32_t { HEATER_HANDLER = 0x444100A4, RAD_SENSOR = 0x443200A5, - /* 0x54 ('T') for test handlers */ TEST_TASK = 0x54694269, LIBGPIOD_TEST = 0x54123456, From 6071e34771af2d62e48b2c7a1f47eafb1b07dd6c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 8 Apr 2022 21:16:02 +0200 Subject: [PATCH 0004/2058] some refactoring --- linux/boardtest/UartTestClass.cpp | 174 ++++++++++--------- linux/boardtest/UartTestClass.h | 4 + linux/devices/GPSHyperionLinuxController.cpp | 1 - mission/devices/P60DockHandler.cpp | 2 +- tmtc | 2 +- 5 files changed, 100 insertions(+), 83 deletions(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 0941e423..6ca8ef9a 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -23,7 +23,7 @@ UartTestClass::UartTestClass(object_id_t objectId, ScexUartReader* reader) : TestTask(objectId), reader(reader) { mode = TestModes::SCEX; - scexMode = ScexModes::READER_TASK; + scexMode = ScexModes::SIMPLE; } ReturnValue_t UartTestClass::initialize() { @@ -138,47 +138,7 @@ void UartTestClass::scexInit() { return; } if (scexMode == ScexModes::SIMPLE) { -#if defined(RASPBERRY_PI) - std::string devname = "/dev/serial0"; -#else - std::string devname = "/dev/ul-scex"; -#endif - /* Get file descriptor */ - serialPort = open(devname.c_str(), O_RDWR); - if (serialPort < 0) { - sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) - << std::endl; - return; - } - // Setting up UART parameters - tty.c_cflag &= ~PARENB; // Clear parity bit - tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication - tty.c_cflag &= ~CSIZE; // Clear all the size bits - tty.c_cflag |= CS8; // 8 bits per byte - tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control - tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) - - // Use non-canonical mode and clear echo flag - tty.c_lflag &= ~(ICANON | ECHO); - - // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are - // received in one go - tty.c_cc[VTIME] = 1; // In units of 0.1 seconds - tty.c_cc[VMIN] = 255; // Read up to 255 bytes - - // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. -#if !defined(XIPHOS_Q7S) - if (cfsetispeed(&tty, B57600) != 0) { - sif::warning << "UartTestClass::scexInit: Setting baud rate failed" << std::endl; - } -#endif - - if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { - sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) - << std::endl; - } - // Flush received and unread data - tcflush(serialPort, TCIFLUSH); + scexSimpleInit(); } else { #if defined(RASPBERRY_PI) std::string devname = "/dev/serial0"; @@ -189,6 +149,11 @@ void UartTestClass::scexInit() { new UartCookie(this->getObjectId(), devname, UartModes::NON_CANONICAL, 57600, 4096); reader->setDebugMode(true); ReturnValue_t result = reader->initializeInterface(uartCookie); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "UartTestClass::gpsPeriodic: Initializing SCEX reader " + "UART IF failed" + << std::endl; + } } } @@ -198,44 +163,7 @@ void UartTestClass::scexPeriodic() { } if (scexMode == ScexModes::SIMPLE) { - sif::info << "UartTestClass::scexInit: Sending ping command to SCEX" << std::endl; - // reader->sendMessage(nullptr, nullptr, 0); - uint8_t tmpCmdBuf[32] = {}; - size_t len = 0; - prepareScexPing(tmpCmdBuf, &len); - ReturnValue_t result = - dleEncoder.encode(tmpCmdBuf, len, cmdBuf.data(), cmdBuf.size(), &encodedLen, true); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; - return; - } - if (result != 0) { - return; - }; - size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); - if (bytesWritten != encodedLen) { - sif::warning << "Sending ping command to solar experiment failed" << std::endl; - } - - // Read back reply immediately - int bytesRead = 0; - do { - bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), - static_cast(recBuf.size())); - if (bytesRead < 0) { - sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" - << errno << ", " << strerror(errno) << "]" << std::endl; - break; - } else if (bytesRead >= static_cast(recBuf.size())) { - sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough" - << std::endl; - } else if (bytesRead > 0) { - sif::info << "Received " << bytesRead - << " bytes from the Solar Cell Experiment:" << std::endl; - arrayprinter::print(recBuf.data(), bytesRead, OutputType::HEX, false); - break; - } - } while (bytesRead > 0); + scexSimplePeriodic(); } else { size_t len = 0; prepareScexPing(cmdBuf.data(), &len); @@ -259,3 +187,89 @@ int UartTestClass::prepareScexPing(uint8_t* cmdBuf, size_t* len) { *len = 7; return 0; } + +void UartTestClass::scexSimplePeriodic() { + sif::info << "UartTestClass::scexInit: Sending ping command to SCEX" << std::endl; + uint8_t tmpCmdBuf[32] = {}; + size_t len = 0; + prepareScexPing(tmpCmdBuf, &len); + ReturnValue_t result = + dleEncoder.encode(tmpCmdBuf, len, cmdBuf.data(), cmdBuf.size(), &encodedLen, true); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; + return; + } + if (result != 0) { + return; + }; + size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); + if (bytesWritten != encodedLen) { + sif::warning << "Sending ping command to solar experiment failed" << std::endl; + } + + // Read back reply immediately + int bytesRead = 0; + do { + bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), + static_cast(recBuf.size())); + if (bytesRead == 0) { + sif::warning << "Reading SCEX: Timeout occured after 0.5 seconds" << std::endl; + } else if (bytesRead < 0) { + sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" << errno + << ", " << strerror(errno) << "]" << std::endl; + break; + } else if (bytesRead >= static_cast(recBuf.size())) { + sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough" + << std::endl; + } else if (bytesRead > 0) { + sif::info << "Received " << bytesRead + << " bytes from the Solar Cell Experiment:" << std::endl; + arrayprinter::print(recBuf.data(), bytesRead, OutputType::HEX, false); + break; + } + } while (bytesRead > 0); +} + +void UartTestClass::scexSimpleInit() { +#if defined(RASPBERRY_PI) + std::string devname = "/dev/serial0"; +#else + std::string devname = "/dev/ul-scex"; +#endif + /* Get file descriptor */ + serialPort = open(devname.c_str(), O_RDWR); + if (serialPort < 0) { + sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + return; + } + // Setting up UART parameters + tty.c_cflag &= ~PARENB; // Clear parity bit + tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication + tty.c_cflag &= ~CSIZE; // Clear all the size bits + tty.c_cflag |= CS8; // 8 bits per byte + tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control + tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) + + // Use non-canonical mode and clear echo flag + tty.c_lflag &= ~(ICANON | ECHO); + + // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are + // received in one go + tty.c_cc[VTIME] = 5; // In units of 0.1 seconds + tty.c_cc[VMIN] = 1; // Read up to 255 bytes + + // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. +#if !defined(XIPHOS_Q7S) + if (cfsetispeed(&tty, B57600) != 0) { + sif::warning << "UartTestClass::scexInit: Setting baud rate failed" << std::endl; + } +#endif + + // Flush received and unread data + tcflush(serialPort, TCIOFLUSH); + if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { + sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + } +} diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index 17fdca59..7c046931 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -35,6 +35,10 @@ class UartTestClass : public TestTask { void scexInit(); void scexPeriodic(); int prepareScexPing(uint8_t* cmdBuf, size_t* len); + + void scexSimplePeriodic(); + void scexSimpleInit(); + TestModes mode = TestModes::GPS; DleEncoder dleEncoder = DleEncoder(); UartCookie* uartCookie = nullptr; diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index d1ef7d1b..20860211 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -3,7 +3,6 @@ #include "OBSWConfig.h" #include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/timemanager/Clock.h" - #include "linux/utility/utility.h" #include "mission/utility/compileTime.h" diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index d37673fc..508471d2 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -111,7 +111,7 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { dataOffset += 6; coreHk.bootCount = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - if(firstHk) { + if (firstHk) { triggerEvent(P60_BOOT_COUNT, coreHk.bootCount.value); } dataOffset += 6; diff --git a/tmtc b/tmtc index 3a1c7c62..091cf2dd 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 3a1c7c62887eb377c498bd9cdac47b93f40c85ba +Subproject commit 091cf2dd632c71a0fa8000312bb11e84f1a755db From 44c8f5f7307549b2c7399fcdcf2f5014d25b2ee4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 9 Apr 2022 01:00:42 +0200 Subject: [PATCH 0005/2058] bugfix for SCEX --- bsp_linux_board/ObjectFactory.cpp | 2 +- linux/boardtest/UartTestClass.cpp | 99 ++++++++++--------- linux/boardtest/UartTestClass.h | 4 +- .../devicedefinitions/SCEXDefinitions.h | 12 ++- 4 files changed, 66 insertions(+), 51 deletions(-) diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp index 6bfa487f..fe6a0fa3 100644 --- a/bsp_linux_board/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -78,7 +78,7 @@ void ObjectFactory::produce(void* args) { createRpiAcsBoard(gpioIF, spiDev); #endif -#if OBSW_ADD_SUN_SENSORS == 1 || defined(OBSW_ADD_RTD_DEVICES) +#if OBSW_ADD_SUN_SENSORS == 1 || OBSW_ADD_RTD_DEVICES == 1 #ifdef RASPBERRY_PI rpi::gpio::initSpiCsDecoder(gpioIF); #endif diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 6ca8ef9a..a59dc4ea 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -12,7 +12,6 @@ #include "fsfw/globalfunctions/DleEncoder.h" #include "fsfw/globalfunctions/arrayprinter.h" #include "fsfw/serviceinterface.h" -#include "mission/devices/devicedefinitions/SCEXDefinitions.h" #define GPS_REPLY_WIRETAPPING 0 @@ -24,6 +23,7 @@ UartTestClass::UartTestClass(object_id_t objectId, ScexUartReader* reader) : TestTask(objectId), reader(reader) { mode = TestModes::SCEX; scexMode = ScexModes::SIMPLE; + currCmd = scex::ScexCmds::ONE_CELL; } ReturnValue_t UartTestClass::initialize() { @@ -166,14 +166,16 @@ void UartTestClass::scexPeriodic() { scexSimplePeriodic(); } else { size_t len = 0; - prepareScexPing(cmdBuf.data(), &len); + prepareScexCmd(scex::ScexCmds::PING, false, cmdBuf.data(), &len); reader->sendMessage(uartCookie, cmdBuf.data(), len); } } -int UartTestClass::prepareScexPing(uint8_t* cmdBuf, size_t* len) { +int UartTestClass::prepareScexCmd(scex::ScexCmds cmd, bool tempCheck, + uint8_t* cmdBuf, size_t* len) { + using namespace scex; // Send ping command - cmdBuf[0] = scex::CMD_PING; + cmdBuf[0] = scex::createCmdByte(cmd, false); // These two fields are the packet counter and the total packet count. Those are 1 and 1 for each // telecommand so far cmdBuf[1] = 1; @@ -188,48 +190,6 @@ int UartTestClass::prepareScexPing(uint8_t* cmdBuf, size_t* len) { return 0; } -void UartTestClass::scexSimplePeriodic() { - sif::info << "UartTestClass::scexInit: Sending ping command to SCEX" << std::endl; - uint8_t tmpCmdBuf[32] = {}; - size_t len = 0; - prepareScexPing(tmpCmdBuf, &len); - ReturnValue_t result = - dleEncoder.encode(tmpCmdBuf, len, cmdBuf.data(), cmdBuf.size(), &encodedLen, true); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; - return; - } - if (result != 0) { - return; - }; - size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); - if (bytesWritten != encodedLen) { - sif::warning << "Sending ping command to solar experiment failed" << std::endl; - } - - // Read back reply immediately - int bytesRead = 0; - do { - bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), - static_cast(recBuf.size())); - if (bytesRead == 0) { - sif::warning << "Reading SCEX: Timeout occured after 0.5 seconds" << std::endl; - } else if (bytesRead < 0) { - sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" << errno - << ", " << strerror(errno) << "]" << std::endl; - break; - } else if (bytesRead >= static_cast(recBuf.size())) { - sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough" - << std::endl; - } else if (bytesRead > 0) { - sif::info << "Received " << bytesRead - << " bytes from the Solar Cell Experiment:" << std::endl; - arrayprinter::print(recBuf.data(), bytesRead, OutputType::HEX, false); - break; - } - } while (bytesRead > 0); -} - void UartTestClass::scexSimpleInit() { #if defined(RASPBERRY_PI) std::string devname = "/dev/serial0"; @@ -256,8 +216,8 @@ void UartTestClass::scexSimpleInit() { // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are // received in one go - tty.c_cc[VTIME] = 5; // In units of 0.1 seconds - tty.c_cc[VMIN] = 1; // Read up to 255 bytes + tty.c_cc[VTIME] = 0; // In units of 0.1 seconds + tty.c_cc[VMIN] = 0; // Read up to 255 bytes // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. #if !defined(XIPHOS_Q7S) @@ -273,3 +233,46 @@ void UartTestClass::scexSimpleInit() { << std::endl; } } + +void UartTestClass::scexSimplePeriodic() { + using namespace scex; + sif::info << "UartTestClass::scexInit: Sending ping command to SCEX" << std::endl; + uint8_t tmpCmdBuf[32] = {}; + size_t len = 0; + prepareScexCmd(currCmd, false, tmpCmdBuf, &len); + ReturnValue_t result = + dleEncoder.encode(tmpCmdBuf, len, cmdBuf.data(), cmdBuf.size(), &encodedLen, true); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; + return; + } + if (result != 0) { + return; + }; + size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); + if (bytesWritten != encodedLen) { + sif::warning << "Sending ping command to solar experiment failed" << std::endl; + } + + // Read back reply immediately + int bytesRead = 0; + do { + bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), + static_cast(recBuf.size())); + if (bytesRead == 0) { + sif::warning << "Reading SCEX: Timeout or no bytes read" << std::endl; + } else if (bytesRead < 0) { + sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" << errno + << ", " << strerror(errno) << "]" << std::endl; + break; + } else if (bytesRead >= static_cast(recBuf.size())) { + sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough" + << std::endl; + } else if (bytesRead > 0) { + sif::info << "Received " << bytesRead + << " bytes from the Solar Cell Experiment:" << std::endl; + arrayprinter::print(recBuf.data(), bytesRead, OutputType::HEX, false); + break; + } + } while (bytesRead > 0); +} diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index 7c046931..3836506c 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -8,6 +8,7 @@ #include #include "lwgps/lwgps.h" +#include "mission/devices/devicedefinitions/SCEXDefinitions.h" #include "test/testtasks/TestTask.h" class ScexUartReader; @@ -34,11 +35,12 @@ class UartTestClass : public TestTask { void scexInit(); void scexPeriodic(); - int prepareScexPing(uint8_t* cmdBuf, size_t* len); + int prepareScexCmd(scex::ScexCmds cmd, bool tempCheck, uint8_t* cmdBuf, size_t* len); void scexSimplePeriodic(); void scexSimpleInit(); + scex::ScexCmds currCmd = scex::ScexCmds::PING; TestModes mode = TestModes::GPS; DleEncoder dleEncoder = DleEncoder(); UartCookie* uartCookie = nullptr; diff --git a/mission/devices/devicedefinitions/SCEXDefinitions.h b/mission/devices/devicedefinitions/SCEXDefinitions.h index 8becabc8..f9c532ff 100644 --- a/mission/devices/devicedefinitions/SCEXDefinitions.h +++ b/mission/devices/devicedefinitions/SCEXDefinitions.h @@ -6,7 +6,17 @@ // Definitions for the Solar Cell Experiment namespace scex { -static constexpr uint8_t CMD_PING = 0x4e; +enum ScexCmds: uint8_t { + PING = 0b00111, + ONE_CELL = 0b00110 +}; + +static constexpr uint8_t IDLE_BIT_0_DEF_STATE = 0; +static constexpr uint8_t IDLE_BIT_1_DEF_STATE = 1; + +uint8_t createCmdByte(ScexCmds cmd, bool tempCheck) { + return (IDLE_BIT_0_DEF_STATE << 7) | (IDLE_BIT_1_DEF_STATE << 6) | (cmd << 1) | tempCheck; +} } From 808e01dfd360e7894d0aba11f985ea42cc7318ac Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 9 Apr 2022 14:43:06 +0200 Subject: [PATCH 0006/2058] DLE FRAM packets can be read now --- fsfw | 2 +- linux/boardtest/UartTestClass.cpp | 152 ++++++++++-------- linux/boardtest/UartTestClass.h | 20 ++- linux/devices/CMakeLists.txt | 1 + linux/devices/ScexDleParser.cpp | 6 + linux/devices/ScexDleParser.h | 12 ++ linux/devices/ScexUartReader.cpp | 37 +++-- linux/devices/ScexUartReader.h | 16 +- linux/fsfwconfig/OBSWConfig.h.in | 2 + mission/devices/CMakeLists.txt | 2 + .../devices/devicedefinitions/CMakeLists.txt | 3 + .../devicedefinitions/ScexDefinitions.cpp | 5 + .../{SCEXDefinitions.h => ScexDefinitions.h} | 11 +- 13 files changed, 176 insertions(+), 93 deletions(-) create mode 100644 linux/devices/ScexDleParser.cpp create mode 100644 linux/devices/ScexDleParser.h create mode 100644 mission/devices/devicedefinitions/CMakeLists.txt create mode 100644 mission/devices/devicedefinitions/ScexDefinitions.cpp rename mission/devices/devicedefinitions/{SCEXDefinitions.h => ScexDefinitions.h} (63%) diff --git a/fsfw b/fsfw index 85a6e4b1..bdddee4f 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 85a6e4b12977f24247ed3ca3011c6f8b611a144e +Subproject commit bdddee4f81fbdff7f207fd03b3c592522e04c5aa diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index a59dc4ea..0a164c8b 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -4,6 +4,7 @@ #include // Contains file controls like O_RDWR #include #include +#include #include #include // write(), read(), close() @@ -20,10 +21,15 @@ #endif UartTestClass::UartTestClass(object_id_t objectId, ScexUartReader* reader) - : TestTask(objectId), reader(reader) { + : TestTask(objectId), reader(reader), decodeRingBuf(4096, true) { mode = TestModes::SCEX; scexMode = ScexModes::SIMPLE; - currCmd = scex::ScexCmds::ONE_CELL; + currCmd = scex::ScexCmds::FRAM; + if (mode == TestModes::SCEX) { + dleParser = + new ScexDleParser(decodeRingBuf, dleEncoder, {encodedBuf.data(), encodedBuf.size()}, + {decodedBuf.data(), decodedBuf.size()}, &foundDlePacketHandler, this); + } } ReturnValue_t UartTestClass::initialize() { @@ -145,8 +151,7 @@ void UartTestClass::scexInit() { #else std::string devname = "/dev/ul-scex"; #endif - uartCookie = - new UartCookie(this->getObjectId(), devname, UartModes::NON_CANONICAL, 57600, 4096); + uartCookie = new UartCookie(this->getObjectId(), devname, UartBaudRate::RATE_57600, 4096); reader->setDebugMode(true); ReturnValue_t result = reader->initializeInterface(uartCookie); if (result != HasReturnvaluesIF::RETURN_OK) { @@ -171,25 +176,6 @@ void UartTestClass::scexPeriodic() { } } -int UartTestClass::prepareScexCmd(scex::ScexCmds cmd, bool tempCheck, - uint8_t* cmdBuf, size_t* len) { - using namespace scex; - // Send ping command - cmdBuf[0] = scex::createCmdByte(cmd, false); - // These two fields are the packet counter and the total packet count. Those are 1 and 1 for each - // telecommand so far - cmdBuf[1] = 1; - cmdBuf[2] = 1; - uint16_t userDataLen = 0; - cmdBuf[3] = (userDataLen >> 8) & 0xff; - cmdBuf[4] = userDataLen & 0xff; - uint16_t crc = CRC::crc16ccitt(cmdBuf, 5); - cmdBuf[5] = (crc >> 8) & 0xff; - cmdBuf[6] = crc & 0xff; - *len = 7; - return 0; -} - void UartTestClass::scexSimpleInit() { #if defined(RASPBERRY_PI) std::string devname = "/dev/serial0"; @@ -216,8 +202,8 @@ void UartTestClass::scexSimpleInit() { // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are // received in one go - tty.c_cc[VTIME] = 0; // In units of 0.1 seconds - tty.c_cc[VMIN] = 0; // Read up to 255 bytes + tty.c_cc[VTIME] = 10; // In units of 0.1 seconds + tty.c_cc[VMIN] = 255; // Read up to 255 bytes // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. #if !defined(XIPHOS_Q7S) @@ -226,53 +212,89 @@ void UartTestClass::scexSimpleInit() { } #endif - // Flush received and unread data - tcflush(serialPort, TCIOFLUSH); if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) << std::endl; } + // Flush received and unread data + tcflush(serialPort, TCIOFLUSH); } void UartTestClass::scexSimplePeriodic() { using namespace scex; - sif::info << "UartTestClass::scexInit: Sending ping command to SCEX" << std::endl; - uint8_t tmpCmdBuf[32] = {}; - size_t len = 0; - prepareScexCmd(currCmd, false, tmpCmdBuf, &len); - ReturnValue_t result = - dleEncoder.encode(tmpCmdBuf, len, cmdBuf.data(), cmdBuf.size(), &encodedLen, true); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; - return; - } - if (result != 0) { - return; - }; - size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); - if (bytesWritten != encodedLen) { - sif::warning << "Sending ping command to solar experiment failed" << std::endl; - } - - // Read back reply immediately - int bytesRead = 0; - do { - bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), - static_cast(recBuf.size())); - if (bytesRead == 0) { - sif::warning << "Reading SCEX: Timeout or no bytes read" << std::endl; - } else if (bytesRead < 0) { - sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" << errno - << ", " << strerror(errno) << "]" << std::endl; - break; - } else if (bytesRead >= static_cast(recBuf.size())) { - sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough" - << std::endl; - } else if (bytesRead > 0) { - sif::info << "Received " << bytesRead - << " bytes from the Solar Cell Experiment:" << std::endl; - arrayprinter::print(recBuf.data(), bytesRead, OutputType::HEX, false); - break; + ReturnValue_t result = RETURN_OK; + if (not cmdSent) { + // Flush received and unread data + tcflush(serialPort, TCIFLUSH); + uint8_t tmpCmdBuf[32] = {}; + size_t len = 0; + sif::info << "UartTestClass::scexSimplePeriodic: Sending command to SCEX" << std::endl; + prepareScexCmd(currCmd, false, tmpCmdBuf, &len); + result = dleEncoder.encode(tmpCmdBuf, len, cmdBuf.data(), cmdBuf.size(), &encodedLen, true); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; + return; } - } while (bytesRead > 0); + if (result != 0) { + return; + }; + size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); + if (bytesWritten != encodedLen) { + sif::warning << "Sending command to solar experiment failed" << std::endl; + } + cmdSent = true; + cmdDone = false; + } + if (not cmdDone) { + // Read back reply immediately + int bytesRead = 0; + do { + bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), + static_cast(recBuf.size())); + if (bytesRead == 0) { + sif::warning << "Reading SCEX: Timeout or no bytes read" << std::endl; + } else if (bytesRead < 0) { + sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" + << errno << ", " << strerror(errno) << "]" << std::endl; + break; + } else if (bytesRead >= static_cast(recBuf.size())) { + sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough" + << std::endl; + } else if (bytesRead > 0) { + dleParser->passData(recBuf.data(), bytesRead); + if (currCmd == ScexCmds::PING) { + cmdDone = true; + cmdSent = false; + } + } + } while (bytesRead > 0); + } +} + +int UartTestClass::prepareScexCmd(scex::ScexCmds cmd, bool tempCheck, uint8_t* cmdBuf, + size_t* len) { + using namespace scex; + // Send ping command + cmdBuf[0] = scex::createCmdByte(cmd, false); + // These two fields are the packet counter and the total packet count. Those are 1 and 1 for each + // telecommand so far + cmdBuf[1] = 1; + cmdBuf[2] = 1; + uint16_t userDataLen = 0; + cmdBuf[3] = (userDataLen >> 8) & 0xff; + cmdBuf[4] = userDataLen & 0xff; + uint16_t crc = CRC::crc16ccitt(cmdBuf, 5); + cmdBuf[5] = (crc >> 8) & 0xff; + cmdBuf[6] = crc & 0xff; + *len = 7; + return 0; +} + +void UartTestClass::foundDlePacketHandler(uint8_t* packet, size_t len, void* args) { + UartTestClass* obj = reinterpret_cast(args); + obj->handleFoundDlePacket(packet, len); +} + +void UartTestClass::handleFoundDlePacket(uint8_t* packet, size_t len) { + sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; } diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index 3836506c..b080f8a3 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -1,6 +1,7 @@ #ifndef LINUX_BOARDTEST_UARTTESTCLASS_H_ #define LINUX_BOARDTEST_UARTTESTCLASS_H_ +#include #include #include #include // Contains POSIX terminal control definitions @@ -8,10 +9,11 @@ #include #include "lwgps/lwgps.h" -#include "mission/devices/devicedefinitions/SCEXDefinitions.h" +#include "mission/devices/devicedefinitions/ScexDefinitions.h" #include "test/testtasks/TestTask.h" class ScexUartReader; +class ScexDleParser; class UartTestClass : public TestTask { public: @@ -40,6 +42,11 @@ class UartTestClass : public TestTask { void scexSimplePeriodic(); void scexSimpleInit(); + static void foundDlePacketHandler(uint8_t* packet, size_t len, void* args); + void handleFoundDlePacket(uint8_t* packet, size_t len); + + bool cmdSent = false; + bool cmdDone = false; scex::ScexCmds currCmd = scex::ScexCmds::PING; TestModes mode = TestModes::GPS; DleEncoder dleEncoder = DleEncoder(); @@ -48,10 +55,15 @@ class UartTestClass : public TestTask { lwgps_t gpsData = {}; struct termios tty = {}; int serialPort = 0; - std::array cmdBuf = {}; - std::array recBuf = {}; - uint8_t recvCnt = 0; + bool startFound = false; ScexUartReader* reader = nullptr; + SimpleRingBuffer decodeRingBuf; + std::array cmdBuf = {}; + std::array recBuf = {}; + std::array encodedBuf = {}; + std::array decodedBuf = {}; + ScexDleParser* dleParser; + uint8_t recvCnt = 0; }; #endif /* LINUX_BOARDTEST_UARTTESTCLASS_H_ */ diff --git a/linux/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt index b8568560..6be5da2f 100644 --- a/linux/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -6,6 +6,7 @@ endif() target_sources(${OBSW_NAME} PRIVATE ScexUartReader.cpp + ScexDleParser.cpp ) add_subdirectory(ploc) add_subdirectory(startracker) diff --git a/linux/devices/ScexDleParser.cpp b/linux/devices/ScexDleParser.cpp new file mode 100644 index 00000000..f2620b8e --- /dev/null +++ b/linux/devices/ScexDleParser.cpp @@ -0,0 +1,6 @@ +#include "ScexDleParser.h" + +ScexDleParser::ScexDleParser(SimpleRingBuffer &decodeRingBuf, DleEncoder &decoder, + BufPair encodedBuf, BufPair decodedBuf, FoundPacketHandler handler, + void *args) + : DleParser(decodeRingBuf, decoder, encodedBuf, decodedBuf, handler, args) {} diff --git a/linux/devices/ScexDleParser.h b/linux/devices/ScexDleParser.h new file mode 100644 index 00000000..d914cdaf --- /dev/null +++ b/linux/devices/ScexDleParser.h @@ -0,0 +1,12 @@ +#ifndef LINUX_DEVICES_SCEXDLEPARSER_H_ +#define LINUX_DEVICES_SCEXDLEPARSER_H_ + +#include + +class ScexDleParser : public DleParser { + public: + ScexDleParser(SimpleRingBuffer& decodeRingBuf, DleEncoder& decoder, BufPair encodedBuf, + BufPair decodedBuf, FoundPacketHandler handler, void* args); +}; + +#endif /* LINUX_DEVICES_SCEXDLEPARSER_H_ */ diff --git a/linux/devices/ScexUartReader.cpp b/linux/devices/ScexUartReader.cpp index a35f153f..8017e8c6 100644 --- a/linux/devices/ScexUartReader.cpp +++ b/linux/devices/ScexUartReader.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include // write(), read(), close() #include // Error integer and strerror() function @@ -14,7 +15,12 @@ #include "OBSWConfig.h" ScexUartReader::ScexUartReader(object_id_t objectId) - : SystemObject(objectId), ringBuffer(200 * 2048, true), sizesQueue(200) { + : SystemObject(objectId), + decodeRingBuf(4096, true), + ipcRingBuf(200 * 2048, true), + ipcQueue(200), + dleParser(decodeRingBuf, dleEncoder, {encodedBuf.data(), encodedBuf.size()}, + {decodedBuf.data(), decodedBuf.size()}, &foundDlePacketHandler, this) { semaphore = SemaphoreFactory::instance()->createBinarySemaphore(); semaphore->acquire(); lock = MutexFactory::instance()->createMutex(); @@ -47,10 +53,10 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) { sif::error << "ScexUartReader::performOperation: Receive buffer too small" << std::endl; } else if (bytesRead > 0) { MutexGuard mg(lock); - sizesQueue.insert(bytesRead); - ReturnValue_t result = ringBuffer.writeData(recBuf.data(), bytesRead); + ipcQueue.insert(bytesRead); + ReturnValue_t result = dleParser.passData(recBuf.data(), bytesRead); if (result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "ScexUartReader::performOperation: Writing into ring buffer failed" + sif::warning << "ScexUartReader::performOperation: Passing data to DLE parser failed" << std::endl; } if (debugMode) { @@ -91,10 +97,9 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) { // Use non-canonical mode and clear echo flag tty.c_lflag &= ~(ICANON | ECHO); - // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are - // received in one go - tty.c_cc[VTIME] = 20; // Read for up to 2 seconds - tty.c_cc[VMIN] = 0; // Read as much as there is available + // Non-blocking mode, use polling + tty.c_cc[VTIME] = 0; // Read for up to 2 seconds + tty.c_cc[VMIN] = 0; // Read as much as there is available // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. #if !defined(XIPHOS_Q7S) @@ -157,16 +162,26 @@ ReturnValue_t ScexUartReader::finish() { return RETURN_OK; } +void ScexUartReader::foundDlePacketHandler(uint8_t *packet, size_t len, void *args) { + ScexUartReader *obj = reinterpret_cast(args); + obj->handleFoundDlePacket(packet, len); +} + +void ScexUartReader::handleFoundDlePacket(uint8_t *packet, size_t len) { + // TODO: insert data into IPC ring buffer here + sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; +} + ReturnValue_t ScexUartReader::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, size_t *size) { MutexGuard mg(lock); - if (sizesQueue.empty()) { + if (ipcQueue.empty()) { *size = 0; return RETURN_OK; } - *size = sizesQueue.pop(); + *size = ipcQueue.pop(); *buffer = ipcBuffer.data(); - ReturnValue_t result = ringBuffer.readData(ipcBuffer.data(), *size, true); + ReturnValue_t result = ipcRingBuf.readData(ipcBuffer.data(), *size, true); if (result != RETURN_OK) { sif::warning << "ScexUartReader::readReceivedMessage: Reading RingBuffer failed" << std::endl; } diff --git a/linux/devices/ScexUartReader.h b/linux/devices/ScexUartReader.h index 13ff7d73..246dd8f9 100644 --- a/linux/devices/ScexUartReader.h +++ b/linux/devices/ScexUartReader.h @@ -8,6 +8,7 @@ #include #include #include +#include #include // Contains POSIX terminal control definitions class SemaphoreIF; @@ -34,13 +35,20 @@ class ScexUartReader : public SystemObject, // strg+shift+n struct termios tty = {}; bool doFinish = false; DleEncoder dleEncoder = DleEncoder(); - SimpleRingBuffer ringBuffer; - DynamicFIFO sizesQueue; + SimpleRingBuffer decodeRingBuf; + Countdown finishCoutdown = Countdown(180 * 1000); std::array cmdbuf = {}; - std::array recBuf = {}; - + std::array recBuf = {}; + std::array encodedBuf = {}; + std::array decodedBuf = {}; std::array ipcBuffer = {}; + SimpleRingBuffer ipcRingBuf; + DynamicFIFO ipcQueue; + ScexDleParser dleParser; + + static void foundDlePacketHandler(uint8_t *packet, size_t len, void *args); + void handleFoundDlePacket(uint8_t *packet, size_t len); ReturnValue_t performOperation(uint8_t operationCode = 0) override; diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index bbf8da64..d288a0aa 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -163,6 +163,8 @@ debugging. */ #ifdef RASPBERRY_PI +#define OBSW_TC_FROM_PDEC 0 + #define OBSW_ENABLE_TIMERS 1 #define OBSW_ADD_STAR_TRACKER 0 #define OBSW_ADD_PLOC_SUPERVISOR 0 diff --git a/mission/devices/CMakeLists.txt b/mission/devices/CMakeLists.txt index 2919ff1f..fc013271 100644 --- a/mission/devices/CMakeLists.txt +++ b/mission/devices/CMakeLists.txt @@ -19,3 +19,5 @@ target_sources(${LIB_EIVE_MISSION} PRIVATE PayloadPcduHandler.cpp SolarArrayDeploymentHandler.cpp ) + +add_subdirectory(devicedefinitions) diff --git a/mission/devices/devicedefinitions/CMakeLists.txt b/mission/devices/devicedefinitions/CMakeLists.txt new file mode 100644 index 00000000..3ac1d9bc --- /dev/null +++ b/mission/devices/devicedefinitions/CMakeLists.txt @@ -0,0 +1,3 @@ +target_sources(${LIB_EIVE_MISSION} PRIVATE + ScexDefinitions.cpp +) diff --git a/mission/devices/devicedefinitions/ScexDefinitions.cpp b/mission/devices/devicedefinitions/ScexDefinitions.cpp new file mode 100644 index 00000000..1e39f414 --- /dev/null +++ b/mission/devices/devicedefinitions/ScexDefinitions.cpp @@ -0,0 +1,5 @@ +#include "ScexDefinitions.h" + +uint8_t scex::createCmdByte(ScexCmds cmd, bool tempCheck) { + return (IDLE_BIT_0_DEF_STATE << 7) | (IDLE_BIT_1_DEF_STATE << 6) | (cmd << 1) | tempCheck; +} diff --git a/mission/devices/devicedefinitions/SCEXDefinitions.h b/mission/devices/devicedefinitions/ScexDefinitions.h similarity index 63% rename from mission/devices/devicedefinitions/SCEXDefinitions.h rename to mission/devices/devicedefinitions/ScexDefinitions.h index f9c532ff..704500f4 100644 --- a/mission/devices/devicedefinitions/SCEXDefinitions.h +++ b/mission/devices/devicedefinitions/ScexDefinitions.h @@ -6,18 +6,13 @@ // Definitions for the Solar Cell Experiment namespace scex { -enum ScexCmds: uint8_t { - PING = 0b00111, - ONE_CELL = 0b00110 -}; +enum ScexCmds : uint8_t { PING = 0b00111, ONE_CELL = 0b00110, FRAM = 0b00001 }; static constexpr uint8_t IDLE_BIT_0_DEF_STATE = 0; static constexpr uint8_t IDLE_BIT_1_DEF_STATE = 1; -uint8_t createCmdByte(ScexCmds cmd, bool tempCheck) { - return (IDLE_BIT_0_DEF_STATE << 7) | (IDLE_BIT_1_DEF_STATE << 6) | (cmd << 1) | tempCheck; -} +uint8_t createCmdByte(ScexCmds cmd, bool tempCheck); -} +} // namespace scex #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_ */ From d00cb6d4a540d74cfa906187e2f21f7c5a1ce657 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 9 Apr 2022 15:38:09 +0200 Subject: [PATCH 0007/2058] updates for new dle parser API --- fsfw | 2 +- linux/boardtest/UartTestClass.cpp | 10 +++++++--- linux/boardtest/UartTestClass.h | 3 ++- linux/devices/ScexDleParser.cpp | 2 +- linux/devices/ScexDleParser.h | 2 +- linux/devices/ScexUartReader.cpp | 10 +++++++--- linux/devices/ScexUartReader.h | 2 +- 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/fsfw b/fsfw index bdddee4f..4e242aa9 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit bdddee4f81fbdff7f207fd03b3c592522e04c5aa +Subproject commit 4e242aa9547dfc6d7abc0cdd405440547239016b diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 0a164c8b..672a34c8 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -290,9 +290,13 @@ int UartTestClass::prepareScexCmd(scex::ScexCmds cmd, bool tempCheck, uint8_t* c return 0; } -void UartTestClass::foundDlePacketHandler(uint8_t* packet, size_t len, void* args) { - UartTestClass* obj = reinterpret_cast(args); - obj->handleFoundDlePacket(packet, len); +void UartTestClass::foundDlePacketHandler(const DleParser::Context& ctx) { + UartTestClass* obj = reinterpret_cast(ctx.userArgs); + if (ctx.getType() == DleParser::ContextType::PACKET_FOUND) { + obj->handleFoundDlePacket(ctx.decodedPacket.first, ctx.decodedPacket.second); + } else { + DleParser::defaultErrorHandler(ctx.error.first, ctx.error.second); + } } void UartTestClass::handleFoundDlePacket(uint8_t* packet, size_t len) { diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index b080f8a3..c6242281 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -3,6 +3,7 @@ #include #include +#include #include #include // Contains POSIX terminal control definitions @@ -42,7 +43,7 @@ class UartTestClass : public TestTask { void scexSimplePeriodic(); void scexSimpleInit(); - static void foundDlePacketHandler(uint8_t* packet, size_t len, void* args); + static void foundDlePacketHandler(const DleParser::Context& ctx); void handleFoundDlePacket(uint8_t* packet, size_t len); bool cmdSent = false; diff --git a/linux/devices/ScexDleParser.cpp b/linux/devices/ScexDleParser.cpp index f2620b8e..3a95e497 100644 --- a/linux/devices/ScexDleParser.cpp +++ b/linux/devices/ScexDleParser.cpp @@ -1,6 +1,6 @@ #include "ScexDleParser.h" ScexDleParser::ScexDleParser(SimpleRingBuffer &decodeRingBuf, DleEncoder &decoder, - BufPair encodedBuf, BufPair decodedBuf, FoundPacketHandler handler, + BufPair encodedBuf, BufPair decodedBuf, UserHandler handler, void *args) : DleParser(decodeRingBuf, decoder, encodedBuf, decodedBuf, handler, args) {} diff --git a/linux/devices/ScexDleParser.h b/linux/devices/ScexDleParser.h index d914cdaf..eab7e9c1 100644 --- a/linux/devices/ScexDleParser.h +++ b/linux/devices/ScexDleParser.h @@ -6,7 +6,7 @@ class ScexDleParser : public DleParser { public: ScexDleParser(SimpleRingBuffer& decodeRingBuf, DleEncoder& decoder, BufPair encodedBuf, - BufPair decodedBuf, FoundPacketHandler handler, void* args); + BufPair decodedBuf, UserHandler handler, void* args); }; #endif /* LINUX_DEVICES_SCEXDLEPARSER_H_ */ diff --git a/linux/devices/ScexUartReader.cpp b/linux/devices/ScexUartReader.cpp index 8017e8c6..5a325668 100644 --- a/linux/devices/ScexUartReader.cpp +++ b/linux/devices/ScexUartReader.cpp @@ -162,9 +162,13 @@ ReturnValue_t ScexUartReader::finish() { return RETURN_OK; } -void ScexUartReader::foundDlePacketHandler(uint8_t *packet, size_t len, void *args) { - ScexUartReader *obj = reinterpret_cast(args); - obj->handleFoundDlePacket(packet, len); +void ScexUartReader::foundDlePacketHandler(const DleParser::Context &ctx) { + ScexUartReader *obj = reinterpret_cast(ctx.userArgs); + if (ctx.getType() == DleParser::ContextType::PACKET_FOUND) { + obj->handleFoundDlePacket(ctx.decodedPacket.first, ctx.decodedPacket.second); + } else { + DleParser::defaultErrorHandler(ctx.error.first, ctx.error.second); + } } void ScexUartReader::handleFoundDlePacket(uint8_t *packet, size_t len) { diff --git a/linux/devices/ScexUartReader.h b/linux/devices/ScexUartReader.h index 246dd8f9..ad760b39 100644 --- a/linux/devices/ScexUartReader.h +++ b/linux/devices/ScexUartReader.h @@ -47,7 +47,7 @@ class ScexUartReader : public SystemObject, // strg+shift+n DynamicFIFO ipcQueue; ScexDleParser dleParser; - static void foundDlePacketHandler(uint8_t *packet, size_t len, void *args); + static void foundDlePacketHandler(const DleParser::Context &ctx); void handleFoundDlePacket(uint8_t *packet, size_t len); ReturnValue_t performOperation(uint8_t operationCode = 0) override; From 9f3f264eac0a986d7c0f025124f1595b9d21763f Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Wed, 13 Apr 2022 17:43:16 +0200 Subject: [PATCH 0008/2058] continued scex uart reader, some bugs --- fsfw | 2 +- linux/boardtest/UartTestClass.cpp | 493 ++++++++++++++++-------------- linux/boardtest/UartTestClass.h | 3 - linux/devices/ScexUartReader.cpp | 38 ++- 4 files changed, 293 insertions(+), 243 deletions(-) diff --git a/fsfw b/fsfw index 5ff88129..e0c9bf58 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 5ff88129b8158a3a66366968231a68d01564f8fe +Subproject commit e0c9bf587151094a54568117aa7159607b8bac2e diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 672a34c8..c2619699 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -21,284 +21,331 @@ #endif UartTestClass::UartTestClass(object_id_t objectId, ScexUartReader* reader) - : TestTask(objectId), reader(reader), decodeRingBuf(4096, true) { - mode = TestModes::SCEX; - scexMode = ScexModes::SIMPLE; - currCmd = scex::ScexCmds::FRAM; - if (mode == TestModes::SCEX) { - dleParser = - new ScexDleParser(decodeRingBuf, dleEncoder, {encodedBuf.data(), encodedBuf.size()}, - {decodedBuf.data(), decodedBuf.size()}, &foundDlePacketHandler, this); - } +: TestTask(objectId), reader(reader) { + mode = TestModes::SCEX; + scexMode = ScexModes::READER_TASK; + currCmd = scex::ScexCmds::FRAM; + if (scexMode == ScexModes::SIMPLE) { + auto encodingBuf = new std::array; + DleParser::BufPair encodingBufPair {encodingBuf->data(), encodingBuf->size()}; + auto decodedBuf = new std::array; + DleParser::BufPair decodingBufPair {decodedBuf->data(), decodedBuf->size()}; + dleParser = + new ScexDleParser(*(new SimpleRingBuffer(4096, true)), dleEncoder, encodingBufPair, decodingBufPair, &foundDlePacketHandler, this); + } } ReturnValue_t UartTestClass::initialize() { - if (mode == TestModes::GPS) { - gpsInit(); - } else if (mode == TestModes::SCEX) { - scexInit(); - } - return HasReturnvaluesIF::RETURN_OK; + if (mode == TestModes::GPS) { + gpsInit(); + } else if (mode == TestModes::SCEX) { + scexInit(); + } + return HasReturnvaluesIF::RETURN_OK; } ReturnValue_t UartTestClass::performOneShotAction() { return HasReturnvaluesIF::RETURN_OK; } ReturnValue_t UartTestClass::performPeriodicAction() { - if (mode == TestModes::GPS) { - gpsPeriodic(); - } else if (mode == TestModes::SCEX) { - scexPeriodic(); - } - return HasReturnvaluesIF::RETURN_OK; + if (mode == TestModes::GPS) { + gpsPeriodic(); + } else if (mode == TestModes::SCEX) { + scexPeriodic(); + } + return HasReturnvaluesIF::RETURN_OK; } void UartTestClass::gpsInit() { #if RPI_TEST_GPS_HANDLER == 1 - int result = lwgps_init(&gpsData); - if (result == 0) { - sif::warning << "lwgps_init error: " << result << std::endl; - } + int result = lwgps_init(&gpsData); + if (result == 0) { + sif::warning << "lwgps_init error: " << result << std::endl; + } - /* Get file descriptor */ - serialPort = open("/dev/serial0", O_RDWR); - if (serialPort < 0) { - sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) - << std::endl; - } - /* Setting up UART parameters */ - tty.c_cflag &= ~PARENB; // Clear parity bit - tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication - tty.c_cflag &= ~CSIZE; // Clear all the size bits - tty.c_cflag |= CS8; // 8 bits per byte - tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control - tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) - // Use canonical mode for GPS device - tty.c_lflag |= ICANON; - tty.c_lflag &= ~ECHO; // Disable echo - tty.c_lflag &= ~ECHOE; // Disable erasure - tty.c_lflag &= ~ECHONL; // Disable new-line echo - tty.c_lflag &= ~ISIG; // Disable interpretation of INTR, QUIT and SUSP - tty.c_iflag &= ~(IXON | IXOFF | IXANY); // Turn off s/w flow ctrl - tty.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | - ICRNL); // Disable any special handling of received bytes - tty.c_oflag &= ~OPOST; // Prevent special interpretation of output bytes (e.g. newline chars) - tty.c_oflag &= ~ONLCR; // Prevent conversion of newline to carriage return/line feed + /* Get file descriptor */ + serialPort = open("/dev/serial0", O_RDWR); + if (serialPort < 0) { + sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + } + /* Setting up UART parameters */ + tty.c_cflag &= ~PARENB; // Clear parity bit + tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication + tty.c_cflag &= ~CSIZE; // Clear all the size bits + tty.c_cflag |= CS8; // 8 bits per byte + tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control + tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) + // Use canonical mode for GPS device + tty.c_lflag |= ICANON; + tty.c_lflag &= ~ECHO; // Disable echo + tty.c_lflag &= ~ECHOE; // Disable erasure + tty.c_lflag &= ~ECHONL; // Disable new-line echo + tty.c_lflag &= ~ISIG; // Disable interpretation of INTR, QUIT and SUSP + tty.c_iflag &= ~(IXON | IXOFF | IXANY); // Turn off s/w flow ctrl + tty.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | + ICRNL); // Disable any special handling of received bytes + tty.c_oflag &= ~OPOST; // Prevent special interpretation of output bytes (e.g. newline chars) + tty.c_oflag &= ~ONLCR; // Prevent conversion of newline to carriage return/line feed - // Non-blocking mode - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 0; + // Non-blocking mode + tty.c_cc[VTIME] = 0; + tty.c_cc[VMIN] = 0; - cfsetispeed(&tty, B9600); - cfsetospeed(&tty, B9600); - if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { - sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) - << std::endl; - ; - } - // Flush received and unread data. Those are old NMEA strings which are not relevant anymore - tcflush(serialPort, TCIFLUSH); + cfsetispeed(&tty, B9600); + cfsetospeed(&tty, B9600); + if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { + sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + ; + } + // Flush received and unread data. Those are old NMEA strings which are not relevant anymore + tcflush(serialPort, TCIFLUSH); #endif } void UartTestClass::gpsPeriodic() { #if RPI_TEST_GPS_HANDLER == 1 - int bytesRead = 0; - do { - bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), - static_cast(recBuf.size())); - if (bytesRead < 0) { - sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" << errno - << ", " << strerror(errno) << "]" << std::endl; - break; - } else if (bytesRead >= static_cast(recBuf.size())) { - sif::debug << "UartTestClass::performPeriodicAction: " - "recv buffer might not be large enough" - << std::endl; - } else if (bytesRead > 0) { - // pass data to lwgps for processing + int bytesRead = 0; + do { + bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), + static_cast(recBuf.size())); + if (bytesRead < 0) { + sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" << errno + << ", " << strerror(errno) << "]" << std::endl; + break; + } else if (bytesRead >= static_cast(recBuf.size())) { + sif::debug << "UartTestClass::performPeriodicAction: " + "recv buffer might not be large enough" + << std::endl; + } else if (bytesRead > 0) { + // pass data to lwgps for processing #if GPS_REPLY_WIRETAPPING == 1 - sif::info << recBuf.data() << std::endl; + sif::info << recBuf.data() << std::endl; #endif - int result = lwgps_process(&gpsData, recBuf.data(), bytesRead); - if (result == 0) { - sif::warning << "UartTestClass::performPeriodicAction: lwgps_process error" << std::endl; - } - recvCnt++; - if (recvCnt == 6) { - recvCnt = 0; - sif::info << "GPS Data" << std::endl; - // Print messages - printf("Valid status: %d\n", gpsData.is_valid); - printf("Latitude: %f degrees\n", gpsData.latitude); - printf("Longitude: %f degrees\n", gpsData.longitude); - printf("Altitude: %f meters\n", gpsData.altitude); - } - } - } while (bytesRead > 0); + int result = lwgps_process(&gpsData, recBuf.data(), bytesRead); + if (result == 0) { + sif::warning << "UartTestClass::performPeriodicAction: lwgps_process error" << std::endl; + } + recvCnt++; + if (recvCnt == 6) { + recvCnt = 0; + sif::info << "GPS Data" << std::endl; + // Print messages + printf("Valid status: %d\n", gpsData.is_valid); + printf("Latitude: %f degrees\n", gpsData.latitude); + printf("Longitude: %f degrees\n", gpsData.longitude); + printf("Altitude: %f meters\n", gpsData.altitude); + } + } + } while (bytesRead > 0); #endif } void UartTestClass::scexInit() { - if (reader == nullptr) { - sif::warning << "UartTestClass::scexInit: Reader invalid" << std::endl; - return; - } - if (scexMode == ScexModes::SIMPLE) { - scexSimpleInit(); - } else { + if (reader == nullptr) { + sif::warning << "UartTestClass::scexInit: Reader invalid" << std::endl; + return; + } + if (scexMode == ScexModes::SIMPLE) { + scexSimpleInit(); + } else { #if defined(RASPBERRY_PI) - std::string devname = "/dev/serial0"; + std::string devname = "/dev/serial0"; #else - std::string devname = "/dev/ul-scex"; + std::string devname = "/dev/ul-scex"; #endif - uartCookie = new UartCookie(this->getObjectId(), devname, UartBaudRate::RATE_57600, 4096); - reader->setDebugMode(true); - ReturnValue_t result = reader->initializeInterface(uartCookie); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "UartTestClass::gpsPeriodic: Initializing SCEX reader " - "UART IF failed" - << std::endl; - } - } + uartCookie = new UartCookie(this->getObjectId(), devname, UartBaudRate::RATE_57600, 4096); + reader->setDebugMode(true); + ReturnValue_t result = reader->initializeInterface(uartCookie); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "UartTestClass::gpsPeriodic: Initializing SCEX reader " + "UART IF failed" + << std::endl; + } + } } void UartTestClass::scexPeriodic() { - if (reader == nullptr) { - return; - } + using namespace std; + if (reader == nullptr) { + return; + } + + if (scexMode == ScexModes::SIMPLE) { + scexSimplePeriodic(); + } else { + if (not cmdSent){ + size_t len = 0; + prepareScexCmd(scex::ScexCmds::PING, false, cmdBuf.data(), &len); + reader->sendMessage(uartCookie, cmdBuf.data(), len); + cmdSent = true; + cmdDone = false; + } + if (cmdSent and not cmdDone){ + uint8_t* decodedPacket = nullptr; + size_t len = 0; + ReturnValue_t result = reader->readReceivedMessage(uartCookie, &decodedPacket, &len); + + if(len > 0){ + sif::info<<"CmdByte: "<<(int)decodedPacket[0]<((decodedPacket[0] >> 1) & 0b11111); + size_t packetCounter = decodedPacket[1]; + sif::info<<"PacketCounter: "<finish(); + sif::info<<"Reader is finished" << endl; + cmdDone = true; + if(cmd == scex::ScexCmds::PING){ + cmdSent = false; + } + } + + } + } + + } - if (scexMode == ScexModes::SIMPLE) { - scexSimplePeriodic(); - } else { - size_t len = 0; - prepareScexCmd(scex::ScexCmds::PING, false, cmdBuf.data(), &len); - reader->sendMessage(uartCookie, cmdBuf.data(), len); - } } void UartTestClass::scexSimpleInit() { #if defined(RASPBERRY_PI) - std::string devname = "/dev/serial0"; + std::string devname = "/dev/serial0"; #else - std::string devname = "/dev/ul-scex"; + std::string devname = "/dev/ul-scex"; #endif - /* Get file descriptor */ - serialPort = open(devname.c_str(), O_RDWR); - if (serialPort < 0) { - sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) - << std::endl; - return; - } - // Setting up UART parameters - tty.c_cflag &= ~PARENB; // Clear parity bit - tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication - tty.c_cflag &= ~CSIZE; // Clear all the size bits - tty.c_cflag |= CS8; // 8 bits per byte - tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control - tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) + /* Get file descriptor */ + serialPort = open(devname.c_str(), O_RDWR); + if (serialPort < 0) { + sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + return; + } + // Setting up UART parameters + tty.c_cflag &= ~PARENB; // Clear parity bit + tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication + tty.c_cflag &= ~CSIZE; // Clear all the size bits + tty.c_cflag |= CS8; // 8 bits per byte + tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control + tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) - // Use non-canonical mode and clear echo flag - tty.c_lflag &= ~(ICANON | ECHO); + // Use non-canonical mode and clear echo flag + tty.c_lflag &= ~(ICANON | ECHO); - // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are - // received in one go - tty.c_cc[VTIME] = 10; // In units of 0.1 seconds - tty.c_cc[VMIN] = 255; // Read up to 255 bytes + // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are + // received in one go + tty.c_cc[VTIME] = 10; // In units of 0.1 seconds + tty.c_cc[VMIN] = 255; // Read up to 255 bytes - // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. + // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. #if !defined(XIPHOS_Q7S) - if (cfsetispeed(&tty, B57600) != 0) { - sif::warning << "UartTestClass::scexInit: Setting baud rate failed" << std::endl; - } + if (cfsetispeed(&tty, B57600) != 0) { + sif::warning << "UartTestClass::scexInit: Setting baud rate failed" << std::endl; + } #endif - if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { - sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) - << std::endl; - } - // Flush received and unread data - tcflush(serialPort, TCIOFLUSH); + if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { + sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + } + // Flush received and unread data + tcflush(serialPort, TCIOFLUSH); } void UartTestClass::scexSimplePeriodic() { - using namespace scex; - ReturnValue_t result = RETURN_OK; - if (not cmdSent) { - // Flush received and unread data - tcflush(serialPort, TCIFLUSH); - uint8_t tmpCmdBuf[32] = {}; - size_t len = 0; - sif::info << "UartTestClass::scexSimplePeriodic: Sending command to SCEX" << std::endl; - prepareScexCmd(currCmd, false, tmpCmdBuf, &len); - result = dleEncoder.encode(tmpCmdBuf, len, cmdBuf.data(), cmdBuf.size(), &encodedLen, true); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; - return; - } - if (result != 0) { - return; - }; - size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); - if (bytesWritten != encodedLen) { - sif::warning << "Sending command to solar experiment failed" << std::endl; - } - cmdSent = true; - cmdDone = false; - } - if (not cmdDone) { - // Read back reply immediately - int bytesRead = 0; - do { - bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), - static_cast(recBuf.size())); - if (bytesRead == 0) { - sif::warning << "Reading SCEX: Timeout or no bytes read" << std::endl; - } else if (bytesRead < 0) { - sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" - << errno << ", " << strerror(errno) << "]" << std::endl; - break; - } else if (bytesRead >= static_cast(recBuf.size())) { - sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough" - << std::endl; - } else if (bytesRead > 0) { - dleParser->passData(recBuf.data(), bytesRead); - if (currCmd == ScexCmds::PING) { - cmdDone = true; - cmdSent = false; - } - } - } while (bytesRead > 0); - } + using namespace scex; + ReturnValue_t result = RETURN_OK; + if (not cmdSent) { + // Flush received and unread data + tcflush(serialPort, TCIFLUSH); + uint8_t tmpCmdBuf[32] = {}; + size_t len = 0; + sif::info << "UartTestClass::scexSimplePeriodic: Sending command to SCEX" << std::endl; + prepareScexCmd(currCmd, false, tmpCmdBuf, &len); + result = dleEncoder.encode(tmpCmdBuf, len, cmdBuf.data(), cmdBuf.size(), &encodedLen, true); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; + return; + } + if (result != 0) { + return; + }; + size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); + if (bytesWritten != encodedLen) { + sif::warning << "Sending command to solar experiment failed" << std::endl; + } + cmdSent = true; + cmdDone = false; + } + if (not cmdDone) { + // Read back reply immediately + int bytesRead = 0; + do { + bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), + static_cast(recBuf.size())); + if (bytesRead == 0) { + sif::warning << "Reading SCEX: Timeout or no bytes read" << std::endl; + } else if (bytesRead < 0) { + sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" + << errno << ", " << strerror(errno) << "]" << std::endl; + break; + } else if (bytesRead >= static_cast(recBuf.size())) { + sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough" + << std::endl; + } else if (bytesRead > 0) { + dleParser->passData(recBuf.data(), bytesRead); + if (currCmd == ScexCmds::PING) { + cmdDone = true; + cmdSent = false; + } + } + } while (bytesRead > 0); + } } int UartTestClass::prepareScexCmd(scex::ScexCmds cmd, bool tempCheck, uint8_t* cmdBuf, - size_t* len) { - using namespace scex; - // Send ping command - cmdBuf[0] = scex::createCmdByte(cmd, false); - // These two fields are the packet counter and the total packet count. Those are 1 and 1 for each - // telecommand so far - cmdBuf[1] = 1; - cmdBuf[2] = 1; - uint16_t userDataLen = 0; - cmdBuf[3] = (userDataLen >> 8) & 0xff; - cmdBuf[4] = userDataLen & 0xff; - uint16_t crc = CRC::crc16ccitt(cmdBuf, 5); - cmdBuf[5] = (crc >> 8) & 0xff; - cmdBuf[6] = crc & 0xff; - *len = 7; - return 0; + size_t* len) { + using namespace scex; + // Send ping command + cmdBuf[0] = scex::createCmdByte(cmd, false); + // These two fields are the packet counter and the total packet count. Those are 1 and 1 for each + // telecommand so far + cmdBuf[1] = 1; + cmdBuf[2] = 1; + uint16_t userDataLen = 0; + cmdBuf[3] = (userDataLen >> 8) & 0xff; + cmdBuf[4] = userDataLen & 0xff; + uint16_t crc = CRC::crc16ccitt(cmdBuf, 5); + cmdBuf[5] = (crc >> 8) & 0xff; + cmdBuf[6] = crc & 0xff; + *len = 7; + return 0; } void UartTestClass::foundDlePacketHandler(const DleParser::Context& ctx) { - UartTestClass* obj = reinterpret_cast(ctx.userArgs); - if (ctx.getType() == DleParser::ContextType::PACKET_FOUND) { - obj->handleFoundDlePacket(ctx.decodedPacket.first, ctx.decodedPacket.second); - } else { - DleParser::defaultErrorHandler(ctx.error.first, ctx.error.second); - } + UartTestClass* obj = reinterpret_cast(ctx.userArgs); + if (ctx.getType() == DleParser::ContextType::PACKET_FOUND) { + obj->handleFoundDlePacket(ctx.decodedPacket.first, ctx.decodedPacket.second); + } else { + DleParser::defaultErrorHandler(ctx.error.first, ctx.error.second); + } } void UartTestClass::handleFoundDlePacket(uint8_t* packet, size_t len) { - sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; + sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; } diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index c6242281..03c6805d 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -58,11 +58,8 @@ class UartTestClass : public TestTask { int serialPort = 0; bool startFound = false; ScexUartReader* reader = nullptr; - SimpleRingBuffer decodeRingBuf; std::array cmdBuf = {}; std::array recBuf = {}; - std::array encodedBuf = {}; - std::array decodedBuf = {}; ScexDleParser* dleParser; uint8_t recvCnt = 0; }; diff --git a/linux/devices/ScexUartReader.cpp b/linux/devices/ScexUartReader.cpp index 5a325668..15201dd1 100644 --- a/linux/devices/ScexUartReader.cpp +++ b/linux/devices/ScexUartReader.cpp @@ -26,16 +26,15 @@ ScexUartReader::ScexUartReader(object_id_t objectId) lock = MutexFactory::instance()->createMutex(); } -// void ScexUartRead::start() { /* semaphore->give(); */ } ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) { lock->lockMutex(); state = States::IDLE; lock->unlockMutex(); while (true) { semaphore->acquire(); - std::cout << "task was started" << std::endl; + sif::info << "task was started" << std::endl; int bytesRead = 0; - do { + while(true) { bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), static_cast(recBuf.size())); if (bytesRead == 0) { @@ -52,21 +51,17 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) { } else if (bytesRead >= static_cast(recBuf.size())) { sif::error << "ScexUartReader::performOperation: Receive buffer too small" << std::endl; } else if (bytesRead > 0) { - MutexGuard mg(lock); - ipcQueue.insert(bytesRead); ReturnValue_t result = dleParser.passData(recBuf.data(), bytesRead); + if (debugMode) { + sif::info << "Received " << bytesRead + << " bytes from the Solar Cell Experiment:" << std::endl; + } if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "ScexUartReader::performOperation: Passing data to DLE parser failed" << std::endl; } - if (debugMode) { - sif::info << "Received " << bytesRead - << " bytes from the Solar Cell Experiment:" << std::endl; - arrayprinter::print(recBuf.data(), bytesRead, OutputType::HEX, false); - } - break; } - } while (bytesRead > 0); + }; // task block comes here std::cout << "done" << std::endl; } @@ -75,10 +70,11 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) { ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) { UartCookie *uartCookie = dynamic_cast(cookie); - if (uartCookie) { + if (uartCookie == nullptr) { return RETURN_FAILED; } std::string devname = uartCookie->getDeviceFile(); + sif::info << devname << std::endl; /* Get file descriptor */ serialPort = open(devname.c_str(), O_RDWR); if (serialPort < 0) { @@ -98,8 +94,8 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) { tty.c_lflag &= ~(ICANON | ECHO); // Non-blocking mode, use polling - tty.c_cc[VTIME] = 0; // Read for up to 2 seconds - tty.c_cc[VMIN] = 0; // Read as much as there is available + tty.c_cc[VTIME] = 10; // Read for up to 1 seconds + tty.c_cc[VMIN] = 255; // Read as much as there is available // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. #if !defined(XIPHOS_Q7S) @@ -174,11 +170,21 @@ void ScexUartReader::foundDlePacketHandler(const DleParser::Context &ctx) { void ScexUartReader::handleFoundDlePacket(uint8_t *packet, size_t len) { // TODO: insert data into IPC ring buffer here sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; + //MutexGuard mg(lock); + ReturnValue_t result = ipcQueue.insert(len); + if(result != RETURN_OK){ + sif::warning<< "IPCQueue error" << std::endl; + } + result = ipcRingBuf.writeData(packet, len); + if(result != RETURN_OK){ + sif::warning<< "IPCRingBuf error" << std::endl; + } + sif::info << "DLE handler done" << std::endl; } ReturnValue_t ScexUartReader::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, size_t *size) { - MutexGuard mg(lock); + //MutexGuard mg(lock); if (ipcQueue.empty()) { *size = 0; return RETURN_OK; From bbdd3c052e31f9270fa037b472bf91ba4eb4288e Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Wed, 13 Apr 2022 17:47:24 +0200 Subject: [PATCH 0009/2058] mutex --- linux/boardtest/UartTestClass.cpp | 2 +- linux/devices/ScexUartReader.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index c2619699..28d92c40 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -23,7 +23,7 @@ UartTestClass::UartTestClass(object_id_t objectId, ScexUartReader* reader) : TestTask(objectId), reader(reader) { mode = TestModes::SCEX; - scexMode = ScexModes::READER_TASK; + scexMode = ScexModes::SIMPLE; currCmd = scex::ScexCmds::FRAM; if (scexMode == ScexModes::SIMPLE) { auto encodingBuf = new std::array; diff --git a/linux/devices/ScexUartReader.cpp b/linux/devices/ScexUartReader.cpp index 15201dd1..657fb829 100644 --- a/linux/devices/ScexUartReader.cpp +++ b/linux/devices/ScexUartReader.cpp @@ -170,7 +170,7 @@ void ScexUartReader::foundDlePacketHandler(const DleParser::Context &ctx) { void ScexUartReader::handleFoundDlePacket(uint8_t *packet, size_t len) { // TODO: insert data into IPC ring buffer here sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; - //MutexGuard mg(lock); + MutexGuard mg(lock); ReturnValue_t result = ipcQueue.insert(len); if(result != RETURN_OK){ sif::warning<< "IPCQueue error" << std::endl; @@ -184,7 +184,7 @@ void ScexUartReader::handleFoundDlePacket(uint8_t *packet, size_t len) { ReturnValue_t ScexUartReader::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, size_t *size) { - //MutexGuard mg(lock); + MutexGuard mg(lock); if (ipcQueue.empty()) { *size = 0; return RETURN_OK; From 57cc77e19750b508823b8578cd47c34de61670c2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 15 Apr 2022 01:39:47 +0200 Subject: [PATCH 0010/2058] fixed some tiny bugs --- linux/boardtest/UartTestClass.cpp | 538 +++++++++++++++--------------- linux/devices/ScexUartReader.cpp | 31 +- mission/devices/IMTQHandler.cpp | 2 +- tmtc | 2 +- 4 files changed, 289 insertions(+), 284 deletions(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 28d92c40..7723dc86 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -21,331 +21,333 @@ #endif UartTestClass::UartTestClass(object_id_t objectId, ScexUartReader* reader) -: TestTask(objectId), reader(reader) { - mode = TestModes::SCEX; - scexMode = ScexModes::SIMPLE; - currCmd = scex::ScexCmds::FRAM; - if (scexMode == ScexModes::SIMPLE) { - auto encodingBuf = new std::array; - DleParser::BufPair encodingBufPair {encodingBuf->data(), encodingBuf->size()}; - auto decodedBuf = new std::array; - DleParser::BufPair decodingBufPair {decodedBuf->data(), decodedBuf->size()}; - dleParser = - new ScexDleParser(*(new SimpleRingBuffer(4096, true)), dleEncoder, encodingBufPair, decodingBufPair, &foundDlePacketHandler, this); - } + : TestTask(objectId), reader(reader) { + mode = TestModes::SCEX; + scexMode = ScexModes::READER_TASK; + currCmd = scex::ScexCmds::PING; + if (scexMode == ScexModes::SIMPLE) { + auto encodingBuf = new std::array; + DleParser::BufPair encodingBufPair{encodingBuf->data(), encodingBuf->size()}; + auto decodedBuf = new std::array; + DleParser::BufPair decodingBufPair{decodedBuf->data(), decodedBuf->size()}; + dleParser = new ScexDleParser(*(new SimpleRingBuffer(4096, true)), dleEncoder, encodingBufPair, + decodingBufPair, &foundDlePacketHandler, this); + } } ReturnValue_t UartTestClass::initialize() { - if (mode == TestModes::GPS) { - gpsInit(); - } else if (mode == TestModes::SCEX) { - scexInit(); - } - return HasReturnvaluesIF::RETURN_OK; + if (mode == TestModes::GPS) { + gpsInit(); + } else if (mode == TestModes::SCEX) { + scexInit(); + } + return HasReturnvaluesIF::RETURN_OK; } ReturnValue_t UartTestClass::performOneShotAction() { return HasReturnvaluesIF::RETURN_OK; } ReturnValue_t UartTestClass::performPeriodicAction() { - if (mode == TestModes::GPS) { - gpsPeriodic(); - } else if (mode == TestModes::SCEX) { - scexPeriodic(); - } - return HasReturnvaluesIF::RETURN_OK; + if (mode == TestModes::GPS) { + gpsPeriodic(); + } else if (mode == TestModes::SCEX) { + scexPeriodic(); + } + return HasReturnvaluesIF::RETURN_OK; } void UartTestClass::gpsInit() { #if RPI_TEST_GPS_HANDLER == 1 - int result = lwgps_init(&gpsData); - if (result == 0) { - sif::warning << "lwgps_init error: " << result << std::endl; - } + int result = lwgps_init(&gpsData); + if (result == 0) { + sif::warning << "lwgps_init error: " << result << std::endl; + } - /* Get file descriptor */ - serialPort = open("/dev/serial0", O_RDWR); - if (serialPort < 0) { - sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) - << std::endl; - } - /* Setting up UART parameters */ - tty.c_cflag &= ~PARENB; // Clear parity bit - tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication - tty.c_cflag &= ~CSIZE; // Clear all the size bits - tty.c_cflag |= CS8; // 8 bits per byte - tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control - tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) - // Use canonical mode for GPS device - tty.c_lflag |= ICANON; - tty.c_lflag &= ~ECHO; // Disable echo - tty.c_lflag &= ~ECHOE; // Disable erasure - tty.c_lflag &= ~ECHONL; // Disable new-line echo - tty.c_lflag &= ~ISIG; // Disable interpretation of INTR, QUIT and SUSP - tty.c_iflag &= ~(IXON | IXOFF | IXANY); // Turn off s/w flow ctrl - tty.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | - ICRNL); // Disable any special handling of received bytes - tty.c_oflag &= ~OPOST; // Prevent special interpretation of output bytes (e.g. newline chars) - tty.c_oflag &= ~ONLCR; // Prevent conversion of newline to carriage return/line feed + /* Get file descriptor */ + serialPort = open("/dev/serial0", O_RDWR); + if (serialPort < 0) { + sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + } + /* Setting up UART parameters */ + tty.c_cflag &= ~PARENB; // Clear parity bit + tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication + tty.c_cflag &= ~CSIZE; // Clear all the size bits + tty.c_cflag |= CS8; // 8 bits per byte + tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control + tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) + // Use canonical mode for GPS device + tty.c_lflag |= ICANON; + tty.c_lflag &= ~ECHO; // Disable echo + tty.c_lflag &= ~ECHOE; // Disable erasure + tty.c_lflag &= ~ECHONL; // Disable new-line echo + tty.c_lflag &= ~ISIG; // Disable interpretation of INTR, QUIT and SUSP + tty.c_iflag &= ~(IXON | IXOFF | IXANY); // Turn off s/w flow ctrl + tty.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | + ICRNL); // Disable any special handling of received bytes + tty.c_oflag &= ~OPOST; // Prevent special interpretation of output bytes (e.g. newline chars) + tty.c_oflag &= ~ONLCR; // Prevent conversion of newline to carriage return/line feed - // Non-blocking mode - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 0; + // Non-blocking mode + tty.c_cc[VTIME] = 0; + tty.c_cc[VMIN] = 0; - cfsetispeed(&tty, B9600); - cfsetospeed(&tty, B9600); - if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { - sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) - << std::endl; - ; - } - // Flush received and unread data. Those are old NMEA strings which are not relevant anymore - tcflush(serialPort, TCIFLUSH); + cfsetispeed(&tty, B9600); + cfsetospeed(&tty, B9600); + if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { + sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + ; + } + // Flush received and unread data. Those are old NMEA strings which are not relevant anymore + tcflush(serialPort, TCIFLUSH); #endif } void UartTestClass::gpsPeriodic() { #if RPI_TEST_GPS_HANDLER == 1 - int bytesRead = 0; - do { - bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), - static_cast(recBuf.size())); - if (bytesRead < 0) { - sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" << errno - << ", " << strerror(errno) << "]" << std::endl; - break; - } else if (bytesRead >= static_cast(recBuf.size())) { - sif::debug << "UartTestClass::performPeriodicAction: " - "recv buffer might not be large enough" - << std::endl; - } else if (bytesRead > 0) { - // pass data to lwgps for processing + int bytesRead = 0; + do { + bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), + static_cast(recBuf.size())); + if (bytesRead < 0) { + sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" << errno + << ", " << strerror(errno) << "]" << std::endl; + break; + } else if (bytesRead >= static_cast(recBuf.size())) { + sif::debug << "UartTestClass::performPeriodicAction: " + "recv buffer might not be large enough" + << std::endl; + } else if (bytesRead > 0) { + // pass data to lwgps for processing #if GPS_REPLY_WIRETAPPING == 1 - sif::info << recBuf.data() << std::endl; + sif::info << recBuf.data() << std::endl; #endif - int result = lwgps_process(&gpsData, recBuf.data(), bytesRead); - if (result == 0) { - sif::warning << "UartTestClass::performPeriodicAction: lwgps_process error" << std::endl; - } - recvCnt++; - if (recvCnt == 6) { - recvCnt = 0; - sif::info << "GPS Data" << std::endl; - // Print messages - printf("Valid status: %d\n", gpsData.is_valid); - printf("Latitude: %f degrees\n", gpsData.latitude); - printf("Longitude: %f degrees\n", gpsData.longitude); - printf("Altitude: %f meters\n", gpsData.altitude); - } - } - } while (bytesRead > 0); + int result = lwgps_process(&gpsData, recBuf.data(), bytesRead); + if (result == 0) { + sif::warning << "UartTestClass::performPeriodicAction: lwgps_process error" << std::endl; + } + recvCnt++; + if (recvCnt == 6) { + recvCnt = 0; + sif::info << "GPS Data" << std::endl; + // Print messages + printf("Valid status: %d\n", gpsData.is_valid); + printf("Latitude: %f degrees\n", gpsData.latitude); + printf("Longitude: %f degrees\n", gpsData.longitude); + printf("Altitude: %f meters\n", gpsData.altitude); + } + } + } while (bytesRead > 0); #endif } void UartTestClass::scexInit() { - if (reader == nullptr) { - sif::warning << "UartTestClass::scexInit: Reader invalid" << std::endl; - return; - } - if (scexMode == ScexModes::SIMPLE) { - scexSimpleInit(); - } else { + if (reader == nullptr) { + sif::warning << "UartTestClass::scexInit: Reader invalid" << std::endl; + return; + } + if (scexMode == ScexModes::SIMPLE) { + scexSimpleInit(); + } else { #if defined(RASPBERRY_PI) - std::string devname = "/dev/serial0"; + std::string devname = "/dev/serial0"; #else - std::string devname = "/dev/ul-scex"; + std::string devname = "/dev/ul-scex"; #endif - uartCookie = new UartCookie(this->getObjectId(), devname, UartBaudRate::RATE_57600, 4096); - reader->setDebugMode(true); - ReturnValue_t result = reader->initializeInterface(uartCookie); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "UartTestClass::gpsPeriodic: Initializing SCEX reader " - "UART IF failed" - << std::endl; - } - } + uartCookie = new UartCookie(this->getObjectId(), devname, UartBaudRate::RATE_57600, 4096); + reader->setDebugMode(true); + ReturnValue_t result = reader->initializeInterface(uartCookie); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "UartTestClass::gpsPeriodic: Initializing SCEX reader " + "UART IF failed" + << std::endl; + } + } } void UartTestClass::scexPeriodic() { - using namespace std; - if (reader == nullptr) { - return; - } + using namespace std; + if (reader == nullptr) { + return; + } - if (scexMode == ScexModes::SIMPLE) { - scexSimplePeriodic(); - } else { - if (not cmdSent){ - size_t len = 0; - prepareScexCmd(scex::ScexCmds::PING, false, cmdBuf.data(), &len); - reader->sendMessage(uartCookie, cmdBuf.data(), len); - cmdSent = true; - cmdDone = false; - } - if (cmdSent and not cmdDone){ - uint8_t* decodedPacket = nullptr; - size_t len = 0; - ReturnValue_t result = reader->readReceivedMessage(uartCookie, &decodedPacket, &len); + if (scexMode == ScexModes::SIMPLE) { + scexSimplePeriodic(); + } else { + if (not cmdSent) { + size_t len = 0; + prepareScexCmd(scex::ScexCmds::PING, false, cmdBuf.data(), &len); + reader->sendMessage(uartCookie, cmdBuf.data(), len); + cmdSent = true; + cmdDone = false; + } + if (cmdSent and not cmdDone) { + uint8_t* decodedPacket = nullptr; + size_t len = 0; + ReturnValue_t result = reader->readReceivedMessage(uartCookie, &decodedPacket, &len); - if(len > 0){ - sif::info<<"CmdByte: "<<(int)decodedPacket[0]<((decodedPacket[0] >> 1) & 0b11111); - size_t packetCounter = decodedPacket[1]; - sif::info<<"PacketCounter: "<finish(); - sif::info<<"Reader is finished" << endl; - cmdDone = true; - if(cmd == scex::ScexCmds::PING){ - cmdSent = false; - } - } - - } - } - - } + if (len > 0) { + sif::info << "CmdByte: " << std::setw(2) << std::setfill('0') << std::hex + << (int)decodedPacket[0] << std::dec << endl; + scex::ScexCmds cmd = static_cast((decodedPacket[0] >> 1) & 0b11111); + sif::info << "Command: 0x" << std::setw(2) << std::setfill('0') << std::hex + << static_cast(cmd) << std::dec << std::endl; + size_t packetCounter = decodedPacket[1]; + sif::info << "PacketCounter: " << packetCounter << endl; + size_t totalPacketCounter = decodedPacket[2]; + sif::info << "TotalPacketCount: " << totalPacketCounter << endl; + uint16_t packetLen = (decodedPacket[3] << 8) | (decodedPacket[4]); + sif::info << "PacketLength: " << packetLen << endl; + uint16_t expectedPacketLen = packetLen + 7; + sif::info << "ExpectedPacketLength: " << packetLen + 7 << endl; + if (expectedPacketLen != len) { + sif::warning << "ExpectedPacketLength " << expectedPacketLen << " is not Length" << len + << endl; + } + if (CRC::crc16ccitt(decodedPacket, expectedPacketLen) != 0) { + sif::warning << "CRC invalid" << endl; + } else { + sif::info << "CRC valid" << endl; + } + if (packetCounter == totalPacketCounter) { + reader->finish(); + sif::info << "Reader is finished" << endl; + cmdDone = true; + // TODO: Bug in firmware, other command will be returned + cmdSent = false; + // if (cmd == scex::ScexCmds::PING) { + // cmdSent = false; + // } + } + } + } + } } void UartTestClass::scexSimpleInit() { #if defined(RASPBERRY_PI) - std::string devname = "/dev/serial0"; + std::string devname = "/dev/serial0"; #else - std::string devname = "/dev/ul-scex"; + std::string devname = "/dev/ul-scex"; #endif - /* Get file descriptor */ - serialPort = open(devname.c_str(), O_RDWR); - if (serialPort < 0) { - sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) - << std::endl; - return; - } - // Setting up UART parameters - tty.c_cflag &= ~PARENB; // Clear parity bit - tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication - tty.c_cflag &= ~CSIZE; // Clear all the size bits - tty.c_cflag |= CS8; // 8 bits per byte - tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control - tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) + /* Get file descriptor */ + serialPort = open(devname.c_str(), O_RDWR); + if (serialPort < 0) { + sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + return; + } + // Setting up UART parameters + tty.c_cflag &= ~PARENB; // Clear parity bit + tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication + tty.c_cflag &= ~CSIZE; // Clear all the size bits + tty.c_cflag |= CS8; // 8 bits per byte + tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control + tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) - // Use non-canonical mode and clear echo flag - tty.c_lflag &= ~(ICANON | ECHO); + // Use non-canonical mode and clear echo flag + tty.c_lflag &= ~(ICANON | ECHO); - // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are - // received in one go - tty.c_cc[VTIME] = 10; // In units of 0.1 seconds - tty.c_cc[VMIN] = 255; // Read up to 255 bytes + // Non-blocking mode, read until either line is 0.1 second idle or maximum of 255 bytes are + // received in one go + tty.c_cc[VTIME] = 0; // In units of 0.1 seconds + tty.c_cc[VMIN] = 0; // Read up to 255 bytes - // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. + // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. #if !defined(XIPHOS_Q7S) - if (cfsetispeed(&tty, B57600) != 0) { - sif::warning << "UartTestClass::scexInit: Setting baud rate failed" << std::endl; - } + if (cfsetispeed(&tty, B57600) != 0) { + sif::warning << "UartTestClass::scexInit: Setting baud rate failed" << std::endl; + } #endif - if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { - sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) - << std::endl; - } - // Flush received and unread data - tcflush(serialPort, TCIOFLUSH); + if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { + sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + } + // Flush received and unread data + tcflush(serialPort, TCIOFLUSH); } void UartTestClass::scexSimplePeriodic() { - using namespace scex; - ReturnValue_t result = RETURN_OK; - if (not cmdSent) { - // Flush received and unread data - tcflush(serialPort, TCIFLUSH); - uint8_t tmpCmdBuf[32] = {}; - size_t len = 0; - sif::info << "UartTestClass::scexSimplePeriodic: Sending command to SCEX" << std::endl; - prepareScexCmd(currCmd, false, tmpCmdBuf, &len); - result = dleEncoder.encode(tmpCmdBuf, len, cmdBuf.data(), cmdBuf.size(), &encodedLen, true); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; - return; - } - if (result != 0) { - return; - }; - size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); - if (bytesWritten != encodedLen) { - sif::warning << "Sending command to solar experiment failed" << std::endl; - } - cmdSent = true; - cmdDone = false; - } - if (not cmdDone) { - // Read back reply immediately - int bytesRead = 0; - do { - bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), - static_cast(recBuf.size())); - if (bytesRead == 0) { - sif::warning << "Reading SCEX: Timeout or no bytes read" << std::endl; - } else if (bytesRead < 0) { - sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" - << errno << ", " << strerror(errno) << "]" << std::endl; - break; - } else if (bytesRead >= static_cast(recBuf.size())) { - sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough" - << std::endl; - } else if (bytesRead > 0) { - dleParser->passData(recBuf.data(), bytesRead); - if (currCmd == ScexCmds::PING) { - cmdDone = true; - cmdSent = false; - } - } - } while (bytesRead > 0); - } + using namespace scex; + ReturnValue_t result = RETURN_OK; + if (not cmdSent) { + // Flush received and unread data + tcflush(serialPort, TCIFLUSH); + uint8_t tmpCmdBuf[32] = {}; + size_t len = 0; + sif::info << "UartTestClass::scexSimplePeriodic: Sending command to SCEX" << std::endl; + prepareScexCmd(currCmd, false, tmpCmdBuf, &len); + result = dleEncoder.encode(tmpCmdBuf, len, cmdBuf.data(), cmdBuf.size(), &encodedLen, true); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl; + return; + } + if (result != 0) { + return; + }; + size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen); + if (bytesWritten != encodedLen) { + sif::warning << "Sending command to solar experiment failed" << std::endl; + } + cmdSent = true; + cmdDone = false; + } + if (not cmdDone) { + // Read back reply immediately + int bytesRead = 0; + do { + bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), + static_cast(recBuf.size())); + if (bytesRead == 0) { + sif::warning << "Reading SCEX: Timeout or no bytes read" << std::endl; + } else if (bytesRead < 0) { + sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" + << errno << ", " << strerror(errno) << "]" << std::endl; + break; + } else if (bytesRead >= static_cast(recBuf.size())) { + sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough" + << std::endl; + } else if (bytesRead > 0) { + dleParser->passData(recBuf.data(), bytesRead); + if (currCmd == ScexCmds::PING) { + cmdDone = true; + cmdSent = false; + } + } + } while (bytesRead > 0); + } } int UartTestClass::prepareScexCmd(scex::ScexCmds cmd, bool tempCheck, uint8_t* cmdBuf, - size_t* len) { - using namespace scex; - // Send ping command - cmdBuf[0] = scex::createCmdByte(cmd, false); - // These two fields are the packet counter and the total packet count. Those are 1 and 1 for each - // telecommand so far - cmdBuf[1] = 1; - cmdBuf[2] = 1; - uint16_t userDataLen = 0; - cmdBuf[3] = (userDataLen >> 8) & 0xff; - cmdBuf[4] = userDataLen & 0xff; - uint16_t crc = CRC::crc16ccitt(cmdBuf, 5); - cmdBuf[5] = (crc >> 8) & 0xff; - cmdBuf[6] = crc & 0xff; - *len = 7; - return 0; + size_t* len) { + using namespace scex; + // Send ping command + cmdBuf[0] = scex::createCmdByte(cmd, false); + // These two fields are the packet counter and the total packet count. Those are 1 and 1 for each + // telecommand so far + cmdBuf[1] = 1; + cmdBuf[2] = 1; + uint16_t userDataLen = 0; + cmdBuf[3] = (userDataLen >> 8) & 0xff; + cmdBuf[4] = userDataLen & 0xff; + uint16_t crc = CRC::crc16ccitt(cmdBuf, 5); + cmdBuf[5] = (crc >> 8) & 0xff; + cmdBuf[6] = crc & 0xff; + *len = 7; + return 0; } void UartTestClass::foundDlePacketHandler(const DleParser::Context& ctx) { - UartTestClass* obj = reinterpret_cast(ctx.userArgs); - if (ctx.getType() == DleParser::ContextType::PACKET_FOUND) { - obj->handleFoundDlePacket(ctx.decodedPacket.first, ctx.decodedPacket.second); - } else { - DleParser::defaultErrorHandler(ctx.error.first, ctx.error.second); - } + UartTestClass* obj = reinterpret_cast(ctx.userArgs); + if (ctx.getType() == DleParser::ContextType::PACKET_FOUND) { + obj->handleFoundDlePacket(ctx.decodedPacket.first, ctx.decodedPacket.second); + } else { + DleParser::defaultErrorHandler(ctx.error.first, ctx.error.second); + } } void UartTestClass::handleFoundDlePacket(uint8_t* packet, size_t len) { - sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; + sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; } diff --git a/linux/devices/ScexUartReader.cpp b/linux/devices/ScexUartReader.cpp index 657fb829..e0868b48 100644 --- a/linux/devices/ScexUartReader.cpp +++ b/linux/devices/ScexUartReader.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include // write(), read(), close() @@ -34,16 +35,17 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) { semaphore->acquire(); sif::info << "task was started" << std::endl; int bytesRead = 0; - while(true) { + while (true) { bytesRead = read(serialPort, reinterpret_cast(recBuf.data()), static_cast(recBuf.size())); if (bytesRead == 0) { MutexGuard mg(lock); - States currentState = state; - if (currentState == States::FINISH) { + if (state == States::FINISH) { + sif::debug << "finish detected" << std::endl; state = States::IDLE; break; } + TaskFactory::delayTask(1000); } else if (bytesRead < 0) { sif::warning << "ScexUartReader::performOperation: read call failed with error [" << errno << ", " << strerror(errno) << "]" << std::endl; @@ -63,7 +65,7 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) { } }; // task block comes here - std::cout << "done" << std::endl; + sif::info << "task was stopped" << std::endl; } return RETURN_OK; } @@ -74,7 +76,7 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) { return RETURN_FAILED; } std::string devname = uartCookie->getDeviceFile(); - sif::info << devname << std::endl; + sif::info << devname << std::endl; /* Get file descriptor */ serialPort = open(devname.c_str(), O_RDWR); if (serialPort < 0) { @@ -94,8 +96,8 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) { tty.c_lflag &= ~(ICANON | ECHO); // Non-blocking mode, use polling - tty.c_cc[VTIME] = 10; // Read for up to 1 seconds - tty.c_cc[VMIN] = 255; // Read as much as there is available + tty.c_cc[VTIME] = 0; + tty.c_cc[VMIN] = 0; // Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here. #if !defined(XIPHOS_Q7S) @@ -109,7 +111,7 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) { << std::endl; } // Flush received and unread data - tcflush(serialPort, TCIFLUSH); + tcflush(serialPort, TCIOFLUSH); return RETURN_OK; } @@ -172,13 +174,13 @@ void ScexUartReader::handleFoundDlePacket(uint8_t *packet, size_t len) { sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; MutexGuard mg(lock); ReturnValue_t result = ipcQueue.insert(len); - if(result != RETURN_OK){ - sif::warning<< "IPCQueue error" << std::endl; + if (result != RETURN_OK) { + sif::warning << "IPCQueue error" << std::endl; } result = ipcRingBuf.writeData(packet, len); - if(result != RETURN_OK){ - sif::warning<< "IPCRingBuf error" << std::endl; - } + if (result != RETURN_OK) { + sif::warning << "IPCRingBuf error" << std::endl; + } sif::info << "DLE handler done" << std::endl; } @@ -189,7 +191,8 @@ ReturnValue_t ScexUartReader::readReceivedMessage(CookieIF *cookie, uint8_t **bu *size = 0; return RETURN_OK; } - *size = ipcQueue.pop(); + sif::info << "returning data" << std::endl; + ipcQueue.retrieve(size); *buffer = ipcBuffer.data(); ReturnValue_t result = ipcRingBuf.readData(ipcBuffer.data(), *size, true); if (result != RETURN_OK) { diff --git a/mission/devices/IMTQHandler.cpp b/mission/devices/IMTQHandler.cpp index 645a8aa7..e9483d35 100644 --- a/mission/devices/IMTQHandler.cpp +++ b/mission/devices/IMTQHandler.cpp @@ -118,7 +118,7 @@ ReturnValue_t IMTQHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma case (IMTQ::START_ACTUATION_DIPOLE): { /* IMTQ expects low byte first */ commandBuffer[0] = IMTQ::CC::START_ACTUATION_DIPOLE; - if(commandData == nullptr) { + if (commandData == nullptr) { return DeviceHandlerIF::INVALID_COMMAND_PARAMETER; } commandBuffer[1] = commandData[1]; diff --git a/tmtc b/tmtc index ecb973c3..8a30f669 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit ecb973c37fe43954d0be1f19b0735b3546d2ef1b +Subproject commit 8a30f669f075c284494d7c1c6618e42e2aec8f15 From f52c2a32b7064b2a11d1a2f6e1fddd4c56efbc33 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 15 Apr 2022 01:40:14 +0200 Subject: [PATCH 0011/2058] repoint fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index e0c9bf58..186b3565 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e0c9bf587151094a54568117aa7159607b8bac2e +Subproject commit 186b3565e0eb6ca10ec2203febdbc7eb7e7f7fe0 From ad12fa606020b6f261d8a944f12e1a82a6c116fb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 15 Apr 2022 01:40:53 +0200 Subject: [PATCH 0012/2058] repoint fsfw again --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 186b3565..e949368b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 186b3565e0eb6ca10ec2203febdbc7eb7e7f7fe0 +Subproject commit e949368b062e8703c35d2043ece8d7258cd2608b From 01f812b932dff83601fd780a1548eeb06fba947f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 15 Apr 2022 01:42:00 +0200 Subject: [PATCH 0013/2058] reorder fix --- mission/devices/IMTQHandler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mission/devices/IMTQHandler.cpp b/mission/devices/IMTQHandler.cpp index 2b3ba240..07f610b7 100644 --- a/mission/devices/IMTQHandler.cpp +++ b/mission/devices/IMTQHandler.cpp @@ -10,7 +10,6 @@ IMTQHandler::IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, power::Switch_t pwrSwitcher) : DeviceHandlerBase(objectId, comIF, comCookie), - switcher(pwrSwitcher), engHkDataset(this), calMtmMeasurementSet(this), rawMtmMeasurementSet(this), @@ -19,8 +18,9 @@ IMTQHandler::IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comC posYselfTestDataset(this), negYselfTestDataset(this), posZselfTestDataset(this), - negZselfTestDataset(this) { - if (comCookie == NULL) { + negZselfTestDataset(this), + switcher(pwrSwitcher) { + if (comCookie == nullptr) { sif::error << "IMTQHandler: Invalid com cookie" << std::endl; } } From a99b0007db8694441e32e457ba12fe7425f742e7 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Thu, 21 Apr 2022 16:58:43 +0200 Subject: [PATCH 0014/2058] fsfw update --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index e0c9bf58..befaca78 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e0c9bf587151094a54568117aa7159607b8bac2e +Subproject commit befaca78c660f232c312667202f2bbd5da95c235 From 578899b5a584c8e7952d303103fd71982172a5d3 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Thu, 21 Apr 2022 19:47:09 +0200 Subject: [PATCH 0015/2058] scexhelper --- linux/boardtest/UartTestClass.cpp | 55 ++++++------ linux/boardtest/UartTestClass.h | 1 + linux/devices/CMakeLists.txt | 1 + linux/devices/ScexHelper.cpp | 83 +++++++++++++++++++ linux/devices/ScexHelper.h | 48 +++++++++++ .../devicedefinitions/ScexDefinitions.h | 2 +- 6 files changed, 163 insertions(+), 27 deletions(-) create mode 100644 linux/devices/ScexHelper.cpp create mode 100644 linux/devices/ScexHelper.h diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 7723dc86..b4a23c6c 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include // write(), read(), close() @@ -167,6 +168,7 @@ void UartTestClass::scexInit() { void UartTestClass::scexPeriodic() { using namespace std; + using namespace scex; if (reader == nullptr) { return; } @@ -187,38 +189,39 @@ void UartTestClass::scexPeriodic() { ReturnValue_t result = reader->readReceivedMessage(uartCookie, &decodedPacket, &len); if (len > 0) { - sif::info << "CmdByte: " << std::setw(2) << std::setfill('0') << std::hex - << (int)decodedPacket[0] << std::dec << endl; - scex::ScexCmds cmd = static_cast((decodedPacket[0] >> 1) & 0b11111); - sif::info << "Command: 0x" << std::setw(2) << std::setfill('0') << std::hex - << static_cast(cmd) << std::dec << std::endl; - size_t packetCounter = decodedPacket[1]; - sif::info << "PacketCounter: " << packetCounter << endl; - size_t totalPacketCounter = decodedPacket[2]; - sif::info << "TotalPacketCount: " << totalPacketCounter << endl; - uint16_t packetLen = (decodedPacket[3] << 8) | (decodedPacket[4]); - sif::info << "PacketLength: " << packetLen << endl; - uint16_t expectedPacketLen = packetLen + 7; + ScexHelper helper; + const uint8_t* helperPtr = decodedPacket; + result = helper.deSerialize(&helperPtr, &len); + if (result == ScexHelper::INVALID_CRC) { + sif::warning << "CRC invalid" << std::endl; + } + sif::info << helper << endl; - sif::info << "ExpectedPacketLength: " << packetLen + 7 << endl; - if (expectedPacketLen != len) { - sif::warning << "ExpectedPacketLength " << expectedPacketLen << " is not Length" << len - << endl; + //ping + //if ping cmd + ofstream out("/tmp/scex-ping.bin", ofstream::binary ); + if (out.bad()) { + sif::warning << "bad" < + //countdown (max 2min), wenn nicht if (helper.getPacketCounter() == helper.getTotalPacketCounter()) { nach 2min reader->finish(); + if(helper.getCmd() == FRAM) { + if(helper.getPacketCounter() == 0) { + // neues file anlegen wie oben ping + } else { + // an bestehendes file hinzufügen + } } - if (packetCounter == totalPacketCounter) { + out << helper; + + if (helper.getPacketCounter() == helper.getTotalPacketCounter()) { reader->finish(); sif::info << "Reader is finished" << endl; cmdDone = true; - // TODO: Bug in firmware, other command will be returned - cmdSent = false; - // if (cmd == scex::ScexCmds::PING) { - // cmdSent = false; - // } + if (helper.getCmd() == scex::ScexCmds::PING) { + cmdSent = false; + } } } } diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index 03c6805d..0a228782 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -61,6 +61,7 @@ class UartTestClass : public TestTask { std::array cmdBuf = {}; std::array recBuf = {}; ScexDleParser* dleParser; + scex::ScexCmds cmdHelper; uint8_t recvCnt = 0; }; diff --git a/linux/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt index 6be5da2f..9a4695ca 100644 --- a/linux/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -7,6 +7,7 @@ endif() target_sources(${OBSW_NAME} PRIVATE ScexUartReader.cpp ScexDleParser.cpp + ScexHelper.cpp ) add_subdirectory(ploc) add_subdirectory(startracker) diff --git a/linux/devices/ScexHelper.cpp b/linux/devices/ScexHelper.cpp new file mode 100644 index 00000000..bc7ee04f --- /dev/null +++ b/linux/devices/ScexHelper.cpp @@ -0,0 +1,83 @@ +#include "ScexHelper.h" + +#include + +#include "fsfw/serviceinterface.h" + +ScexHelper::ScexHelper() {} + +ReturnValue_t ScexHelper::serialize(uint8_t** buffer, size_t* size, size_t maxSize, + Endianness streamEndianness) const { + return RETURN_FAILED; +} + +size_t ScexHelper::getSerializedSize() const { return totalPacketLen; } + +ReturnValue_t ScexHelper::deSerialize(const uint8_t** buffer, size_t* size, + Endianness streamEndianness) { + if (buffer == nullptr or size == nullptr) { + return RETURN_FAILED; + } + if (*size < 7) { + return STREAM_TOO_SHORT; + } + start = *buffer; + cmdByteRaw = **buffer; + cmd = static_cast((cmdByteRaw >> 1) & 0b11111); + + *buffer += 1; + packetCounter = **buffer; + + *buffer += 1; + totalPacketCounter = **buffer; + + *buffer += 1; + payloadLen = (**buffer << 8) | *(*buffer + 1); + + *buffer += 2; + totalPacketLen = payloadLen + HEADER_LEN + CRC_LEN; + if (totalPacketLen >= *size) { + return STREAM_TOO_SHORT; + } + *buffer += payloadLen; + crc = (**buffer << 8) | *(*buffer + 1); + if (CRC::crc16ccitt(start, totalPacketLen) != 0) { + return INVALID_CRC; + } + return RETURN_OK; +} + +scex::ScexCmds ScexHelper::getCmd() const { return cmd; } + +uint8_t ScexHelper::getCmdByteRaw() const { return cmdByteRaw; } + +uint16_t ScexHelper::getCrc() const { return crc; } + +size_t ScexHelper::getExpectedPacketLen() const { return totalPacketLen; } + +uint8_t ScexHelper::getPacketCounter() const { return packetCounter; } + +uint16_t ScexHelper::getPayloadLen() const { return payloadLen; } + +const uint8_t* ScexHelper::getStart() const { return start; } + +uint8_t ScexHelper::getTotalPacketCounter() const { return totalPacketCounter; } + +std::ostream& operator<<(std::ostream& os, const ScexHelper& h) { + using namespace std; + sif::info << "Command Byte Raw: 0x" << std::setw(2) << std::setfill('0') << std::hex + << (int)h.cmdByteRaw << " | Command: 0x" << std::setw(2) << std::setfill('0') + << std::hex << static_cast(h.cmd) << std::dec << std::endl; + sif::info << "PacketCounter: " << h.packetCounter << endl; + sif::info << "TotalPacketCount: " << h.totalPacketCounter << endl; + sif::info << "PayloadLength: " << h.payloadLen << endl; + sif::info << "TotalPacketLength: " << h.totalPacketLen << endl; + + return os; +} + +std::ofstream& operator<<(std::ofstream& of, const ScexHelper& h) { + of.write(reinterpret_cast(h.start), h.getSerializedSize()); + + return of; +} diff --git a/linux/devices/ScexHelper.h b/linux/devices/ScexHelper.h new file mode 100644 index 00000000..a835bd0a --- /dev/null +++ b/linux/devices/ScexHelper.h @@ -0,0 +1,48 @@ +#ifndef LINUX_DEVICES_SCEXHELPER_H_ +#define LINUX_DEVICES_SCEXHELPER_H_ +#include +#include + +#include +#include +#include +#include +// ScexHelper helper; +// helper.deSerialize(data, ...); +// sif::info << helper << std::endl; +class ScexHelper : public HasReturnvaluesIF, public SerializeIF { + public: + static const ReturnValue_t INVALID_CRC = HasReturnvaluesIF::makeReturnCode(0, 2); + static constexpr uint8_t HEADER_LEN = 5; + static constexpr uint8_t CRC_LEN = 2; + ScexHelper(); + ReturnValue_t serialize(uint8_t **buffer, size_t *size, size_t maxSize, + Endianness streamEndianness) const override; + + size_t getSerializedSize() const override; + ReturnValue_t deSerialize(const uint8_t **buffer, size_t *size, + Endianness streamEndianness = Endianness::BIG) override; + friend std::ostream &operator<<(std::ostream &os, const ScexHelper &h); + friend std::ofstream &operator<<(std::ofstream &os, const ScexHelper &h); + + scex::ScexCmds getCmd() const; + uint8_t getCmdByteRaw() const; + uint16_t getCrc() const; + size_t getExpectedPacketLen() const; + uint8_t getPacketCounter() const; + uint16_t getPayloadLen() const; + const uint8_t *getStart() const; + uint8_t getTotalPacketCounter() const; + + private: + const uint8_t *start = nullptr; + uint16_t crc = 0; + uint8_t cmdByteRaw = 0; + scex::ScexCmds cmd = scex::ScexCmds::INVALID; + int packetCounter = 0; + int totalPacketCounter = 0; + uint16_t payloadLen = 0; + size_t totalPacketLen = 0; +}; + +#endif /* LINUX_DEVICES_SCEXHELPER_H_ */ diff --git a/mission/devices/devicedefinitions/ScexDefinitions.h b/mission/devices/devicedefinitions/ScexDefinitions.h index 704500f4..f479981e 100644 --- a/mission/devices/devicedefinitions/ScexDefinitions.h +++ b/mission/devices/devicedefinitions/ScexDefinitions.h @@ -6,7 +6,7 @@ // Definitions for the Solar Cell Experiment namespace scex { -enum ScexCmds : uint8_t { PING = 0b00111, ONE_CELL = 0b00110, FRAM = 0b00001 }; +enum ScexCmds : uint8_t { PING = 0b00111, ONE_CELL = 0b00110, FRAM = 0b00001, INVALID = 255 }; static constexpr uint8_t IDLE_BIT_0_DEF_STATE = 0; static constexpr uint8_t IDLE_BIT_1_DEF_STATE = 1; From a0db5dcc7cb3f39106ecf0dc2ec36b025936a529 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 17:00:23 +0200 Subject: [PATCH 0016/2058] add first mode sequence for acs ss --- bsp_q7s/core/CMakeLists.txt | 1 + bsp_q7s/core/acsModeTree.cpp | 72 +++++++++++++++++++++++++++++++++++ bsp_q7s/core/acsModeTree.h | 10 +++++ common/config/commonObjects.h | 5 ++- generators/fsfwgen | 2 +- 5 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 bsp_q7s/core/acsModeTree.cpp create mode 100644 bsp_q7s/core/acsModeTree.h diff --git a/bsp_q7s/core/CMakeLists.txt b/bsp_q7s/core/CMakeLists.txt index 8731b7a3..30538565 100644 --- a/bsp_q7s/core/CMakeLists.txt +++ b/bsp_q7s/core/CMakeLists.txt @@ -1,4 +1,5 @@ target_sources(${OBSW_NAME} PRIVATE + acsModeTree.cpp CoreController.cpp obsw.cpp InitMission.cpp diff --git a/bsp_q7s/core/acsModeTree.cpp b/bsp_q7s/core/acsModeTree.cpp new file mode 100644 index 00000000..c097d971 --- /dev/null +++ b/bsp_q7s/core/acsModeTree.cpp @@ -0,0 +1,72 @@ +#include + +#include "acsModeTree.h" +#include +#include +#include + +FixedArrayList ACS_SEQUENCE_OFF = FixedArrayList(); +FixedArrayList ACS_TABLE_OFF_TGT = FixedArrayList(); +FixedArrayList ACS_TABLE_OFF_TRANS = FixedArrayList(); + +static constexpr Mode_t ACS_SEQUENCE_OFF_ID = HasModesIF::MODE_OFF; +static constexpr Mode_t ACS_TABLE_OFF_TGT_ID = 0x61000000; +static constexpr Mode_t ACS_TABLE_OFF_TRANS_ID = 0x61000001; + +void satsystem::acsSubsystemInit() { + ModeListEntry entry; + Subsystem *acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 20, 20); + buildOffSequence(acsSubsystem, entry); +} + +void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { + // Build OFF target + ss->addTable(&ACS_TABLE_OFF_TGT, ACS_TABLE_OFF_TGT_ID, false, true); + + // Build OFF transition + eh.setObject(objects::ACS_CONTROLLER); + eh.setMode(HasModesIF::MODE_OFF); + eh.setSubmode(0); + ACS_TABLE_OFF_TRANS.insert(eh); + + eh.setObject(objects::IMTQ_HANDLER); + eh.setMode(HasModesIF::MODE_OFF); + eh.setSubmode(0); + ACS_TABLE_OFF_TRANS.insert(eh); + + eh.setObject(objects::STAR_TRACKER); + eh.setMode(HasModesIF::MODE_OFF); + eh.setSubmode(0); + ACS_TABLE_OFF_TRANS.insert(eh); + + eh.setObject(objects::ACS_BOARD_ASS); + eh.setMode(HasModesIF::MODE_OFF); + eh.setSubmode(0); + ACS_TABLE_OFF_TRANS.insert(eh); + + eh.setObject(objects::SUS_BOARD_ASS); + eh.setMode(HasModesIF::MODE_OFF); + eh.setSubmode(0); + ACS_TABLE_OFF_TRANS.insert(eh); + + eh.setObject(objects::RW_ASS); + eh.setMode(HasModesIF::MODE_OFF); + eh.setSubmode(0); + ACS_TABLE_OFF_TRANS.insert(eh); + + ss->addTable(&ACS_TABLE_OFF_TRANS, ACS_TABLE_OFF_TRANS_ID, false, true); + + // Build OFF sequence + eh.setTableId(ACS_TABLE_OFF_TGT_ID); + eh.setWaitSeconds(0); + eh.setCheckSuccess(false); + ACS_SEQUENCE_OFF.insert(eh); + + eh.setTableId(ACS_TABLE_OFF_TRANS_ID); + eh.setWaitSeconds(0); + eh.setCheckSuccess(false); + ACS_SEQUENCE_OFF.insert(eh); + + ss->addSequence(&ACS_SEQUENCE_OFF, ACS_SEQUENCE_OFF_ID, ACS_SEQUENCE_OFF_ID, false, true); + ss->setInitialMode(HasModesIF::MODE_OFF); +} diff --git a/bsp_q7s/core/acsModeTree.h b/bsp_q7s/core/acsModeTree.h new file mode 100644 index 00000000..34811349 --- /dev/null +++ b/bsp_q7s/core/acsModeTree.h @@ -0,0 +1,10 @@ +#include + +class Subsystem; + +namespace satsystem { + +void acsSubsystemInit(); +void buildOffSequence(Subsystem* ss, ModeListEntry& entryHelper); + +} diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index a4f3319e..0b27a023 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -97,7 +97,10 @@ enum commonObjects: uint32_t { // 0x73 ('s') for assemblies and system/subsystem components ACS_BOARD_ASS = 0x73000001, SUS_BOARD_ASS = 0x73000002, - TCS_BOARD_ASS = 0x73000003 + TCS_BOARD_ASS = 0x73000003, + RW_ASS = 0x73000004, + ACS_SUBSYSTEM = 0x73010001, + EIVE_SYSTEM = 0x73010000, }; } diff --git a/generators/fsfwgen b/generators/fsfwgen index 5ad9fb94..19e8ee90 160000 --- a/generators/fsfwgen +++ b/generators/fsfwgen @@ -1 +1 @@ -Subproject commit 5ad9fb94af3312d29863527106396395f7b808a5 +Subproject commit 19e8ee90be12f72ceb8c2aefdfd665b5babad417 From 874e06baa1b8e97061c35779dc06157c872e9395 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 17:49:28 +0200 Subject: [PATCH 0017/2058] continued acs subsystem --- bsp_q7s/core/acsModeTree.cpp | 135 +++++++++++++++--- bsp_q7s/core/acsModeTree.h | 5 + generators/fsfwgen | 2 +- .../AcsControllerDefinitions.h | 21 +++ 4 files changed, 144 insertions(+), 19 deletions(-) create mode 100644 mission/controller/controllerdefinitions/AcsControllerDefinitions.h diff --git a/bsp_q7s/core/acsModeTree.cpp b/bsp_q7s/core/acsModeTree.cpp index c097d971..58c1159a 100644 --- a/bsp_q7s/core/acsModeTree.cpp +++ b/bsp_q7s/core/acsModeTree.cpp @@ -1,6 +1,8 @@ #include +#include #include "acsModeTree.h" +#include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" #include #include #include @@ -9,50 +11,69 @@ FixedArrayList ACS_SEQUENCE_OFF = FixedArrayList ACS_TABLE_OFF_TGT = FixedArrayList(); FixedArrayList ACS_TABLE_OFF_TRANS = FixedArrayList(); -static constexpr Mode_t ACS_SEQUENCE_OFF_ID = HasModesIF::MODE_OFF; -static constexpr Mode_t ACS_TABLE_OFF_TGT_ID = 0x61000000; -static constexpr Mode_t ACS_TABLE_OFF_TRANS_ID = 0x61000001; +static constexpr Mode_t ACS_SEQUENCE_OFF_ID = acs::CtrlModes::OFF; +static constexpr Mode_t ACS_TABLE_OFF_TGT_ID = (acs::CtrlModes::OFF << 8) | 1; +static constexpr Mode_t ACS_TABLE_OFF_TRANS_ID = (acs::CtrlModes::OFF << 8) | 2; + +FixedArrayList ACS_SEQUENCE_DETUMBLE = FixedArrayList(); +FixedArrayList ACS_TABLE_DETUMBLE_TGT = FixedArrayList(); +FixedArrayList ACS_TABLE_DETUMBLE_TRANS_0 = FixedArrayList(); +FixedArrayList ACS_TABLE_DETUMBLE_TRANS_1 = FixedArrayList(); + +static constexpr Mode_t ACS_SEQUENCE_DETUMBLE_ID = acs::CtrlModes::DETUMBLE; +static constexpr Mode_t ACS_TABLE_DETUMBLE_TGT_ID = (acs::CtrlModes::DETUMBLE << 8) | 1; +static constexpr Mode_t ACS_TABLE_DETUMBLE_TRANS_0_ID = (acs::CtrlModes::DETUMBLE << 8) | 2; +static constexpr Mode_t ACS_TABLE_DETUMBLE_TRANS_1_ID = (acs::CtrlModes::DETUMBLE << 8) | 3; + +// Alias for checker function +const auto CHK = satsystem::checkInsert; +static const auto OFF = HasModesIF::MODE_OFF; +static const auto NML = DeviceHandlerIF::MODE_NORMAL; void satsystem::acsSubsystemInit() { ModeListEntry entry; Subsystem *acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 20, 20); buildOffSequence(acsSubsystem, entry); + buildDetumbleSequence(acsSubsystem, entry); + acsSubsystem->setInitialMode(HasModesIF::MODE_OFF); } void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildOffSequence"; + auto ctxc = context.c_str(); // Build OFF target ss->addTable(&ACS_TABLE_OFF_TGT, ACS_TABLE_OFF_TGT_ID, false, true); // Build OFF transition eh.setObject(objects::ACS_CONTROLLER); - eh.setMode(HasModesIF::MODE_OFF); + eh.setMode(OFF); eh.setSubmode(0); - ACS_TABLE_OFF_TRANS.insert(eh); + CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); eh.setObject(objects::IMTQ_HANDLER); - eh.setMode(HasModesIF::MODE_OFF); + eh.setMode(OFF); eh.setSubmode(0); - ACS_TABLE_OFF_TRANS.insert(eh); + CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); eh.setObject(objects::STAR_TRACKER); - eh.setMode(HasModesIF::MODE_OFF); + eh.setMode(OFF); eh.setSubmode(0); - ACS_TABLE_OFF_TRANS.insert(eh); + CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); eh.setObject(objects::ACS_BOARD_ASS); - eh.setMode(HasModesIF::MODE_OFF); + eh.setMode(OFF); eh.setSubmode(0); - ACS_TABLE_OFF_TRANS.insert(eh); + CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); eh.setObject(objects::SUS_BOARD_ASS); - eh.setMode(HasModesIF::MODE_OFF); + eh.setMode(OFF); eh.setSubmode(0); - ACS_TABLE_OFF_TRANS.insert(eh); + CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); eh.setObject(objects::RW_ASS); - eh.setMode(HasModesIF::MODE_OFF); + eh.setMode(OFF); eh.setSubmode(0); - ACS_TABLE_OFF_TRANS.insert(eh); + CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); ss->addTable(&ACS_TABLE_OFF_TRANS, ACS_TABLE_OFF_TRANS_ID, false, true); @@ -60,13 +81,91 @@ void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(ACS_TABLE_OFF_TGT_ID); eh.setWaitSeconds(0); eh.setCheckSuccess(false); - ACS_SEQUENCE_OFF.insert(eh); + CHK(ACS_SEQUENCE_OFF.insert(eh), ctxc); eh.setTableId(ACS_TABLE_OFF_TRANS_ID); eh.setWaitSeconds(0); eh.setCheckSuccess(false); - ACS_SEQUENCE_OFF.insert(eh); + CHK(ACS_SEQUENCE_OFF.insert(eh), ctxc); ss->addSequence(&ACS_SEQUENCE_OFF, ACS_SEQUENCE_OFF_ID, ACS_SEQUENCE_OFF_ID, false, true); - ss->setInitialMode(HasModesIF::MODE_OFF); +} + +void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { + + std::string context = "satsystem::buildDetumbleSequence"; + auto ctxc = context.c_str(); + // Build DETUMBLE target + eh.setObject(objects::ACS_CONTROLLER); + eh.setMode(acs::CtrlModes::DETUMBLE); + eh.setSubmode(0); + CHK(ACS_TABLE_DETUMBLE_TGT.insert(eh), ctxc); + + eh.setObject(objects::IMTQ_HANDLER); + eh.setMode(NML); + eh.setSubmode(0); + CHK(ACS_TABLE_DETUMBLE_TGT.insert(eh), ctxc); + + eh.setObject(objects::SUS_BOARD_ASS); + eh.setMode(NML); + eh.setSubmode(0); + CHK(ACS_TABLE_DETUMBLE_TGT.insert(eh), ctxc); + + eh.setObject(objects::ACS_BOARD_ASS); + eh.setMode(NML); + eh.setSubmode(0); + CHK(ACS_TABLE_DETUMBLE_TGT.insert(eh), ctxc); + + ss->addTable(&ACS_TABLE_DETUMBLE_TGT, ACS_TABLE_DETUMBLE_TGT_ID, false, true); + + // Build DETUMBLE transition 0 + + eh.setObject(objects::IMTQ_HANDLER); + eh.setMode(NML); + eh.setSubmode(0); + CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc); + + eh.setObject(objects::STAR_TRACKER); + eh.setMode(OFF); + eh.setSubmode(0); + CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc); + + eh.setObject(objects::ACS_BOARD_ASS); + eh.setMode(NML); + eh.setSubmode(0); + CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc); + + eh.setObject(objects::SUS_BOARD_ASS); + eh.setMode(NML); + eh.setSubmode(0); + CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc); + + eh.setObject(objects::RW_ASS); + eh.setMode(OFF); + eh.setSubmode(0); + CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc); + + ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0, ACS_TABLE_DETUMBLE_TRANS_0_ID, false, true); + + // Build DETUMBLE transition 1 + + eh.setObject(objects::ACS_CONTROLLER); + eh.setMode(acs::CtrlModes::DETUMBLE); + eh.setSubmode(0); + CHK(ACS_TABLE_DETUMBLE_TRANS_1.insert(eh), ctxc); + ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1, ACS_TABLE_DETUMBLE_TRANS_1_ID, false, true); + + ss->addSequence(&ACS_SEQUENCE_DETUMBLE, ACS_SEQUENCE_DETUMBLE_ID, 0 /*Ãœ TODO*/, false, true); +} + +void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) {} + +void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) {} + +void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {} + +void satsystem::checkInsert(ReturnValue_t result, const char* ctx) { + if(result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "Insertion failed at " << ctx << std::endl; + } } diff --git a/bsp_q7s/core/acsModeTree.h b/bsp_q7s/core/acsModeTree.h index 34811349..8f0c593d 100644 --- a/bsp_q7s/core/acsModeTree.h +++ b/bsp_q7s/core/acsModeTree.h @@ -6,5 +6,10 @@ namespace satsystem { void acsSubsystemInit(); void buildOffSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildDetumbleSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildSafeSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildIdleSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); +void checkInsert(ReturnValue_t result, const char* ctx); } diff --git a/generators/fsfwgen b/generators/fsfwgen index 19e8ee90..9d7963f3 160000 --- a/generators/fsfwgen +++ b/generators/fsfwgen @@ -1 +1 @@ -Subproject commit 19e8ee90be12f72ceb8c2aefdfd665b5babad417 +Subproject commit 9d7963f3292c669814810adf50d6820b2e5c29b7 diff --git a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h new file mode 100644 index 00000000..43cce539 --- /dev/null +++ b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h @@ -0,0 +1,21 @@ +#ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ +#define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ + +#include + +namespace acs { + +enum CtrlModes { + OFF = HasModesIF::MODE_OFF, + IDLE = 1, + DETUMBLE = 2, + SAFE = 3, + IDLE = 4, + TARGET_PT = 5 +}; + +} + + + +#endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ */ From e3783d09416e46c2cb995752f8b6ee0c2af1e7bf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 23 Apr 2022 12:37:12 +0200 Subject: [PATCH 0018/2058] small fix --- fsfw | 2 +- .../controller/controllerdefinitions/AcsControllerDefinitions.h | 1 - tmtc | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fsfw b/fsfw index 24ef96d1..280b641c 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 24ef96d1b802e768d395f94b69f9f81a3c6d1e66 +Subproject commit 280b641cbc621d0c00c89851aaffbb64d5e5f40b diff --git a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h index 43cce539..c05f1b27 100644 --- a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h @@ -7,7 +7,6 @@ namespace acs { enum CtrlModes { OFF = HasModesIF::MODE_OFF, - IDLE = 1, DETUMBLE = 2, SAFE = 3, IDLE = 4, diff --git a/tmtc b/tmtc index 28983d38..b1aaef90 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 28983d387b82578a73fbfe052cb53dec1910d021 +Subproject commit b1aaef90c72874f501c6524ec967827f17e8cedf From baa6f05f8eeaa79c6f7ac7855db4587646c0db2b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 08:48:22 +0200 Subject: [PATCH 0019/2058] neat --- bsp_q7s/core/acsModeTree.cpp | 185 +++++++----------- bsp_q7s/core/acsModeTree.h | 2 +- .../AcsControllerDefinitions.h | 10 +- 3 files changed, 70 insertions(+), 127 deletions(-) diff --git a/bsp_q7s/core/acsModeTree.cpp b/bsp_q7s/core/acsModeTree.cpp index 58c1159a..207a98bf 100644 --- a/bsp_q7s/core/acsModeTree.cpp +++ b/bsp_q7s/core/acsModeTree.cpp @@ -1,38 +1,36 @@ +#include "acsModeTree.h" + #include #include - -#include "acsModeTree.h" -#include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" -#include -#include #include +#include +#include -FixedArrayList ACS_SEQUENCE_OFF = FixedArrayList(); -FixedArrayList ACS_TABLE_OFF_TGT = FixedArrayList(); -FixedArrayList ACS_TABLE_OFF_TRANS = FixedArrayList(); - -static constexpr Mode_t ACS_SEQUENCE_OFF_ID = acs::CtrlModes::OFF; -static constexpr Mode_t ACS_TABLE_OFF_TGT_ID = (acs::CtrlModes::OFF << 8) | 1; -static constexpr Mode_t ACS_TABLE_OFF_TRANS_ID = (acs::CtrlModes::OFF << 8) | 2; - -FixedArrayList ACS_SEQUENCE_DETUMBLE = FixedArrayList(); -FixedArrayList ACS_TABLE_DETUMBLE_TGT = FixedArrayList(); -FixedArrayList ACS_TABLE_DETUMBLE_TRANS_0 = FixedArrayList(); -FixedArrayList ACS_TABLE_DETUMBLE_TRANS_1 = FixedArrayList(); - -static constexpr Mode_t ACS_SEQUENCE_DETUMBLE_ID = acs::CtrlModes::DETUMBLE; -static constexpr Mode_t ACS_TABLE_DETUMBLE_TGT_ID = (acs::CtrlModes::DETUMBLE << 8) | 1; -static constexpr Mode_t ACS_TABLE_DETUMBLE_TRANS_0_ID = (acs::CtrlModes::DETUMBLE << 8) | 2; -static constexpr Mode_t ACS_TABLE_DETUMBLE_TRANS_1_ID = (acs::CtrlModes::DETUMBLE << 8) | 3; +#include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" // Alias for checker function const auto CHK = satsystem::checkInsert; static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; +auto ACS_SEQUENCE_OFF = std::make_pair(acs::CtrlModes::OFF, FixedArrayList()); +auto ACS_TABLE_OFF_TGT = + std::make_pair((acs::CtrlModes::OFF << 8) | 1, FixedArrayList()); +auto ACS_TABLE_OFF_TRANS = + std::make_pair((acs::CtrlModes::OFF << 8) | 2, FixedArrayList()); + +auto ACS_SEQUENCE_DETUMBLE = + std::make_pair(acs::CtrlModes::DETUMBLE, FixedArrayList()); +auto ACS_TABLE_DETUMBLE_TGT = + std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 1, FixedArrayList()); +auto ACS_TABLE_DETUMBLE_TRANS_0 = + std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 2, FixedArrayList()); +auto ACS_TABLE_DETUMBLE_TRANS_1 = + std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 3, FixedArrayList()); + void satsystem::acsSubsystemInit() { ModeListEntry entry; - Subsystem *acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 20, 20); + Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 20, 20); buildOffSequence(acsSubsystem, entry); buildDetumbleSequence(acsSubsystem, entry); acsSubsystem->setInitialMode(HasModesIF::MODE_OFF); @@ -41,121 +39,74 @@ void satsystem::acsSubsystemInit() { void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildOffSequence"; auto ctxc = context.c_str(); - // Build OFF target - ss->addTable(&ACS_TABLE_OFF_TGT, ACS_TABLE_OFF_TGT_ID, false, true); + + auto ih = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; // Build OFF transition - eh.setObject(objects::ACS_CONTROLLER); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); - - eh.setObject(objects::IMTQ_HANDLER); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); - - eh.setObject(objects::STAR_TRACKER); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); - - eh.setObject(objects::ACS_BOARD_ASS); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); - - eh.setObject(objects::SUS_BOARD_ASS); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); - - eh.setObject(objects::RW_ASS); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); - - ss->addTable(&ACS_TABLE_OFF_TRANS, ACS_TABLE_OFF_TRANS_ID, false, true); + ih(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + ih(objects::IMTQ_HANDLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + ih(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + ih(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + ih(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + ih(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); // Build OFF sequence - eh.setTableId(ACS_TABLE_OFF_TGT_ID); + eh.setTableId(ACS_TABLE_OFF_TGT.first); eh.setWaitSeconds(0); eh.setCheckSuccess(false); - CHK(ACS_SEQUENCE_OFF.insert(eh), ctxc); + CHK(ACS_SEQUENCE_OFF.second.insert(eh), ctxc); - eh.setTableId(ACS_TABLE_OFF_TRANS_ID); + eh.setTableId(ACS_TABLE_OFF_TRANS.first); eh.setWaitSeconds(0); eh.setCheckSuccess(false); - CHK(ACS_SEQUENCE_OFF.insert(eh), ctxc); + CHK(ACS_SEQUENCE_OFF.second.insert(eh), ctxc); - ss->addSequence(&ACS_SEQUENCE_OFF, ACS_SEQUENCE_OFF_ID, ACS_SEQUENCE_OFF_ID, false, true); + // Build OFF target + ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true); + ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true); + ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, false, + true); } void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { - std::string context = "satsystem::buildDetumbleSequence"; auto ctxc = context.c_str(); + auto ih = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; // Build DETUMBLE target - eh.setObject(objects::ACS_CONTROLLER); - eh.setMode(acs::CtrlModes::DETUMBLE); - eh.setSubmode(0); - CHK(ACS_TABLE_DETUMBLE_TGT.insert(eh), ctxc); + ih(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); + ih(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); + ih(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); + ih(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - eh.setObject(objects::IMTQ_HANDLER); - eh.setMode(NML); - eh.setSubmode(0); - CHK(ACS_TABLE_DETUMBLE_TGT.insert(eh), ctxc); - - eh.setObject(objects::SUS_BOARD_ASS); - eh.setMode(NML); - eh.setSubmode(0); - CHK(ACS_TABLE_DETUMBLE_TGT.insert(eh), ctxc); - - eh.setObject(objects::ACS_BOARD_ASS); - eh.setMode(NML); - eh.setSubmode(0); - CHK(ACS_TABLE_DETUMBLE_TGT.insert(eh), ctxc); - - ss->addTable(&ACS_TABLE_DETUMBLE_TGT, ACS_TABLE_DETUMBLE_TGT_ID, false, true); + ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true); // Build DETUMBLE transition 0 - - eh.setObject(objects::IMTQ_HANDLER); - eh.setMode(NML); - eh.setSubmode(0); - CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc); - - eh.setObject(objects::STAR_TRACKER); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc); - - eh.setObject(objects::ACS_BOARD_ASS); - eh.setMode(NML); - eh.setSubmode(0); - CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc); - - eh.setObject(objects::SUS_BOARD_ASS); - eh.setMode(NML); - eh.setSubmode(0); - CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc); - - eh.setObject(objects::RW_ASS); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc); - - ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0, ACS_TABLE_DETUMBLE_TRANS_0_ID, false, true); + ih(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + ih(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + ih(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + ih(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + ih(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); // Build DETUMBLE transition 1 + ih(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); - eh.setObject(objects::ACS_CONTROLLER); - eh.setMode(acs::CtrlModes::DETUMBLE); - eh.setSubmode(0); - CHK(ACS_TABLE_DETUMBLE_TRANS_1.insert(eh), ctxc); - ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1, ACS_TABLE_DETUMBLE_TRANS_1_ID, false, true); - - ss->addSequence(&ACS_SEQUENCE_DETUMBLE, ACS_SEQUENCE_DETUMBLE_ID, 0 /*Ãœ TODO*/, false, true); + // Build full sequence + ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, true); + ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, true); + ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, + ACS_SEQUENCE_DETUMBLE.first, false, true); } void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) {} @@ -165,7 +116,7 @@ void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) {} void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {} void satsystem::checkInsert(ReturnValue_t result, const char* ctx) { - if(result != HasReturnvaluesIF::RETURN_OK) { + if (result != HasReturnvaluesIF::RETURN_OK) { sif::error << "Insertion failed at " << ctx << std::endl; } } diff --git a/bsp_q7s/core/acsModeTree.h b/bsp_q7s/core/acsModeTree.h index 8f0c593d..f37d0f75 100644 --- a/bsp_q7s/core/acsModeTree.h +++ b/bsp_q7s/core/acsModeTree.h @@ -12,4 +12,4 @@ void buildIdleSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); void checkInsert(ReturnValue_t result, const char* ctx); -} +} // namespace satsystem diff --git a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h index c05f1b27..d0733046 100644 --- a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h @@ -5,16 +5,8 @@ namespace acs { -enum CtrlModes { - OFF = HasModesIF::MODE_OFF, - DETUMBLE = 2, - SAFE = 3, - IDLE = 4, - TARGET_PT = 5 -}; +enum CtrlModes { OFF = HasModesIF::MODE_OFF, DETUMBLE = 2, SAFE = 3, IDLE = 4, TARGET_PT = 5 }; } - - #endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ */ From bbb4ba2191582bb70d4289329504a84bfd85b3e3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 10:08:29 +0200 Subject: [PATCH 0020/2058] baseline acs mode tree done --- bsp_q7s/core/acsModeTree.cpp | 268 +++++++++++++++++++++++++++++------ 1 file changed, 226 insertions(+), 42 deletions(-) diff --git a/bsp_q7s/core/acsModeTree.cpp b/bsp_q7s/core/acsModeTree.cpp index 207a98bf..f99b79fc 100644 --- a/bsp_q7s/core/acsModeTree.cpp +++ b/bsp_q7s/core/acsModeTree.cpp @@ -20,100 +20,284 @@ auto ACS_TABLE_OFF_TRANS = std::make_pair((acs::CtrlModes::OFF << 8) | 2, FixedArrayList()); auto ACS_SEQUENCE_DETUMBLE = - std::make_pair(acs::CtrlModes::DETUMBLE, FixedArrayList()); + std::make_pair(acs::CtrlModes::DETUMBLE, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TGT = - std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 1, FixedArrayList()); + std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 1, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_0 = std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 2, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_1 = std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 3, FixedArrayList()); +auto ACS_SEQUENCE_SAFE = + std::make_pair(acs::CtrlModes::SAFE, FixedArrayList()); +auto ACS_TABLE_SAFE_TGT = + std::make_pair((acs::CtrlModes::SAFE << 8) | 1, FixedArrayList()); +auto ACS_TABLE_SAFE_TRANS_0 = + std::make_pair((acs::CtrlModes::SAFE << 8) | 2, FixedArrayList()); +auto ACS_TABLE_SAFE_TRANS_1 = + std::make_pair((acs::CtrlModes::SAFE << 8) | 3, FixedArrayList()); + +auto ACS_SEQUENCE_IDLE = + std::make_pair(acs::CtrlModes::IDLE, FixedArrayList()); +auto ACS_TABLE_IDLE_TGT = + std::make_pair((acs::CtrlModes::IDLE << 8) | 1, FixedArrayList()); +auto ACS_TABLE_IDLE_TRANS_0 = + std::make_pair((acs::CtrlModes::IDLE << 8) | 2, FixedArrayList()); +auto ACS_TABLE_IDLE_TRANS_1 = + std::make_pair((acs::CtrlModes::IDLE << 8) | 3, FixedArrayList()); + +auto ACS_SEQUENCE_TARGET_PT = + std::make_pair(acs::CtrlModes::TARGET_PT, FixedArrayList()); +auto ACS_TABLE_TARGET_PT_TGT = + std::make_pair((acs::CtrlModes::TARGET_PT << 8) | 1, FixedArrayList()); +auto ACS_TABLE_TARGET_PT_TRANS_0 = + std::make_pair((acs::CtrlModes::TARGET_PT << 8) | 2, FixedArrayList()); +auto ACS_TABLE_TARGET_PT_TRANS_1 = + std::make_pair((acs::CtrlModes::TARGET_PT << 8) | 3, FixedArrayList()); + +enum InsertType { + TABLE, + SEQ +}; + void satsystem::acsSubsystemInit() { ModeListEntry entry; Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 20, 20); buildOffSequence(acsSubsystem, entry); + buildSafeSequence(acsSubsystem, entry); buildDetumbleSequence(acsSubsystem, entry); + buildIdleSequence(acsSubsystem, entry); + buildTargetPtSequence(acsSubsystem, entry); acsSubsystem->setInitialMode(HasModesIF::MODE_OFF); } void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildOffSequence"; auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& table) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(table.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; - auto ih = [&](object_id_t obj, Mode_t mode, Submode_t submode, + // OFF Target table is empty + ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true); + + // Build OFF transition + iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::IMTQ_HANDLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true); + + // Build OFF sequence + ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TGT.first, 0, false); + ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS.first, 0, false); + ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, false, + true); +} + +void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildSafeSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList& sequence) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(sequence.insert(eh), ctxc); }; + // Insert Helper Sequence + auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; + // Build SAFE target + iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); + ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true); - // Build OFF transition - ih(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); - ih(objects::IMTQ_HANDLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); - ih(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_OFF_TRANS.second); - ih(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); - ih(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); - ih(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + // Build SAFE transition 0 + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::RW_ASS, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); + ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true); - // Build OFF sequence - eh.setTableId(ACS_TABLE_OFF_TGT.first); - eh.setWaitSeconds(0); - eh.setCheckSuccess(false); - CHK(ACS_SEQUENCE_OFF.second.insert(eh), ctxc); + // Build SAFE transition 1 + iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second); + ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true); - eh.setTableId(ACS_TABLE_OFF_TRANS.first); - eh.setWaitSeconds(0); - eh.setCheckSuccess(false); - CHK(ACS_SEQUENCE_OFF.second.insert(eh), ctxc); - - // Build OFF target - ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true); - ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true); - ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, false, + // Build SAFE sequence + ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, false); + ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_1.first, 0, false); + ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, false, true); } void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildDetumbleSequence"; auto ctxc = context.c_str(); - auto ih = [&](object_id_t obj, Mode_t mode, Submode_t submode, + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList& sequence) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(sequence.insert(eh), ctxc); }; + // Insert Helper Sequence + auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; // Build DETUMBLE target - ih(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); - ih(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - ih(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - ih(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - + iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true); // Build DETUMBLE transition 0 - ih(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - ih(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - ih(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - ih(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - ih(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, true); // Build DETUMBLE transition 1 - ih(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); - - // Build full sequence - ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, true); + iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, true); + + // Build DETUMBLE sequence + ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, false); + ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_1.first, 0, false); ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, ACS_SEQUENCE_DETUMBLE.first, false, true); } -void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) {} -void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) {} +void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildIdleSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; + // Build IDLE target + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); + ss->addTable(&ACS_TABLE_IDLE_TGT.second, ACS_TABLE_IDLE_TGT.first, false, true); -void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {} + // Build IDLE transition 0 + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + ss->addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true); + + // Build IDLE transition 1 + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); + ss->addTable(&ACS_TABLE_IDLE_TRANS_1.second, ACS_TABLE_IDLE_TRANS_1.first, false, true); + + // Build IDLE sequence + ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TGT.first, 0, false); + ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_1.first, 0, false); + ss->addSequence(&ACS_SEQUENCE_IDLE.second, ACS_SEQUENCE_IDLE.first, + ACS_SEQUENCE_IDLE.first, false, true); +} + +void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildTargetPtSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; + + // Build TARGET PT table + iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true); + + // Build TARGET PT transition 0 + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, true); + + // Build TARGET PT transition 1 + iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TRANS_1.second); + ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, true); + + // Build IDLE sequence + ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, false); + ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_1.first, 0, false); + ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, + ACS_SEQUENCE_TARGET_PT.first, false, true); +} void satsystem::checkInsert(ReturnValue_t result, const char* ctx) { if (result != HasReturnvaluesIF::RETURN_OK) { From 298148eebfd6f542a07741cafc41dd2b44390c16 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 10:08:54 +0200 Subject: [PATCH 0021/2058] bump fsfwgen --- generators/fsfwgen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/fsfwgen b/generators/fsfwgen index 9d7963f3..d2bdabbf 160000 --- a/generators/fsfwgen +++ b/generators/fsfwgen @@ -1 +1 @@ -Subproject commit 9d7963f3292c669814810adf50d6820b2e5c29b7 +Subproject commit d2bdabbf0f213747efc18cb45fcf2a2294b14bc8 From 9ba65b04fd703d55518f8506e6aa6ce143205ebe Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 10:30:47 +0200 Subject: [PATCH 0022/2058] add IDLE charge mode --- bsp_q7s/core/acsModeTree.cpp | 224 ++++++++++++------ bsp_q7s/core/acsModeTree.h | 1 + .../AcsControllerDefinitions.h | 6 +- 3 files changed, 154 insertions(+), 77 deletions(-) diff --git a/bsp_q7s/core/acsModeTree.cpp b/bsp_q7s/core/acsModeTree.cpp index f99b79fc..b944caa9 100644 --- a/bsp_q7s/core/acsModeTree.cpp +++ b/bsp_q7s/core/acsModeTree.cpp @@ -13,60 +13,66 @@ const auto CHK = satsystem::checkInsert; static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; -auto ACS_SEQUENCE_OFF = std::make_pair(acs::CtrlModes::OFF, FixedArrayList()); +auto ACS_SEQUENCE_OFF = + std::make_pair(acs::CtrlModes::OFF << 24, FixedArrayList()); auto ACS_TABLE_OFF_TGT = - std::make_pair((acs::CtrlModes::OFF << 8) | 1, FixedArrayList()); + std::make_pair((acs::CtrlModes::OFF << 24) | 1, FixedArrayList()); auto ACS_TABLE_OFF_TRANS = - std::make_pair((acs::CtrlModes::OFF << 8) | 2, FixedArrayList()); + std::make_pair((acs::CtrlModes::OFF << 24) | 2, FixedArrayList()); auto ACS_SEQUENCE_DETUMBLE = - std::make_pair(acs::CtrlModes::DETUMBLE, FixedArrayList()); + std::make_pair(acs::CtrlModes::DETUMBLE << 24, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TGT = - std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 1, FixedArrayList()); + std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_0 = - std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 2, FixedArrayList()); + std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_1 = - std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 3, FixedArrayList()); + std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_SAFE = - std::make_pair(acs::CtrlModes::SAFE, FixedArrayList()); + std::make_pair(acs::CtrlModes::SAFE << 24, FixedArrayList()); auto ACS_TABLE_SAFE_TGT = - std::make_pair((acs::CtrlModes::SAFE << 8) | 1, FixedArrayList()); + std::make_pair((acs::CtrlModes::SAFE << 24) | 1, FixedArrayList()); auto ACS_TABLE_SAFE_TRANS_0 = - std::make_pair((acs::CtrlModes::SAFE << 8) | 2, FixedArrayList()); + std::make_pair((acs::CtrlModes::SAFE << 24) | 2, FixedArrayList()); auto ACS_TABLE_SAFE_TRANS_1 = - std::make_pair((acs::CtrlModes::SAFE << 8) | 3, FixedArrayList()); + std::make_pair((acs::CtrlModes::SAFE << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_IDLE = - std::make_pair(acs::CtrlModes::IDLE, FixedArrayList()); + std::make_pair(acs::CtrlModes::IDLE << 24, FixedArrayList()); auto ACS_TABLE_IDLE_TGT = - std::make_pair((acs::CtrlModes::IDLE << 8) | 1, FixedArrayList()); + std::make_pair((acs::CtrlModes::IDLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_0 = - std::make_pair((acs::CtrlModes::IDLE << 8) | 2, FixedArrayList()); + std::make_pair((acs::CtrlModes::IDLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_1 = - std::make_pair((acs::CtrlModes::IDLE << 8) | 3, FixedArrayList()); + std::make_pair((acs::CtrlModes::IDLE << 24) | 3, FixedArrayList()); + +auto ACS_SEQUENCE_IDLE_CHRG = std::make_pair(acs::CtrlModes::IDLE << 24 | (acs::IDLE_CHARGE << 8), + FixedArrayList()); +auto ACS_TABLE_IDLE_CHRG_TGT = std::make_pair( + (acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 1, FixedArrayList()); +auto ACS_TABLE_IDLE_CHRG_TRANS_0 = std::make_pair( + (acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 2, FixedArrayList()); +auto ACS_TABLE_IDLE_CHRG_TRANS_1 = std::make_pair( + (acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 3, FixedArrayList()); auto ACS_SEQUENCE_TARGET_PT = std::make_pair(acs::CtrlModes::TARGET_PT, FixedArrayList()); auto ACS_TABLE_TARGET_PT_TGT = - std::make_pair((acs::CtrlModes::TARGET_PT << 8) | 1, FixedArrayList()); + std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 1, FixedArrayList()); auto ACS_TABLE_TARGET_PT_TRANS_0 = - std::make_pair((acs::CtrlModes::TARGET_PT << 8) | 2, FixedArrayList()); + std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 2, FixedArrayList()); auto ACS_TABLE_TARGET_PT_TRANS_1 = - std::make_pair((acs::CtrlModes::TARGET_PT << 8) | 3, FixedArrayList()); - -enum InsertType { - TABLE, - SEQ -}; + std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 3, FixedArrayList()); void satsystem::acsSubsystemInit() { ModeListEntry entry; - Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 20, 20); + Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 12, 24); buildOffSequence(acsSubsystem, entry); buildSafeSequence(acsSubsystem, entry); buildDetumbleSequence(acsSubsystem, entry); buildIdleSequence(acsSubsystem, entry); + buildIdleChargeSequence(acsSubsystem, entry); buildTargetPtSequence(acsSubsystem, entry); acsSubsystem->setInitialMode(HasModesIF::MODE_OFF); } @@ -75,16 +81,15 @@ void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildOffSequence"; auto ctxc = context.c_str(); // Insert Helper Table - auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, - ArrayList& table) { + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList& table) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(table.insert(eh), ctxc); }; // Insert Helper Sequence - auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, - bool checkSuccess) { + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); @@ -92,7 +97,7 @@ void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { }; // OFF Target table is empty - ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true); + CHK(ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); // Build OFF transition iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); @@ -101,13 +106,14 @@ void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); - ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true); + CHK(ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc); // Build OFF sequence ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TGT.first, 0, false); ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS.first, 0, false); - ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, false, - true); + CHK(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, + false, true), + ctxc); } void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { @@ -115,15 +121,15 @@ void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, - ArrayList& sequence) { + ArrayList& sequence) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(sequence.insert(eh), ctxc); }; // Insert Helper Sequence - auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, - bool checkSuccess) { + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); @@ -134,7 +140,7 @@ void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); - ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true); + CHK(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); // Build SAFE transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); @@ -142,18 +148,21 @@ void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); - ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true); + CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true), + ctxc); // Build SAFE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second); - ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true); + CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), + ctxc); // Build SAFE sequence - ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, false); + ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, true); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_0.first, 0, false); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_1.first, 0, false); - ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, false, - true); + CHK(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, + false, true), + ctxc); } void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { @@ -161,15 +170,15 @@ void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, - ArrayList& sequence) { + ArrayList& sequence) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(sequence.insert(eh), ctxc); }; // Insert Helper Sequence - auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, - bool checkSuccess) { + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); @@ -180,7 +189,8 @@ void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true); + CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true), + ctxc); // Build DETUMBLE transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); @@ -188,35 +198,39 @@ void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, true); + CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, + true), + ctxc); // Build DETUMBLE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); - ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, true); + CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, + true), + ctxc); // Build DETUMBLE sequence - ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, false); + ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, true); ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_0.first, 0, false); ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_1.first, 0, false); - ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, - ACS_SEQUENCE_DETUMBLE.first, false, true); + CHK(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, + ACS_SEQUENCE_SAFE.first, false, true), + ctxc); } - void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildIdleSequence"; auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, - ArrayList& sequence) { + ArrayList& sequence) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(sequence.insert(eh), ctxc); }; // Insert Helper Sequence - auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, - bool checkSuccess) { + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); @@ -231,23 +245,77 @@ void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { ss->addTable(&ACS_TABLE_IDLE_TGT.second, ACS_TABLE_IDLE_TGT.first, false, true); // Build IDLE transition 0 - iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - iht(objects::RW_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_TRANS_0.second); ss->addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true); // Build IDLE transition 1 - iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TRANS_1.second); ss->addTable(&ACS_TABLE_IDLE_TRANS_1.second, ACS_TABLE_IDLE_TRANS_1.first, false, true); // Build IDLE sequence - ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TGT.first, 0, false); - ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TGT.first, 0, true); + ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_1.first, 0, false); - ss->addSequence(&ACS_SEQUENCE_IDLE.second, ACS_SEQUENCE_IDLE.first, - ACS_SEQUENCE_IDLE.first, false, true); + ss->addSequence(&ACS_SEQUENCE_IDLE.second, ACS_SEQUENCE_IDLE.first, ACS_SEQUENCE_SAFE.first, + false, true); +} + +void satsystem::buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildIdleChargeSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; + // Build IDLE target + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, + ACS_TABLE_IDLE_CHRG_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); + CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true), + ctxc); + + // Build IDLE transition 0 + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + iht(objects::RW_ASS, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false, + true), + ctxc); + + // Build IDLE transition 1 + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, + ACS_TABLE_IDLE_CHRG_TRANS_1.second); + CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false, + true), + ctxc); + + // Build IDLE sequence + ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TGT.first, 0, true); + ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, 0, true); + ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, 0, false); + CHK(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first, + ACS_SEQUENCE_SAFE.first, false, true), + ctxc); } void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { @@ -255,15 +323,15 @@ void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, - ArrayList& sequence) { + ArrayList& sequence) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(sequence.insert(eh), ctxc); }; // Insert Helper Sequence - auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, - bool checkSuccess) { + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); @@ -277,7 +345,8 @@ void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); - ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true); + CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true), + ctxc); // Build TARGET PT transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); @@ -285,22 +354,27 @@ void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); - ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, true); + CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, + true), + ctxc); // Build TARGET PT transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TRANS_1.second); - ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, true); + CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, + true), + ctxc); // Build IDLE sequence - ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, false); - ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, true); + ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_1.first, 0, false); - ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, - ACS_SEQUENCE_TARGET_PT.first, false, true); + CHK(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, + ACS_SEQUENCE_IDLE.first, false, true), + ctxc); } void satsystem::checkInsert(ReturnValue_t result, const char* ctx) { if (result != HasReturnvaluesIF::RETURN_OK) { - sif::error << "Insertion failed at " << ctx << std::endl; + sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx << std::endl; } } diff --git a/bsp_q7s/core/acsModeTree.h b/bsp_q7s/core/acsModeTree.h index f37d0f75..b6c96e39 100644 --- a/bsp_q7s/core/acsModeTree.h +++ b/bsp_q7s/core/acsModeTree.h @@ -9,6 +9,7 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildDetumbleSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildSafeSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildIdleSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); void checkInsert(ReturnValue_t result, const char* ctx); diff --git a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h index d0733046..8122178d 100644 --- a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h @@ -5,8 +5,10 @@ namespace acs { -enum CtrlModes { OFF = HasModesIF::MODE_OFF, DETUMBLE = 2, SAFE = 3, IDLE = 4, TARGET_PT = 5 }; +enum CtrlModes { OFF = HasModesIF::MODE_OFF, SAFE = 1, DETUMBLE = 2, IDLE = 3, TARGET_PT = 4 }; -} +static constexpr Submode_t IDLE_CHARGE = 1; + +} // namespace acs #endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ */ From f014e2d5c794897f17fa0a5a70e7ca3ae716a299 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 10:36:03 +0200 Subject: [PATCH 0023/2058] system folder restructuring --- bsp_q7s/core/CMakeLists.txt | 1 - bsp_q7s/core/ObjectFactory.cpp | 30 +++++++++---------- linux/ObjectFactory.cpp | 8 ++--- mission/devices/PayloadPcduHandler.h | 4 +-- mission/system/CMakeLists.txt | 19 ++---------- .../system/{ => objects}/AcsBoardAssembly.cpp | 0 .../system/{ => objects}/AcsBoardAssembly.h | 0 mission/system/{ => objects}/AcsBoardFdir.cpp | 0 mission/system/{ => objects}/AcsBoardFdir.h | 0 mission/system/{ => objects}/AcsSubsystem.cpp | 0 mission/system/{ => objects}/AcsSubsystem.h | 0 mission/system/objects/CMakeLists.txt | 17 +++++++++++ mission/system/{ => objects}/ComSubsystem.cpp | 0 mission/system/{ => objects}/ComSubsystem.h | 0 .../{ => objects}/DualLaneAssemblyBase.cpp | 0 .../{ => objects}/DualLaneAssemblyBase.h | 2 +- .../DualLanePowerStateMachine.cpp | 0 .../{ => objects}/DualLanePowerStateMachine.h | 2 +- mission/system/{ => objects}/EiveSystem.cpp | 0 mission/system/{ => objects}/EiveSystem.h | 0 .../system/{ => objects}/PayloadSubsystem.cpp | 0 .../system/{ => objects}/PayloadSubsystem.h | 0 .../{ => objects}/PowerStateMachineBase.cpp | 0 .../{ => objects}/PowerStateMachineBase.h | 0 mission/system/{ => objects}/RtdFdir.cpp | 0 mission/system/{ => objects}/RtdFdir.h | 0 mission/system/{ => objects}/SusAssembly.cpp | 0 mission/system/{ => objects}/SusAssembly.h | 0 mission/system/{ => objects}/SusFdir.cpp | 0 mission/system/{ => objects}/SusFdir.h | 0 .../system/{ => objects}/TcsBoardAssembly.cpp | 0 .../system/{ => objects}/TcsBoardAssembly.h | 0 mission/system/{ => objects}/definitions.h | 0 mission/system/tree/CMakeLists.txt | 3 ++ .../system/tree}/acsModeTree.cpp | 0 .../system/tree}/acsModeTree.h | 0 36 files changed, 45 insertions(+), 41 deletions(-) rename mission/system/{ => objects}/AcsBoardAssembly.cpp (100%) rename mission/system/{ => objects}/AcsBoardAssembly.h (100%) rename mission/system/{ => objects}/AcsBoardFdir.cpp (100%) rename mission/system/{ => objects}/AcsBoardFdir.h (100%) rename mission/system/{ => objects}/AcsSubsystem.cpp (100%) rename mission/system/{ => objects}/AcsSubsystem.h (100%) create mode 100644 mission/system/objects/CMakeLists.txt rename mission/system/{ => objects}/ComSubsystem.cpp (100%) rename mission/system/{ => objects}/ComSubsystem.h (100%) rename mission/system/{ => objects}/DualLaneAssemblyBase.cpp (100%) rename mission/system/{ => objects}/DualLaneAssemblyBase.h (98%) rename mission/system/{ => objects}/DualLanePowerStateMachine.cpp (100%) rename mission/system/{ => objects}/DualLanePowerStateMachine.h (91%) rename mission/system/{ => objects}/EiveSystem.cpp (100%) rename mission/system/{ => objects}/EiveSystem.h (100%) rename mission/system/{ => objects}/PayloadSubsystem.cpp (100%) rename mission/system/{ => objects}/PayloadSubsystem.h (100%) rename mission/system/{ => objects}/PowerStateMachineBase.cpp (100%) rename mission/system/{ => objects}/PowerStateMachineBase.h (100%) rename mission/system/{ => objects}/RtdFdir.cpp (100%) rename mission/system/{ => objects}/RtdFdir.h (100%) rename mission/system/{ => objects}/SusAssembly.cpp (100%) rename mission/system/{ => objects}/SusAssembly.h (100%) rename mission/system/{ => objects}/SusFdir.cpp (100%) rename mission/system/{ => objects}/SusFdir.h (100%) rename mission/system/{ => objects}/TcsBoardAssembly.cpp (100%) rename mission/system/{ => objects}/TcsBoardAssembly.h (100%) rename mission/system/{ => objects}/definitions.h (100%) create mode 100644 mission/system/tree/CMakeLists.txt rename {bsp_q7s/core => mission/system/tree}/acsModeTree.cpp (100%) rename {bsp_q7s/core => mission/system/tree}/acsModeTree.h (100%) diff --git a/bsp_q7s/core/CMakeLists.txt b/bsp_q7s/core/CMakeLists.txt index 30538565..8731b7a3 100644 --- a/bsp_q7s/core/CMakeLists.txt +++ b/bsp_q7s/core/CMakeLists.txt @@ -1,5 +1,4 @@ target_sources(${OBSW_NAME} PRIVATE - acsModeTree.cpp CoreController.cpp obsw.cpp InitMission.cpp diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index ecc88ede..a675ffc5 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -37,11 +37,11 @@ #include "linux/obc/PdecHandler.h" #include "linux/obc/Ptme.h" #include "linux/obc/PtmeConfig.h" -#include "mission/system/AcsBoardFdir.h" -#include "mission/system/RtdFdir.h" -#include "mission/system/SusAssembly.h" -#include "mission/system/SusFdir.h" -#include "mission/system/TcsBoardAssembly.h" +#include "mission/system/objects/AcsBoardFdir.h" +#include "mission/system/objects/RtdFdir.h" +#include "mission/system/objects/SusAssembly.h" +#include "mission/system/objects/SusFdir.h" +#include "mission/system/objects/TcsBoardAssembly.h" #include "tmtc/apid.h" #include "tmtc/pusIds.h" @@ -92,13 +92,13 @@ #include "mission/devices/devicedefinitions/SusDefinitions.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" #include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" -#include "mission/system/AcsBoardAssembly.h" +#include "mission/system/objects/AcsBoardAssembly.h" #include "mission/tmtc/CCSDSHandler.h" #include "mission/tmtc/VirtualChannel.h" #include "mission/utility/TmFunnel.h" -ResetArgs resetArgsGnss0; -ResetArgs resetArgsGnss1; +ResetArgs RESET_ARGS_GNSS_0; +ResetArgs RESET_ARGS_GNSS_1; void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); } @@ -537,15 +537,15 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI #if OBSW_DEBUG_GPS == 1 debugGps = true; #endif - resetArgsGnss1.gnss1 = true; - resetArgsGnss1.gpioComIF = gpioComIF; - resetArgsGnss1.waitPeriodMs = 100; - resetArgsGnss0.gnss1 = false; - resetArgsGnss0.gpioComIF = gpioComIF; - resetArgsGnss0.waitPeriodMs = 100; + RESET_ARGS_GNSS_1.gnss1 = true; + RESET_ARGS_GNSS_1.gpioComIF = gpioComIF; + RESET_ARGS_GNSS_1.waitPeriodMs = 100; + RESET_ARGS_GNSS_0.gnss1 = false; + RESET_ARGS_GNSS_0.gpioComIF = gpioComIF; + RESET_ARGS_GNSS_0.waitPeriodMs = 100; auto gpsHandler0 = new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps); - gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0); + gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS_0); AcsBoardHelper acsBoardHelper = AcsBoardHelper( objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER, diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 7811fdbe..6b86b128 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -9,10 +9,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "OBSWConfig.h" #include "devConf.h" diff --git a/mission/devices/PayloadPcduHandler.h b/mission/devices/PayloadPcduHandler.h index dba5b4ef..d5d0f5b1 100644 --- a/mission/devices/PayloadPcduHandler.h +++ b/mission/devices/PayloadPcduHandler.h @@ -10,8 +10,8 @@ #include "fsfw_hal/common/gpio/GpioIF.h" #include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" #include "mission/memory/SdCardMountedIF.h" -#include "mission/system/DualLanePowerStateMachine.h" -#include "mission/system/definitions.h" +#include "mission/system/objects/DualLanePowerStateMachine.h" +#include "mission/system/objects/definitions.h" #ifdef FSFW_OSAL_LINUX class SpiComIF; diff --git a/mission/system/CMakeLists.txt b/mission/system/CMakeLists.txt index 59418a07..0e9ce773 100644 --- a/mission/system/CMakeLists.txt +++ b/mission/system/CMakeLists.txt @@ -1,17 +1,2 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE - EiveSystem.cpp - AcsSubsystem.cpp - ComSubsystem.cpp - PayloadSubsystem.cpp - - AcsBoardAssembly.cpp - SusAssembly.cpp - DualLanePowerStateMachine.cpp - PowerStateMachineBase.cpp - DualLaneAssemblyBase.cpp - TcsBoardAssembly.cpp - - AcsBoardFdir.cpp - SusFdir.cpp - RtdFdir.cpp -) \ No newline at end of file +add_subdirectory(objects) +add_subdirectory(tree) diff --git a/mission/system/AcsBoardAssembly.cpp b/mission/system/objects/AcsBoardAssembly.cpp similarity index 100% rename from mission/system/AcsBoardAssembly.cpp rename to mission/system/objects/AcsBoardAssembly.cpp diff --git a/mission/system/AcsBoardAssembly.h b/mission/system/objects/AcsBoardAssembly.h similarity index 100% rename from mission/system/AcsBoardAssembly.h rename to mission/system/objects/AcsBoardAssembly.h diff --git a/mission/system/AcsBoardFdir.cpp b/mission/system/objects/AcsBoardFdir.cpp similarity index 100% rename from mission/system/AcsBoardFdir.cpp rename to mission/system/objects/AcsBoardFdir.cpp diff --git a/mission/system/AcsBoardFdir.h b/mission/system/objects/AcsBoardFdir.h similarity index 100% rename from mission/system/AcsBoardFdir.h rename to mission/system/objects/AcsBoardFdir.h diff --git a/mission/system/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp similarity index 100% rename from mission/system/AcsSubsystem.cpp rename to mission/system/objects/AcsSubsystem.cpp diff --git a/mission/system/AcsSubsystem.h b/mission/system/objects/AcsSubsystem.h similarity index 100% rename from mission/system/AcsSubsystem.h rename to mission/system/objects/AcsSubsystem.h diff --git a/mission/system/objects/CMakeLists.txt b/mission/system/objects/CMakeLists.txt new file mode 100644 index 00000000..22fd63b7 --- /dev/null +++ b/mission/system/objects/CMakeLists.txt @@ -0,0 +1,17 @@ +target_sources(${LIB_EIVE_MISSION} PRIVATE + EiveSystem.cpp + AcsSubsystem.cpp + ComSubsystem.cpp + PayloadSubsystem.cpp + + AcsBoardAssembly.cpp + SusAssembly.cpp + DualLanePowerStateMachine.cpp + PowerStateMachineBase.cpp + DualLaneAssemblyBase.cpp + TcsBoardAssembly.cpp + + AcsBoardFdir.cpp + SusFdir.cpp + RtdFdir.cpp +) diff --git a/mission/system/ComSubsystem.cpp b/mission/system/objects/ComSubsystem.cpp similarity index 100% rename from mission/system/ComSubsystem.cpp rename to mission/system/objects/ComSubsystem.cpp diff --git a/mission/system/ComSubsystem.h b/mission/system/objects/ComSubsystem.h similarity index 100% rename from mission/system/ComSubsystem.h rename to mission/system/objects/ComSubsystem.h diff --git a/mission/system/DualLaneAssemblyBase.cpp b/mission/system/objects/DualLaneAssemblyBase.cpp similarity index 100% rename from mission/system/DualLaneAssemblyBase.cpp rename to mission/system/objects/DualLaneAssemblyBase.cpp diff --git a/mission/system/DualLaneAssemblyBase.h b/mission/system/objects/DualLaneAssemblyBase.h similarity index 98% rename from mission/system/DualLaneAssemblyBase.h rename to mission/system/objects/DualLaneAssemblyBase.h index 4233d860..7a8c7ac9 100644 --- a/mission/system/DualLaneAssemblyBase.h +++ b/mission/system/objects/DualLaneAssemblyBase.h @@ -2,7 +2,7 @@ #define MISSION_SYSTEM_DUALLANEASSEMBLYBASE_H_ #include -#include +#include /** * @brief Encapsulates assemblies which are also responsible for dual lane power switching diff --git a/mission/system/DualLanePowerStateMachine.cpp b/mission/system/objects/DualLanePowerStateMachine.cpp similarity index 100% rename from mission/system/DualLanePowerStateMachine.cpp rename to mission/system/objects/DualLanePowerStateMachine.cpp diff --git a/mission/system/DualLanePowerStateMachine.h b/mission/system/objects/DualLanePowerStateMachine.h similarity index 91% rename from mission/system/DualLanePowerStateMachine.h rename to mission/system/objects/DualLanePowerStateMachine.h index d2160c64..7a6f29b6 100644 --- a/mission/system/DualLanePowerStateMachine.h +++ b/mission/system/objects/DualLanePowerStateMachine.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include "definitions.h" diff --git a/mission/system/EiveSystem.cpp b/mission/system/objects/EiveSystem.cpp similarity index 100% rename from mission/system/EiveSystem.cpp rename to mission/system/objects/EiveSystem.cpp diff --git a/mission/system/EiveSystem.h b/mission/system/objects/EiveSystem.h similarity index 100% rename from mission/system/EiveSystem.h rename to mission/system/objects/EiveSystem.h diff --git a/mission/system/PayloadSubsystem.cpp b/mission/system/objects/PayloadSubsystem.cpp similarity index 100% rename from mission/system/PayloadSubsystem.cpp rename to mission/system/objects/PayloadSubsystem.cpp diff --git a/mission/system/PayloadSubsystem.h b/mission/system/objects/PayloadSubsystem.h similarity index 100% rename from mission/system/PayloadSubsystem.h rename to mission/system/objects/PayloadSubsystem.h diff --git a/mission/system/PowerStateMachineBase.cpp b/mission/system/objects/PowerStateMachineBase.cpp similarity index 100% rename from mission/system/PowerStateMachineBase.cpp rename to mission/system/objects/PowerStateMachineBase.cpp diff --git a/mission/system/PowerStateMachineBase.h b/mission/system/objects/PowerStateMachineBase.h similarity index 100% rename from mission/system/PowerStateMachineBase.h rename to mission/system/objects/PowerStateMachineBase.h diff --git a/mission/system/RtdFdir.cpp b/mission/system/objects/RtdFdir.cpp similarity index 100% rename from mission/system/RtdFdir.cpp rename to mission/system/objects/RtdFdir.cpp diff --git a/mission/system/RtdFdir.h b/mission/system/objects/RtdFdir.h similarity index 100% rename from mission/system/RtdFdir.h rename to mission/system/objects/RtdFdir.h diff --git a/mission/system/SusAssembly.cpp b/mission/system/objects/SusAssembly.cpp similarity index 100% rename from mission/system/SusAssembly.cpp rename to mission/system/objects/SusAssembly.cpp diff --git a/mission/system/SusAssembly.h b/mission/system/objects/SusAssembly.h similarity index 100% rename from mission/system/SusAssembly.h rename to mission/system/objects/SusAssembly.h diff --git a/mission/system/SusFdir.cpp b/mission/system/objects/SusFdir.cpp similarity index 100% rename from mission/system/SusFdir.cpp rename to mission/system/objects/SusFdir.cpp diff --git a/mission/system/SusFdir.h b/mission/system/objects/SusFdir.h similarity index 100% rename from mission/system/SusFdir.h rename to mission/system/objects/SusFdir.h diff --git a/mission/system/TcsBoardAssembly.cpp b/mission/system/objects/TcsBoardAssembly.cpp similarity index 100% rename from mission/system/TcsBoardAssembly.cpp rename to mission/system/objects/TcsBoardAssembly.cpp diff --git a/mission/system/TcsBoardAssembly.h b/mission/system/objects/TcsBoardAssembly.h similarity index 100% rename from mission/system/TcsBoardAssembly.h rename to mission/system/objects/TcsBoardAssembly.h diff --git a/mission/system/definitions.h b/mission/system/objects/definitions.h similarity index 100% rename from mission/system/definitions.h rename to mission/system/objects/definitions.h diff --git a/mission/system/tree/CMakeLists.txt b/mission/system/tree/CMakeLists.txt new file mode 100644 index 00000000..f88891d4 --- /dev/null +++ b/mission/system/tree/CMakeLists.txt @@ -0,0 +1,3 @@ +target_sources(${LIB_EIVE_MISSION} PRIVATE + acsModeTree.cpp +) diff --git a/bsp_q7s/core/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp similarity index 100% rename from bsp_q7s/core/acsModeTree.cpp rename to mission/system/tree/acsModeTree.cpp diff --git a/bsp_q7s/core/acsModeTree.h b/mission/system/tree/acsModeTree.h similarity index 100% rename from bsp_q7s/core/acsModeTree.h rename to mission/system/tree/acsModeTree.h From f9dd77b8ec2ea608a2ee3960ab158b305de54904 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 10:50:59 +0200 Subject: [PATCH 0024/2058] create and schedule ACS SS --- bsp_q7s/core/InitMission.cpp | 14 +++++++++----- bsp_q7s/core/ObjectFactory.cpp | 4 ++++ mission/system/tree/acsModeTree.cpp | 26 +++++++++++++++++--------- mission/system/tree/acsModeTree.h | 9 +-------- 4 files changed, 31 insertions(+), 22 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index ced1d12a..b2fbb41f 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -114,9 +114,9 @@ void initmission::initTasks() { #endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ #if OBSW_ADD_ACS_HANDLERS == 1 - PeriodicTaskIF* acsTask = factory->createPeriodicTask( - "ACS_CTRL", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); - result = acsTask->addComponent(objects::GPS_CONTROLLER); + PeriodicTaskIF* gpsTask = factory->createPeriodicTask( + "ACS_CTRL", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + result = gpsTask->addComponent(objects::GPS_CONTROLLER); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER); } @@ -124,7 +124,7 @@ void initmission::initTasks() { #endif /* OBSW_ADD_ACS_HANDLERS */ PeriodicTaskIF* sysTask = factory->createPeriodicTask( - "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + "SYS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); result = sysTask->addComponent(objects::ACS_BOARD_ASS); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS); @@ -139,6 +139,10 @@ void initmission::initTasks() { if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS); } + result = sysTask->addComponent(objects::ACS_SUBSYSTEM); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM); + } // FS task, task interval does not matter because it runs in permanent loop, priority low // because it is a non-essential background task @@ -227,7 +231,7 @@ void initmission::initTasks() { #endif /* OBSW_ADD_STAR_TRACKER == 1 */ #if OBSW_ADD_ACS_HANDLERS == 1 - acsTask->startTask(); + gpsTask->startTask(); #endif sysTask->startTask(); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index a675ffc5..19457188 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -42,6 +42,7 @@ #include "mission/system/objects/SusAssembly.h" #include "mission/system/objects/SusFdir.h" #include "mission/system/objects/TcsBoardAssembly.h" +#include "mission/system/tree/acsModeTree.h" #include "tmtc/apid.h" #include "tmtc/pusIds.h" @@ -135,6 +136,7 @@ void ObjectFactory::produce(void* args) { SpiComIF* spiComIF = nullptr; I2cComIF* i2cComIF = nullptr; PowerSwitchIF* pwrSwitcher = nullptr; + createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF, &i2cComIF); createTmpComponents(); new CoreController(objects::CORE_CONTROLLER); @@ -205,6 +207,8 @@ void ObjectFactory::produce(void* args) { new PlocUpdater(objects::PLOC_UPDATER); new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER); + + satsystem::initAcsSubsystem(); } void ObjectFactory::createTmpComponents() { diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index b944caa9..e5748f08 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -8,8 +8,16 @@ #include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" +void checkInsert(ReturnValue_t result, const char* ctx); +void buildOffSequence(Subsystem* ss, ModeListEntry& eh); +void buildDetumbleSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildSafeSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildIdleSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); + // Alias for checker function -const auto CHK = satsystem::checkInsert; +const auto CHK = checkInsert; static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; @@ -65,7 +73,7 @@ auto ACS_TABLE_TARGET_PT_TRANS_0 = auto ACS_TABLE_TARGET_PT_TRANS_1 = std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 3, FixedArrayList()); -void satsystem::acsSubsystemInit() { +void satsystem::initAcsSubsystem() { ModeListEntry entry; Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 12, 24); buildOffSequence(acsSubsystem, entry); @@ -77,7 +85,7 @@ void satsystem::acsSubsystemInit() { acsSubsystem->setInitialMode(HasModesIF::MODE_OFF); } -void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { +void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildOffSequence"; auto ctxc = context.c_str(); // Insert Helper Table @@ -116,7 +124,7 @@ void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { ctxc); } -void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { +void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildSafeSequence"; auto ctxc = context.c_str(); // Insert Helper Table @@ -165,7 +173,7 @@ void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { ctxc); } -void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { +void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildDetumbleSequence"; auto ctxc = context.c_str(); // Insert Helper Table @@ -217,7 +225,7 @@ void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { ctxc); } -void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { +void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildIdleSequence"; auto ctxc = context.c_str(); // Insert Helper Table @@ -264,7 +272,7 @@ void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { false, true); } -void satsystem::buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { +void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildIdleChargeSequence"; auto ctxc = context.c_str(); // Insert Helper Table @@ -318,7 +326,7 @@ void satsystem::buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { ctxc); } -void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { +void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildTargetPtSequence"; auto ctxc = context.c_str(); // Insert Helper Table @@ -373,7 +381,7 @@ void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { ctxc); } -void satsystem::checkInsert(ReturnValue_t result, const char* ctx) { +void checkInsert(ReturnValue_t result, const char* ctx) { if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx << std::endl; } diff --git a/mission/system/tree/acsModeTree.h b/mission/system/tree/acsModeTree.h index b6c96e39..5ad5d7c9 100644 --- a/mission/system/tree/acsModeTree.h +++ b/mission/system/tree/acsModeTree.h @@ -4,13 +4,6 @@ class Subsystem; namespace satsystem { -void acsSubsystemInit(); -void buildOffSequence(Subsystem* ss, ModeListEntry& entryHelper); -void buildDetumbleSequence(Subsystem* ss, ModeListEntry& entryHelper); -void buildSafeSequence(Subsystem* ss, ModeListEntry& entryHelper); -void buildIdleSequence(Subsystem* ss, ModeListEntry& entryHelper); -void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper); -void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); +void initAcsSubsystem(); -void checkInsert(ReturnValue_t result, const char* ctx); } // namespace satsystem From 0697cca88a4881e3c980528251293cb8237fd9ad Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 13:36:11 +0200 Subject: [PATCH 0025/2058] started acs subsystem --- bsp_q7s/core/ObjectFactory.cpp | 4 +- common/config/commonObjects.h | 8 +- generators/fsfwgen | 2 +- mission/system/objects/definitions.h | 6 ++ mission/system/tree/CMakeLists.txt | 2 + mission/system/tree/acsModeTree.cpp | 26 ++++-- mission/system/tree/acsModeTree.h | 4 +- mission/system/tree/payloadModeTree.cpp | 116 ++++++++++++++++++++++++ mission/system/tree/payloadModeTree.h | 12 +++ mission/system/tree/system.cpp | 9 ++ mission/system/tree/system.h | 10 ++ 11 files changed, 183 insertions(+), 16 deletions(-) create mode 100644 mission/system/tree/payloadModeTree.cpp create mode 100644 mission/system/tree/payloadModeTree.h create mode 100644 mission/system/tree/system.cpp create mode 100644 mission/system/tree/system.h diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 19457188..9489dbc3 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -42,7 +42,7 @@ #include "mission/system/objects/SusAssembly.h" #include "mission/system/objects/SusFdir.h" #include "mission/system/objects/TcsBoardAssembly.h" -#include "mission/system/tree/acsModeTree.h" +#include "mission/system/tree/system.h" #include "tmtc/apid.h" #include "tmtc/pusIds.h" @@ -208,7 +208,7 @@ void ObjectFactory::produce(void* args) { new PlocUpdater(objects::PLOC_UPDATER); new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER); - satsystem::initAcsSubsystem(); + satsystem::init(); } void ObjectFactory::createTmpComponents() { diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index 0b27a023..fff9b465 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -38,7 +38,7 @@ enum commonObjects: uint32_t { GYRO_2_ADIS_HANDLER = 0x44120212, GYRO_3_L3G_HANDLER = 0x44120313, PLPCDU_HANDLER = 0x44300000, - + SCEX_HANDLER = 0x44400000, IMTQ_HANDLER = 0x44140014, PLOC_MPSOC_HANDLER = 0x44330015, PLOC_SUPERVISOR_HANDLER = 0x44330016, @@ -99,8 +99,12 @@ enum commonObjects: uint32_t { SUS_BOARD_ASS = 0x73000002, TCS_BOARD_ASS = 0x73000003, RW_ASS = 0x73000004, - ACS_SUBSYSTEM = 0x73010001, + PLOC_SWITCHER = 0x73000005, + CAM_SWITCHER = 0x73000006, EIVE_SYSTEM = 0x73010000, + ACS_SUBSYSTEM = 0x73010001, + PL_SUBSYSTEM = 0x73010002, + PLOC_SUBSYSTEM = 0x73010003, }; } diff --git a/generators/fsfwgen b/generators/fsfwgen index d2bdabbf..2a408e8c 160000 --- a/generators/fsfwgen +++ b/generators/fsfwgen @@ -1 +1 @@ -Subproject commit d2bdabbf0f213747efc18cb45fcf2a2294b14bc8 +Subproject commit 2a408e8c7dd2ebe974b9699fb5aee0889aa86392 diff --git a/mission/system/objects/definitions.h b/mission/system/objects/definitions.h index aee127bb..99868659 100644 --- a/mission/system/objects/definitions.h +++ b/mission/system/objects/definitions.h @@ -16,4 +16,10 @@ enum Submodes : Submode_t { A_SIDE = 0, B_SIDE = 1, DUAL_MODE = 2 }; } // namespace duallane +namespace payload { + +enum Modes { NONE = 0, DAC = 1, CAM = 2, PL_DATA = 3, EARTH_OBSV = 4, SCEX = 5 }; + +} + #endif /* MISSION_SYSTEM_DEFINITIONS_H_ */ diff --git a/mission/system/tree/CMakeLists.txt b/mission/system/tree/CMakeLists.txt index f88891d4..c5bddc3f 100644 --- a/mission/system/tree/CMakeLists.txt +++ b/mission/system/tree/CMakeLists.txt @@ -1,3 +1,5 @@ target_sources(${LIB_EIVE_MISSION} PRIVATE acsModeTree.cpp + payloadModeTree.cpp + system.cpp ) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index e5748f08..3fca1ce0 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -8,6 +8,8 @@ #include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" +// Alias for checker function +namespace { void checkInsert(ReturnValue_t result, const char* ctx); void buildOffSequence(Subsystem* ss, ModeListEntry& eh); void buildDetumbleSequence(Subsystem* ss, ModeListEntry& entryHelper); @@ -15,8 +17,8 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildIdleSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); +} // namespace -// Alias for checker function const auto CHK = checkInsert; static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; @@ -73,7 +75,7 @@ auto ACS_TABLE_TARGET_PT_TRANS_0 = auto ACS_TABLE_TARGET_PT_TRANS_1 = std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 3, FixedArrayList()); -void satsystem::initAcsSubsystem() { +void satsystem::acs::init() { ModeListEntry entry; Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 12, 24); buildOffSequence(acsSubsystem, entry); @@ -82,11 +84,13 @@ void satsystem::initAcsSubsystem() { buildIdleSequence(acsSubsystem, entry); buildIdleChargeSequence(acsSubsystem, entry); buildTargetPtSequence(acsSubsystem, entry); - acsSubsystem->setInitialMode(HasModesIF::MODE_OFF); + acsSubsystem->setInitialMode(OFF); } +namespace { + void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { - std::string context = "satsystem::buildOffSequence"; + std::string context = "satsystem::acs::buildOffSequence"; auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList& table) { @@ -125,7 +129,7 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { } void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { - std::string context = "satsystem::buildSafeSequence"; + std::string context = "satsystem::acs::buildSafeSequence"; auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, @@ -174,7 +178,7 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { } void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { - std::string context = "satsystem::buildDetumbleSequence"; + std::string context = "satsystem::acs::buildDetumbleSequence"; auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, @@ -226,7 +230,7 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { } void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { - std::string context = "satsystem::buildIdleSequence"; + std::string context = "satsystem::acs::buildIdleSequence"; auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, @@ -273,7 +277,7 @@ void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { } void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { - std::string context = "satsystem::buildIdleChargeSequence"; + std::string context = "satsystem::acs::buildIdleChargeSequence"; auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, @@ -327,7 +331,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { } void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { - std::string context = "satsystem::buildTargetPtSequence"; + std::string context = "satsystem::acs::buildTargetPtSequence"; auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, @@ -383,6 +387,8 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { void checkInsert(ReturnValue_t result, const char* ctx) { if (result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx << std::endl; + sif::warning << "Insertion failed at " << ctx << std::endl; } } + +} // namespace diff --git a/mission/system/tree/acsModeTree.h b/mission/system/tree/acsModeTree.h index 5ad5d7c9..3492ee9e 100644 --- a/mission/system/tree/acsModeTree.h +++ b/mission/system/tree/acsModeTree.h @@ -3,7 +3,9 @@ class Subsystem; namespace satsystem { +namespace acs { -void initAcsSubsystem(); +void init(); +} } // namespace satsystem diff --git a/mission/system/tree/payloadModeTree.cpp b/mission/system/tree/payloadModeTree.cpp new file mode 100644 index 00000000..8d5ff876 --- /dev/null +++ b/mission/system/tree/payloadModeTree.cpp @@ -0,0 +1,116 @@ +#include "payloadModeTree.h" + +#include +#include +#include +#include +#include + +#include "mission/system/objects/PayloadSubsystem.h" + +namespace { +void checkInsert(ReturnValue_t result, const char* ctx); +void initOffSequence(Subsystem* ss, ModeListEntry& eh); +void initPlDacSequence(Subsystem* ss, ModeListEntry& eh); +void initPlCamSequence(Subsystem* ss, ModeListEntry& eh); +void initPlDataSequence(Subsystem* ss, ModeListEntry& eh); +void initEarthObsvSequence(Subsystem* ss, ModeListEntry& eh); +void initScexSequence(Subsystem* ss, ModeListEntry& eh); +} // namespace + +const auto CHK = checkInsert; +static const auto OFF = HasModesIF::MODE_OFF; +// static const auto NML = DeviceHandlerIF::MODE_NORMAL; + +auto PL_SEQUENCE_OFF = std::make_pair(OFF << 24, FixedArrayList()); +auto PL_TABLE_OFF_TGT = std::make_pair((OFF << 24) | 1, FixedArrayList()); +auto PL_TABLE_OFF_TRANS = std::make_pair((OFF << 24) | 2, FixedArrayList()); + +void satsystem::pl::init() { + ModeListEntry entry; + Subsystem* plSubsystem = new Subsystem(objects::PL_SUBSYSTEM, objects::EIVE_SYSTEM, 12, 24); + initOffSequence(plSubsystem, entry); + initPlDacSequence(plSubsystem, entry); + initPlCamSequence(plSubsystem, entry); + initPlDataSequence(plSubsystem, entry); + initEarthObsvSequence(plSubsystem, entry); + initScexSequence(plSubsystem, entry); + plSubsystem->setInitialMode(OFF); +} + +namespace { + +void initOffSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::payload::buildOffSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; + + // Build OFF target. Is empty + ss->addTable(&PL_TABLE_OFF_TGT.second, PL_TABLE_OFF_TGT.first, false, true); + + // Build OFF transition 0 + iht(objects::PLOC_SWITCHER, OFF, 0, PL_TABLE_OFF_TRANS.second); + iht(objects::CAM_SWITCHER, OFF, 0, PL_TABLE_OFF_TRANS.second); + iht(objects::SCEX_HANDLER, OFF, 0, PL_TABLE_OFF_TRANS.second); + iht(objects::PLPCDU_HANDLER, OFF, 0, PL_TABLE_OFF_TRANS.second); + iht(objects::PLOC_SUBSYSTEM, OFF, 0, PL_TABLE_OFF_TRANS.second); + ss->addTable(&PL_TABLE_OFF_TRANS.second, PL_TABLE_OFF_TRANS.first, false, true); + + // Build OFF sequence + ihs(PL_SEQUENCE_OFF.second, PL_TABLE_OFF_TGT.first, 0, false); + ihs(PL_SEQUENCE_OFF.second, PL_TABLE_OFF_TRANS.first, 0, false); + ss->addSequence(&PL_SEQUENCE_OFF.second, PL_SEQUENCE_OFF.first, PL_SEQUENCE_OFF.first, false, + true); +} + +void initPlDacSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::payload::initPlDacSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; +} + +void initPlCamSequence(Subsystem* ss, ModeListEntry& eh) {} + +void initPlDataSequence(Subsystem* ss, ModeListEntry& eh) {} + +void initEarthObsvSequence(Subsystem* ss, ModeListEntry& eh) {} + +void initScexSequence(Subsystem* ss, ModeListEntry& eh) {} + +void checkInsert(ReturnValue_t result, const char* ctx) { + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "satsystem::checkInsert: PL | Insertion failed at " << ctx << std::endl; + } +} + +} // namespace diff --git a/mission/system/tree/payloadModeTree.h b/mission/system/tree/payloadModeTree.h new file mode 100644 index 00000000..738eb01c --- /dev/null +++ b/mission/system/tree/payloadModeTree.h @@ -0,0 +1,12 @@ +#ifndef MISSION_SYSTEM_TREE_PAYLOADMODETREE_H_ +#define MISSION_SYSTEM_TREE_PAYLOADMODETREE_H_ + +namespace satsystem { + +namespace pl { +void init(); +} + +} // namespace satsystem + +#endif /* MISSION_SYSTEM_TREE_PAYLOADMODETREE_H_ */ diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp new file mode 100644 index 00000000..4455588f --- /dev/null +++ b/mission/system/tree/system.cpp @@ -0,0 +1,9 @@ +#include "system.h" + +#include "acsModeTree.h" +#include "payloadModeTree.h" + +void satsystem::init() { + acs::init(); + pl::init(); +} diff --git a/mission/system/tree/system.h b/mission/system/tree/system.h new file mode 100644 index 00000000..a8599121 --- /dev/null +++ b/mission/system/tree/system.h @@ -0,0 +1,10 @@ +#ifndef MISSION_SYSTEM_TREE_SYSTEM_H_ +#define MISSION_SYSTEM_TREE_SYSTEM_H_ + +namespace satsystem { + +void init(); + +} + +#endif /* MISSION_SYSTEM_TREE_SYSTEM_H_ */ From f5723dc1816263d2a28cf8257afeb670c63ffd49 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 18:44:38 +0200 Subject: [PATCH 0026/2058] continued pl ss --- .../payloadPcduDefinitions.h | 3 + mission/system/objects/definitions.h | 8 +- mission/system/tree/payloadModeTree.cpp | 157 ++++++++++++++++-- 3 files changed, 156 insertions(+), 12 deletions(-) diff --git a/mission/devices/devicedefinitions/payloadPcduDefinitions.h b/mission/devices/devicedefinitions/payloadPcduDefinitions.h index ab387fc7..6ad31d3f 100644 --- a/mission/devices/devicedefinitions/payloadPcduDefinitions.h +++ b/mission/devices/devicedefinitions/payloadPcduDefinitions.h @@ -101,6 +101,9 @@ enum NormalSubmodeBits { }; static constexpr Submode_t ALL_OFF_SUBMODE = 0; +static constexpr Submode_t ALL_ON_SUBMODE = (1 << HPA_ON) | (1 << MPA_ON) | (1 << TX_ON) | + (1 << X8_ON) | (1 << DRO_ON) | + (1 << SOLID_STATE_RELAYS_ADC_ON); // 12 ADC values * 2 + trailing zero static constexpr size_t ADC_REPLY_SIZE = 25; diff --git a/mission/system/objects/definitions.h b/mission/system/objects/definitions.h index 99868659..99fc5eb6 100644 --- a/mission/system/objects/definitions.h +++ b/mission/system/objects/definitions.h @@ -18,8 +18,14 @@ enum Submodes : Submode_t { A_SIDE = 0, B_SIDE = 1, DUAL_MODE = 2 }; namespace payload { -enum Modes { NONE = 0, DAC = 1, CAM = 2, PL_DATA = 3, EARTH_OBSV = 4, SCEX = 5 }; +enum Modes { NONE = 0, SUPV_ONLY = 1, MPSOC_STREAM = 2, CAM_STREAM = 3, EARTH_OBSV = 4, SCEX = 5 }; + +namespace ploc { + +enum Modes { OFF = 0, SUPV_ONLY = 1, MPSOC_ON = 2 }; } +} // namespace payload + #endif /* MISSION_SYSTEM_DEFINITIONS_H_ */ diff --git a/mission/system/tree/payloadModeTree.cpp b/mission/system/tree/payloadModeTree.cpp index 8d5ff876..2ce4678a 100644 --- a/mission/system/tree/payloadModeTree.cpp +++ b/mission/system/tree/payloadModeTree.cpp @@ -6,33 +6,63 @@ #include #include +#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" #include "mission/system/objects/PayloadSubsystem.h" +#include "mission/system/objects/definitions.h" namespace { void checkInsert(ReturnValue_t result, const char* ctx); void initOffSequence(Subsystem* ss, ModeListEntry& eh); -void initPlDacSequence(Subsystem* ss, ModeListEntry& eh); -void initPlCamSequence(Subsystem* ss, ModeListEntry& eh); -void initPlDataSequence(Subsystem* ss, ModeListEntry& eh); +void initPlMpsocStreamSequence(Subsystem* ss, ModeListEntry& eh); +void initPlCamStreamSequence(Subsystem* ss, ModeListEntry& eh); +void initPlSpvSequence(Subsystem* ss, ModeListEntry& eh); void initEarthObsvSequence(Subsystem* ss, ModeListEntry& eh); void initScexSequence(Subsystem* ss, ModeListEntry& eh); } // namespace const auto CHK = checkInsert; static const auto OFF = HasModesIF::MODE_OFF; -// static const auto NML = DeviceHandlerIF::MODE_NORMAL; +static const auto ON = HasModesIF::MODE_ON; +static const auto NML = DeviceHandlerIF::MODE_NORMAL; auto PL_SEQUENCE_OFF = std::make_pair(OFF << 24, FixedArrayList()); auto PL_TABLE_OFF_TGT = std::make_pair((OFF << 24) | 1, FixedArrayList()); auto PL_TABLE_OFF_TRANS = std::make_pair((OFF << 24) | 2, FixedArrayList()); +auto PL_SEQUENCE_MPSOC_STREAM = + std::make_pair(payload::Modes::MPSOC_STREAM << 24, FixedArrayList()); +auto PL_TABLE_MPSOC_STREAM_TGT = + std::make_pair((payload::Modes::MPSOC_STREAM << 24) | 1, FixedArrayList()); +auto PL_TABLE_MPSOC_STREAM_TRANS_0 = + std::make_pair((payload::Modes::MPSOC_STREAM << 24) | 2, FixedArrayList()); +auto PL_TABLE_MPSOC_STREAM_TRANS_1 = + std::make_pair((payload::Modes::MPSOC_STREAM << 24) | 2, FixedArrayList()); + +auto PL_SEQUENCE_CAM_STREAM = + std::make_pair(payload::Modes::CAM_STREAM << 24, FixedArrayList()); +auto PL_TABLE_CAM_STREAM_TGT = + std::make_pair((payload::Modes::CAM_STREAM << 24) | 1, FixedArrayList()); +auto PL_TABLE_CAM_STREAM_TRANS_0 = + std::make_pair((payload::Modes::CAM_STREAM << 24) | 2, FixedArrayList()); +auto PL_TABLE_CAM_STREAM_TRANS_1 = + std::make_pair((payload::Modes::CAM_STREAM << 24) | 2, FixedArrayList()); + +auto PL_SEQUENCE_SUPV_ONLY = + std::make_pair(payload::Modes::CAM_STREAM << 24, FixedArrayList()); +auto PL_TABLE_SUPV_ONLY_TGT = + std::make_pair((payload::Modes::CAM_STREAM << 24) | 1, FixedArrayList()); +auto PL_TABLE_SUPV_ONLY_TRANS_0 = + std::make_pair((payload::Modes::CAM_STREAM << 24) | 2, FixedArrayList()); +auto PL_TABLE_SUPV_ONLY_TRANS_1 = + std::make_pair((payload::Modes::CAM_STREAM << 24) | 2, FixedArrayList()); + void satsystem::pl::init() { ModeListEntry entry; Subsystem* plSubsystem = new Subsystem(objects::PL_SUBSYSTEM, objects::EIVE_SYSTEM, 12, 24); initOffSequence(plSubsystem, entry); - initPlDacSequence(plSubsystem, entry); - initPlCamSequence(plSubsystem, entry); - initPlDataSequence(plSubsystem, entry); + initPlMpsocStreamSequence(plSubsystem, entry); + initPlCamStreamSequence(plSubsystem, entry); + initPlSpvSequence(plSubsystem, entry); initEarthObsvSequence(plSubsystem, entry); initScexSequence(plSubsystem, entry); plSubsystem->setInitialMode(OFF); @@ -78,8 +108,8 @@ void initOffSequence(Subsystem* ss, ModeListEntry& eh) { true); } -void initPlDacSequence(Subsystem* ss, ModeListEntry& eh) { - std::string context = "satsystem::payload::initPlDacSequence"; +void initPlMpsocStreamSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::payload::initPlMpsocStreamSequence"; auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, @@ -97,11 +127,116 @@ void initPlDacSequence(Subsystem* ss, ModeListEntry& eh) { eh.setCheckSuccess(checkSuccess); CHK(sequence.insert(eh), ctxc); }; + + // Build MPSoC stream target + // Camera should always be off to prevent a conflict with the MPSoC streaming + iht(objects::PLPCDU_HANDLER, NML, plpcdu::ALL_ON_SUBMODE, PL_TABLE_MPSOC_STREAM_TGT.second); + iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_MPSOC_STREAM_TGT.second); + iht(objects::CAM_SWITCHER, OFF, 0, PL_TABLE_MPSOC_STREAM_TGT.second); + iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::MPSOC_ON, PL_TABLE_MPSOC_STREAM_TGT.second); + ss->addTable(&PL_TABLE_MPSOC_STREAM_TGT.second, PL_TABLE_MPSOC_STREAM_TGT.first, false, true); + + // Build MPSoC stream transition 0 + iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); + iht(objects::CAM_SWITCHER, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); + iht(objects::SCEX_HANDLER, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); + ss->addTable(&PL_TABLE_MPSOC_STREAM_TRANS_0.second, PL_TABLE_MPSOC_STREAM_TRANS_0.first, false, + true); + + // Build MPSoC stream transition 1 + iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::MPSOC_ON, PL_TABLE_MPSOC_STREAM_TRANS_1.second); + ss->addTable(&PL_TABLE_MPSOC_STREAM_TRANS_1.second, PL_TABLE_MPSOC_STREAM_TRANS_1.first, false, + true); + + // Build MPSoC stream sequence + ihs(PL_SEQUENCE_MPSOC_STREAM.second, PL_TABLE_MPSOC_STREAM_TGT.first, 0, true); + ihs(PL_SEQUENCE_MPSOC_STREAM.second, PL_TABLE_MPSOC_STREAM_TRANS_0.first, 0, true); + ihs(PL_SEQUENCE_MPSOC_STREAM.second, PL_TABLE_MPSOC_STREAM_TRANS_1.first, 0, false); + ss->addSequence(&PL_SEQUENCE_MPSOC_STREAM.second, PL_SEQUENCE_MPSOC_STREAM.first, + PL_SEQUENCE_OFF.first, false, true); } -void initPlCamSequence(Subsystem* ss, ModeListEntry& eh) {} +void initPlCamStreamSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::payload::initPlCamSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; -void initPlDataSequence(Subsystem* ss, ModeListEntry& eh) {} + // Build CAM target + // Only check that the PL PCDU is on for now. It might later become necessary to switch on + // the PLOC, so we ignore its state. + iht(objects::PLPCDU_HANDLER, NML, plpcdu::ALL_ON_SUBMODE, PL_TABLE_CAM_STREAM_TGT.second); + ss->addTable(&PL_TABLE_CAM_STREAM_TGT.second, PL_TABLE_CAM_STREAM_TGT.first, false, true); + + // Build CAM transition 0 + // PLOC is actively commanded off here + iht(objects::PLOC_SUBSYSTEM, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); + iht(objects::CAM_SWITCHER, ON, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); + iht(objects::SCEX_HANDLER, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); + ss->addTable(&PL_TABLE_MPSOC_STREAM_TRANS_0.second, PL_TABLE_MPSOC_STREAM_TRANS_0.first, false, + true); + + // Build CAM transition 1 + iht(objects::PLOC_SWITCHER, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_1.second); + ss->addTable(&PL_TABLE_MPSOC_STREAM_TRANS_1.second, PL_TABLE_MPSOC_STREAM_TRANS_1.first, false, + true); + + // Build CAM stream sequence + ihs(PL_SEQUENCE_CAM_STREAM.second, PL_TABLE_CAM_STREAM_TGT.first, 0, true); + ihs(PL_SEQUENCE_CAM_STREAM.second, PL_TABLE_CAM_STREAM_TRANS_0.first, 0, true); + ihs(PL_SEQUENCE_CAM_STREAM.second, PL_TABLE_CAM_STREAM_TRANS_1.first, 0, false); + ss->addSequence(&PL_SEQUENCE_CAM_STREAM.second, PL_SEQUENCE_CAM_STREAM.first, + PL_SEQUENCE_OFF.first, false, true); +} + +void initPlSpvSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::payload::initPlSupvSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; + + // Build Payload Supervisor Only target + iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_SUPV_ONLY_TGT.second); + iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::SUPV_ONLY, PL_TABLE_SUPV_ONLY_TGT.second); + ss->addTable(&PL_TABLE_SUPV_ONLY_TGT.second, PL_TABLE_SUPV_ONLY_TGT.first, false, true); + + // Build Payload Supervisor Only transition 0 + iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_SUPV_ONLY_TRANS_0.second); + ss->addTable(&PL_TABLE_SUPV_ONLY_TRANS_0.second, PL_TABLE_SUPV_ONLY_TRANS_0.first, inStore, + preInit) + + // Build Payload Supervisor Only transition 1 + iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::SUPV_ONLY, + PL_TABLE_SUPV_ONLY_TRANS_1.second); +} void initEarthObsvSequence(Subsystem* ss, ModeListEntry& eh) {} From e2f0c0f1be3885abec108d34f0333fd786109db0 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Tue, 26 Apr 2022 13:22:56 +0200 Subject: [PATCH 0027/2058] fram rec --- linux/boardtest/UartTestClass.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index b4a23c6c..12404269 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -25,7 +25,7 @@ UartTestClass::UartTestClass(object_id_t objectId, ScexUartReader* reader) : TestTask(objectId), reader(reader) { mode = TestModes::SCEX; scexMode = ScexModes::READER_TASK; - currCmd = scex::ScexCmds::PING; + currCmd = scex::ScexCmds::FRAM; if (scexMode == ScexModes::SIMPLE) { auto encodingBuf = new std::array; DleParser::BufPair encodingBufPair{encodingBuf->data(), encodingBuf->size()}; @@ -178,7 +178,7 @@ void UartTestClass::scexPeriodic() { } else { if (not cmdSent) { size_t len = 0; - prepareScexCmd(scex::ScexCmds::PING, false, cmdBuf.data(), &len); + prepareScexCmd(currCmd, false, cmdBuf.data(), &len); reader->sendMessage(uartCookie, cmdBuf.data(), len); cmdSent = true; cmdDone = false; @@ -199,21 +199,24 @@ void UartTestClass::scexPeriodic() { //ping //if ping cmd + if(helper.getCmd() == PING) { ofstream out("/tmp/scex-ping.bin", ofstream::binary ); if (out.bad()) { sif::warning << "bad" < //countdown (max 2min), wenn nicht if (helper.getPacketCounter() == helper.getTotalPacketCounter()) { nach 2min reader->finish(); if(helper.getCmd() == FRAM) { if(helper.getPacketCounter() == 0) { - // neues file anlegen wie oben ping + ofstream out("/tmp/scex-fram.bin", ofstream::binary ); // neues file anlegen wie oben ping } else { - // an bestehendes file hinzufügen + ofstream out("/tmp/scex-fram.bin", ofstream::binary | ofstream::app );// an bestehendes file hinzufügen + out << helper; } } - out << helper; if (helper.getPacketCounter() == helper.getTotalPacketCounter()) { reader->finish(); @@ -326,7 +329,7 @@ void UartTestClass::scexSimplePeriodic() { int UartTestClass::prepareScexCmd(scex::ScexCmds cmd, bool tempCheck, uint8_t* cmdBuf, size_t* len) { using namespace scex; - // Send ping command + // Send command cmdBuf[0] = scex::createCmdByte(cmd, false); // These two fields are the packet counter and the total packet count. Those are 1 and 1 for each // telecommand so far From c5683afe9f892a838bc4654ddc64130ca9177736 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Wed, 27 Apr 2022 16:46:11 +0200 Subject: [PATCH 0028/2058] fram --- linux/devices/ScexUartReader.cpp | 2 +- linux/devices/ScexUartReader.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linux/devices/ScexUartReader.cpp b/linux/devices/ScexUartReader.cpp index e0868b48..cfac79e4 100644 --- a/linux/devices/ScexUartReader.cpp +++ b/linux/devices/ScexUartReader.cpp @@ -51,7 +51,7 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) { << ", " << strerror(errno) << "]" << std::endl; break; } else if (bytesRead >= static_cast(recBuf.size())) { - sif::error << "ScexUartReader::performOperation: Receive buffer too small" << std::endl; + sif::error << "ScexUartReader::performOperation: Receive buffer too small for " << bytesRead << " bytes" << std::endl; } else if (bytesRead > 0) { ReturnValue_t result = dleParser.passData(recBuf.data(), bytesRead); if (debugMode) { diff --git a/linux/devices/ScexUartReader.h b/linux/devices/ScexUartReader.h index ad760b39..4cebb31e 100644 --- a/linux/devices/ScexUartReader.h +++ b/linux/devices/ScexUartReader.h @@ -37,9 +37,9 @@ class ScexUartReader : public SystemObject, // strg+shift+n DleEncoder dleEncoder = DleEncoder(); SimpleRingBuffer decodeRingBuf; - Countdown finishCoutdown = Countdown(180 * 1000); + Countdown finishCountdown = Countdown(180 * 1000); std::array cmdbuf = {}; - std::array recBuf = {}; + std::array recBuf = {}; std::array encodedBuf = {}; std::array decodedBuf = {}; std::array ipcBuffer = {}; From e11c84a5ed09f20a8ba75cd2663f515f48c414bb Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Wed, 27 Apr 2022 18:21:32 +0200 Subject: [PATCH 0029/2058] update --- linux/boardtest/UartTestClass.cpp | 63 +++++++++++++++++++------------ linux/boardtest/UartTestClass.h | 4 +- linux/devices/ScexHelper.cpp | 2 +- linux/devices/ScexUartReader.cpp | 11 +++--- linux/devices/ScexUartReader.h | 1 - 5 files changed, 47 insertions(+), 34 deletions(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 12404269..27e8d02e 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -156,7 +156,7 @@ void UartTestClass::scexInit() { std::string devname = "/dev/ul-scex"; #endif uartCookie = new UartCookie(this->getObjectId(), devname, UartBaudRate::RATE_57600, 4096); - reader->setDebugMode(true); + reader->setDebugMode(false); ReturnValue_t result = reader->initializeInterface(uartCookie); if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "UartTestClass::gpsPeriodic: Initializing SCEX reader " @@ -186,9 +186,11 @@ void UartTestClass::scexPeriodic() { if (cmdSent and not cmdDone) { uint8_t* decodedPacket = nullptr; size_t len = 0; - ReturnValue_t result = reader->readReceivedMessage(uartCookie, &decodedPacket, &len); - - if (len > 0) { + do { + ReturnValue_t result = reader->readReceivedMessage(uartCookie, &decodedPacket, &len); + if(len == 0){ + break; + } ScexHelper helper; const uint8_t* helperPtr = decodedPacket; result = helper.deSerialize(&helperPtr, &len); @@ -197,25 +199,35 @@ void UartTestClass::scexPeriodic() { } sif::info << helper << endl; - //ping - //if ping cmd - if(helper.getCmd() == PING) { - ofstream out("/tmp/scex-ping.bin", ofstream::binary ); - if (out.bad()) { - sif::warning << "bad" < - //countdown (max 2min), wenn nicht if (helper.getPacketCounter() == helper.getTotalPacketCounter()) { nach 2min reader->finish(); - if(helper.getCmd() == FRAM) { - if(helper.getPacketCounter() == 0) { - ofstream out("/tmp/scex-fram.bin", ofstream::binary ); // neues file anlegen wie oben ping - } else { - ofstream out("/tmp/scex-fram.bin", ofstream::binary | ofstream::app );// an bestehendes file hinzufügen - out << helper; - } + // fram + // packetcounter eins höher, wenn mehr packet verloren -> merkt sich welches packet fehlt + //was wenn erstes packet fehlt; mit boolean var (firstpacketarrived=false) die immer mit finish false wird? + // countdown (max 2min), wenn nicht if (helper.getPacketCounter() == + // helper.getTotalPacketCounter()) { nach 2min reader->finish(); + if (helper.getCmd() == FRAM) { + if (helper.getPacketCounter() == 1) { + //countdown starten + finishCountdown.resetTimer(); + ofstream out("/tmp/scex-fram.bin", + ofstream::binary); // neues file anlegen wie oben ping + } else { + ofstream out("/tmp/scex-fram.bin", + ofstream::binary | ofstream::app); // an bestehendes file hinzufügen + out << helper; + } + + if(finishCountdown.hasTimedOut()){ + reader->finish(); + } } if (helper.getPacketCounter() == helper.getTotalPacketCounter()) { @@ -226,7 +238,7 @@ void UartTestClass::scexPeriodic() { cmdSent = false; } } - } + } while (len > 0); } } } @@ -313,8 +325,9 @@ void UartTestClass::scexSimplePeriodic() { << errno << ", " << strerror(errno) << "]" << std::endl; break; } else if (bytesRead >= static_cast(recBuf.size())) { - sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough" - << std::endl; + sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large " + "enough, bytes read:" + << bytesRead << std::endl; } else if (bytesRead > 0) { dleParser->passData(recBuf.data(), bytesRead); if (currCmd == ScexCmds::PING) { diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index 0a228782..28a8b8a7 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include // Contains POSIX terminal control definitions @@ -46,6 +47,7 @@ class UartTestClass : public TestTask { static void foundDlePacketHandler(const DleParser::Context& ctx); void handleFoundDlePacket(uint8_t* packet, size_t len); + Countdown finishCountdown = Countdown(180 * 1000); bool cmdSent = false; bool cmdDone = false; scex::ScexCmds currCmd = scex::ScexCmds::PING; @@ -59,7 +61,7 @@ class UartTestClass : public TestTask { bool startFound = false; ScexUartReader* reader = nullptr; std::array cmdBuf = {}; - std::array recBuf = {}; + std::array recBuf = {}; ScexDleParser* dleParser; scex::ScexCmds cmdHelper; uint8_t recvCnt = 0; diff --git a/linux/devices/ScexHelper.cpp b/linux/devices/ScexHelper.cpp index bc7ee04f..ca29ff65 100644 --- a/linux/devices/ScexHelper.cpp +++ b/linux/devices/ScexHelper.cpp @@ -71,7 +71,7 @@ std::ostream& operator<<(std::ostream& os, const ScexHelper& h) { sif::info << "PacketCounter: " << h.packetCounter << endl; sif::info << "TotalPacketCount: " << h.totalPacketCounter << endl; sif::info << "PayloadLength: " << h.payloadLen << endl; - sif::info << "TotalPacketLength: " << h.totalPacketLen << endl; + sif::info << "TotalPacketLength: " << h.totalPacketLen; return os; } diff --git a/linux/devices/ScexUartReader.cpp b/linux/devices/ScexUartReader.cpp index cfac79e4..517ee4a1 100644 --- a/linux/devices/ScexUartReader.cpp +++ b/linux/devices/ScexUartReader.cpp @@ -45,13 +45,14 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) { state = States::IDLE; break; } - TaskFactory::delayTask(1000); + TaskFactory::delayTask(400); } else if (bytesRead < 0) { sif::warning << "ScexUartReader::performOperation: read call failed with error [" << errno << ", " << strerror(errno) << "]" << std::endl; break; } else if (bytesRead >= static_cast(recBuf.size())) { - sif::error << "ScexUartReader::performOperation: Receive buffer too small for " << bytesRead << " bytes" << std::endl; + sif::error << "ScexUartReader::performOperation: Receive buffer too small for " << bytesRead + << " bytes" << std::endl; } else if (bytesRead > 0) { ReturnValue_t result = dleParser.passData(recBuf.data(), bytesRead); if (debugMode) { @@ -76,7 +77,6 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) { return RETURN_FAILED; } std::string devname = uartCookie->getDeviceFile(); - sif::info << devname << std::endl; /* Get file descriptor */ serialPort = open(devname.c_str(), O_RDWR); if (serialPort < 0) { @@ -171,7 +171,7 @@ void ScexUartReader::foundDlePacketHandler(const DleParser::Context &ctx) { void ScexUartReader::handleFoundDlePacket(uint8_t *packet, size_t len) { // TODO: insert data into IPC ring buffer here - sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; + // sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; MutexGuard mg(lock); ReturnValue_t result = ipcQueue.insert(len); if (result != RETURN_OK) { @@ -181,7 +181,7 @@ void ScexUartReader::handleFoundDlePacket(uint8_t *packet, size_t len) { if (result != RETURN_OK) { sif::warning << "IPCRingBuf error" << std::endl; } - sif::info << "DLE handler done" << std::endl; + // sif::info << "DLE handler done" << std::endl; } ReturnValue_t ScexUartReader::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, @@ -191,7 +191,6 @@ ReturnValue_t ScexUartReader::readReceivedMessage(CookieIF *cookie, uint8_t **bu *size = 0; return RETURN_OK; } - sif::info << "returning data" << std::endl; ipcQueue.retrieve(size); *buffer = ipcBuffer.data(); ReturnValue_t result = ipcRingBuf.readData(ipcBuffer.data(), *size, true); diff --git a/linux/devices/ScexUartReader.h b/linux/devices/ScexUartReader.h index 4cebb31e..4abbfd86 100644 --- a/linux/devices/ScexUartReader.h +++ b/linux/devices/ScexUartReader.h @@ -37,7 +37,6 @@ class ScexUartReader : public SystemObject, // strg+shift+n DleEncoder dleEncoder = DleEncoder(); SimpleRingBuffer decodeRingBuf; - Countdown finishCountdown = Countdown(180 * 1000); std::array cmdbuf = {}; std::array recBuf = {}; std::array encodedBuf = {}; From b4a54804dfbbefbeea06028f50a391bcaf78a164 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 13:07:28 +0200 Subject: [PATCH 0030/2058] submodule update --- generators/fsfwgen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/fsfwgen b/generators/fsfwgen index d2bdabbf..2a408e8c 160000 --- a/generators/fsfwgen +++ b/generators/fsfwgen @@ -1 +1 @@ -Subproject commit d2bdabbf0f213747efc18cb45fcf2a2294b14bc8 +Subproject commit 2a408e8c7dd2ebe974b9699fb5aee0889aa86392 From 40b84b0576cd3fac16a2788ac17a70254fd20392 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 13:08:19 +0200 Subject: [PATCH 0031/2058] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ef8a06..e1b7d3cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ list yields a list of all related PRs for each release. # [v1.11.0] +## Added + +- ACS Subsystem + ## Changed - Update rootfs base of Linux, all related OBSW changes From c1fe7563d2b50945831be6827a4eb7dbead614d6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 15:05:38 +0200 Subject: [PATCH 0032/2058] finished first rudimentary pl ss --- fsfw | 2 +- mission/system/tree/payloadModeTree.cpp | 129 +++++++++++++++++++++--- 2 files changed, 114 insertions(+), 17 deletions(-) diff --git a/fsfw b/fsfw index d61fe7db..1c4ea6dd 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit d61fe7db93b37dd6652dbfee5b7c93f400ac5a11 +Subproject commit 1c4ea6dd0dbc6e93086c28d8e0ce3bed5be0c73c diff --git a/mission/system/tree/payloadModeTree.cpp b/mission/system/tree/payloadModeTree.cpp index 2ce4678a..ad65230f 100644 --- a/mission/system/tree/payloadModeTree.cpp +++ b/mission/system/tree/payloadModeTree.cpp @@ -36,25 +36,41 @@ auto PL_TABLE_MPSOC_STREAM_TGT = auto PL_TABLE_MPSOC_STREAM_TRANS_0 = std::make_pair((payload::Modes::MPSOC_STREAM << 24) | 2, FixedArrayList()); auto PL_TABLE_MPSOC_STREAM_TRANS_1 = - std::make_pair((payload::Modes::MPSOC_STREAM << 24) | 2, FixedArrayList()); + std::make_pair((payload::Modes::MPSOC_STREAM << 24) | 3, FixedArrayList()); auto PL_SEQUENCE_CAM_STREAM = std::make_pair(payload::Modes::CAM_STREAM << 24, FixedArrayList()); auto PL_TABLE_CAM_STREAM_TGT = - std::make_pair((payload::Modes::CAM_STREAM << 24) | 1, FixedArrayList()); + std::make_pair((payload::Modes::CAM_STREAM << 24) | 1, FixedArrayList()); auto PL_TABLE_CAM_STREAM_TRANS_0 = - std::make_pair((payload::Modes::CAM_STREAM << 24) | 2, FixedArrayList()); -auto PL_TABLE_CAM_STREAM_TRANS_1 = std::make_pair((payload::Modes::CAM_STREAM << 24) | 2, FixedArrayList()); +auto PL_TABLE_CAM_STREAM_TRANS_1 = + std::make_pair((payload::Modes::CAM_STREAM << 24) | 3, FixedArrayList()); auto PL_SEQUENCE_SUPV_ONLY = - std::make_pair(payload::Modes::CAM_STREAM << 24, FixedArrayList()); + std::make_pair(payload::Modes::SUPV_ONLY << 24, FixedArrayList()); auto PL_TABLE_SUPV_ONLY_TGT = - std::make_pair((payload::Modes::CAM_STREAM << 24) | 1, FixedArrayList()); + std::make_pair((payload::Modes::SUPV_ONLY << 24) | 1, FixedArrayList()); auto PL_TABLE_SUPV_ONLY_TRANS_0 = - std::make_pair((payload::Modes::CAM_STREAM << 24) | 2, FixedArrayList()); + std::make_pair((payload::Modes::SUPV_ONLY << 24) | 2, FixedArrayList()); auto PL_TABLE_SUPV_ONLY_TRANS_1 = - std::make_pair((payload::Modes::CAM_STREAM << 24) | 2, FixedArrayList()); + std::make_pair((payload::Modes::SUPV_ONLY << 24) | 3, FixedArrayList()); + +auto PL_SEQUENCE_EARTH_OBSV = + std::make_pair(payload::Modes::EARTH_OBSV << 24, FixedArrayList()); +auto PL_TABLE_EARTH_OBSV_TGT = + std::make_pair((payload::Modes::EARTH_OBSV << 24) | 1, FixedArrayList()); +auto PL_TABLE_EARTH_OBSV_TRANS_0 = + std::make_pair((payload::Modes::EARTH_OBSV << 24) | 2, FixedArrayList()); +auto PL_TABLE_EARTH_OBSV_TRANS_1 = + std::make_pair((payload::Modes::EARTH_OBSV << 24) | 3, FixedArrayList()); + +auto PL_SEQUENCE_SCEX = + std::make_pair(payload::Modes::SCEX << 24, FixedArrayList()); +auto PL_TABLE_SCEX_TGT = + std::make_pair((payload::Modes::SCEX << 24) | 1, FixedArrayList()); +auto PL_TABLE_SCEX_TRANS_0 = + std::make_pair((payload::Modes::SCEX << 24) | 2, FixedArrayList()); void satsystem::pl::init() { ModeListEntry entry; @@ -226,21 +242,102 @@ void initPlSpvSequence(Subsystem* ss, ModeListEntry& eh) { // Build Payload Supervisor Only target iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_SUPV_ONLY_TGT.second); iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::SUPV_ONLY, PL_TABLE_SUPV_ONLY_TGT.second); - ss->addTable(&PL_TABLE_SUPV_ONLY_TGT.second, PL_TABLE_SUPV_ONLY_TGT.first, false, true); + ss->addTable(TableEntry(PL_TABLE_SUPV_ONLY_TGT.first, &PL_TABLE_SUPV_ONLY_TGT.second)); // Build Payload Supervisor Only transition 0 iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_SUPV_ONLY_TRANS_0.second); - ss->addTable(&PL_TABLE_SUPV_ONLY_TRANS_0.second, PL_TABLE_SUPV_ONLY_TRANS_0.first, inStore, - preInit) + iht(objects::CAM_SWITCHER, OFF, 0, PL_TABLE_SUPV_ONLY_TRANS_0.second); + ss->addTable(TableEntry(PL_TABLE_SUPV_ONLY_TRANS_0.first, &PL_TABLE_SUPV_ONLY_TRANS_0.second)); - // Build Payload Supervisor Only transition 1 - iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::SUPV_ONLY, - PL_TABLE_SUPV_ONLY_TRANS_1.second); + // Build Payload Supervisor Only transition 1 + iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::SUPV_ONLY, PL_TABLE_SUPV_ONLY_TRANS_1.second); + + // Build Payload Supervisor Only Sequence + ihs(PL_SEQUENCE_SUPV_ONLY.second, PL_TABLE_SUPV_ONLY_TGT.first, 0, true); + ihs(PL_SEQUENCE_SUPV_ONLY.second, PL_TABLE_SUPV_ONLY_TRANS_0.first, 0, true); + ihs(PL_SEQUENCE_SUPV_ONLY.second, PL_TABLE_SUPV_ONLY_TRANS_1.first, 0, false); + ss->addSequence(SequenceEntry(PL_SEQUENCE_SUPV_ONLY.first, &PL_SEQUENCE_SUPV_ONLY.second, + PL_SEQUENCE_OFF.first)); } -void initEarthObsvSequence(Subsystem* ss, ModeListEntry& eh) {} +void initEarthObsvSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::payload::initEarthObsvSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; -void initScexSequence(Subsystem* ss, ModeListEntry& eh) {} + // Build Earth Observation target + iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_EARTH_OBSV_TGT.second); + iht(objects::CAM_SWITCHER, ON, 0, PL_TABLE_EARTH_OBSV_TGT.second); + iht(objects::PLPCDU_HANDLER, OFF, 0, PL_TABLE_EARTH_OBSV_TGT.second); + iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::MPSOC_ON, PL_TABLE_EARTH_OBSV_TGT.second); + ss->addTable(TableEntry(PL_TABLE_EARTH_OBSV_TGT.first, &PL_TABLE_EARTH_OBSV_TGT.second)); + + // Build Earth Observation transition 0 + iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_EARTH_OBSV_TRANS_0.second); + iht(objects::CAM_SWITCHER, ON, 0, PL_TABLE_EARTH_OBSV_TRANS_0.second); + iht(objects::PLPCDU_HANDLER, OFF, 0, PL_TABLE_EARTH_OBSV_TRANS_0.second); + ss->addTable(TableEntry(PL_TABLE_EARTH_OBSV_TRANS_0.first, &PL_TABLE_EARTH_OBSV_TRANS_0.second)); + + // Build Earth Observation transition 1 + iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::MPSOC_ON, PL_TABLE_EARTH_OBSV_TRANS_1.second); + ss->addTable(TableEntry(PL_TABLE_EARTH_OBSV_TRANS_1.first, &PL_TABLE_EARTH_OBSV_TRANS_1.second)); + + ihs(PL_SEQUENCE_EARTH_OBSV.second, PL_TABLE_EARTH_OBSV_TGT.first, 0, true); + ihs(PL_SEQUENCE_EARTH_OBSV.second, PL_TABLE_EARTH_OBSV_TRANS_0.first, 0, true); + ihs(PL_SEQUENCE_EARTH_OBSV.second, PL_TABLE_EARTH_OBSV_TRANS_1.first, 0, false); + ss->addSequence(SequenceEntry(PL_SEQUENCE_EARTH_OBSV.first, &PL_SEQUENCE_EARTH_OBSV.second, + PL_SEQUENCE_OFF.first)); +} + +void initScexSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::payload::initScexSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; + + // Build SCEX target + iht(objects::SCEX_HANDLER, NML, 0, PL_TABLE_SCEX_TGT.second); + ss->addTable(TableEntry(PL_TABLE_EARTH_OBSV_TGT.first, &PL_TABLE_EARTH_OBSV_TGT.second)); + + // Build SCEX transition 0 + iht(objects::SCEX_HANDLER, NML, 0, PL_TABLE_SCEX_TGT.second); + ss->addTable(TableEntry(PL_TABLE_SCEX_TRANS_0.first, &PL_TABLE_SCEX_TRANS_0.second)); + + // Build SCEX sequence + ihs(PL_SEQUENCE_SCEX.second, PL_TABLE_SCEX_TGT.first, 0, true); + ihs(PL_SEQUENCE_SCEX.second, PL_TABLE_SCEX_TRANS_0.first, 0, false); + ss->addSequence( + SequenceEntry(PL_SEQUENCE_SCEX.first, &PL_SEQUENCE_SCEX.second, PL_SEQUENCE_OFF.first)); +} void checkInsert(ReturnValue_t result, const char* ctx) { if (result != HasReturnvaluesIF::RETURN_OK) { From 5de45a7ae7d70a40387636813dc0c01f4bd6f641 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 16:05:01 +0200 Subject: [PATCH 0033/2058] more readable --- mission/system/tree/acsModeTree.cpp | 64 ++++++++++++++--------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index e5748f08..b78a5ff2 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -17,7 +17,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); // Alias for checker function -const auto CHK = checkInsert; +const auto check = checkInsert; static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; @@ -93,7 +93,7 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(table.insert(eh), ctxc); + check(table.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -101,11 +101,11 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // OFF Target table is empty - CHK(ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); + check(ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); // Build OFF transition iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); @@ -114,12 +114,12 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); - CHK(ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc); + check(ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc); // Build OFF sequence ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TGT.first, 0, false); ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, + check(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, false, true), ctxc); } @@ -133,7 +133,7 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -141,14 +141,14 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build SAFE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); - CHK(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); + check(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); // Build SAFE transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); @@ -156,19 +156,19 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true), + check(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true), ctxc); // Build SAFE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), + check(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), ctxc); // Build SAFE sequence ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, true); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_0.first, 0, false); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, + check(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, false, true), ctxc); } @@ -182,7 +182,7 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -190,14 +190,14 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build DETUMBLE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true), + check(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true), ctxc); // Build DETUMBLE transition 0 @@ -206,13 +206,13 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, + check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, true), ctxc); // Build DETUMBLE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, + check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, true), ctxc); @@ -220,7 +220,7 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, true); ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_0.first, 0, false); ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, + check(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, ACS_SEQUENCE_SAFE.first, false, true), ctxc); } @@ -234,7 +234,7 @@ void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -242,7 +242,7 @@ void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build IDLE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TGT.second); @@ -281,7 +281,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -289,7 +289,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build IDLE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, @@ -297,7 +297,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); - CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true), + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true), ctxc); // Build IDLE transition 0 @@ -306,14 +306,14 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false, + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false, true), ctxc); // Build IDLE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, ACS_TABLE_IDLE_CHRG_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false, + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false, true), ctxc); @@ -321,7 +321,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TGT.first, 0, true); ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first, + check(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first, ACS_SEQUENCE_SAFE.first, false, true), ctxc); } @@ -335,7 +335,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -343,7 +343,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build TARGET PT table @@ -353,7 +353,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); - CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true), + check(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true), ctxc); // Build TARGET PT transition 0 @@ -362,13 +362,13 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, + check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, true), ctxc); // Build TARGET PT transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, + check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, true), ctxc); @@ -376,7 +376,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, true); ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, + check(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, ACS_SEQUENCE_IDLE.first, false, true), ctxc); } From 9c0a89bbdcd2bddfee2f18b4ea7fa2a3ca6b87ff Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 16:20:41 +0200 Subject: [PATCH 0034/2058] added all checks, made checker func generic --- mission/system/tree/CMakeLists.txt | 1 + mission/system/tree/acsModeTree.cpp | 126 +++++++++++------------- mission/system/tree/payloadModeTree.cpp | 118 ++++++++++++---------- mission/system/tree/util.cpp | 9 ++ mission/system/tree/util.h | 12 +++ 5 files changed, 149 insertions(+), 117 deletions(-) create mode 100644 mission/system/tree/util.cpp create mode 100644 mission/system/tree/util.h diff --git a/mission/system/tree/CMakeLists.txt b/mission/system/tree/CMakeLists.txt index c5bddc3f..908f4b3d 100644 --- a/mission/system/tree/CMakeLists.txt +++ b/mission/system/tree/CMakeLists.txt @@ -2,4 +2,5 @@ target_sources(${LIB_EIVE_MISSION} PRIVATE acsModeTree.cpp payloadModeTree.cpp system.cpp + util.cpp ) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 3fca1ce0..43ede7ae 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -7,10 +7,10 @@ #include #include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" +#include "util.h" // Alias for checker function namespace { -void checkInsert(ReturnValue_t result, const char* ctx); void buildOffSequence(Subsystem* ss, ModeListEntry& eh); void buildDetumbleSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildSafeSequence(Subsystem* ss, ModeListEntry& entryHelper); @@ -19,7 +19,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); } // namespace -const auto CHK = checkInsert; +const auto check = subsystem::checkInsert; static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; @@ -97,7 +97,7 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(table.insert(eh), ctxc); + check(table.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -105,11 +105,11 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // OFF Target table is empty - CHK(ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); + check(ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); // Build OFF transition iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); @@ -118,14 +118,14 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); - CHK(ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc); + check(ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc); // Build OFF sequence ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TGT.first, 0, false); ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, - false, true), - ctxc); + check(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, + false, true), + ctxc); } void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { @@ -137,7 +137,7 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -145,14 +145,14 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build SAFE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); - CHK(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); + check(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); // Build SAFE transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); @@ -160,21 +160,21 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true), - ctxc); + check(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true), + ctxc); // Build SAFE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), - ctxc); + check(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), + ctxc); // Build SAFE sequence ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, true); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_0.first, 0, false); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, - false, true), - ctxc); + check(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, + false, true), + ctxc); } void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { @@ -186,7 +186,7 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -194,15 +194,15 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build DETUMBLE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true), - ctxc); + check(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true), + ctxc); // Build DETUMBLE transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); @@ -210,23 +210,23 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, - true), - ctxc); + check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, + true), + ctxc); // Build DETUMBLE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, - true), - ctxc); + check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, + true), + ctxc); // Build DETUMBLE sequence ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, true); ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_0.first, 0, false); ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, - ACS_SEQUENCE_SAFE.first, false, true), - ctxc); + check(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, + ACS_SEQUENCE_SAFE.first, false, true), + ctxc); } void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { @@ -238,7 +238,7 @@ void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -246,7 +246,7 @@ void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build IDLE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TGT.second); @@ -285,7 +285,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -293,7 +293,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build IDLE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, @@ -301,8 +301,8 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); - CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true), - ctxc); + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true), + ctxc); // Build IDLE transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); @@ -310,24 +310,24 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false, - true), - ctxc); + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false, + true), + ctxc); // Build IDLE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, ACS_TABLE_IDLE_CHRG_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false, - true), - ctxc); + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false, + true), + ctxc); // Build IDLE sequence ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TGT.first, 0, true); ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first, - ACS_SEQUENCE_SAFE.first, false, true), - ctxc); + check(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first, + ACS_SEQUENCE_SAFE.first, false, true), + ctxc); } void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { @@ -339,7 +339,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -347,7 +347,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build TARGET PT table @@ -357,8 +357,8 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); - CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true), - ctxc); + check(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true), + ctxc); // Build TARGET PT transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); @@ -366,29 +366,23 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, - true), - ctxc); + check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, + true), + ctxc); // Build TARGET PT transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, - true), - ctxc); + check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, + true), + ctxc); // Build IDLE sequence ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, true); ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, - ACS_SEQUENCE_IDLE.first, false, true), - ctxc); -} - -void checkInsert(ReturnValue_t result, const char* ctx) { - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "Insertion failed at " << ctx << std::endl; - } + check(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, + ACS_SEQUENCE_IDLE.first, false, true), + ctxc); } } // namespace diff --git a/mission/system/tree/payloadModeTree.cpp b/mission/system/tree/payloadModeTree.cpp index ad65230f..d5779120 100644 --- a/mission/system/tree/payloadModeTree.cpp +++ b/mission/system/tree/payloadModeTree.cpp @@ -9,9 +9,9 @@ #include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" #include "mission/system/objects/PayloadSubsystem.h" #include "mission/system/objects/definitions.h" +#include "util.h" namespace { -void checkInsert(ReturnValue_t result, const char* ctx); void initOffSequence(Subsystem* ss, ModeListEntry& eh); void initPlMpsocStreamSequence(Subsystem* ss, ModeListEntry& eh); void initPlCamStreamSequence(Subsystem* ss, ModeListEntry& eh); @@ -20,7 +20,7 @@ void initEarthObsvSequence(Subsystem* ss, ModeListEntry& eh); void initScexSequence(Subsystem* ss, ModeListEntry& eh); } // namespace -const auto CHK = checkInsert; +const auto check = subsystem::checkInsert; static const auto OFF = HasModesIF::MODE_OFF; static const auto ON = HasModesIF::MODE_ON; static const auto NML = DeviceHandlerIF::MODE_NORMAL; @@ -95,7 +95,7 @@ void initOffSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -103,11 +103,11 @@ void initOffSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build OFF target. Is empty - ss->addTable(&PL_TABLE_OFF_TGT.second, PL_TABLE_OFF_TGT.first, false, true); + check(ss->addTable(TableEntry(PL_TABLE_OFF_TGT.first, &PL_TABLE_OFF_TGT.second)), ctxc); // Build OFF transition 0 iht(objects::PLOC_SWITCHER, OFF, 0, PL_TABLE_OFF_TRANS.second); @@ -115,13 +115,14 @@ void initOffSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::SCEX_HANDLER, OFF, 0, PL_TABLE_OFF_TRANS.second); iht(objects::PLPCDU_HANDLER, OFF, 0, PL_TABLE_OFF_TRANS.second); iht(objects::PLOC_SUBSYSTEM, OFF, 0, PL_TABLE_OFF_TRANS.second); - ss->addTable(&PL_TABLE_OFF_TRANS.second, PL_TABLE_OFF_TRANS.first, false, true); + check(ss->addTable(TableEntry(PL_TABLE_OFF_TRANS.first, &PL_TABLE_OFF_TRANS.second)), ctxc); // Build OFF sequence ihs(PL_SEQUENCE_OFF.second, PL_TABLE_OFF_TGT.first, 0, false); ihs(PL_SEQUENCE_OFF.second, PL_TABLE_OFF_TRANS.first, 0, false); - ss->addSequence(&PL_SEQUENCE_OFF.second, PL_SEQUENCE_OFF.first, PL_SEQUENCE_OFF.first, false, - true); + check(ss->addSequence( + SequenceEntry(PL_SEQUENCE_OFF.first, &PL_SEQUENCE_OFF.second, PL_SEQUENCE_OFF.first)), + ctxc); } void initPlMpsocStreamSequence(Subsystem* ss, ModeListEntry& eh) { @@ -133,7 +134,7 @@ void initPlMpsocStreamSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -141,7 +142,7 @@ void initPlMpsocStreamSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build MPSoC stream target @@ -150,26 +151,31 @@ void initPlMpsocStreamSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_MPSOC_STREAM_TGT.second); iht(objects::CAM_SWITCHER, OFF, 0, PL_TABLE_MPSOC_STREAM_TGT.second); iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::MPSOC_ON, PL_TABLE_MPSOC_STREAM_TGT.second); - ss->addTable(&PL_TABLE_MPSOC_STREAM_TGT.second, PL_TABLE_MPSOC_STREAM_TGT.first, false, true); + check( + ss->addTable(TableEntry(PL_TABLE_MPSOC_STREAM_TGT.first, &PL_TABLE_MPSOC_STREAM_TGT.second)), + ctxc); // Build MPSoC stream transition 0 iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); iht(objects::CAM_SWITCHER, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); iht(objects::SCEX_HANDLER, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); - ss->addTable(&PL_TABLE_MPSOC_STREAM_TRANS_0.second, PL_TABLE_MPSOC_STREAM_TRANS_0.first, false, - true); + check(ss->addTable( + TableEntry(PL_TABLE_MPSOC_STREAM_TRANS_0.first, &PL_TABLE_MPSOC_STREAM_TRANS_0.second)), + ctxc); // Build MPSoC stream transition 1 iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::MPSOC_ON, PL_TABLE_MPSOC_STREAM_TRANS_1.second); - ss->addTable(&PL_TABLE_MPSOC_STREAM_TRANS_1.second, PL_TABLE_MPSOC_STREAM_TRANS_1.first, false, - true); + check(ss->addTable( + TableEntry(PL_TABLE_MPSOC_STREAM_TRANS_1.first, &PL_TABLE_MPSOC_STREAM_TRANS_1.second)), + ctxc); // Build MPSoC stream sequence ihs(PL_SEQUENCE_MPSOC_STREAM.second, PL_TABLE_MPSOC_STREAM_TGT.first, 0, true); ihs(PL_SEQUENCE_MPSOC_STREAM.second, PL_TABLE_MPSOC_STREAM_TRANS_0.first, 0, true); ihs(PL_SEQUENCE_MPSOC_STREAM.second, PL_TABLE_MPSOC_STREAM_TRANS_1.first, 0, false); - ss->addSequence(&PL_SEQUENCE_MPSOC_STREAM.second, PL_SEQUENCE_MPSOC_STREAM.first, - PL_SEQUENCE_OFF.first, false, true); + check(ss->addSequence(SequenceEntry(PL_SEQUENCE_MPSOC_STREAM.first, + &PL_SEQUENCE_MPSOC_STREAM.second, PL_SEQUENCE_OFF.first)), + ctxc); } void initPlCamStreamSequence(Subsystem* ss, ModeListEntry& eh) { @@ -181,7 +187,7 @@ void initPlCamStreamSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -189,34 +195,38 @@ void initPlCamStreamSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build CAM target // Only check that the PL PCDU is on for now. It might later become necessary to switch on // the PLOC, so we ignore its state. iht(objects::PLPCDU_HANDLER, NML, plpcdu::ALL_ON_SUBMODE, PL_TABLE_CAM_STREAM_TGT.second); - ss->addTable(&PL_TABLE_CAM_STREAM_TGT.second, PL_TABLE_CAM_STREAM_TGT.first, false, true); + check(ss->addTable(TableEntry(PL_TABLE_CAM_STREAM_TGT.first, &PL_TABLE_CAM_STREAM_TGT.second)), + ctxc); // Build CAM transition 0 // PLOC is actively commanded off here iht(objects::PLOC_SUBSYSTEM, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); iht(objects::CAM_SWITCHER, ON, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); iht(objects::SCEX_HANDLER, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_0.second); - ss->addTable(&PL_TABLE_MPSOC_STREAM_TRANS_0.second, PL_TABLE_MPSOC_STREAM_TRANS_0.first, false, - true); + check(ss->addTable( + TableEntry(PL_TABLE_MPSOC_STREAM_TRANS_0.first, &PL_TABLE_MPSOC_STREAM_TRANS_0.second)), + ctxc); // Build CAM transition 1 iht(objects::PLOC_SWITCHER, OFF, 0, PL_TABLE_MPSOC_STREAM_TRANS_1.second); - ss->addTable(&PL_TABLE_MPSOC_STREAM_TRANS_1.second, PL_TABLE_MPSOC_STREAM_TRANS_1.first, false, - true); + check(ss->addTable( + TableEntry(PL_TABLE_MPSOC_STREAM_TRANS_1.first, &PL_TABLE_MPSOC_STREAM_TRANS_1.second)), + ctxc); // Build CAM stream sequence ihs(PL_SEQUENCE_CAM_STREAM.second, PL_TABLE_CAM_STREAM_TGT.first, 0, true); ihs(PL_SEQUENCE_CAM_STREAM.second, PL_TABLE_CAM_STREAM_TRANS_0.first, 0, true); ihs(PL_SEQUENCE_CAM_STREAM.second, PL_TABLE_CAM_STREAM_TRANS_1.first, 0, false); - ss->addSequence(&PL_SEQUENCE_CAM_STREAM.second, PL_SEQUENCE_CAM_STREAM.first, - PL_SEQUENCE_OFF.first, false, true); + check(ss->addSequence(SequenceEntry(PL_SEQUENCE_CAM_STREAM.first, &PL_SEQUENCE_CAM_STREAM.second, + PL_SEQUENCE_OFF.first)), + ctxc); } void initPlSpvSequence(Subsystem* ss, ModeListEntry& eh) { @@ -228,7 +238,7 @@ void initPlSpvSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -236,18 +246,21 @@ void initPlSpvSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build Payload Supervisor Only target iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_SUPV_ONLY_TGT.second); iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::SUPV_ONLY, PL_TABLE_SUPV_ONLY_TGT.second); - ss->addTable(TableEntry(PL_TABLE_SUPV_ONLY_TGT.first, &PL_TABLE_SUPV_ONLY_TGT.second)); + check(ss->addTable(TableEntry(PL_TABLE_SUPV_ONLY_TGT.first, &PL_TABLE_SUPV_ONLY_TGT.second)), + ctxc); // Build Payload Supervisor Only transition 0 iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_SUPV_ONLY_TRANS_0.second); iht(objects::CAM_SWITCHER, OFF, 0, PL_TABLE_SUPV_ONLY_TRANS_0.second); - ss->addTable(TableEntry(PL_TABLE_SUPV_ONLY_TRANS_0.first, &PL_TABLE_SUPV_ONLY_TRANS_0.second)); + check(ss->addTable( + TableEntry(PL_TABLE_SUPV_ONLY_TRANS_0.first, &PL_TABLE_SUPV_ONLY_TRANS_0.second)), + ctxc); // Build Payload Supervisor Only transition 1 iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::SUPV_ONLY, PL_TABLE_SUPV_ONLY_TRANS_1.second); @@ -256,8 +269,9 @@ void initPlSpvSequence(Subsystem* ss, ModeListEntry& eh) { ihs(PL_SEQUENCE_SUPV_ONLY.second, PL_TABLE_SUPV_ONLY_TGT.first, 0, true); ihs(PL_SEQUENCE_SUPV_ONLY.second, PL_TABLE_SUPV_ONLY_TRANS_0.first, 0, true); ihs(PL_SEQUENCE_SUPV_ONLY.second, PL_TABLE_SUPV_ONLY_TRANS_1.first, 0, false); - ss->addSequence(SequenceEntry(PL_SEQUENCE_SUPV_ONLY.first, &PL_SEQUENCE_SUPV_ONLY.second, - PL_SEQUENCE_OFF.first)); + check(ss->addSequence(SequenceEntry(PL_SEQUENCE_SUPV_ONLY.first, &PL_SEQUENCE_SUPV_ONLY.second, + PL_SEQUENCE_OFF.first)), + ctxc); } void initEarthObsvSequence(Subsystem* ss, ModeListEntry& eh) { @@ -269,7 +283,7 @@ void initEarthObsvSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -277,7 +291,7 @@ void initEarthObsvSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build Earth Observation target @@ -285,23 +299,29 @@ void initEarthObsvSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::CAM_SWITCHER, ON, 0, PL_TABLE_EARTH_OBSV_TGT.second); iht(objects::PLPCDU_HANDLER, OFF, 0, PL_TABLE_EARTH_OBSV_TGT.second); iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::MPSOC_ON, PL_TABLE_EARTH_OBSV_TGT.second); - ss->addTable(TableEntry(PL_TABLE_EARTH_OBSV_TGT.first, &PL_TABLE_EARTH_OBSV_TGT.second)); + check(ss->addTable(TableEntry(PL_TABLE_EARTH_OBSV_TGT.first, &PL_TABLE_EARTH_OBSV_TGT.second)), + ctxc); // Build Earth Observation transition 0 iht(objects::PLOC_SWITCHER, ON, 0, PL_TABLE_EARTH_OBSV_TRANS_0.second); iht(objects::CAM_SWITCHER, ON, 0, PL_TABLE_EARTH_OBSV_TRANS_0.second); iht(objects::PLPCDU_HANDLER, OFF, 0, PL_TABLE_EARTH_OBSV_TRANS_0.second); - ss->addTable(TableEntry(PL_TABLE_EARTH_OBSV_TRANS_0.first, &PL_TABLE_EARTH_OBSV_TRANS_0.second)); + check(ss->addTable( + TableEntry(PL_TABLE_EARTH_OBSV_TRANS_0.first, &PL_TABLE_EARTH_OBSV_TRANS_0.second)), + ctxc); // Build Earth Observation transition 1 iht(objects::PLOC_SUBSYSTEM, NML, payload::ploc::MPSOC_ON, PL_TABLE_EARTH_OBSV_TRANS_1.second); - ss->addTable(TableEntry(PL_TABLE_EARTH_OBSV_TRANS_1.first, &PL_TABLE_EARTH_OBSV_TRANS_1.second)); + check(ss->addTable( + TableEntry(PL_TABLE_EARTH_OBSV_TRANS_1.first, &PL_TABLE_EARTH_OBSV_TRANS_1.second)), + ctxc); ihs(PL_SEQUENCE_EARTH_OBSV.second, PL_TABLE_EARTH_OBSV_TGT.first, 0, true); ihs(PL_SEQUENCE_EARTH_OBSV.second, PL_TABLE_EARTH_OBSV_TRANS_0.first, 0, true); ihs(PL_SEQUENCE_EARTH_OBSV.second, PL_TABLE_EARTH_OBSV_TRANS_1.first, 0, false); - ss->addSequence(SequenceEntry(PL_SEQUENCE_EARTH_OBSV.first, &PL_SEQUENCE_EARTH_OBSV.second, - PL_SEQUENCE_OFF.first)); + check(ss->addSequence(SequenceEntry(PL_SEQUENCE_EARTH_OBSV.first, &PL_SEQUENCE_EARTH_OBSV.second, + PL_SEQUENCE_OFF.first)), + ctxc); } void initScexSequence(Subsystem* ss, ModeListEntry& eh) { @@ -313,7 +333,7 @@ void initScexSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -321,28 +341,24 @@ void initScexSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build SCEX target iht(objects::SCEX_HANDLER, NML, 0, PL_TABLE_SCEX_TGT.second); - ss->addTable(TableEntry(PL_TABLE_EARTH_OBSV_TGT.first, &PL_TABLE_EARTH_OBSV_TGT.second)); + check(ss->addTable(TableEntry(PL_TABLE_EARTH_OBSV_TGT.first, &PL_TABLE_EARTH_OBSV_TGT.second)), + ctxc); // Build SCEX transition 0 iht(objects::SCEX_HANDLER, NML, 0, PL_TABLE_SCEX_TGT.second); - ss->addTable(TableEntry(PL_TABLE_SCEX_TRANS_0.first, &PL_TABLE_SCEX_TRANS_0.second)); + check(ss->addTable(TableEntry(PL_TABLE_SCEX_TRANS_0.first, &PL_TABLE_SCEX_TRANS_0.second)), ctxc); // Build SCEX sequence ihs(PL_SEQUENCE_SCEX.second, PL_TABLE_SCEX_TGT.first, 0, true); ihs(PL_SEQUENCE_SCEX.second, PL_TABLE_SCEX_TRANS_0.first, 0, false); - ss->addSequence( - SequenceEntry(PL_SEQUENCE_SCEX.first, &PL_SEQUENCE_SCEX.second, PL_SEQUENCE_OFF.first)); -} - -void checkInsert(ReturnValue_t result, const char* ctx) { - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "satsystem::checkInsert: PL | Insertion failed at " << ctx << std::endl; - } + check(ss->addSequence( + SequenceEntry(PL_SEQUENCE_SCEX.first, &PL_SEQUENCE_SCEX.second, PL_SEQUENCE_OFF.first)), + ctxc); } } // namespace diff --git a/mission/system/tree/util.cpp b/mission/system/tree/util.cpp new file mode 100644 index 00000000..2a93efd8 --- /dev/null +++ b/mission/system/tree/util.cpp @@ -0,0 +1,9 @@ +#include "util.h" + +#include "fsfw/serviceinterface.h" + +void subsystem::checkInsert(ReturnValue_t result, const char* ctx) { + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx << std::endl; + } +} diff --git a/mission/system/tree/util.h b/mission/system/tree/util.h new file mode 100644 index 00000000..5caf8e6d --- /dev/null +++ b/mission/system/tree/util.h @@ -0,0 +1,12 @@ +#ifndef MISSION_SYSTEM_TREE_UTIL_H_ +#define MISSION_SYSTEM_TREE_UTIL_H_ + +#include + +namespace subsystem { + +void checkInsert(ReturnValue_t result, const char* ctx); + +} + +#endif /* MISSION_SYSTEM_TREE_UTIL_H_ */ From fe285888750659964bfcc47c993fe5daf654e536 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 29 Apr 2022 10:56:43 +0200 Subject: [PATCH 0035/2058] repoint tmtc submodule --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 76da8042..168b6622 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 76da8042a4601087e99fa856af241afe9e43695d +Subproject commit 168b662288175f9db77a5796a02f38cb66911092 From 5888d90fbcd0a117f020abb9800ee6f6229eef2b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 29 Apr 2022 11:16:53 +0200 Subject: [PATCH 0036/2058] continued reboot command --- bsp_q7s/core/CoreController.cpp | 53 ++++++++++++++++++++++----------- bsp_q7s/core/CoreController.h | 10 +++++-- 2 files changed, 43 insertions(+), 20 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 208999c2..da6a5807 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -211,8 +211,13 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_ rewriteRebootFile(rebootFile); return HasActionsIF::EXECUTION_FINISHED; } + case (XSC_REBOOT_OBC): { + // Warning: This function will never return, because it reboots the system + return actionXscReboot(data, size); + } case (REBOOT_OBC): { - return actionPerformReboot(data, size); + // Warning: This function will never return, because it reboots the system + return actionReboot(data, size); } default: { return HasActionsIF::INVALID_ACTION_ID; @@ -844,25 +849,18 @@ void CoreController::initPrint() { #endif } -ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t size) { +ReturnValue_t CoreController::actionXscReboot(const uint8_t *data, size_t size) { if (size < 1) { return HasActionsIF::INVALID_PARAMETERS; } bool rebootSameBootCopy = data[0]; - bool protOpPerformed; + bool protOpPerformed = false; + SdCardManager::instance()->setBlocking(true); if (rebootSameBootCopy) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "CoreController::actionPerformReboot: Rebooting on current image" << std::endl; #endif - // Attempt graceful shutdown by unmounting and switching off SD cards - SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_0); - SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_1); - // If any boot copies are unprotected - ReturnValue_t retval = setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, true, - protOpPerformed, false); - if (retval == HasReturnvaluesIF::RETURN_OK and protOpPerformed) { - sif::info << "Running slot was writeprotected before reboot" << std::endl; - } + gracefulShutdownTasks(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, protOpPerformed); int result = std::system("xsc_boot_copy -r"); if (result != 0) { utility::handleSystemError(result, "CoreController::executeAction"); @@ -884,12 +882,8 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si auto tgtChip = static_cast(data[1]); auto tgtCopy = static_cast(data[2]); - ReturnValue_t retval = - setBootCopyProtection(static_cast(data[1]), static_cast(data[2]), true, - protOpPerformed, false); - if (retval == HasReturnvaluesIF::RETURN_OK and protOpPerformed) { - sif::info << "Target slot was writeprotected before reboot" << std::endl; - } + // This function can not really fail + gracefulShutdownTasks(tgtChip, tgtCopy, protOpPerformed); switch (tgtChip) { case (xsc::Chip::CHIP_0): { @@ -930,6 +924,29 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si return HasReturnvaluesIF::RETURN_FAILED; } +ReturnValue_t CoreController::actionReboot(const uint8_t *data, size_t size) { + bool protOpPerformed = false; + gracefulShutdownTasks(xsc::Chip::CHIP_0, xsc::Copy::COPY_0, protOpPerformed); + std::system("reboot"); + return RETURN_OK; +} + +ReturnValue_t CoreController::gracefulShutdownTasks(xsc::Chip chip, xsc::Copy copy, + bool &protOpPerformed) { + // Attempt graceful shutdown by unmounting and switching off SD cards + SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_0); + SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_1); + // If any boot copies are unprotected + ReturnValue_t result = setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, true, + protOpPerformed, false); + if (result == HasReturnvaluesIF::RETURN_OK and protOpPerformed) { + // TODO: Would be nice to notify operator. But we can't use the filesystem anymore + // and a reboot is imminent. Use scratch buffer? + sif::info << "Running slot was writeprotected before reboot" << std::endl; + } + return result; +} + CoreController::~CoreController() {} void CoreController::determinePreferredSdCard() { diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index dee06530..ede76890 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -67,8 +67,11 @@ class CoreController : public ExtendedControllerBase { static constexpr ActionId_t SWITCH_IMG_LOCK = 7; static constexpr ActionId_t SET_MAX_REBOOT_CNT = 8; - static constexpr ActionId_t REBOOT_OBC = 32; + //! Reboot using the xsc_boot_copy command + static constexpr ActionId_t XSC_REBOOT_OBC = 32; static constexpr ActionId_t MOUNT_OTHER_COPY = 33; + //! Reboot using the reboot command + static constexpr ActionId_t REBOOT_OBC = 34; static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::CORE; @@ -221,7 +224,10 @@ class CoreController : public ExtendedControllerBase { ReturnValue_t actionListDirectoryIntoFile(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size); - ReturnValue_t actionPerformReboot(const uint8_t* data, size_t size); + ReturnValue_t actionXscReboot(const uint8_t* data, size_t size); + ReturnValue_t actionReboot(const uint8_t* data, size_t size); + + ReturnValue_t gracefulShutdownTasks(xsc::Chip chip, xsc::Copy copy, bool& protOpPerformed); void performWatchdogControlOperation(); From e16e6c2d17ab41df0aea08cd1e2cc76c5541643c Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Fri, 29 Apr 2022 12:26:18 +0200 Subject: [PATCH 0037/2058] fileId --- linux/boardtest/UartTestClass.cpp | 26 ++++++++++++++++++++++---- linux/boardtest/UartTestClass.h | 3 +++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 27e8d02e..88a0895c 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -217,11 +217,13 @@ void UartTestClass::scexPeriodic() { if (helper.getPacketCounter() == 1) { //countdown starten finishCountdown.resetTimer(); - ofstream out("/tmp/scex-fram.bin", - ofstream::binary); // neues file anlegen wie oben ping + fileId = gen_random(12); + fileName = "/tmp/scex-fram_"+fileId+".bin"; + ofstream out(fileName, + ofstream::binary); // neues file anlegen } else { - ofstream out("/tmp/scex-fram.bin", - ofstream::binary | ofstream::app); // an bestehendes file hinzufügen + ofstream out(fileName, + ofstream::binary | ofstream::app); // an bestehendes file appenden out << helper; } @@ -370,3 +372,19 @@ void UartTestClass::foundDlePacketHandler(const DleParser::Context& ctx) { void UartTestClass::handleFoundDlePacket(uint8_t* packet, size_t len) { sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; } + +std::string gen_random(const int len) { + static const char alphanum[] = + "0123456789" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz"; + + std::string tmp_s; + tmp_s.reserve(len); + + for (int i = 0; i < len; ++i) { + tmp_s += alphanum[rand() % (sizeof(alphanum) - 1)]; + } + + return tmp_s; +} diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index 28a8b8a7..dad9152e 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -46,7 +46,10 @@ class UartTestClass : public TestTask { static void foundDlePacketHandler(const DleParser::Context& ctx); void handleFoundDlePacket(uint8_t* packet, size_t len); + std::string gen_random(const int len); + std::string fileId = ""; + std::string fileName = ""; Countdown finishCountdown = Countdown(180 * 1000); bool cmdSent = false; bool cmdDone = false; From be7b1411268ff97850de370bccdbbd48c5846e90 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Fri, 29 Apr 2022 12:30:52 +0200 Subject: [PATCH 0038/2058] update --- linux/boardtest/UartTestClass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 88a0895c..2e1a195c 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -373,7 +373,7 @@ void UartTestClass::handleFoundDlePacket(uint8_t* packet, size_t len) { sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; } -std::string gen_random(const int len) { +std::string UartTestClass::gen_random(const int len) { static const char alphanum[] = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" From 7c15eb57bbde24efd1e84abc926803f148fc4d74 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Fri, 29 Apr 2022 12:48:13 +0200 Subject: [PATCH 0039/2058] update --- linux/boardtest/UartTestClass.cpp | 47 ++++++++++++++++++------------- linux/boardtest/UartTestClass.h | 1 + 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 2e1a195c..1fa6a10c 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -188,8 +188,8 @@ void UartTestClass::scexPeriodic() { size_t len = 0; do { ReturnValue_t result = reader->readReceivedMessage(uartCookie, &decodedPacket, &len); - if(len == 0){ - break; + if (len == 0) { + break; } ScexHelper helper; const uint8_t* helperPtr = decodedPacket; @@ -210,15 +210,19 @@ void UartTestClass::scexPeriodic() { } // fram // packetcounter eins höher, wenn mehr packet verloren -> merkt sich welches packet fehlt - //was wenn erstes packet fehlt; mit boolean var (firstpacketarrived=false) die immer mit finish false wird? + // was wenn erstes packet fehlt; mit boolean var (firstpacketarrived=false) die immer mit + // finish false wird? // countdown (max 2min), wenn nicht if (helper.getPacketCounter() == // helper.getTotalPacketCounter()) { nach 2min reader->finish(); if (helper.getCmd() == FRAM) { + if (not fileNameSet) { + fileId = gen_random(12); + fileName = "/tmp/scex-fram_" + fileId + ".bin"; + fileNameSet = true; + } if (helper.getPacketCounter() == 1) { - //countdown starten - finishCountdown.resetTimer(); - fileId = gen_random(12); - fileName = "/tmp/scex-fram_"+fileId+".bin"; + // countdown starten + finishCountdown.resetTimer(); ofstream out(fileName, ofstream::binary); // neues file anlegen } else { @@ -227,8 +231,11 @@ void UartTestClass::scexPeriodic() { out << helper; } - if(finishCountdown.hasTimedOut()){ - reader->finish(); + if (finishCountdown.hasTimedOut()) { + reader->finish(); + sif::warning << "Reader countdown expired" << endl; + cmdDone = true; + fileNameSet = false; } } @@ -236,8 +243,10 @@ void UartTestClass::scexPeriodic() { reader->finish(); sif::info << "Reader is finished" << endl; cmdDone = true; + fileNameSet = false; if (helper.getCmd() == scex::ScexCmds::PING) { cmdSent = false; + fileNameSet = true; // to not generate everytime new file } } } while (len > 0); @@ -374,17 +383,17 @@ void UartTestClass::handleFoundDlePacket(uint8_t* packet, size_t len) { } std::string UartTestClass::gen_random(const int len) { - static const char alphanum[] = - "0123456789" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz"; + static const char alphanum[] = + "0123456789" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz"; - std::string tmp_s; - tmp_s.reserve(len); + std::string tmp_s; + tmp_s.reserve(len); - for (int i = 0; i < len; ++i) { - tmp_s += alphanum[rand() % (sizeof(alphanum) - 1)]; - } + for (int i = 0; i < len; ++i) { + tmp_s += alphanum[rand() % (sizeof(alphanum) - 1)]; + } - return tmp_s; + return tmp_s; } diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index dad9152e..8c6bc22f 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -50,6 +50,7 @@ class UartTestClass : public TestTask { std::string fileId = ""; std::string fileName = ""; + bool fileNameSet = false; Countdown finishCountdown = Countdown(180 * 1000); bool cmdSent = false; bool cmdDone = false; From 57f3103e52d19c26fca380a44832cf40564aa9cd Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Fri, 29 Apr 2022 13:31:14 +0200 Subject: [PATCH 0040/2058] update --- linux/boardtest/UartTestClass.cpp | 28 +++++++++++++++++----------- linux/boardtest/UartTestClass.h | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 1fa6a10c..b958579a 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -9,6 +9,9 @@ #include #include // write(), read(), close() +#include +#include + #include "OBSWConfig.h" #include "fsfw/globalfunctions/CRC.h" #include "fsfw/globalfunctions/DleEncoder.h" @@ -216,7 +219,7 @@ void UartTestClass::scexPeriodic() { // helper.getTotalPacketCounter()) { nach 2min reader->finish(); if (helper.getCmd() == FRAM) { if (not fileNameSet) { - fileId = gen_random(12); + fileId = random_string(12); fileName = "/tmp/scex-fram_" + fileId + ".bin"; fileNameSet = true; } @@ -382,18 +385,21 @@ void UartTestClass::handleFoundDlePacket(uint8_t* packet, size_t len) { sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; } -std::string UartTestClass::gen_random(const int len) { - static const char alphanum[] = +std::string UartTestClass::random_string(std::string::size_type length) { + static auto& chrs = "0123456789" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz"; + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - std::string tmp_s; - tmp_s.reserve(len); + thread_local static std::mt19937 rg{std::random_device{}()}; + thread_local static std::uniform_int_distribution pick(0, + sizeof(chrs) - 2); - for (int i = 0; i < len; ++i) { - tmp_s += alphanum[rand() % (sizeof(alphanum) - 1)]; - } + std::string s; - return tmp_s; + s.reserve(length); + + while (length--) s += chrs[pick(rg)]; + + return s; } diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index 8c6bc22f..ca42a688 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -46,7 +46,7 @@ class UartTestClass : public TestTask { static void foundDlePacketHandler(const DleParser::Context& ctx); void handleFoundDlePacket(uint8_t* packet, size_t len); - std::string gen_random(const int len); + std::string random_string(std::string::size_type length); std::string fileId = ""; std::string fileName = ""; From f2cb43a52fb91f13c20e8b30887eb33af4f207d5 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Fri, 29 Apr 2022 15:46:16 +0200 Subject: [PATCH 0041/2058] scexDataHandler --- common/config/commonSubsystemIds.h | 1 + linux/boardtest/UartTestClass.cpp | 15 +- linux/boardtest/UartTestClass.h | 6 +- linux/devices/ScexHelper.cpp | 6 +- linux/devices/ScexHelper.h | 7 +- mission/devices/CMakeLists.txt | 1 + mission/devices/ScexDeviceHandler.cpp | 128 ++++++++++++++++++ mission/devices/ScexDeviceHandler.h | 36 +++++ .../devicedefinitions/ScexDefinitions.cpp | 33 ++++- .../devicedefinitions/ScexDefinitions.h | 33 ++++- 10 files changed, 246 insertions(+), 20 deletions(-) create mode 100644 mission/devices/ScexDeviceHandler.cpp create mode 100644 mission/devices/ScexDeviceHandler.h diff --git a/common/config/commonSubsystemIds.h b/common/config/commonSubsystemIds.h index cd692231..c19a4d0c 100644 --- a/common/config/commonSubsystemIds.h +++ b/common/config/commonSubsystemIds.h @@ -30,6 +30,7 @@ enum: uint8_t { PDU1_HANDLER = 133, PDU2_HANDLER = 134, ACU_HANDLER = 135, + SCEX_HANDLER = 136, COMMON_SUBSYSTEM_ID_END }; } diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index b958579a..469081cd 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -17,6 +17,7 @@ #include "fsfw/globalfunctions/DleEncoder.h" #include "fsfw/globalfunctions/arrayprinter.h" #include "fsfw/serviceinterface.h" +#include "mission/devices/devicedefinitions/ScexDefinitions.h" #define GPS_REPLY_WIRETAPPING 0 @@ -28,7 +29,7 @@ UartTestClass::UartTestClass(object_id_t objectId, ScexUartReader* reader) : TestTask(objectId), reader(reader) { mode = TestModes::SCEX; scexMode = ScexModes::READER_TASK; - currCmd = scex::ScexCmds::FRAM; + currCmd = scex::Cmds::FRAM; if (scexMode == ScexModes::SIMPLE) { auto encodingBuf = new std::array; DleParser::BufPair encodingBufPair{encodingBuf->data(), encodingBuf->size()}; @@ -219,7 +220,7 @@ void UartTestClass::scexPeriodic() { // helper.getTotalPacketCounter()) { nach 2min reader->finish(); if (helper.getCmd() == FRAM) { if (not fileNameSet) { - fileId = random_string(12); + fileId = random_string(6); fileName = "/tmp/scex-fram_" + fileId + ".bin"; fileNameSet = true; } @@ -235,8 +236,9 @@ void UartTestClass::scexPeriodic() { } if (finishCountdown.hasTimedOut()) { + triggerEvent(scex::EXPERIMENT_TIMEDOUT, currCmd, 0); reader->finish(); - sif::warning << "Reader countdown expired" << endl; + sif::warning << "Reader timeout" << endl; cmdDone = true; fileNameSet = false; } @@ -247,7 +249,7 @@ void UartTestClass::scexPeriodic() { sif::info << "Reader is finished" << endl; cmdDone = true; fileNameSet = false; - if (helper.getCmd() == scex::ScexCmds::PING) { + if (helper.getCmd() == scex::Cmds::PING) { cmdSent = false; fileNameSet = true; // to not generate everytime new file } @@ -344,7 +346,7 @@ void UartTestClass::scexSimplePeriodic() { << bytesRead << std::endl; } else if (bytesRead > 0) { dleParser->passData(recBuf.data(), bytesRead); - if (currCmd == ScexCmds::PING) { + if (currCmd == Cmds::PING) { cmdDone = true; cmdSent = false; } @@ -353,8 +355,7 @@ void UartTestClass::scexSimplePeriodic() { } } -int UartTestClass::prepareScexCmd(scex::ScexCmds cmd, bool tempCheck, uint8_t* cmdBuf, - size_t* len) { +int UartTestClass::prepareScexCmd(scex::Cmds cmd, bool tempCheck, uint8_t* cmdBuf, size_t* len) { using namespace scex; // Send command cmdBuf[0] = scex::createCmdByte(cmd, false); diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index ca42a688..efe15dc1 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -39,7 +39,7 @@ class UartTestClass : public TestTask { void scexInit(); void scexPeriodic(); - int prepareScexCmd(scex::ScexCmds cmd, bool tempCheck, uint8_t* cmdBuf, size_t* len); + int prepareScexCmd(scex::Cmds cmd, bool tempCheck, uint8_t* cmdBuf, size_t* len); void scexSimplePeriodic(); void scexSimpleInit(); @@ -54,7 +54,7 @@ class UartTestClass : public TestTask { Countdown finishCountdown = Countdown(180 * 1000); bool cmdSent = false; bool cmdDone = false; - scex::ScexCmds currCmd = scex::ScexCmds::PING; + scex::Cmds currCmd = scex::Cmds::PING; TestModes mode = TestModes::GPS; DleEncoder dleEncoder = DleEncoder(); UartCookie* uartCookie = nullptr; @@ -67,7 +67,7 @@ class UartTestClass : public TestTask { std::array cmdBuf = {}; std::array recBuf = {}; ScexDleParser* dleParser; - scex::ScexCmds cmdHelper; + scex::Cmds cmdHelper; uint8_t recvCnt = 0; }; diff --git a/linux/devices/ScexHelper.cpp b/linux/devices/ScexHelper.cpp index ca29ff65..92a9e24a 100644 --- a/linux/devices/ScexHelper.cpp +++ b/linux/devices/ScexHelper.cpp @@ -23,7 +23,7 @@ ReturnValue_t ScexHelper::deSerialize(const uint8_t** buffer, size_t* size, } start = *buffer; cmdByteRaw = **buffer; - cmd = static_cast((cmdByteRaw >> 1) & 0b11111); + cmd = static_cast((cmdByteRaw >> 1) & 0b11111); *buffer += 1; packetCounter = **buffer; @@ -35,7 +35,7 @@ ReturnValue_t ScexHelper::deSerialize(const uint8_t** buffer, size_t* size, payloadLen = (**buffer << 8) | *(*buffer + 1); *buffer += 2; - totalPacketLen = payloadLen + HEADER_LEN + CRC_LEN; + totalPacketLen = payloadLen + scex::HEADER_LEN + scex::CRC_LEN; if (totalPacketLen >= *size) { return STREAM_TOO_SHORT; } @@ -47,7 +47,7 @@ ReturnValue_t ScexHelper::deSerialize(const uint8_t** buffer, size_t* size, return RETURN_OK; } -scex::ScexCmds ScexHelper::getCmd() const { return cmd; } +scex::Cmds ScexHelper::getCmd() const { return cmd; } uint8_t ScexHelper::getCmdByteRaw() const { return cmdByteRaw; } diff --git a/linux/devices/ScexHelper.h b/linux/devices/ScexHelper.h index a835bd0a..02908514 100644 --- a/linux/devices/ScexHelper.h +++ b/linux/devices/ScexHelper.h @@ -13,8 +13,7 @@ class ScexHelper : public HasReturnvaluesIF, public SerializeIF { public: static const ReturnValue_t INVALID_CRC = HasReturnvaluesIF::makeReturnCode(0, 2); - static constexpr uint8_t HEADER_LEN = 5; - static constexpr uint8_t CRC_LEN = 2; + ScexHelper(); ReturnValue_t serialize(uint8_t **buffer, size_t *size, size_t maxSize, Endianness streamEndianness) const override; @@ -25,7 +24,7 @@ class ScexHelper : public HasReturnvaluesIF, public SerializeIF { friend std::ostream &operator<<(std::ostream &os, const ScexHelper &h); friend std::ofstream &operator<<(std::ofstream &os, const ScexHelper &h); - scex::ScexCmds getCmd() const; + scex::Cmds getCmd() const; uint8_t getCmdByteRaw() const; uint16_t getCrc() const; size_t getExpectedPacketLen() const; @@ -38,7 +37,7 @@ class ScexHelper : public HasReturnvaluesIF, public SerializeIF { const uint8_t *start = nullptr; uint16_t crc = 0; uint8_t cmdByteRaw = 0; - scex::ScexCmds cmd = scex::ScexCmds::INVALID; + scex::Cmds cmd = scex::Cmds::INVALID; int packetCounter = 0; int totalPacketCounter = 0; uint16_t payloadLen = 0; diff --git a/mission/devices/CMakeLists.txt b/mission/devices/CMakeLists.txt index fc013271..9ad299e8 100644 --- a/mission/devices/CMakeLists.txt +++ b/mission/devices/CMakeLists.txt @@ -18,6 +18,7 @@ target_sources(${LIB_EIVE_MISSION} PRIVATE SusHandler.cpp PayloadPcduHandler.cpp SolarArrayDeploymentHandler.cpp + ScexDeviceHandler.cpp ) add_subdirectory(devicedefinitions) diff --git a/mission/devices/ScexDeviceHandler.cpp b/mission/devices/ScexDeviceHandler.cpp new file mode 100644 index 00000000..fe948a7e --- /dev/null +++ b/mission/devices/ScexDeviceHandler.cpp @@ -0,0 +1,128 @@ +#include "ScexDeviceHandler.h" + +#include + +#include "mission/devices/devicedefinitions/ScexDefinitions.h" +#include "fsfw/globalfunctions/CRC.h" +#include + +ScexDeviceHandler::ScexDeviceHandler(object_id_t objectId, ScexUartReader& reader, CookieIF* cookie) + : DeviceHandlerBase(objectId, reader.getObjectId(),cookie), reader(reader) +{ + +} + +void ScexDeviceHandler::doStartUp() { + // mode on + setMode(MODE_ON); +} + +void ScexDeviceHandler::doShutDown() { setMode(_MODE_POWER_DOWN); } + +ReturnValue_t ScexDeviceHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { + return RETURN_OK; +} + +ReturnValue_t ScexDeviceHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { + return RETURN_OK; +} + +ReturnValue_t ScexDeviceHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t* commandData, + size_t commandDataLen) { + using namespace scex; + + if (not std::find(VALID_CMDS.begin(), VALID_CMDS.end(), deviceCommand) != VALID_CMDS.end()) { + return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; + } + if (commandDataLen < 1) { + return DeviceHandlerIF::INVALID_COMMAND_PARAMETER; + } + + switch (deviceCommand) { + case (PING): { + rawPacket = cmdBuf.size(); + + prepareScexCmd(deviceCommand, commandData[0], {cmdBuf.data(), cmdBuf.size()}, rawPacketLen, + {nullptr, 0}); + return RETURN_OK; + } + case (FRAM): { + prepareScexCmd(deviceCommand, commandData[0], {cmdBuf.data(), cmdBuf.size()}, rawPacketLen, + {nullptr, 0}); + return RETURN_OK; + } + case (ION_CMD): { + prepareScexCmd(deviceCommand, commandData[0], {cmdBuf.data(), cmdBuf.size()}, rawPacketLen, + {nullptr, 0}); + return RETURN_OK; + } + case (TEMP_CMD): { + prepareScexCmd(deviceCommand, commandData[0], {cmdBuf.data(), cmdBuf.size()}, rawPacketLen, + {nullptr, 0}); + return RETURN_OK; + } + case (ONE_CELL): { + prepareScexCmd(deviceCommand, commandData[0], {cmdBuf.data(), cmdBuf.size()}, rawPacketLen, + {commandData + 1, commandData - 1}); + return RETURN_OK; + } + case (ALL_CELLS_CMD): { + prepareScexCmd(deviceCommand, commandData[0], {cmdBuf.data(), cmdBuf.size()}, rawPacketLen, + {commandData + 1, commandData - 1}); + return RETURN_OK; + } + case (EXP_STATUS_CMD): { + prepareScexCmd(deviceCommand, commandData[0], {cmdBuf.data(), cmdBuf.size()}, rawPacketLen, + {nullptr, 0}); + return RETURN_OK; + } + } + return RETURN_OK; +} + +void ScexDeviceHandler::fillCommandAndReplyMap() { + insertInCommandAndReplyMap(scex::Cmds::PING, 3); + insertInCommandAndReplyMap(scex::Cmds::ION_CMD, 3); + insertInCommandAndReplyMap(scex::Cmds::TEMP_CMD, 3); + insertInCommandAndReplyMap(scex::Cmds::EXP_STATUS_CMD, 3); + + insertInCommandMap(scex::Cmds::ALL_CELLS_CMD); + insertInCommandMap(scex::Cmds::ONE_CELL); + insertInCommandMap(scex::Cmds::FRAM); + + insertInReplyMap(scex::Cmds::ERROR_REPLY, 3); +} + +ReturnValue_t ScexDeviceHandler::scanForReply(const uint8_t* start, size_t remainingSize, + DeviceCommandId_t* foundId, size_t* foundLen) { + //helper.deSerialize(blabla); + //crc check + + *foundId = helper.getCmd(); + *foundLen = remainingSize; + + return RETURN_OK; +} + +ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) { + //cmd auswertung (in file reinschreiben) + return RETURN_OK; +} + +uint32_t ScexDeviceHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { + return RETURN_OK; +} + +ReturnValue_t ScexDeviceHandler::getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) { + return RETURN_OK; +} + +ReturnValue_t ScexDeviceHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) { + return RETURN_OK; +} + + + +void ScexDeviceHandler::modeChanged() {} diff --git a/mission/devices/ScexDeviceHandler.h b/mission/devices/ScexDeviceHandler.h new file mode 100644 index 00000000..5058ed3b --- /dev/null +++ b/mission/devices/ScexDeviceHandler.h @@ -0,0 +1,36 @@ +#ifndef MISSION_DEVICES_SCEXDEVICEHANDLER_H_ +#define MISSION_DEVICES_SCEXDEVICEHANDLER_H_ + +#include +#include +#include + +class ScexDeviceHandler : public DeviceHandlerBase { + public: + // ctor vervollständigen + ScexDeviceHandler(object_id_t objectId, ScexUartReader& reader, CookieIF* cookie); + private: + std::array cmdBuf = {}; + + // DeviceHandlerBase private function implementation + void doStartUp() override; + void doShutDown() override; + ScexHelper helper; + ScexUartReader& reader; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) override; + void fillCommandAndReplyMap() override; + ReturnValue_t scanForReply(const uint8_t *start, size_t remainingSize, DeviceCommandId_t *foundId, + size_t *foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches) override; + + ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) override; + void modeChanged() override; +}; + +#endif /* MISSION_DEVICES_SCEXDEVICEHANDLER_H_ */ diff --git a/mission/devices/devicedefinitions/ScexDefinitions.cpp b/mission/devices/devicedefinitions/ScexDefinitions.cpp index 1e39f414..c202dd5c 100644 --- a/mission/devices/devicedefinitions/ScexDefinitions.cpp +++ b/mission/devices/devicedefinitions/ScexDefinitions.cpp @@ -1,5 +1,36 @@ #include "ScexDefinitions.h" -uint8_t scex::createCmdByte(ScexCmds cmd, bool tempCheck) { +#include + +#include + +uint8_t scex::createCmdByte(Cmds cmd, bool tempCheck) { return (IDLE_BIT_0_DEF_STATE << 7) | (IDLE_BIT_1_DEF_STATE << 6) | (cmd << 1) | tempCheck; } + +ReturnValue_t scex::prepareScexCmd(scex::Cmds cmd, bool tempCheck, + std::pair cmdBufPair, size_t& cmdLen, + std::pair usrDataPair) { + using namespace scex; + uint8_t* cmdBuf = cmdBufPair.first; + const uint8_t* userData = usrDataPair.first; + // Send command + if (cmdBuf == nullptr or (cmdBufPair.second < usrDataPair.second + HEADER_LEN + CRC_LEN) or + (usrDataPair.second > 0 and userData == nullptr)) { + cmdLen = 0; + return HasReturnvaluesIF::RETURN_FAILED; + } + cmdBuf[0] = scex::createCmdByte(cmd, tempCheck); + // These two fields are the packet counter and the total packet count. Those are 1 and 1 for each + // telecommand so far + cmdBuf[1] = 1; + cmdBuf[2] = 1; + cmdBuf[3] = (usrDataPair.second >> 8) & 0xff; + cmdBuf[4] = usrDataPair.second & 0xff; + std::memcpy(cmdBuf + HEADER_LEN, userData, usrDataPair.second); + uint16_t crc = CRC::crc16ccitt(cmdBuf, usrDataPair.second + HEADER_LEN); + cmdBuf[usrDataPair.second + HEADER_LEN] = (crc >> 8) & 0xff; + cmdBuf[usrDataPair.second + HEADER_LEN + 1] = crc & 0xff; + cmdLen = usrDataPair.second + HEADER_LEN + CRC_LEN; + return HasReturnvaluesIF::RETURN_OK; +} diff --git a/mission/devices/devicedefinitions/ScexDefinitions.h b/mission/devices/devicedefinitions/ScexDefinitions.h index f479981e..70426085 100644 --- a/mission/devices/devicedefinitions/ScexDefinitions.h +++ b/mission/devices/devicedefinitions/ScexDefinitions.h @@ -1,17 +1,46 @@ #ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_ #define MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_ +#include +#include +#include + #include +#include // Definitions for the Solar Cell Experiment namespace scex { -enum ScexCmds : uint8_t { PING = 0b00111, ONE_CELL = 0b00110, FRAM = 0b00001, INVALID = 255 }; +static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SCEX_HANDLER; + +static constexpr Event MISSING_PACKET = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW); + +static constexpr Event EXPERIMENT_TIMEDOUT = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW); + +enum Cmds : DeviceCommandId_t { + PING = 0b00111, + ALL_CELLS_CMD = 0b00101, + ONE_CELL = 0b00110, + FRAM = 0b00001, + EXP_STATUS_CMD = 0b00010, + TEMP_CMD = 0b00011, + ION_CMD = 0b00100, + ERROR_REPLY = 0b01000, + INVALID = 255 +}; + +static const std::vector VALID_CMDS = { + PING, ALL_CELLS_CMD, ONE_CELL, FRAM, EXP_STATUS_CMD, TEMP_CMD, ION_CMD}; + +static constexpr uint8_t HEADER_LEN = 5; +static constexpr uint8_t CRC_LEN = 2; static constexpr uint8_t IDLE_BIT_0_DEF_STATE = 0; static constexpr uint8_t IDLE_BIT_1_DEF_STATE = 1; -uint8_t createCmdByte(ScexCmds cmd, bool tempCheck); +uint8_t createCmdByte(Cmds cmd, bool tempCheck); +ReturnValue_t prepareScexCmd(scex::Cmds cmd, bool tempCheck, std::pair cmdBufPair, + size_t& cmdLen, std::pair usrDataPair); } // namespace scex From aa9acef76a9e0593ad37ec92389a96da46f3627c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 May 2022 12:53:12 +0200 Subject: [PATCH 0042/2058] bump tmtc submodule --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 8d0a8312..0a47c17f 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8d0a83122932deb49a9e536bea1a0b5723b1cb2a +Subproject commit 0a47c17fa699dc571d2d3e63ec08c9f4cf513f65 From 0abb726b30a39e76f55d2d9709085c65069dc938 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 May 2022 16:15:43 +0200 Subject: [PATCH 0043/2058] bump submodules --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index d61fe7db..7f6c8b8b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit d61fe7db93b37dd6652dbfee5b7c93f400ac5a11 +Subproject commit 7f6c8b8b123a63546de0d73f0de35900d6c806bf diff --git a/tmtc b/tmtc index 168b6622..0a47c17f 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 168b662288175f9db77a5796a02f38cb66911092 +Subproject commit 0a47c17fa699dc571d2d3e63ec08c9f4cf513f65 From 238afbaa8b46063753d769d3c0ef5a2461fe0ae2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 May 2022 17:37:00 +0200 Subject: [PATCH 0044/2058] add health IF to heater handler --- bsp_q7s/core/InitMission.cpp | 12 ++++++-- bsp_q7s/core/ObjectFactory.cpp | 11 ++++---- bsp_q7s/core/ObjectFactory.h | 3 +- mission/core/GenericFactory.cpp | 7 +++-- mission/core/GenericFactory.h | 4 ++- mission/devices/HeaterHandler.cpp | 46 ++++++++++++++++++++++--------- mission/devices/HeaterHandler.h | 30 ++++++++++++++++---- 7 files changed, 83 insertions(+), 30 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index ced1d12a..782673ce 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -33,8 +33,16 @@ ObjectManagerIF* objectManager = nullptr; void initmission::initMission() { sif::info << "Building global objects.." << std::endl; - /* Instantiate global object manager and also create all objects */ - ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); + try { + /* Instantiate global object manager and also create all objects */ + ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); + } catch (const std::invalid_argument& e) { + sif::error << "initmission::initMission: Object Construction failed with an " + "invalid argument: " + << e.what(); + std::exit(1); + } + sif::info << "Initializing all objects.." << std::endl; ObjectManager::instance()->initialize(); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index d45b58b7..08f1fc64 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -131,7 +131,8 @@ void Factory::setStaticFrameworkObjectIds() { void ObjectFactory::produce(void* args) { ObjectFactory::setStatics(); - ObjectFactory::produceGenericObjects(); + HealthTableIF* healthTable = nullptr; + ObjectFactory::produceGenericObjects(&healthTable); LinuxLibgpioIF* gpioComIF = nullptr; UartComIF* uartComIF = nullptr; @@ -151,7 +152,7 @@ void ObjectFactory::produce(void* args) { createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); #endif - createHeaterComponents(); + createHeaterComponents(pwrSwitcher, healthTable); createSolarArrayDeploymentComponents(); createPlPcduComponents(gpioComIF, spiComIF, pwrSwitcher); #if OBSW_ADD_SYRLINKS == 1 @@ -580,7 +581,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI #endif /* OBSW_ADD_ACS_HANDLERS == 1 */ } -void ObjectFactory::createHeaterComponents() { +void ObjectFactory::createHeaterComponents(PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable) { using namespace gpio; GpioCookie* heaterGpiosCookie = new GpioCookie; GpiodRegularByLineName* gpio = nullptr; @@ -621,8 +622,8 @@ void ObjectFactory::createHeaterComponents() { Levels::LOW); heaterGpiosCookie->addGpio(gpioIds::HEATER_7, gpio); - new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, heaterGpiosCookie, - objects::PCDU_HANDLER, pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); + new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, heaterGpiosCookie, pwrSwitcher, + pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V, healthTable); } void ObjectFactory::createSolarArrayDeploymentComponents() { diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index a812be35..39dd5a6a 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -6,6 +6,7 @@ class UartComIF; class SpiComIF; class I2cComIF; class PowerSwitchIF; +class HealthTableIF; class AcsBoardAssembly; namespace ObjectFactory { @@ -22,7 +23,7 @@ void createTmpComponents(); void createRadSensorComponent(LinuxLibgpioIF* gpioComIF); void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, PowerSwitchIF* pwrSwitcher); -void createHeaterComponents(); +void createHeaterComponents(PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable); void createSolarArrayDeploymentComponents(); void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher); void createPayloadComponents(LinuxLibgpioIF* gpioComIF); diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index d2db67fd..581fe962 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -44,10 +44,13 @@ #define OBSW_TM_TO_PTME 0 #endif -void ObjectFactory::produceGenericObjects() { +void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { // Framework objects new EventManager(objects::EVENT_MANAGER); - new HealthTable(objects::HEALTH_TABLE); + auto healthTable = new HealthTable(objects::HEALTH_TABLE); + if (healthTable != nullptr) { + *healthTable_ = healthTable; + } new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER); new TimeStamper(objects::TIME_STAMPER); diff --git a/mission/core/GenericFactory.h b/mission/core/GenericFactory.h index 1a3b1300..cabbbb91 100644 --- a/mission/core/GenericFactory.h +++ b/mission/core/GenericFactory.h @@ -1,9 +1,11 @@ #ifndef MISSION_CORE_GENERICFACTORY_H_ #define MISSION_CORE_GENERICFACTORY_H_ +class HealthTableIF; + namespace ObjectFactory { -void produceGenericObjects(); +void produceGenericObjects(HealthTableIF** healthTable); } diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 5e78bc0e..5f62122d 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -1,21 +1,31 @@ #include "HeaterHandler.h" +#include #include #include #include +#include + #include "devices/gpioIds.h" #include "devices/powerSwitcherList.h" HeaterHandler::HeaterHandler(object_id_t setObjectId_, object_id_t gpioDriverId_, - CookieIF* gpioCookie_, object_id_t mainLineSwitcherObjectId_, - uint8_t mainLineSwitch_) + CookieIF* gpioCookie_, PowerSwitchIF* mainLineSwitcher_, + power::Switch_t mainLineSwitch_, HealthTableIF* healthTable_) : SystemObject(setObjectId_), gpioDriverId(gpioDriverId_), gpioCookie(gpioCookie_), - mainLineSwitcherObjectId(mainLineSwitcherObjectId_), + mainLineSwitcher(mainLineSwitcher_), mainLineSwitch(mainLineSwitch_), + healthTable(healthTable_), actionHelper(this, nullptr) { + if (mainLineSwitcher == nullptr) { + throw std::invalid_argument("HeaterHandler::HeaterHandler: Invalid PowerSwitchIF"); + } + if (healthTable == nullptr) { + throw std::invalid_argument("HeaterHandler::HeaterHandler: Invalid HealthTableIF"); + } auto mqArgs = MqArgs(setObjectId_, static_cast(this)); commandQueue = QueueFactory::instance()->createMessageQueue( cmdQueueSize, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs); @@ -55,21 +65,16 @@ ReturnValue_t HeaterHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } + if (healthTable != nullptr) { + healthTable->registerObject(getObjectId()); + } + IPCStore = ObjectManager::instance()->get(objects::IPC_STORE); if (IPCStore == nullptr) { sif::error << "HeaterHandler::initialize: IPC store not set up in factory." << std::endl; return ObjectManagerIF::CHILD_INIT_FAILED; } - if (mainLineSwitcherObjectId != objects::NO_OBJECT) { - mainLineSwitcher = ObjectManager::instance()->get(mainLineSwitcherObjectId); - if (mainLineSwitcher == nullptr) { - sif::error << "HeaterHandler::initialize: Failed to get main line switcher. Make sure " - << "main line switcher object is initialized." << std::endl; - return ObjectManagerIF::CHILD_INIT_FAILED; - } - } - result = actionHelper.initialize(commandQueue); if (result != RETURN_OK) { return ObjectManagerIF::CHILD_INIT_FAILED; @@ -345,4 +350,19 @@ ReturnValue_t HeaterHandler::getSwitchState(uint8_t switchNr) const { return 0; ReturnValue_t HeaterHandler::getFuseState(uint8_t fuseNr) const { return 0; } -uint32_t HeaterHandler::getSwitchDelayMs(void) const { return 0; } +uint32_t HeaterHandler::getSwitchDelayMs(void) const { return 2000; } + +ReturnValue_t HeaterHandler::setHealth(HealthState health) { + if (healthTable != nullptr) { + healthTable->setHealth(getObjectId(), health); + return RETURN_OK; + } + return RETURN_FAILED; +} + +HasHealthIF::HealthState HeaterHandler::getHealth() { + if (healthTable != nullptr) { + return healthTable->getHealth(getObjectId()); + } + return HasHealthIF::HealthState::HEALTHY; +} diff --git a/mission/devices/HeaterHandler.h b/mission/devices/HeaterHandler.h index 18b821ec..ba0ac99e 100644 --- a/mission/devices/HeaterHandler.h +++ b/mission/devices/HeaterHandler.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -15,6 +16,9 @@ #include "devices/heaterSwitcherList.h" +class PowerSwitchIF; +class HealthTableIF; + /** * @brief This class intends the control of heaters. * @@ -22,6 +26,7 @@ */ class HeaterHandler : public ExecutableObjectIF, public PowerSwitchIF, + public HasHealthIF, public SystemObject, public HasActionsIF { public: @@ -37,10 +42,24 @@ class HeaterHandler : public ExecutableObjectIF, static const DeviceCommandId_t SWITCH_HEATER = 0x0; HeaterHandler(object_id_t setObjectId, object_id_t gpioDriverId, CookieIF* gpioCookie, - object_id_t mainLineSwitcherObjectId, uint8_t mainLineSwitch); + PowerSwitchIF* mainLineSwitcherObjectId, power::Switch_t mainLineSwitch, + HealthTableIF* healthTable); virtual ~HeaterHandler(); + /** + * @brief Set the Health State + * The parent will be informed, if the Health changes + * @param health + */ + ReturnValue_t setHealth(HealthState health) override; + + /** + * @brief Get Health State + * @return Health State of the object + */ + HasHealthIF::HealthState getHealth() override; + virtual ReturnValue_t performOperation(uint8_t operationCode = 0) override; virtual ReturnValue_t sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) override; @@ -114,16 +133,15 @@ class HeaterHandler : public ExecutableObjectIF, /** Queue to receive messages from other objects. */ MessageQueueIF* commandQueue = nullptr; - object_id_t mainLineSwitcherObjectId; - - /** Switch number of the heater power supply switch */ - uint8_t mainLineSwitch; - /** * Power switcher object which controls the 8V main line of the heater * logic on the TCS board. */ PowerSwitchIF* mainLineSwitcher = nullptr; + /** Switch number of the heater power supply switch */ + power::Switch_t mainLineSwitch; + + HealthTableIF* healthTable = nullptr; ActionHelper actionHelper; From b98c691c2b2771ceceba529b572227314494a457 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 May 2022 17:51:00 +0200 Subject: [PATCH 0045/2058] added health helper to heater handler --- bsp_q7s/core/ObjectFactory.cpp | 2 +- mission/devices/HeaterHandler.cpp | 51 ++++++++++++++----------------- mission/devices/HeaterHandler.h | 6 ++-- 3 files changed, 27 insertions(+), 32 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 08f1fc64..987cb7a3 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -623,7 +623,7 @@ void ObjectFactory::createHeaterComponents(PowerSwitchIF* pwrSwitcher, HealthTab heaterGpiosCookie->addGpio(gpioIds::HEATER_7, gpio); new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, heaterGpiosCookie, pwrSwitcher, - pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V, healthTable); + pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); } void ObjectFactory::createSolarArrayDeploymentComponents() { diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 5f62122d..dec71a2a 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -12,20 +12,17 @@ HeaterHandler::HeaterHandler(object_id_t setObjectId_, object_id_t gpioDriverId_, CookieIF* gpioCookie_, PowerSwitchIF* mainLineSwitcher_, - power::Switch_t mainLineSwitch_, HealthTableIF* healthTable_) + power::Switch_t mainLineSwitch_) : SystemObject(setObjectId_), gpioDriverId(gpioDriverId_), gpioCookie(gpioCookie_), mainLineSwitcher(mainLineSwitcher_), mainLineSwitch(mainLineSwitch_), - healthTable(healthTable_), + healthHelper(this, getObjectId()), actionHelper(this, nullptr) { if (mainLineSwitcher == nullptr) { throw std::invalid_argument("HeaterHandler::HeaterHandler: Invalid PowerSwitchIF"); } - if (healthTable == nullptr) { - throw std::invalid_argument("HeaterHandler::HeaterHandler: Invalid HealthTableIF"); - } auto mqArgs = MqArgs(setObjectId_, static_cast(this)); commandQueue = QueueFactory::instance()->createMessageQueue( cmdQueueSize, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs); @@ -65,9 +62,7 @@ ReturnValue_t HeaterHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - if (healthTable != nullptr) { - healthTable->registerObject(getObjectId()); - } + healthHelper.initialize(commandQueue->getId()); IPCStore = ObjectManager::instance()->get(objects::IPC_STORE); if (IPCStore == nullptr) { @@ -103,16 +98,24 @@ void HeaterHandler::setInitialSwitchStates() { } void HeaterHandler::readCommandQueue() { + ReturnValue_t result = RETURN_OK; CommandMessage command; - ReturnValue_t result = commandQueue->receiveMessage(&command); - if (result != RETURN_OK) { - return; - } - - result = actionHelper.handleActionMessage(&command); - if (result == RETURN_OK) { - return; - } + do { + result = commandQueue->receiveMessage(&command); + if (result == MessageQueueIF::EMPTY) { + break; + } else if (result != RETURN_OK) { + sif::warning << "HeaterHandler::readCommandQueue: Message reception error" << std::endl; + } + result = actionHelper.handleActionMessage(&command); + if (result == RETURN_OK) { + continue; + } + result = healthHelper.handleHealthCommand(&command); + if (result == RETURN_OK) { + continue; + } + } while (result == RETURN_OK); } ReturnValue_t HeaterHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, @@ -353,16 +356,8 @@ ReturnValue_t HeaterHandler::getFuseState(uint8_t fuseNr) const { return 0; } uint32_t HeaterHandler::getSwitchDelayMs(void) const { return 2000; } ReturnValue_t HeaterHandler::setHealth(HealthState health) { - if (healthTable != nullptr) { - healthTable->setHealth(getObjectId(), health); - return RETURN_OK; - } - return RETURN_FAILED; + healthHelper.setHealth(health); + return RETURN_OK; } -HasHealthIF::HealthState HeaterHandler::getHealth() { - if (healthTable != nullptr) { - return healthTable->getHealth(getObjectId()); - } - return HasHealthIF::HealthState::HEALTHY; -} +HasHealthIF::HealthState HeaterHandler::getHealth() { return healthHelper.getHealth(); } diff --git a/mission/devices/HeaterHandler.h b/mission/devices/HeaterHandler.h index ba0ac99e..aa8eea90 100644 --- a/mission/devices/HeaterHandler.h +++ b/mission/devices/HeaterHandler.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -42,8 +43,7 @@ class HeaterHandler : public ExecutableObjectIF, static const DeviceCommandId_t SWITCH_HEATER = 0x0; HeaterHandler(object_id_t setObjectId, object_id_t gpioDriverId, CookieIF* gpioCookie, - PowerSwitchIF* mainLineSwitcherObjectId, power::Switch_t mainLineSwitch, - HealthTableIF* healthTable); + PowerSwitchIF* mainLineSwitcherObjectId, power::Switch_t mainLineSwitch); virtual ~HeaterHandler(); @@ -141,7 +141,7 @@ class HeaterHandler : public ExecutableObjectIF, /** Switch number of the heater power supply switch */ power::Switch_t mainLineSwitch; - HealthTableIF* healthTable = nullptr; + HealthHelper healthHelper; ActionHelper actionHelper; From 9449919b2b280afdaa500e87d72a13fe735b285a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 May 2022 22:45:27 +0200 Subject: [PATCH 0046/2058] Heaters are own objects with HealthIF now --- bsp_q7s/core/ObjectFactory.cpp | 19 +- bsp_q7s/core/ObjectFactory.h | 3 +- common/config/commonObjects.h | 77 +++--- linux/fsfwconfig/objects/systemObjectList.h | 7 - mission/devices/HeaterHandler.cpp | 262 ++++++++------------ mission/devices/HeaterHandler.h | 79 +++--- 6 files changed, 192 insertions(+), 255 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 987cb7a3..43239ea1 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -152,7 +152,7 @@ void ObjectFactory::produce(void* args) { createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); #endif - createHeaterComponents(pwrSwitcher, healthTable); + createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); createSolarArrayDeploymentComponents(); createPlPcduComponents(gpioComIF, spiComIF, pwrSwitcher); #if OBSW_ADD_SYRLINKS == 1 @@ -581,7 +581,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI #endif /* OBSW_ADD_ACS_HANDLERS == 1 */ } -void ObjectFactory::createHeaterComponents(PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable) { +void ObjectFactory::createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, + HealthTableIF* healthTable) { using namespace gpio; GpioCookie* heaterGpiosCookie = new GpioCookie; GpiodRegularByLineName* gpio = nullptr; @@ -622,7 +623,19 @@ void ObjectFactory::createHeaterComponents(PowerSwitchIF* pwrSwitcher, HealthTab Levels::LOW); heaterGpiosCookie->addGpio(gpioIds::HEATER_7, gpio); - new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, heaterGpiosCookie, pwrSwitcher, + gpioIF->addGpios(heaterGpiosCookie); + + HeaterHelper helper({{ + {new HealthDevice(objects::HEATER_0, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_0}, + {new HealthDevice(objects::HEATER_1, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_1}, + {new HealthDevice(objects::HEATER_2, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_2}, + {new HealthDevice(objects::HEATER_3, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_3}, + {new HealthDevice(objects::HEATER_4, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_4}, + {new HealthDevice(objects::HEATER_5, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_5}, + {new HealthDevice(objects::HEATER_6, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_6}, + {new HealthDevice(objects::HEATER_7, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7}, + }}); + new HeaterHandler(objects::HEATER_HANDLER, gpioIF, helper, pwrSwitcher, pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); } diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index 39dd5a6a..7dee478c 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -8,6 +8,7 @@ class I2cComIF; class PowerSwitchIF; class HealthTableIF; class AcsBoardAssembly; +class GpioIF; namespace ObjectFactory { @@ -23,7 +24,7 @@ void createTmpComponents(); void createRadSensorComponent(LinuxLibgpioIF* gpioComIF); void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, PowerSwitchIF* pwrSwitcher); -void createHeaterComponents(PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable); +void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable); void createSolarArrayDeploymentComponents(); void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher); void createPayloadComponents(LinuxLibgpioIF* gpioComIF); diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index a4f3319e..38b735c0 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -22,13 +22,6 @@ enum commonObjects: uint32_t { CORE_CONTROLLER = 0x43000003, /* 0x44 ('D') for device handlers */ - P60DOCK_HANDLER = 0x44250000, - PDU1_HANDLER = 0x44250001, - PDU2_HANDLER = 0x44250002, - ACU_HANDLER = 0x44250003, - BPX_BATT_HANDLER = 0x44260000, - TMP1075_HANDLER_1 = 0x44420004, - TMP1075_HANDLER_2 = 0x44420005, MGM_0_LIS3_HANDLER = 0x44120006, MGM_1_RM3100_HANDLER = 0x44120107, MGM_2_LIS3_HANDLER = 0x44120208, @@ -37,12 +30,45 @@ enum commonObjects: uint32_t { GYRO_1_L3G_HANDLER = 0x44120111, GYRO_2_ADIS_HANDLER = 0x44120212, GYRO_3_L3G_HANDLER = 0x44120313, - PLPCDU_HANDLER = 0x44300000, + SUS_0 = 0x44120032, + SUS_1 = 0x44120033, + SUS_2 = 0x44120034, + SUS_3 = 0x44120035, + SUS_4 = 0x44120036, + SUS_5 = 0x44120037, + SUS_6 = 0x44120038, + SUS_7 = 0x44120039, + SUS_8 = 0x44120040, + SUS_9 = 0x44120041, + SUS_10 = 0x44120042, + SUS_11 = 0x44120043, + RW1 = 0x44120047, + RW2 = 0x44120148, + RW3 = 0x44120249, + RW4 = 0x44120350, + STAR_TRACKER = 0x44130001, + GPS_CONTROLLER = 0x44130045, IMTQ_HANDLER = 0x44140014, + TMP1075_HANDLER_1 = 0x44420004, + TMP1075_HANDLER_2 = 0x44420005, + PCDU_HANDLER = 0x442000A1, + P60DOCK_HANDLER = 0x44250000, + PDU1_HANDLER = 0x44250001, + PDU2_HANDLER = 0x44250002, + ACU_HANDLER = 0x44250003, + BPX_BATT_HANDLER = 0x44260000, + PLPCDU_HANDLER = 0x44300000, + RAD_SENSOR = 0x443200A5, + PLOC_UPDATER = 0x44330000, + PLOC_MEMORY_DUMPER = 0x44330001, + STR_HELPER = 0x44330002, + PLOC_MPSOC_HELPER = 0x44330003, PLOC_MPSOC_HANDLER = 0x44330015, PLOC_SUPERVISOR_HANDLER = 0x44330016, PLOC_SUPERVISOR_HELPER = 0x44330017, + SOLAR_ARRAY_DEPL_HANDLER = 0x444100A2, + HEATER_HANDLER = 0x444100A4, /** * Not yet specified which pt1000 will measure which device/location in the satellite. @@ -65,35 +91,22 @@ enum commonObjects: uint32_t { RTD_IC_17 = 0x44420030, RTD_IC_18 = 0x44420031, - SUS_0 = 0x44120032, - SUS_1 = 0x44120033, - SUS_2 = 0x44120034, - SUS_3 = 0x44120035, - SUS_4 = 0x44120036, - SUS_5 = 0x44120037, - SUS_6 = 0x44120038, - SUS_7 = 0x44120039, - SUS_8 = 0x44120040, - SUS_9 = 0x44120041, - SUS_10 = 0x44120042, - SUS_11 = 0x44120043, - GPS_CONTROLLER = 0x44130045, - RW1 = 0x44120047, - RW2 = 0x44120148, - RW3 = 0x44120249, - RW4 = 0x44120350, - - STAR_TRACKER = 0x44130001, - - PLOC_UPDATER = 0x44330000, - PLOC_MEMORY_DUMPER = 0x44330001, - STR_HELPER = 0x44330002, - PLOC_MPSOC_HELPER = 0x44330003, + SYRLINKS_HK_HANDLER = 0x445300A3, AXI_PTME_CONFIG = 44330004, PTME_CONFIG = 44330005, + // 0x60 for other stuff + HEATER_0 = 0x60000000, + HEATER_1 = 0x60000001, + HEATER_2 = 0x60000002, + HEATER_3 = 0x60000003, + HEATER_4 = 0x60000004, + HEATER_5 = 0x60000005, + HEATER_6 = 0x60000006, + HEATER_7 = 0x60000007, + // 0x73 ('s') for assemblies and system/subsystem components ACS_BOARD_ASS = 0x73000001, SUS_BOARD_ASS = 0x73000002, diff --git a/linux/fsfwconfig/objects/systemObjectList.h b/linux/fsfwconfig/objects/systemObjectList.h index a03e4d38..cf5b7423 100644 --- a/linux/fsfwconfig/objects/systemObjectList.h +++ b/linux/fsfwconfig/objects/systemObjectList.h @@ -50,13 +50,6 @@ enum sourceObjects : uint32_t { SPI_COM_IF = 0x49020004, GPIO_IF = 0x49010005, - /* Custom device handler */ - PCDU_HANDLER = 0x442000A1, - SOLAR_ARRAY_DEPL_HANDLER = 0x444100A2, - SYRLINKS_HK_HANDLER = 0x445300A3, - HEATER_HANDLER = 0x444100A4, - RAD_SENSOR = 0x443200A5, - /* 0x54 ('T') for test handlers */ TEST_TASK = 0x54694269, LIBGPIOD_TEST = 0x54123456, diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index dec71a2a..e27d74b6 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -10,16 +10,22 @@ #include "devices/gpioIds.h" #include "devices/powerSwitcherList.h" -HeaterHandler::HeaterHandler(object_id_t setObjectId_, object_id_t gpioDriverId_, - CookieIF* gpioCookie_, PowerSwitchIF* mainLineSwitcher_, - power::Switch_t mainLineSwitch_) +HeaterHandler::HeaterHandler(object_id_t setObjectId_, GpioIF* gpioInterface_, HeaterHelper helper, + PowerSwitchIF* mainLineSwitcher_, power::Switch_t mainLineSwitch_) : SystemObject(setObjectId_), - gpioDriverId(gpioDriverId_), - gpioCookie(gpioCookie_), + helper(helper), + gpioInterface(gpioInterface_), mainLineSwitcher(mainLineSwitcher_), mainLineSwitch(mainLineSwitch_), - healthHelper(this, getObjectId()), actionHelper(this, nullptr) { + for (const auto& heater : helper.heaters) { + if (heater.first == nullptr) { + throw std::invalid_argument("HeaterHandler::HeaterHandler: Invalid Heater Object"); + } + } + if (gpioInterface_ == nullptr) { + throw std::invalid_argument("HeaterHandler::HeaterHandler: Invalid Gpio IF"); + } if (mainLineSwitcher == nullptr) { throw std::invalid_argument("HeaterHandler::HeaterHandler: Invalid PowerSwitchIF"); } @@ -31,10 +37,10 @@ HeaterHandler::HeaterHandler(object_id_t setObjectId_, object_id_t gpioDriverId_ HeaterHandler::~HeaterHandler() {} ReturnValue_t HeaterHandler::performOperation(uint8_t operationCode) { - if (operationCode == DeviceHandlerIF::PERFORM_OPERATION) { - readCommandQueue(); - handleActiveCommands(); - return RETURN_OK; + readCommandQueue(); + handleActiveCommands(); + for (const auto& heater : helper.heaters) { + heater.first->performOperation(0); } return RETURN_OK; } @@ -50,22 +56,8 @@ ReturnValue_t HeaterHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - gpioInterface = ObjectManager::instance()->get(gpioDriverId); - if (gpioInterface == nullptr) { - sif::error << "HeaterHandler::initialize: Invalid Gpio interface." << std::endl; - return ObjectManagerIF::CHILD_INIT_FAILED; - } - - result = gpioInterface->addGpios(dynamic_cast(gpioCookie)); - if (result != RETURN_OK) { - sif::error << "HeaterHandler::initialize: Failed to initialize Gpio interface" << std::endl; - return ObjectManagerIF::CHILD_INIT_FAILED; - } - - healthHelper.initialize(commandQueue->getId()); - - IPCStore = ObjectManager::instance()->get(objects::IPC_STORE); - if (IPCStore == nullptr) { + ipcStore = ObjectManager::instance()->get(objects::IPC_STORE); + if (ipcStore == nullptr) { sif::error << "HeaterHandler::initialize: IPC store not set up in factory." << std::endl; return ObjectManagerIF::CHILD_INIT_FAILED; } @@ -79,24 +71,12 @@ ReturnValue_t HeaterHandler::initialize() { } ReturnValue_t HeaterHandler::initializeHeaterMap() { - HeaterCommandInfo_t heaterCommandInfo; - for (switchNr_t switchNr = 0; switchNr < heaterSwitches::NUMBER_OF_SWITCHES; switchNr++) { - std::pair status = heaterMap.emplace(switchNr, heaterCommandInfo); - if (status.second == false) { - sif::error << "HeaterHandler::initializeHeaterMap: Failed to initialize heater map" - << std::endl; - return RETURN_FAILED; - } + for (power::Switch_t switchNr = 0; switchNr < heaterSwitches::NUMBER_OF_SWITCHES; switchNr++) { + heaterVec.push_back(HeaterWrapper(helper.heaters[switchNr])); } return RETURN_OK; } -void HeaterHandler::setInitialSwitchStates() { - for (switchNr_t switchNr = 0; switchNr < heaterSwitches::NUMBER_OF_SWITCHES; switchNr++) { - switchStates[switchNr] = OFF; - } -} - void HeaterHandler::readCommandQueue() { ReturnValue_t result = RETURN_OK; CommandMessage command; @@ -111,41 +91,44 @@ void HeaterHandler::readCommandQueue() { if (result == RETURN_OK) { continue; } - result = healthHelper.handleHealthCommand(&command); - if (result == RETURN_OK) { - continue; - } } while (result == RETURN_OK); } ReturnValue_t HeaterHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) { - ReturnValue_t result; - if (actionId != SWITCH_HEATER) { - result = COMMAND_NOT_SUPPORTED; - } else { - switchNr_t switchNr = *data; - HeaterMapIter heaterMapIter = heaterMap.find(switchNr); - if (heaterMapIter != heaterMap.end()) { - if (heaterMapIter->second.active) { - return COMMAND_ALREADY_WAITING; - } - heaterMapIter->second.action = *(data + 1); - heaterMapIter->second.active = true; - heaterMapIter->second.replyQueue = commandedBy; - } else { - sif::error << "HeaterHandler::executeAction: Invalid switchNr" << std::endl; - return INVALID_SWITCH_NR; - } - result = RETURN_OK; + if (data == nullptr or size < 2) { + return HasActionsIF::INVALID_PARAMETERS; } - return result; + if (actionId != SWITCH_HEATER) { + return COMMAND_NOT_SUPPORTED; + } + auto switchNr = *data; + if (switchNr > 7) { + return HasActionsIF::INVALID_PARAMETERS; + } + auto heater = heaterVec.at(switchNr); + HasHealthIF::HealthState health = heater.healthDevice->getHealth(); + if (health == HasHealthIF::FAULTY or health == HasHealthIF::PERMANENT_FAULTY or + health == HasHealthIF::NEEDS_RECOVERY) { + return HasHealthIF::OBJECT_NOT_HEALTHY; + } + if (heater.active) { + return COMMAND_ALREADY_WAITING; + } + auto action = data[1]; + if (action != 0 and action != 1) { + return HasActionsIF::INVALID_PARAMETERS; + } + heater.action = static_cast(data[1]); + heater.active = true; + heater.replyQueue = commandedBy; + return RETURN_OK; } ReturnValue_t HeaterHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) { ReturnValue_t result; store_address_t storeAddress; - uint8_t commandData[2]; + uint8_t commandData[2] = {}; switch (onOff) { case PowerSwitchIF::SWITCH_ON: @@ -161,7 +144,7 @@ ReturnValue_t HeaterHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t o break; } - result = IPCStore->addData(&storeAddress, commandData, sizeof(commandData)); + result = ipcStore->addData(&storeAddress, commandData, sizeof(commandData)); if (result == RETURN_OK) { CommandMessage message; ActionMessage::setCommand(&message, SWITCH_HEATER, storeAddress); @@ -176,15 +159,14 @@ ReturnValue_t HeaterHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t o } void HeaterHandler::handleActiveCommands() { - HeaterMapIter heaterMapIter = heaterMap.begin(); - for (; heaterMapIter != heaterMap.end(); heaterMapIter++) { - if (heaterMapIter->second.active) { - switch (heaterMapIter->second.action) { + for (uint8_t idx = 0; idx < heater::NUMBER_OF_HEATERS; idx++) { + if (heaterVec[idx].active) { + switch (heaterVec[idx].action) { case SET_SWITCH_ON: - handleSwitchOnCommand(heaterMapIter); + handleSwitchOnCommand(idx); break; case SET_SWITCH_OFF: - handleSwitchOffCommand(heaterMapIter); + handleSwitchOffCommand(idx); break; default: sif::error << "HeaterHandler::handleActiveCommands: Invalid action commanded" @@ -195,156 +177,113 @@ void HeaterHandler::handleActiveCommands() { } } -void HeaterHandler::handleSwitchOnCommand(HeaterMapIter heaterMapIter) { +void HeaterHandler::handleSwitchOnCommand(uint8_t heaterIdx) { ReturnValue_t result = RETURN_OK; - switchNr_t switchNr; - + auto& heater = heaterVec.at(heaterIdx); /* Check if command waits for main switch being set on and whether the timeout has expired */ - if (heaterMapIter->second.waitMainSwitchOn && - heaterMapIter->second.mainSwitchCountdown.hasTimedOut()) { + if (heater.waitMainSwitchOn && heater.mainSwitchCountdown.hasTimedOut()) { // TODO - This requires the initiation of an FDIR procedure triggerEvent(MAIN_SWITCH_TIMEOUT); sif::error << "HeaterHandler::handleSwitchOnCommand: Main switch setting on timeout" << std::endl; - heaterMapIter->second.active = false; - heaterMapIter->second.waitMainSwitchOn = false; - if (heaterMapIter->second.replyQueue != commandQueue->getId()) { - actionHelper.finish(false, heaterMapIter->second.replyQueue, heaterMapIter->second.action, - MAIN_SWITCH_SET_TIMEOUT); + heater.active = false; + heater.waitMainSwitchOn = false; + if (heater.replyQueue != commandQueue->getId()) { + actionHelper.finish(false, heater.replyQueue, heater.action, MAIN_SWITCH_SET_TIMEOUT); } return; } - switchNr = heaterMapIter->first; - /* Check state of main line switch */ + // Check state of main line switch ReturnValue_t mainSwitchState = mainLineSwitcher->getSwitchState(mainLineSwitch); if (mainSwitchState == PowerSwitchIF::SWITCH_ON) { - if (!checkSwitchState(switchNr)) { - gpioId_t gpioId = getGpioIdFromSwitchNr(switchNr); + if (!checkSwitchState(heaterIdx)) { + gpioId_t gpioId = heater.gpioId; result = gpioInterface->pullHigh(gpioId); if (result != RETURN_OK) { sif::error << "HeaterHandler::handleSwitchOnCommand: Failed to pull gpio with id " << gpioId << " high" << std::endl; triggerEvent(GPIO_PULL_HIGH_FAILED, result); } else { - switchStates[switchNr] = ON; + heater.switchState = ON; } } else { - triggerEvent(SWITCH_ALREADY_ON, switchNr); + triggerEvent(SWITCH_ALREADY_ON, heaterIdx); } - /* There is no need to send action finish replies if the sender was the - * HeaterHandler itself. */ - if (heaterMapIter->second.replyQueue != commandQueue->getId()) { + // There is no need to send action finish replies if the sender was the + // HeaterHandler itself + if (heater.replyQueue != commandQueue->getId()) { if (result == RETURN_OK) { - actionHelper.finish(true, heaterMapIter->second.replyQueue, heaterMapIter->second.action, - result); + actionHelper.finish(true, heater.replyQueue, heater.action, result); } else { - actionHelper.finish(false, heaterMapIter->second.replyQueue, heaterMapIter->second.action, - result); + actionHelper.finish(false, heater.replyQueue, heater.action, result); } } - heaterMapIter->second.active = false; - heaterMapIter->second.waitMainSwitchOn = false; - } else if (mainSwitchState == PowerSwitchIF::SWITCH_OFF && - heaterMapIter->second.waitMainSwitchOn) { - /* Just waiting for the main switch being set on */ + heater.active = false; + heater.waitMainSwitchOn = false; + } else if (mainSwitchState == PowerSwitchIF::SWITCH_OFF && heater.waitMainSwitchOn) { + // Just waiting for the main switch being set on return; } else if (mainSwitchState == PowerSwitchIF::SWITCH_OFF) { mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_ON); - heaterMapIter->second.mainSwitchCountdown.setTimeout(mainLineSwitcher->getSwitchDelayMs()); - heaterMapIter->second.waitMainSwitchOn = true; + heater.mainSwitchCountdown.setTimeout(mainLineSwitcher->getSwitchDelayMs()); + heater.waitMainSwitchOn = true; } else { sif::debug << "HeaterHandler::handleActiveCommands: Failed to get state of" << " main line switch" << std::endl; - if (heaterMapIter->second.replyQueue != commandQueue->getId()) { - actionHelper.finish(false, heaterMapIter->second.replyQueue, heaterMapIter->second.action, - mainSwitchState); + if (heater.replyQueue != commandQueue->getId()) { + actionHelper.finish(false, heater.replyQueue, heater.action, mainSwitchState); } - heaterMapIter->second.active = false; + heater.active = false; } } -void HeaterHandler::handleSwitchOffCommand(HeaterMapIter heaterMapIter) { +void HeaterHandler::handleSwitchOffCommand(uint8_t heaterIdx) { ReturnValue_t result = RETURN_OK; - switchNr_t switchNr = heaterMapIter->first; - /* Check whether switch is already off */ - if (checkSwitchState(switchNr)) { - gpioId_t gpioId = getGpioIdFromSwitchNr(switchNr); + auto& heater = heaterVec.at(heaterIdx); + // Check whether switch is already off + if (checkSwitchState(heaterIdx)) { + gpioId_t gpioId = heater.gpioId; result = gpioInterface->pullLow(gpioId); if (result != RETURN_OK) { sif::error << "HeaterHandler::handleSwitchOffCommand: Failed to pull gpio with id" << gpioId << " low" << std::endl; triggerEvent(GPIO_PULL_LOW_FAILED, result); } else { - switchStates[switchNr] = OFF; - /* When all switches are off, also main line switch will be turned off */ + heater.switchState = OFF; + // When all switches are off, also main line switch will be turned off if (allSwitchesOff()) { mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); } } } else { sif::info << "HeaterHandler::handleSwitchOffCommand: Switch already off" << std::endl; - triggerEvent(SWITCH_ALREADY_OFF, switchNr); + triggerEvent(SWITCH_ALREADY_OFF, heaterIdx); } - if (heaterMapIter->second.replyQueue != NO_COMMANDER) { - /* Report back switch command reply if necessary */ + if (heater.replyQueue != NO_COMMANDER) { + // Report back switch command reply if necessary if (result == HasReturnvaluesIF::RETURN_OK) { - actionHelper.finish(true, heaterMapIter->second.replyQueue, heaterMapIter->second.action, - result); + actionHelper.finish(true, heater.replyQueue, heater.action, result); } else { - actionHelper.finish(false, heaterMapIter->second.replyQueue, heaterMapIter->second.action, - result); + actionHelper.finish(false, heater.replyQueue, heater.action, result); } } - heaterMapIter->second.active = false; + heater.active = false; } -bool HeaterHandler::checkSwitchState(int switchNr) { return switchStates[switchNr]; } +HeaterHandler::SwitchState HeaterHandler::checkSwitchState(uint8_t switchNr) { + return heaterVec.at(switchNr).switchState; +} bool HeaterHandler::allSwitchesOff() { bool allSwitchesOrd = false; /* Or all switches. As soon one switch is on, allSwitchesOrd will be true */ - for (switchNr_t switchNr = 0; switchNr < heaterSwitches::NUMBER_OF_SWITCHES; switchNr++) { - allSwitchesOrd = allSwitchesOrd || switchStates[switchNr]; + for (power::Switch_t switchNr = 0; switchNr < heaterSwitches::NUMBER_OF_SWITCHES; switchNr++) { + allSwitchesOrd = allSwitchesOrd || heaterVec.at(switchNr).switchState; } return !allSwitchesOrd; } -gpioId_t HeaterHandler::getGpioIdFromSwitchNr(int switchNr) { - gpioId_t gpioId = 0xFFFF; - switch (switchNr) { - case heaterSwitches::HEATER_0: - gpioId = gpioIds::HEATER_0; - break; - case heaterSwitches::HEATER_1: - gpioId = gpioIds::HEATER_1; - break; - case heaterSwitches::HEATER_2: - gpioId = gpioIds::HEATER_2; - break; - case heaterSwitches::HEATER_3: - gpioId = gpioIds::HEATER_3; - break; - case heaterSwitches::HEATER_4: - gpioId = gpioIds::HEATER_4; - break; - case heaterSwitches::HEATER_5: - gpioId = gpioIds::HEATER_5; - break; - case heaterSwitches::HEATER_6: - gpioId = gpioIds::HEATER_6; - break; - case heaterSwitches::HEATER_7: - gpioId = gpioIds::HEATER_7; - break; - default: - sif::error << "HeaterHandler::getGpioIdFromSwitchNr: Unknown heater switch number" - << std::endl; - break; - } - return gpioId; -} - MessageQueueId_t HeaterHandler::getCommandQueue() const { return commandQueue->getId(); } ReturnValue_t HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) { return RETURN_OK; } @@ -354,10 +293,3 @@ ReturnValue_t HeaterHandler::getSwitchState(uint8_t switchNr) const { return 0; ReturnValue_t HeaterHandler::getFuseState(uint8_t fuseNr) const { return 0; } uint32_t HeaterHandler::getSwitchDelayMs(void) const { return 2000; } - -ReturnValue_t HeaterHandler::setHealth(HealthState health) { - healthHelper.setHealth(health); - return RETURN_OK; -} - -HasHealthIF::HealthState HeaterHandler::getHealth() { return healthHelper.getHealth(); } diff --git a/mission/devices/HeaterHandler.h b/mission/devices/HeaterHandler.h index aa8eea90..28ac9899 100644 --- a/mission/devices/HeaterHandler.h +++ b/mission/devices/HeaterHandler.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -13,13 +14,26 @@ #include #include -#include +#include #include "devices/heaterSwitcherList.h" class PowerSwitchIF; class HealthTableIF; +namespace heater { + +static constexpr uint8_t NUMBER_OF_HEATERS = 8; + +} + +using HeaterPair = std::pair; + +struct HeaterHelper { + public: + HeaterHelper(std::array heaters) : heaters(heaters) {} + std::array heaters = {}; +}; /** * @brief This class intends the control of heaters. * @@ -27,7 +41,6 @@ class HealthTableIF; */ class HeaterHandler : public ExecutableObjectIF, public PowerSwitchIF, - public HasHealthIF, public SystemObject, public HasActionsIF { public: @@ -42,24 +55,11 @@ class HeaterHandler : public ExecutableObjectIF, /** Device command IDs */ static const DeviceCommandId_t SWITCH_HEATER = 0x0; - HeaterHandler(object_id_t setObjectId, object_id_t gpioDriverId, CookieIF* gpioCookie, + HeaterHandler(object_id_t setObjectId, GpioIF* gpioInterface_, HeaterHelper helper, PowerSwitchIF* mainLineSwitcherObjectId, power::Switch_t mainLineSwitch); virtual ~HeaterHandler(); - /** - * @brief Set the Health State - * The parent will be informed, if the Health changes - * @param health - */ - ReturnValue_t setHealth(HealthState health) override; - - /** - * @brief Get Health State - * @return Health State of the object - */ - HasHealthIF::HealthState getHealth() override; - virtual ReturnValue_t performOperation(uint8_t operationCode = 0) override; virtual ReturnValue_t sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) override; @@ -88,6 +88,7 @@ class HeaterHandler : public ExecutableObjectIF, static const MessageQueueId_t NO_COMMANDER = 0; enum SwitchState : bool { ON = true, OFF = false }; + enum SwitchAction : uint8_t { SET_SWITCH_OFF, SET_SWITCH_ON, NONE }; /** * @brief Struct holding information about a heater command to execute. @@ -99,35 +100,27 @@ class HeaterHandler : public ExecutableObjectIF, * @param waitSwitchOn True if the command is waiting for the main switch being set on. * @param mainSwitchCountdown Sets timeout to wait for main switch being set on. */ - typedef struct HeaterCommandInfo { - uint8_t action; - MessageQueueId_t replyQueue; + struct HeaterWrapper { + HeaterWrapper(HeaterPair pair) : healthDevice(pair.first), gpioId(pair.second) {} + HealthDevice* healthDevice = nullptr; + gpioId_t gpioId = gpio::NO_GPIO; + SwitchAction action = SwitchAction::NONE; + MessageQueueId_t replyQueue = MessageQueueIF::NO_QUEUE; bool active = false; + SwitchState switchState = SwitchState::OFF; bool waitMainSwitchOn = false; Countdown mainSwitchCountdown; - } HeaterCommandInfo_t; + }; - enum SwitchAction { SET_SWITCH_OFF, SET_SWITCH_ON }; + using HeaterMap = std::vector; - using switchNr_t = uint8_t; - using HeaterMap = std::unordered_map; - using HeaterMapIter = HeaterMap::iterator; + HeaterMap heaterVec = {}; - HeaterMap heaterMap; - - bool switchStates[heaterSwitches::NUMBER_OF_SWITCHES]; + HeaterHelper helper; /** Size of command queue */ size_t cmdQueueSize = 20; - /** - * The object ID of the GPIO driver which enables and disables the - * heaters. - */ - object_id_t gpioDriverId; - - CookieIF* gpioCookie; - GpioIF* gpioInterface = nullptr; /** Queue to receive messages from other objects. */ @@ -141,11 +134,9 @@ class HeaterHandler : public ExecutableObjectIF, /** Switch number of the heater power supply switch */ power::Switch_t mainLineSwitch; - HealthHelper healthHelper; - ActionHelper actionHelper; - StorageManagerIF* IPCStore = nullptr; + StorageManagerIF* ipcStore = nullptr; void readCommandQueue(); @@ -153,13 +144,7 @@ class HeaterHandler : public ExecutableObjectIF, * @brief Returns the state of a switch (ON - true, or OFF - false). * @param switchNr The number of the switch to check. */ - bool checkSwitchState(int switchNr); - - /** - * @brief Returns the ID of the GPIO related to a heater identified by the switch number - * which is defined in the heaterSwitches list. - */ - gpioId_t getGpioIdFromSwitchNr(int switchNr); + SwitchState checkSwitchState(power::Switch_t switchNr); /** * @brief This function runs commands waiting for execution. @@ -173,9 +158,9 @@ class HeaterHandler : public ExecutableObjectIF, */ void setInitialSwitchStates(); - void handleSwitchOnCommand(HeaterMapIter heaterMapIter); + void handleSwitchOnCommand(uint8_t heaterIdx); - void handleSwitchOffCommand(HeaterMapIter heaterMapIter); + void handleSwitchOffCommand(uint8_t heaterIdx); /** * @brief Checks if all switches are off. From 1f8a68dabe8ee7c4382f207b72f7b2cea58650ae Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 May 2022 22:55:39 +0200 Subject: [PATCH 0047/2058] re-use existing enum --- common/config/devices/heaterSwitcherList.h | 4 ++-- mission/devices/HeaterHandler.cpp | 16 ++++++++-------- mission/devices/HeaterHandler.h | 16 +++++----------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/common/config/devices/heaterSwitcherList.h b/common/config/devices/heaterSwitcherList.h index 014e795c..8d27cf15 100644 --- a/common/config/devices/heaterSwitcherList.h +++ b/common/config/devices/heaterSwitcherList.h @@ -3,8 +3,8 @@ #include -namespace heaterSwitches { - enum switcherList: uint8_t { +namespace heater { + enum Switchers: uint8_t { HEATER_0, HEATER_1, HEATER_2, diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index e27d74b6..3582edb0 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -71,7 +71,7 @@ ReturnValue_t HeaterHandler::initialize() { } ReturnValue_t HeaterHandler::initializeHeaterMap() { - for (power::Switch_t switchNr = 0; switchNr < heaterSwitches::NUMBER_OF_SWITCHES; switchNr++) { + for (power::Switch_t switchNr = 0; switchNr < heater::NUMBER_OF_SWITCHES; switchNr++) { heaterVec.push_back(HeaterWrapper(helper.heaters[switchNr])); } return RETURN_OK; @@ -159,14 +159,14 @@ ReturnValue_t HeaterHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t o } void HeaterHandler::handleActiveCommands() { - for (uint8_t idx = 0; idx < heater::NUMBER_OF_HEATERS; idx++) { + for (uint8_t idx = 0; idx < heater::NUMBER_OF_SWITCHES; idx++) { if (heaterVec[idx].active) { switch (heaterVec[idx].action) { case SET_SWITCH_ON: - handleSwitchOnCommand(idx); + handleSwitchOnCommand(static_cast(idx)); break; case SET_SWITCH_OFF: - handleSwitchOffCommand(idx); + handleSwitchOffCommand(static_cast(idx)); break; default: sif::error << "HeaterHandler::handleActiveCommands: Invalid action commanded" @@ -177,7 +177,7 @@ void HeaterHandler::handleActiveCommands() { } } -void HeaterHandler::handleSwitchOnCommand(uint8_t heaterIdx) { +void HeaterHandler::handleSwitchOnCommand(heater::Switchers heaterIdx) { ReturnValue_t result = RETURN_OK; auto& heater = heaterVec.at(heaterIdx); /* Check if command waits for main switch being set on and whether the timeout has expired */ @@ -238,7 +238,7 @@ void HeaterHandler::handleSwitchOnCommand(uint8_t heaterIdx) { } } -void HeaterHandler::handleSwitchOffCommand(uint8_t heaterIdx) { +void HeaterHandler::handleSwitchOffCommand(heater::Switchers heaterIdx) { ReturnValue_t result = RETURN_OK; auto& heater = heaterVec.at(heaterIdx); // Check whether switch is already off @@ -271,14 +271,14 @@ void HeaterHandler::handleSwitchOffCommand(uint8_t heaterIdx) { heater.active = false; } -HeaterHandler::SwitchState HeaterHandler::checkSwitchState(uint8_t switchNr) { +HeaterHandler::SwitchState HeaterHandler::checkSwitchState(heater::Switchers switchNr) { return heaterVec.at(switchNr).switchState; } bool HeaterHandler::allSwitchesOff() { bool allSwitchesOrd = false; /* Or all switches. As soon one switch is on, allSwitchesOrd will be true */ - for (power::Switch_t switchNr = 0; switchNr < heaterSwitches::NUMBER_OF_SWITCHES; switchNr++) { + for (power::Switch_t switchNr = 0; switchNr < heater::NUMBER_OF_SWITCHES; switchNr++) { allSwitchesOrd = allSwitchesOrd || heaterVec.at(switchNr).switchState; } return !allSwitchesOrd; diff --git a/mission/devices/HeaterHandler.h b/mission/devices/HeaterHandler.h index 28ac9899..40685ced 100644 --- a/mission/devices/HeaterHandler.h +++ b/mission/devices/HeaterHandler.h @@ -21,18 +21,12 @@ class PowerSwitchIF; class HealthTableIF; -namespace heater { - -static constexpr uint8_t NUMBER_OF_HEATERS = 8; - -} - using HeaterPair = std::pair; struct HeaterHelper { public: - HeaterHelper(std::array heaters) : heaters(heaters) {} - std::array heaters = {}; + HeaterHelper(std::array heaters) : heaters(heaters) {} + std::array heaters = {}; }; /** * @brief This class intends the control of heaters. @@ -144,7 +138,7 @@ class HeaterHandler : public ExecutableObjectIF, * @brief Returns the state of a switch (ON - true, or OFF - false). * @param switchNr The number of the switch to check. */ - SwitchState checkSwitchState(power::Switch_t switchNr); + SwitchState checkSwitchState(heater::Switchers switchNr); /** * @brief This function runs commands waiting for execution. @@ -158,9 +152,9 @@ class HeaterHandler : public ExecutableObjectIF, */ void setInitialSwitchStates(); - void handleSwitchOnCommand(uint8_t heaterIdx); + void handleSwitchOnCommand(heater::Switchers heaterIdx); - void handleSwitchOffCommand(uint8_t heaterIdx); + void handleSwitchOffCommand(heater::Switchers heaterIdx); /** * @brief Checks if all switches are off. From 0172351e8934f358f117bd8398e98c8bea164f11 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 May 2022 22:58:06 +0200 Subject: [PATCH 0048/2058] additional try catch block --- mission/devices/HeaterHandler.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 3582edb0..5771e27b 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -37,10 +37,15 @@ HeaterHandler::HeaterHandler(object_id_t setObjectId_, GpioIF* gpioInterface_, H HeaterHandler::~HeaterHandler() {} ReturnValue_t HeaterHandler::performOperation(uint8_t operationCode) { - readCommandQueue(); - handleActiveCommands(); - for (const auto& heater : helper.heaters) { - heater.first->performOperation(0); + try { + readCommandQueue(); + handleActiveCommands(); + for (const auto& heater : helper.heaters) { + heater.first->performOperation(0); + } + } catch(const std::out_of_range& e) { + sif::warning << "HeaterHandler::performOperation: " + "Out of range error | " << e.what() << std::endl; } return RETURN_OK; } From c413d90b88f48425c32294f48acf654b6a29ec88 Mon Sep 17 00:00:00 2001 From: petriVM18 Date: Tue, 3 May 2022 08:10:07 +0200 Subject: [PATCH 0049/2058] Minor adaption ti filesystem include and removed arcsect submodule to make it work on my local machine --- .gitmodules | 3 --- mission/devices/devicedefinitions/payloadPcduDefinitions.h | 2 +- mission/memory/NVMParameterBase.cpp | 4 ++-- mission/memory/NVMParameterBase.h | 2 +- thirdparty/arcsec_star_tracker | 1 - 5 files changed, 4 insertions(+), 8 deletions(-) delete mode 160000 thirdparty/arcsec_star_tracker diff --git a/.gitmodules b/.gitmodules index d309e0f5..d9a11687 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,9 +13,6 @@ [submodule "generators/fsfwgen"] path = generators/fsfwgen url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-gen.git -[submodule "thirdparty/arcsec_star_tracker"] - path = thirdparty/arcsec_star_tracker - url = https://egit.irs.uni-stuttgart.de/eive/arcsec_star_tracker.git [submodule "thirdparty/json"] path = thirdparty/json url = https://github.com/nlohmann/json.git diff --git a/mission/devices/devicedefinitions/payloadPcduDefinitions.h b/mission/devices/devicedefinitions/payloadPcduDefinitions.h index ab387fc7..c4dc2aa1 100644 --- a/mission/devices/devicedefinitions/payloadPcduDefinitions.h +++ b/mission/devices/devicedefinitions/payloadPcduDefinitions.h @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include "OBSWConfig.h" diff --git a/mission/memory/NVMParameterBase.cpp b/mission/memory/NVMParameterBase.cpp index 78f40525..865c561b 100644 --- a/mission/memory/NVMParameterBase.cpp +++ b/mission/memory/NVMParameterBase.cpp @@ -8,7 +8,7 @@ NVMParameterBase::NVMParameterBase(std::string fullName) : fullName(fullName) {} ReturnValue_t NVMParameterBase::readJsonFile() { - if (std::filesystem::exists(fullName)) { + if (std::experimental::filesystem::exists(fullName)) { // Read JSON file content into object std::ifstream i(fullName); try { @@ -37,7 +37,7 @@ void NVMParameterBase::setFullName(std::string fullName) { this->fullName = full std::string NVMParameterBase::getFullName() const { return fullName; } -bool NVMParameterBase::getJsonFileExists() { return std::filesystem::exists(fullName); } +bool NVMParameterBase::getJsonFileExists() { return std::experimental::filesystem::exists(fullName); } void NVMParameterBase::printKeys() const { sif::info << "Printing keys for JSON file " << fullName << std::endl; diff --git a/mission/memory/NVMParameterBase.h b/mission/memory/NVMParameterBase.h index eb839905..16d9824c 100644 --- a/mission/memory/NVMParameterBase.h +++ b/mission/memory/NVMParameterBase.h @@ -1,7 +1,7 @@ #ifndef BSP_Q7S_CORE_NVMPARAMS_NVMPARAMIF_H_ #define BSP_Q7S_CORE_NVMPARAMS_NVMPARAMIF_H_ -#include +#include #include #include diff --git a/thirdparty/arcsec_star_tracker b/thirdparty/arcsec_star_tracker deleted file mode 160000 index 93e93965..00000000 --- a/thirdparty/arcsec_star_tracker +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 93e93965e2c6405170b62c523dea1990db02d2ad From b49ed2bacf0501998cfa40069ad45a8ff16f7178 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 3 May 2022 16:03:57 +0200 Subject: [PATCH 0050/2058] fsfw update --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 7760b306..7f6c8b8b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 7760b3063ee9249316edd1772384474676b062b2 +Subproject commit 7f6c8b8b123a63546de0d73f0de35900d6c806bf From bc28ae4d1fcd619de2790546dd19ec36a6873803 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 3 May 2022 17:38:37 +0200 Subject: [PATCH 0051/2058] bump submodules --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 7f6c8b8b..83d9dbc0 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 7f6c8b8b123a63546de0d73f0de35900d6c806bf +Subproject commit 83d9dbc052109c0b1a0c2be72e3fb3015a9abdd7 diff --git a/tmtc b/tmtc index 0a47c17f..aab5c289 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 0a47c17fa699dc571d2d3e63ec08c9f4cf513f65 +Subproject commit aab5c289601a0d80d7104414a34df26d87789fd4 From 8f9e8fe3fb651ec0fb23b44dd7fceb2eb9f2043c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 3 May 2022 17:39:02 +0200 Subject: [PATCH 0052/2058] ignore new build folder name --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c337ab89..a5065673 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /build* +/cmake-build* # Eclipse .settings From d79323c6ca38a9f32791254165d9689ef8f873df Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 3 May 2022 17:45:39 +0200 Subject: [PATCH 0053/2058] small fix for generic factory header --- mission/core/GenericFactory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/core/GenericFactory.h b/mission/core/GenericFactory.h index cabbbb91..4bc6695d 100644 --- a/mission/core/GenericFactory.h +++ b/mission/core/GenericFactory.h @@ -5,7 +5,7 @@ class HealthTableIF; namespace ObjectFactory { -void produceGenericObjects(HealthTableIF** healthTable); +void produceGenericObjects(HealthTableIF** healthTable = nullptr); } From 1536a0f94b32fb2d1977d416aa4c1d32a80d7c49 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 3 May 2022 18:17:10 +0200 Subject: [PATCH 0054/2058] named heaters --- common/config/devices/heaterSwitcherList.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/common/config/devices/heaterSwitcherList.h b/common/config/devices/heaterSwitcherList.h index 8d27cf15..256e5c88 100644 --- a/common/config/devices/heaterSwitcherList.h +++ b/common/config/devices/heaterSwitcherList.h @@ -5,14 +5,14 @@ namespace heater { enum Switchers: uint8_t { - HEATER_0, - HEATER_1, - HEATER_2, - HEATER_3, - HEATER_4, - HEATER_5, - HEATER_6, - HEATER_7, + HEATER_0_OBC_BRD, + HEATER_1_PLOC_PROC_BRD, + HEATER_2_ACS_BRD, + HEATER_3_PCDU_PDU, + HEATER_4_CAMERA, + HEATER_5_STR, + HEATER_6_DRO, + HEATER_7_HPA, NUMBER_OF_SWITCHES }; } From 5f5c996cfd6436b86b3bd4848fac1210a8a4eae3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 4 May 2022 09:26:11 +0200 Subject: [PATCH 0055/2058] bump tmtc IF --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index aab5c289..8bc51b29 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit aab5c289601a0d80d7104414a34df26d87789fd4 +Subproject commit 8bc51b293bc5fbd224b6638d8e7c00fd9ab85930 From 50ca3783187b6a08e3c4e64f50377555f0fb6782 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 4 May 2022 10:34:11 +0200 Subject: [PATCH 0056/2058] update for updated gpio API --- fsfw | 2 +- generators/bsp_q7s_events.csv | 8 +- generators/bsp_q7s_objects.csv | 8 + generators/bsp_q7s_returnvalues.csv | 612 +++++++++--------- generators/events/translateEvents.cpp | 14 +- generators/objects/translateObjects.cpp | 28 +- linux/boardtest/LibgpiodTest.cpp | 22 +- linux/fsfwconfig/events/translateEvents.cpp | 14 +- linux/fsfwconfig/objects/translateObjects.cpp | 28 +- linux/obc/PapbVcInterface.cpp | 12 +- mission/devices/HeaterHandler.cpp | 16 +- mission/devices/HeaterHandler.h | 15 +- tmtc | 2 +- 13 files changed, 431 insertions(+), 350 deletions(-) diff --git a/fsfw b/fsfw index 83d9dbc0..3556eca8 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 83d9dbc052109c0b1a0c2be72e3fb3015a9abdd7 +Subproject commit 3556eca8e875aaa4aab1c96e60f0b1eaefc7e982 diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index d48ca211..939e7862 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -83,9 +83,11 @@ 11303;0x2c27;FDIR_REACTION_IGNORED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h 11400;0x2c88;GPIO_PULL_HIGH_FAILED;LOW;;mission/devices/HeaterHandler.h 11401;0x2c89;GPIO_PULL_LOW_FAILED;LOW;;mission/devices/HeaterHandler.h -11402;0x2c8a;SWITCH_ALREADY_ON;LOW;;mission/devices/HeaterHandler.h -11403;0x2c8b;SWITCH_ALREADY_OFF;LOW;;mission/devices/HeaterHandler.h -11404;0x2c8c;MAIN_SWITCH_TIMEOUT;LOW;;mission/devices/HeaterHandler.h +11402;0x2c8a;HEATER_WENT_ON;INFO;;mission/devices/HeaterHandler.h +11403;0x2c8b;HEATER_WENT_OFF;INFO;;mission/devices/HeaterHandler.h +11404;0x2c8c;SWITCH_ALREADY_ON;LOW;;mission/devices/HeaterHandler.h +11405;0x2c8d;SWITCH_ALREADY_OFF;LOW;;mission/devices/HeaterHandler.h +11406;0x2c8e;MAIN_SWITCH_TIMEOUT;MEDIUM;;mission/devices/HeaterHandler.h 11500;0x2cec;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h 11501;0x2ced;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h 11502;0x2cee;DEPLOYMENT_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index a19c8e77..674a4cae 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -109,6 +109,14 @@ 0x5400CAFE;DUMMY_INTERFACE 0x54123456;LIBGPIOD_TEST 0x54694269;TEST_TASK +0x60000000;HEATER_0 +0x60000001;HEATER_1 +0x60000002;HEATER_2 +0x60000003;HEATER_3 +0x60000004;HEATER_4 +0x60000005;HEATER_5 +0x60000006;HEATER_6 +0x60000007;HEATER_7 0x73000001;ACS_BOARD_ASS 0x73000002;SUS_BOARD_ASS 0x73000003;TCS_BOARD_ASS diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 0081805a..2e31206c 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -1,13 +1,13 @@ 0x0;OK;System-wide code for ok.;RETURN_OK;HasReturnvaluesIF.h;HasReturnvaluesIF 0x1;Failed;Unspecified system-wide code for failed.;RETURN_FAILED;HasReturnvaluesIF.h;HasReturnvaluesIF -0x65a0;NVMB_KeyNotExists;Specified key does not exist in json file;0xA0;mission/memory/NVMParameterBase.h;NVM_PARAM_BASE -0x5aa0;SUSS_ErrorUnlockMutex;;0xA0;mission/devices/SusHandler.h;SUS_HANDLER -0x5aa1;SUSS_ErrorLockMutex;;0xA1;mission/devices/SusHandler.h;SUS_HANDLER +0x62a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;0xA0;mission/tmtc/CCSDSHandler.h;CCSDS_HANDLER 0x68a0;SADPL_CommandNotSupported;;0xA0;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x68a1;SADPL_DeploymentAlreadyExecuting;;0xA1;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x68a2;SADPL_MainSwitchTimeoutFailure;;0xA2;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x68a3;SADPL_SwitchingDeplSa1Failed;;0xA3;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x68a4;SADPL_SwitchingDeplSa2Failed;;0xA4;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER +0x5aa0;SUSS_ErrorUnlockMutex;;0xA0;mission/devices/SusHandler.h;SUS_HANDLER +0x5aa1;SUSS_ErrorLockMutex;;0xA1;mission/devices/SusHandler.h;SUS_HANDLER 0x55b0;RWHA_SpiWriteFailure;;0xB0;mission/devices/RwHandler.h;RW_HANDLER 0x55b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;0xB1;mission/devices/RwHandler.h;RW_HANDLER 0x55b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;0xB2;mission/devices/RwHandler.h;RW_HANDLER @@ -20,12 +20,6 @@ 0x55a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;0xA2;mission/devices/RwHandler.h;RW_HANDLER 0x55a3;RWHA_ExecutionFailed;Command execution failed;0xA3;mission/devices/RwHandler.h;RW_HANDLER 0x55a4;RWHA_CrcError;Reaction wheel reply has invalid crc;0xA4;mission/devices/RwHandler.h;RW_HANDLER -0x5f00;GOMS_PacketTooLong;;0;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f01;GOMS_InvalidTableId;;1;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f02;GOMS_InvalidAddress;;2;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f03;GOMS_InvalidParamSize;;3;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f04;GOMS_InvalidPayloadSize;;4;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f05;GOMS_UnknownReplyId;;5;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x54a0;IMTQ_InvalidCommandCode;;0xA0;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a1;IMTQ_ParameterMissing;;0xA1;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a2;IMTQ_ParameterInvalid;;0xA2;mission/devices/IMTQHandler.h;IMTQ_HANDLER @@ -34,6 +28,17 @@ 0x54a5;IMTQ_RejectedWithoutReason;;0xA5;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a6;IMTQ_CmdErrUnknown;;0xA6;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;0xA7;mission/devices/IMTQHandler.h;IMTQ_HANDLER +0x52a1;HEATER_CommandNotSupported;;0xA1;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x52a2;HEATER_InitFailed;;0xA2;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x52a3;HEATER_InvalidSwitchNr;;0xA3;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x52a4;HEATER_MainSwitchSetTimeout;;0xA4;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x52a5;HEATER_CommandAlreadyWaiting;;0xA5;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x5f00;GOMS_PacketTooLong;;0;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f01;GOMS_InvalidTableId;;1;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f02;GOMS_InvalidAddress;;2;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f03;GOMS_InvalidParamSize;;3;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f04;GOMS_InvalidPayloadSize;;4;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f05;GOMS_UnknownReplyId;;5;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x53a0;SYRLINKS_CrcFailure;;0xA0;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a1;SYRLINKS_UartFraminOrParityErrorAck;;0xA1;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a2;SYRLINKS_BadCharacterAck;;0xA2;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER @@ -43,63 +48,92 @@ 0x53a6;SYRLINKS_BadCrcAck;;0xA6;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a7;SYRLINKS_ReplyWrongSize;;0xA7;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a8;SYRLINKS_MissingStartFrameCharacter;;0xA8;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER -0x52a1;HEATER_CommandNotSupported;;0xA1;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x52a2;HEATER_InitFailed;;0xA2;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x52a3;HEATER_InvalidSwitchNr;;0xA3;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x52a4;HEATER_MainSwitchSetTimeout;;0xA4;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x52a5;HEATER_CommandAlreadyWaiting;;0xA5;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x62a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;0xA0;mission/tmtc/CCSDSHandler.h;CCSDS_HANDLER +0x65a0;NVMB_KeyNotExists;Specified key does not exist in json file;0xA0;mission/memory/NVMParameterBase.h;NVM_PARAM_BASE +0x4300; HSPI_OpeningFileFailed;;0;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI +0x4301; HSPI_FullDuplexTransferFailed;;1;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI +0x4302; HSPI_HalfDuplexTransferFailed;;2;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI +0x4401; HURT_UartReadFailure;;1;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART +0x4402; HURT_UartReadSizeMissmatch;;2;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART +0x4403; HURT_UartRxBufferTooSmall;;3;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART +0x4601; HGIO_UnknownGpioId;;1;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO +0x4602; HGIO_DriveGpioFailure;;2;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO +0x4603; HGIO_GpioTypeFailure;;3;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO +0x4604; HGIO_GpioInvalidInstance;;4;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO +0x4605; HGIO_GpioDuplicateDetected;;5;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO +0x4606; HGIO_GpioInitFailed;;6;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO +0x4200; UXOS_ExecutionFinished;Execution of the current command has finished;0;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL +0x4201; UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL +0x4202; UXOS_BytesRead;Some bytes have been read from the executing process;2;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL +0x4203; UXOS_CommandError;Command execution failed;3;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL +0x4204; UXOS_NoCommandLoadedOrPending;;4;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL +0x4206; UXOS_PcloseCallError;;6;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL +0x3b00; LPIF_PoolEntryNotFound;;0x00;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF +0x3b01; LPIF_PoolEntryTypeConflict;;0x01;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF +0x3d00; HKM_QueueOrDestinationInvalid;;0;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d01; HKM_WrongHkPacketType;;1;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d02; HKM_ReportingStatusUnchanged;;2;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d03; HKM_PeriodicHelperInvalid;;3;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d04; HKM_PoolobjectNotFound;;4;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d05; HKM_DatasetNotFound;;5;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3501; CFDP_InvalidTlvType;;1;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3502; CFDP_InvalidDirectiveFields;;2;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3503; CFDP_InvalidPduDatafieldLen;;3;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3504; CFDP_InvalidAckDirectiveFields;;4;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3505; CFDP_MetadataCantParseOptions;;5;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3506; CFDP_FinishedCantParseFsResponses;;6;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3508; CFDP_FilestoreRequiresSecondFile;;8;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3509; CFDP_FilestoreResponseCantParseFsMessage;;9;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3101; CF_ObjectHasNoFunctions;;1;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF +0x3102; CF_AlreadyCommanding;;2;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF +0x3201; HF_IsBusy;;1;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x3202; HF_InvalidParameters;;2;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x3203; HF_ExecutionFinished;;3;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x3204; HF_InvalidActionId;;4;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x2d01; HPA_InvalidIdentifierId;;0x01;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2d02; HPA_InvalidDomainId;;0x02;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2d03; HPA_InvalidValue;;0x03;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2d05; HPA_ReadOnly;;0x05;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2c01; PAW_UnknownDatatype;;0x01;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c02; PAW_DatatypeMissmatch;;0x02;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c03; PAW_Readonly;;0x03;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c04; PAW_TooBig;;0x04;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c05; PAW_SourceNotSet;;0x05;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c06; PAW_OutOfBounds;;0x06;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c07; PAW_NotSet;;0x07;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c08; PAW_ColumnOrRowsZero;;0x08;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x1701; HHI_ObjectNotHealthy;;1;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF +0x1702; HHI_InvalidHealthState;;2;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF 0x2701; SM_DataTooLarge;;1;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF 0x2702; SM_DataStorageFull;;2;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF 0x2703; SM_IllegalStorageId;;3;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF 0x2704; SM_DataDoesNotExist;;4;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF 0x2705; SM_IllegalAddress;;5;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF 0x2706; SM_PoolTooLarge;;6;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF -0x601; PP_DoItMyself;;1;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x602; PP_PointsToVariable;;2;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x603; PP_PointsToMemory;;3;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x604; PP_ActivityCompleted;;4;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x605; PP_PointsToVectorUint8;;5;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x606; PP_PointsToVectorUint16;;6;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x607; PP_PointsToVectorUint32;;7;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x608; PP_PointsToVectorFloat;;8;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x6a0; PP_DumpNotSupported;;0xA0;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x6e0; PP_InvalidSize;;0xE0;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x6e1; PP_InvalidAddress;;0xE1;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x6e2; PP_InvalidContent;;0xE2;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x6e3; PP_UnalignedAccess;;0xE3;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x6e4; PP_WriteProtected;;0xE4;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x4100; FILS_GenericFileError;;0;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM -0x4101; FILS_IsBusy;;1;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM -0x4102; FILS_InvalidParameters;;2;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM -0x4105; FILS_FileDoesNotExist;;5;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM -0x4106; FILS_FileAlreadyExists;;6;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM -0x4107; FILS_FileLocked;;7;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM -0x410a; FILS_DirectoryDoesNotExist;;10;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM -0x410b; FILS_DirectoryAlreadyExists;;11;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM -0x410c; FILS_DirectoryNotEmpty;;12;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM -0x410f; FILS_SequencePacketMissingWrite;;15;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM -0x4110; FILS_SequencePacketMissingRead;;16;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM -0x13e0; MH_UnknownCmd;;0xE0;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER -0x13e1; MH_InvalidAddress;;0xE1;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER -0x13e2; MH_InvalidSize;;0xE2;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER -0x13e3; MH_StateMismatch;;0xE3;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER -0x37a1; SGP4_InvalidEccentricity;;0xA1;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS -0x37a2; SGP4_InvalidMeanMotion;;0xA2;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS -0x37a3; SGP4_InvalidPerturbationElements;;0xA3;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS -0x37a4; SGP4_InvalidSemiLatusRectum;;0xA4;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS -0x37a5; SGP4_InvalidEpochElements;;0xA5;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS -0x37a6; SGP4_SatelliteHasDecayed;;0xA6;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS -0x37b1; SGP4_TleTooOld;;0xB1;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS -0x37b2; SGP4_TleNotInitialized;;0xB2;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS -0x1101; AL_Full;;0x01;fsfw/src/fsfw/container/ArrayList.h;ARRAY_LIST -0x1501; FM_KeyAlreadyExists;;0x01;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP -0x1502; FM_MapFull;;0x02;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP -0x1503; FM_KeyDoesNotExist;;0x03;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP -0x1801; FF_Full;;1;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS -0x1802; FF_Empty;;2;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS -0x1601; FMM_MapFull;;0x01;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP -0x1602; FMM_KeyDoesNotExist;;0x02;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP +0x2301; MT_TooDetailedRequest;;1;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2302; MT_TooGeneralRequest;;2;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2303; MT_NoMatch;;3;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2304; MT_Full;;4;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2305; MT_NewNodeCreated;;5;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x3e01; DLEE_StreamTooShort;;0x01;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER +0x3e02; DLEE_DecodingError;;0x02;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER +0x2e01; ASC_TooLongForTargetType;;1;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER +0x2e02; ASC_InvalidCharacters;;2;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER +0x2e03; ASC_BufferTooSmall;;0x3;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER +0x1c01; TCD_PacketLost;;1;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION +0x1c02; TCD_DestinationNotFound;;2;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION +0x1c03; TCD_ServiceIdAlreadyExists;;3;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION +0x1b00; TCC_IllegalApid;;0;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b01; TCC_IncompletePacket;;1;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b02; TCC_IncorrectChecksum;;2;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b03; TCC_IllegalPacketType;;3;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b04; TCC_IllegalPacketSubtype;;4;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b05; TCC_IncorrectPrimaryHeader;;5;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b06; TCC_IncorrectSecondaryHeader;;6;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x3901; MQI_Empty;;1;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3902; MQI_Full;No space left for more messages;2;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3903; MQI_NoReplyPartner;Returned if a reply method was called without partner;3;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3904; MQI_DestinationInvalid;Returned if the target destination is invalid.;4;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0xf01; CM_UnknownCommand;;1;fsfw/src/fsfw/ipc/CommandMessageIF.h;COMMAND_MESSAGE 0x3801; MUX_NotEnoughResources;;1;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF 0x3802; MUX_InsufficientMemory;;2;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF 0x3803; MUX_NoPrivilege;;3;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF @@ -112,23 +146,20 @@ 0x380a; MUX_MutexTimeout;;10;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF 0x380b; MUX_MutexInvalidId;;11;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF 0x380c; MUX_MutexDestroyedWhileWaiting;;12;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3901; MQI_Empty;;1;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF -0x3902; MQI_Full;No space left for more messages;2;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF -0x3903; MQI_NoReplyPartner;Returned if a reply method was called without partner;3;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF -0x3904; MQI_DestinationInvalid;Returned if the target destination is invalid.;4;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF -0xf01; CM_UnknownCommand;;1;fsfw/src/fsfw/ipc/CommandMessageIF.h;COMMAND_MESSAGE -0xe01; HM_InvalidMode;;0x01;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF -0xe02; HM_TransNotAllowed;;0x02;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF -0xe03; HM_InTransition;;0x03;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF -0xe04; HM_InvalidSubmode;;0x04;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF +0x2801; TC_InvalidTargetState;;1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF +0x28f1; TC_AboveOperationalLimit;;0xF1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF +0x28f2; TC_BelowOperationalLimit;;0xF2;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF +0x801; DPS_InvalidParameterDefinition;;1;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x802; DPS_SetWasAlreadyRead;;2;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x803; DPS_CommitingWithoutReading;;3;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x804; DPS_DataSetUninitialised;;4;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x805; DPS_DataSetFull;;5;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x806; DPS_PoolVarNull;;6;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x3ca0; PVA_InvalidReadWriteMode;;0xA0;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF +0x3ca1; PVA_InvalidPoolEntry;;0xA1;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF 0xc02; MS_InvalidEntry;;0x02;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF 0xc03; MS_TooManyElements;;0x03;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF 0xc04; MS_CantStoreEmpty;;0x04;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF -0xb01; SB_ChildNotFound;;0x01;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb02; SB_ChildInfoUpdated;;0x02;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb03; SB_ChildDoesntHaveModes;;0x03;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb04; SB_CouldNotInsertChild;;0x04;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb05; SB_TableContainsInvalidObjectId;;0x05;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE 0xd01; SS_SequenceAlreadyExists;;0x01;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM 0xd02; SS_TableAlreadyExists;;0x02;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM 0xd03; SS_TableDoesNotExist;;0x03;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM @@ -143,7 +174,53 @@ 0xd0e; SS_TableInUse;;0x0E;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM 0xda1; SS_TargetTableNotReached;;0xA1;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM 0xda2; SS_TableCheckFailed;;0xA2;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0x2401; EV_ListenerNotFound;;1;fsfw/src/fsfw/events/EventManagerIF.h;EVENT_MANAGER_IF +0xb01; SB_ChildNotFound;;0x01;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb02; SB_ChildInfoUpdated;;0x02;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb03; SB_ChildDoesntHaveModes;;0x03;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb04; SB_CouldNotInsertChild;;0x04;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb05; SB_TableContainsInvalidObjectId;;0x05;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb00; SB_ConnBroken;;0;fsfw/src/fsfw/osal/common/TcpTmTcServer.h;SUBSYSTEM_BASE +0x2901; IEC_NoConfigurationTable;;0x01;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2902; IEC_NoCpuTable;;0x02;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2903; IEC_InvalidWorkspaceAddress;;0x03;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2904; IEC_TooLittleWorkspace;;0x04;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2905; IEC_WorkspaceAllocation;;0x05;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2906; IEC_InterruptStackTooSmall;;0x06;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2907; IEC_ThreadExitted;;0x07;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2908; IEC_InconsistentMpInformation;;0x08;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2909; IEC_InvalidNode;;0x09;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x290a; IEC_NoMpci;;0x0a;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x290b; IEC_BadPacket;;0x0b;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x290c; IEC_OutOfPackets;;0x0c;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x290d; IEC_OutOfGlobalObjects;;0x0d;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x290e; IEC_OutOfProxies;;0x0e;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x290f; IEC_InvalidGlobalId;;0x0f;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2910; IEC_BadStackHook;;0x10;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2911; IEC_BadAttributes;;0x11;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2912; IEC_ImplementationKeyCreateInconsistency;;0x12;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2913; IEC_ImplementationBlockingOperationCancel;;0x13;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2914; IEC_MutexObtainFromBadState;;0x14;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2915; IEC_UnlimitedAndMaximumIs0;;0x15;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x1401; SE_BufferTooShort;;1;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF +0x1402; SE_StreamTooShort;;2;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF +0x1403; SE_TooManyElements;;3;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF +0x4a00; SPPA_NoPacketFound;;0x00;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER +0x4a01; SPPA_SplitPacket;;0x01;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER +0x1d01; PUS_ActivityStarted;;1;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d02; PUS_InvalidSubservice;;2;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d03; PUS_IllegalApplicationData;;3;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d04; PUS_SendTmFailed;;4;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d05; PUS_Timeout;;5;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1f01; CSB_ExecutionComplete;;1;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f02; CSB_NoStepMessage;;2;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f03; CSB_ObjectBusy;;3;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f04; CSB_Busy;;4;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f05; CSB_InvalidTc;;5;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f06; CSB_InvalidObject;;6;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f07; CSB_InvalidReply;;7;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x2500; FDI_YourFault;;0;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF +0x2501; FDI_MyFault;;1;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF +0x2502; FDI_ConfirmLater;;2;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF 0x4e1; RMP_CommandNoDescriptorsAvailable;;0xE1;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL 0x4e2; RMP_CommandBufferFull;;0xE2;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL 0x4e3; RMP_CommandChannelOutOfRange;;0xE3;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL @@ -184,128 +261,6 @@ 0x40a; RMP_ReplyCommandNotImplementedOrNotAuthorised;;10;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL 0x40b; RMP_ReplyRmwDataLengthError;;11;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL 0x40c; RMP_ReplyInvalidTargetLogicalAddress;;12;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL -0x1401; SE_BufferTooShort;;1;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF -0x1402; SE_StreamTooShort;;2;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF -0x1403; SE_TooManyElements;;3;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF -0x3ca0; PVA_InvalidReadWriteMode;;0xA0;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF -0x3ca1; PVA_InvalidPoolEntry;;0xA1;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF -0x801; DPS_InvalidParameterDefinition;;1;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x802; DPS_SetWasAlreadyRead;;2;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x803; DPS_CommitingWithoutReading;;3;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x804; DPS_DataSetUninitialised;;4;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x805; DPS_DataSetFull;;5;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x806; DPS_PoolVarNull;;6;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x1b00; TCC_IllegalApid;;0;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b01; TCC_IncompletePacket;;1;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b02; TCC_IncorrectChecksum;;2;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b03; TCC_IllegalPacketType;;3;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b04; TCC_IllegalPacketSubtype;;4;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b05; TCC_IncorrectPrimaryHeader;;5;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b06; TCC_IncorrectSecondaryHeader;;6;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1c01; TCD_PacketLost;;1;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION -0x1c02; TCD_DestinationNotFound;;2;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION -0x1c03; TCD_ServiceIdAlreadyExists;;3;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION -0x2f01; POS_InPowerTransition;;1;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER -0x2f02; POS_SwitchStateMismatch;;2;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER -0x501; PS_SwitchOn;;1;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x500; PS_SwitchOff;;0;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x502; PS_SwitchTimeout;;2;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x503; PS_FuseOn;;3;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x504; PS_FuseOff;;4;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x3a00; SPH_ConnBroken;;0;fsfw/src/fsfw/osal/common/TcpTmTcServer.h;SEMAPHORE_IF -0x2901; IEC_NoConfigurationTable;;0x01;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2902; IEC_NoCpuTable;;0x02;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2903; IEC_InvalidWorkspaceAddress;;0x03;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2904; IEC_TooLittleWorkspace;;0x04;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2905; IEC_WorkspaceAllocation;;0x05;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2906; IEC_InterruptStackTooSmall;;0x06;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2907; IEC_ThreadExitted;;0x07;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2908; IEC_InconsistentMpInformation;;0x08;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2909; IEC_InvalidNode;;0x09;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x290a; IEC_NoMpci;;0x0a;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x290b; IEC_BadPacket;;0x0b;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x290c; IEC_OutOfPackets;;0x0c;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x290d; IEC_OutOfGlobalObjects;;0x0d;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x290e; IEC_OutOfProxies;;0x0e;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x290f; IEC_InvalidGlobalId;;0x0f;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2910; IEC_BadStackHook;;0x10;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2911; IEC_BadAttributes;;0x11;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2912; IEC_ImplementationKeyCreateInconsistency;;0x12;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2913; IEC_ImplementationBlockingOperationCancel;;0x13;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2914; IEC_MutexObtainFromBadState;;0x14;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2915; IEC_UnlimitedAndMaximumIs0;;0x15;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x2500; FDI_YourFault;;0;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF -0x2501; FDI_MyFault;;1;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF -0x2502; FDI_ConfirmLater;;2;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF -0x201; OM_InsertionFailed;;1;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF -0x202; OM_NotFound;;2;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF -0x203; OM_ChildInitFailed;;3;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF -0x204; OM_InternalErrReporterUninit;;4;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF -0x2101; TMF_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2102; TMF_LastPacketFound;;2;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2103; TMF_StopFetch;;3;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2104; TMF_Timeout;;4;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2105; TMF_TmChannelFull;;5;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2106; TMF_NotStored;;6;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2107; TMF_AllDeleted;;7;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2108; TMF_InvalidData;;8;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2109; TMF_NotReady;;9;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2001; TMB_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2002; TMB_Full;;2;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2003; TMB_Empty;;3;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2004; TMB_NullRequested;;4;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2005; TMB_TooLarge;;5;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2006; TMB_NotReady;;6;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2007; TMB_DumpError;;7;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2008; TMB_CrcError;;8;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2009; TMB_Timeout;;9;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200a; TMB_IdlePacketFound;;10;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200b; TMB_TelecommandFound;;11;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200c; TMB_NoPusATm;;12;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200d; TMB_TooSmall;;13;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200e; TMB_BlockNotFound;;14;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200f; TMB_InvalidRequest;;15;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2c01; PAW_UnknownDatatype;;0x01;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c02; PAW_DatatypeMissmatch;;0x02;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c03; PAW_Readonly;;0x03;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c04; PAW_TooBig;;0x04;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c05; PAW_SourceNotSet;;0x05;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c06; PAW_OutOfBounds;;0x06;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c07; PAW_NotSet;;0x07;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c08; PAW_ColumnOrRowsZero;;0x08;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2d01; HPA_InvalidIdentifierId;;0x01;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF -0x2d02; HPA_InvalidDomainId;;0x02;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF -0x2d03; HPA_InvalidValue;;0x03;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF -0x2d05; HPA_ReadOnly;;0x05;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF -0x3a01; SPH_SemaphoreTimeout;;1;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF -0x3a02; SPH_SemaphoreNotOwned;;2;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF -0x3a03; SPH_SemaphoreInvalid;;3;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF -0x1a01; TRC_NotEnoughSensors;;1;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x1a02; TRC_LowestValueOol;;2;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x1a03; TRC_HighestValueOol;;3;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x1a04; TRC_BothValuesOol;;4;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x1a05; TRC_DuplexOol;;5;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x3001; LIM_Unchecked;;1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3002; LIM_Invalid;;2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3003; LIM_Unselected;;3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3004; LIM_BelowLowLimit;;4;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3005; LIM_AboveHighLimit;;5;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3006; LIM_UnexpectedValue;;6;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3007; LIM_OutOfRange;;7;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30a0; LIM_FirstSample;;0xA0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30e0; LIM_InvalidSize;;0xE0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30e1; LIM_WrongType;;0xE1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30e2; LIM_WrongPid;;0xE2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30e3; LIM_WrongLimitId;;0xE3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30ee; LIM_MonitorNotFound;;0xEE;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3501; CFDP_InvalidTlvType;;1;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3502; CFDP_InvalidDirectiveFields;;2;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3503; CFDP_InvalidPduDatafieldLen;;3;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3504; CFDP_InvalidAckDirectiveFields;;4;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3505; CFDP_MetadataCantParseOptions;;5;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3506; CFDP_FinishedCantParseFsResponses;;6;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3508; CFDP_FilestoreRequiresSecondFile;;8;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3509; CFDP_FilestoreResponseCantParseFsMessage;;9;fsfw/src/fsfw/cfdp/definitions.h;CFDP 0x2b01; CCS_BcIsSetVrCommand;;0x01;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF 0x2b02; CCS_BcIsUnlockCommand;;0x02;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF 0x2bb0; CCS_BcIllegalCommand;;0xB0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF @@ -335,12 +290,97 @@ 0x2bd1; CCS_ShorterThanHeader;;0xD1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF 0x2bd2; CCS_TooShortBlockedPacket;;0xD2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF 0x2bd3; CCS_TooShortMapExtraction;;0xD3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x3301; DC_NoReplyReceived;;0x01;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3302; DC_ProtocolError;;0x02;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3303; DC_Nullpointer;;0x03;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3304; DC_InvalidCookieType;;0x04;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3305; DC_NotActive;;0x05;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3306; DC_TooMuchData;;0x06;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x37a1; SGP4_InvalidEccentricity;;0xA1;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x37a2; SGP4_InvalidMeanMotion;;0xA2;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x37a3; SGP4_InvalidPerturbationElements;;0xA3;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x37a4; SGP4_InvalidSemiLatusRectum;;0xA4;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x37a5; SGP4_InvalidEpochElements;;0xA5;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x37a6; SGP4_SatelliteHasDecayed;;0xA6;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x37b1; SGP4_TleTooOld;;0xB1;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x37b2; SGP4_TleNotInitialized;;0xB2;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x13e0; MH_UnknownCmd;;0xE0;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x13e1; MH_InvalidAddress;;0xE1;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x13e2; MH_InvalidSize;;0xE2;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x13e3; MH_StateMismatch;;0xE3;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x4100; FILS_GenericFileError;;0;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x4101; FILS_IsBusy;;1;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x4102; FILS_InvalidParameters;;2;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x4105; FILS_FileDoesNotExist;;5;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x4106; FILS_FileAlreadyExists;;6;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x4107; FILS_FileLocked;;7;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x410a; FILS_DirectoryDoesNotExist;;10;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x410b; FILS_DirectoryAlreadyExists;;11;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x410c; FILS_DirectoryNotEmpty;;12;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x410f; FILS_SequencePacketMissingWrite;;15;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x4110; FILS_SequencePacketMissingRead;;16;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x601; PP_DoItMyself;;1;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x602; PP_PointsToVariable;;2;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x603; PP_PointsToMemory;;3;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x604; PP_ActivityCompleted;;4;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x605; PP_PointsToVectorUint8;;5;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x606; PP_PointsToVectorUint16;;6;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x607; PP_PointsToVectorUint32;;7;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x608; PP_PointsToVectorFloat;;8;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x6a0; PP_DumpNotSupported;;0xA0;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x6e0; PP_InvalidSize;;0xE0;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x6e1; PP_InvalidAddress;;0xE1;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x6e2; PP_InvalidContent;;0xE2;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x6e3; PP_UnalignedAccess;;0xE3;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x6e4; PP_WriteProtected;;0xE4;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x201; OM_InsertionFailed;;1;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x202; OM_NotFound;;2;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x203; OM_ChildInitFailed;;3;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x204; OM_InternalErrReporterUninit;;4;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x501; PS_SwitchOn;;1;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x500; PS_SwitchOff;;0;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x502; PS_SwitchTimeout;;2;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x503; PS_FuseOn;;3;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x504; PS_FuseOff;;4;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x2f01; POS_InPowerTransition;;1;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER +0x2f02; POS_SwitchStateMismatch;;2;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER +0x1000; TIM_UnsupportedTimeFormat;;0;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1001; TIM_NotEnoughInformationForTargetFormat;;1;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1002; TIM_LengthMismatch;;2;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1003; TIM_InvalidTimeFormat;;3;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1004; TIM_InvalidDayOfYear;;4;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1005; TIM_TimeDoesNotFitFormat;;5;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x3601; TSI_BadTimestamp;;1;fsfw/src/fsfw/timemanager/TimeStamperIF.h;TIME_STAMPER_IF +0x2101; TMF_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2102; TMF_LastPacketFound;;2;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2103; TMF_StopFetch;;3;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2104; TMF_Timeout;;4;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2105; TMF_TmChannelFull;;5;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2106; TMF_NotStored;;6;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2107; TMF_AllDeleted;;7;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2108; TMF_InvalidData;;8;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2109; TMF_NotReady;;9;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2001; TMB_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2002; TMB_Full;;2;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2003; TMB_Empty;;3;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2004; TMB_NullRequested;;4;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2005; TMB_TooLarge;;5;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2006; TMB_NotReady;;6;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2007; TMB_DumpError;;7;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2008; TMB_CrcError;;8;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2009; TMB_Timeout;;9;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200a; TMB_IdlePacketFound;;10;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200b; TMB_TelecommandFound;;11;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200c; TMB_NoPusATm;;12;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200d; TMB_TooSmall;;13;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200e; TMB_BlockNotFound;;14;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200f; TMB_InvalidRequest;;15;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0xe01; HM_InvalidMode;;0x01;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF +0xe02; HM_TransNotAllowed;;0x02;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF +0xe03; HM_InTransition;;0x03;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF +0xe04; HM_InvalidSubmode;;0x04;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF +0x1501; FM_KeyAlreadyExists;;0x01;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP +0x1502; FM_MapFull;;0x02;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP +0x1503; FM_KeyDoesNotExist;;0x03;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP +0x1101; AL_Full;;0x01;fsfw/src/fsfw/container/ArrayList.h;ARRAY_LIST +0x1601; FMM_MapFull;;0x01;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP +0x1602; FMM_KeyDoesNotExist;;0x02;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP +0x1801; FF_Full;;1;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS +0x1802; FF_Empty;;2;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS 0x3a0; DHB_InvalidChannel;;0xA0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE 0x3b0; DHB_AperiodicReply;;0xB0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE 0x3b1; DHB_IgnoreReplyData;;0xB1;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE @@ -377,77 +417,34 @@ 0x26c3; DHI_DeviceReplyInvalid;;0xC3;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF 0x26d0; DHI_InvalidCommandParameter;;0xD0;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF 0x26d1; DHI_InvalidNumberOrLengthOfParameters;;0xD1;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF -0x2301; MT_TooDetailedRequest;;1;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x2302; MT_TooGeneralRequest;;2;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x2303; MT_NoMatch;;3;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x2304; MT_Full;;4;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x2305; MT_NewNodeCreated;;5;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x3e01; DLEE_StreamTooShort;;0x01;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER -0x3e02; DLEE_DecodingError;;0x02;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER -0x2e01; ASC_TooLongForTargetType;;1;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER -0x2e02; ASC_InvalidCharacters;;2;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER -0x2e03; ASC_BufferTooSmall;;0x3;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER -0x1701; HHI_ObjectNotHealthy;;1;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF -0x1702; HHI_InvalidHealthState;;2;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF -0x3101; CF_ObjectHasNoFunctions;;1;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF -0x3102; CF_AlreadyCommanding;;2;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF -0x3201; HF_IsBusy;;1;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF -0x3202; HF_InvalidParameters;;2;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF -0x3203; HF_ExecutionFinished;;3;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF -0x3204; HF_InvalidActionId;;4;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF -0x3601; TSI_BadTimestamp;;1;fsfw/src/fsfw/timemanager/TimeStamperIF.h;TIME_STAMPER_IF -0x1000; TIM_UnsupportedTimeFormat;;0;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1001; TIM_NotEnoughInformationForTargetFormat;;1;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1002; TIM_LengthMismatch;;2;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1003; TIM_InvalidTimeFormat;;3;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1004; TIM_InvalidDayOfYear;;4;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1005; TIM_TimeDoesNotFitFormat;;5;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x3b00; LPIF_PoolEntryNotFound;;0x00;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF -0x3b01; LPIF_PoolEntryTypeConflict;;0x01;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF -0x3d00; HKM_QueueOrDestinationInvalid;;0;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d01; HKM_WrongHkPacketType;;1;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d02; HKM_ReportingStatusUnchanged;;2;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d03; HKM_PeriodicHelperInvalid;;3;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d04; HKM_PoolobjectNotFound;;4;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d05; HKM_DatasetNotFound;;5;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x2801; TC_InvalidTargetState;;1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF -0x28f1; TC_AboveOperationalLimit;;0xF1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF -0x28f2; TC_BelowOperationalLimit;;0xF2;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF -0x1f01; CSB_ExecutionComplete;;1;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f02; CSB_NoStepMessage;;2;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f03; CSB_ObjectBusy;;3;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f04; CSB_Busy;;4;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f05; CSB_InvalidTc;;5;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f06; CSB_InvalidObject;;6;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f07; CSB_InvalidReply;;7;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x4a00; SPPA_NoPacketFound;;0x00;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER -0x4a01; SPPA_SplitPacket;;0x01;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER -0x1d01; PUS_ActivityStarted;;1;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1d02; PUS_InvalidSubservice;;2;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1d03; PUS_IllegalApplicationData;;3;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1d04; PUS_SendTmFailed;;4;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1d05; PUS_Timeout;;5;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x4300; HSPI_OpeningFileFailed;;0;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI -0x4301; HSPI_FullDuplexTransferFailed;;1;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI -0x4302; HSPI_HalfDuplexTransferFailed;;2;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI -0x4601; HGIO_UnknownGpioId;;1;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO -0x4602; HGIO_DriveGpioFailure;;2;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO -0x4603; HGIO_GpioTypeFailure;;3;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO -0x4604; HGIO_GpioInvalidInstance;;4;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO -0x4605; HGIO_GpioDuplicateDetected;;5;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO -0x4606; HGIO_GpioInitFailed;;6;fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h;HAL_GPIO -0x4401; HURT_UartReadFailure;;1;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART -0x4402; HURT_UartReadSizeMissmatch;;2;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART -0x4403; HURT_UartRxBufferTooSmall;;3;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART -0x4200; UXOS_ExecutionFinished;Execution of the current command has finished;0;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL -0x4201; UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL -0x4202; UXOS_BytesRead;Some bytes have been read from the executing process;2;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL -0x4203; UXOS_CommandError;Command execution failed;3;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL -0x4204; UXOS_NoCommandLoadedOrPending;;4;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL -0x4206; UXOS_PcloseCallError;;6;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL -0x7100; SCBU_KeyNotFound;;0;bsp_q7s/memory/scratchApi.h;SCRATCH_BUFFER -0x66a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;0xA0;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER -0x66a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER +0x3301; DC_NoReplyReceived;;0x01;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3302; DC_ProtocolError;;0x02;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3303; DC_Nullpointer;;0x03;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3304; DC_InvalidCookieType;;0x04;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3305; DC_NotActive;;0x05;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3306; DC_TooMuchData;;0x06;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x2401; EV_ListenerNotFound;;1;fsfw/src/fsfw/events/EventManagerIF.h;EVENT_MANAGER_IF +0x1a01; TRC_NotEnoughSensors;;1;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a02; TRC_LowestValueOol;;2;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a03; TRC_HighestValueOol;;3;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a04; TRC_BothValuesOol;;4;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a05; TRC_DuplexOol;;5;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x3001; LIM_Unchecked;;1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3002; LIM_Invalid;;2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3003; LIM_Unselected;;3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3004; LIM_BelowLowLimit;;4;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3005; LIM_AboveHighLimit;;5;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3006; LIM_UnexpectedValue;;6;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3007; LIM_OutOfRange;;7;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30a0; LIM_FirstSample;;0xA0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e0; LIM_InvalidSize;;0xE0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e1; LIM_WrongType;;0xE1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e2; LIM_WrongPid;;0xE2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e3; LIM_WrongLimitId;;0xE3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30ee; LIM_MonitorNotFound;;0xEE;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3a01; SPH_SemaphoreTimeout;;1;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF +0x3a02; SPH_SemaphoreNotOwned;;2;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF +0x3a03; SPH_SemaphoreInvalid;;3;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF 0x7000; SDMA_OpOngoing;;0;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x7001; SDMA_AlreadyOn;;1;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x7002; SDMA_AlreadyMounted;;2;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER @@ -458,7 +455,28 @@ 0x700d; SDMA_UnmountError;;13;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x700e; SDMA_SystemCallError;;14;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x700f; SDMA_PopenCallError;;15;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER +0x7100; SCBU_KeyNotFound;;0;bsp_q7s/memory/scratchApi.h;SCRATCH_BUFFER +0x66a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;0xA0;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER +0x66a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER +0x69a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;0xA0;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;0xA1;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;0xA2;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;0xA3;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;0xA4;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;0xA5;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;0xA6;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);0xA7;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;0xA8;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;0xA9;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x57e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);0xE0;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD +0x57e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);0xE1;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD +0x60a0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;0xA0;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER +0x60a1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;0xA1;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER 0x67a0; PLMPHLP_FileClosedAccidentally;File accidentally close;0xA0;linux/devices/ploc/PlocMPSoCHelper.h;PLOC_MPSOC_HELPER +0x5da0;PLUD_UpdaterBusy;Updater is already performing an update;0xA0;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER +0x5da1;PLUD_NameTooLong;Received update command with invalid path string (too long).;0xA1;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER +0x5da2;PLUD_SdNotMounted;Received command to initiate update but SD card with update image not mounted.;0xA2;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER +0x5da3;PLUD_FileNotExists;Update file received with update command does not exist.;0xA3;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER 0x59a0;PLSV_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;0xA0;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59a1;PLSV_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;0xA1;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59a2;PLSV_ReceivedExeFailure;Received execution failure reply from PLOC supervisor;0xA2;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER @@ -474,39 +492,12 @@ 0x59ac;PLSV_NoMramPacket;Expect reception of an MRAM dump packet but received space packet with other apid.;0xAC;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59ad;PLSV_PathDoesNotExist;Path to PLOC directory on SD card does not exist;0xAD;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59ae;PLSV_MramFileNotExists;MRAM dump file does not exists. The file should actually already have been created with the reception of the first dump packet.;0xAE;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x5da0;PLUD_UpdaterBusy;Updater is already performing an update;0xA0;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER -0x5da1;PLUD_NameTooLong;Received update command with invalid path string (too long).;0xA1;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER -0x5da2;PLUD_SdNotMounted;Received command to initiate update but SD card with update image not mounted.;0xA2;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER -0x5da3;PLUD_FileNotExists;Update file received with update command does not exist.;0xA3;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER -0x60a0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;0xA0;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER -0x60a1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;0xA1;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER -0x69a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;0xA0;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;0xA1;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;0xA2;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;0xA3;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;0xA4;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;0xA5;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;0xA6;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);0xA7;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;0xA8;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;0xA9;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x57e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);0xE0;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD -0x57e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);0xE1;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD 0x6401;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE 0x6402;JSONBASE_SetNotExists;Requested set does not exist in json file;2;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE 0x6403;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE 0x56a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;0xA0;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a1;STRH_PingFailed;Ping command failed;0xA1;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a2;STRH_VersionReqFailed;Status in version reply signals error;0xA2;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER -0x5ea0;STRHLP_SdNotMounted;SD card specified in path string not mounted;0xA0;linux/devices/startracker/StrHelper.h;STR_HELPER -0x5ea1;STRHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;linux/devices/startracker/StrHelper.h;STR_HELPER -0x5ea2;STRHLP_PathNotExists;Specified path does not exist;0xA2;linux/devices/startracker/StrHelper.h;STR_HELPER -0x5ea3;STRHLP_FileCreationFailed;Failed to create download image or read flash file;0xA3;linux/devices/startracker/StrHelper.h;STR_HELPER -0x5ea4;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;0xA4;linux/devices/startracker/StrHelper.h;STR_HELPER -0x5ea5;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;0xA5;linux/devices/startracker/StrHelper.h;STR_HELPER -0x5ea6;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;0xA6;linux/devices/startracker/StrHelper.h;STR_HELPER -0x5ea7;STRHLP_StatusError;Status field in reply signals error;0xA7;linux/devices/startracker/StrHelper.h;STR_HELPER -0x5ea8;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);0xA8;linux/devices/startracker/StrHelper.h;STR_HELPER 0x56a3;STRH_InterfaceReqFailed;Status in interface reply signals error;0xA3;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a4;STRH_PowerReqFailed;Status in power reply signals error;0xA4;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;0xA5;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER @@ -529,7 +520,21 @@ 0x56b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;0xB6;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56b7;STRH_StartrackerRunningFirmware;Star tracker is in firmware mode but must be in bootloader mode to execute this command;0xB7;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56b8;STRH_StartrackerRunningBootloader;Star tracker is in bootloader mode but must be in firmware mode to execute this command;0xB8;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER +0x5ea0;STRHLP_SdNotMounted;SD card specified in path string not mounted;0xA0;linux/devices/startracker/StrHelper.h;STR_HELPER +0x5ea1;STRHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;linux/devices/startracker/StrHelper.h;STR_HELPER +0x5ea2;STRHLP_PathNotExists;Specified path does not exist;0xA2;linux/devices/startracker/StrHelper.h;STR_HELPER +0x5ea3;STRHLP_FileCreationFailed;Failed to create download image or read flash file;0xA3;linux/devices/startracker/StrHelper.h;STR_HELPER +0x5ea4;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;0xA4;linux/devices/startracker/StrHelper.h;STR_HELPER +0x5ea5;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;0xA5;linux/devices/startracker/StrHelper.h;STR_HELPER +0x5ea6;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;0xA6;linux/devices/startracker/StrHelper.h;STR_HELPER +0x5ea7;STRHLP_StatusError;Status field in reply signals error;0xA7;linux/devices/startracker/StrHelper.h;STR_HELPER +0x5ea8;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);0xA8;linux/devices/startracker/StrHelper.h;STR_HELPER +0x5ba0;IPCI_PapbBusy;;0xA0;linux/obc/PapbVcInterface.h;CCSDS_IP_CORE_BRIDGE 0x5ca0;PTME_UnknownVcId;;0xA0;linux/obc/Ptme.h;PTME +0x63a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;0xA0;linux/obc/PtmeConfig.h;RATE_SETTER +0x63a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);0xA1;linux/obc/PtmeConfig.h;RATE_SETTER +0x63a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;0xA2;linux/obc/PtmeConfig.h;RATE_SETTER +0x63a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;0xA3;linux/obc/PtmeConfig.h;RATE_SETTER 0x61a0;PDEC_AbandonedCltu;;0xA0;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61a1;PDEC_FrameDirty;;0xA1;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61a2;PDEC_FrameIllegalMultipleReasons;;0xA2;linux/obc/PdecHandler.h;PDEC_HANDLER @@ -545,8 +550,3 @@ 0x61ab;PDEC_InvalidVcIdLsb;;0xAB;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61ac;PDEC_NsNotZero;;0xAC;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61ae;PDEC_InvalidBcCc;;0xAE;linux/obc/PdecHandler.h;PDEC_HANDLER -0x63a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;0xA0;linux/obc/PtmeConfig.h;RATE_SETTER -0x63a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);0xA1;linux/obc/PtmeConfig.h;RATE_SETTER -0x63a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;0xA2;linux/obc/PtmeConfig.h;RATE_SETTER -0x63a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;0xA3;linux/obc/PtmeConfig.h;RATE_SETTER -0x5ba0;IPCI_PapbBusy;;0xA0;linux/obc/PapbVcInterface.h;CCSDS_IP_CORE_BRIDGE diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 1a155186..97b9e453 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 187 translations. + * @brief Auto-generated event translation file. Contains 189 translations. * @details - * Generated on: 2022-05-03 16:32:00 + * Generated on: 2022-05-04 10:07:44 */ #include "translateEvents.h" @@ -90,6 +90,8 @@ const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED"; const char *FDIR_REACTION_IGNORED_STRING = "FDIR_REACTION_IGNORED"; const char *GPIO_PULL_HIGH_FAILED_STRING = "GPIO_PULL_HIGH_FAILED"; const char *GPIO_PULL_LOW_FAILED_STRING = "GPIO_PULL_LOW_FAILED"; +const char *HEATER_WENT_ON_STRING = "HEATER_WENT_ON"; +const char *HEATER_WENT_OFF_STRING = "HEATER_WENT_OFF"; const char *SWITCH_ALREADY_ON_STRING = "SWITCH_ALREADY_ON"; const char *SWITCH_ALREADY_OFF_STRING = "SWITCH_ALREADY_OFF"; const char *MAIN_SWITCH_TIMEOUT_STRING = "MAIN_SWITCH_TIMEOUT"; @@ -362,10 +364,14 @@ const char *translateEvents(Event event) { case (11401): return GPIO_PULL_LOW_FAILED_STRING; case (11402): - return SWITCH_ALREADY_ON_STRING; + return HEATER_WENT_ON_STRING; case (11403): - return SWITCH_ALREADY_OFF_STRING; + return HEATER_WENT_OFF_STRING; case (11404): + return SWITCH_ALREADY_ON_STRING; + case (11405): + return SWITCH_ALREADY_OFF_STRING; + case (11406): return MAIN_SWITCH_TIMEOUT_STRING; case (11500): return MAIN_SWITCH_ON_TIMEOUT_STRING; diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 62e0d583..de03eaf8 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 117 translations. - * Generated on: 2022-05-03 16:32:00 + * Contains 125 translations. + * Generated on: 2022-05-04 10:07:44 */ #include "translateObjects.h" @@ -117,6 +117,14 @@ const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST"; const char *TEST_TASK_STRING = "TEST_TASK"; +const char *HEATER_0_STRING = "HEATER_0"; +const char *HEATER_1_STRING = "HEATER_1"; +const char *HEATER_2_STRING = "HEATER_2"; +const char *HEATER_3_STRING = "HEATER_3"; +const char *HEATER_4_STRING = "HEATER_4"; +const char *HEATER_5_STRING = "HEATER_5"; +const char *HEATER_6_STRING = "HEATER_6"; +const char *HEATER_7_STRING = "HEATER_7"; const char *ACS_BOARD_ASS_STRING = "ACS_BOARD_ASS"; const char *SUS_BOARD_ASS_STRING = "SUS_BOARD_ASS"; const char *TCS_BOARD_ASS_STRING = "TCS_BOARD_ASS"; @@ -348,6 +356,22 @@ const char *translateObject(object_id_t object) { return LIBGPIOD_TEST_STRING; case 0x54694269: return TEST_TASK_STRING; + case 0x60000000: + return HEATER_0_STRING; + case 0x60000001: + return HEATER_1_STRING; + case 0x60000002: + return HEATER_2_STRING; + case 0x60000003: + return HEATER_3_STRING; + case 0x60000004: + return HEATER_4_STRING; + case 0x60000005: + return HEATER_5_STRING; + case 0x60000006: + return HEATER_6_STRING; + case 0x60000007: + return HEATER_7_STRING; case 0x73000001: return ACS_BOARD_ASS_STRING; case 0x73000002: diff --git a/linux/boardtest/LibgpiodTest.cpp b/linux/boardtest/LibgpiodTest.cpp index 0c5ebe2a..9a36352c 100644 --- a/linux/boardtest/LibgpiodTest.cpp +++ b/linux/boardtest/LibgpiodTest.cpp @@ -19,17 +19,17 @@ LibgpiodTest::LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId, Gpi LibgpiodTest::~LibgpiodTest() {} ReturnValue_t LibgpiodTest::performPeriodicAction() { - int gpioState; + gpio::Levels gpioState; ReturnValue_t result; switch (testCase) { case (TestCases::READ): { - result = gpioInterface->readGpio(gpioIds::TEST_ID_0, &gpioState); + result = gpioInterface->readGpio(gpioIds::TEST_ID_0, gpioState); if (result != RETURN_OK) { sif::warning << "LibgpiodTest::performPeriodicAction: Failed to read gpio " << std::endl; return RETURN_FAILED; } else { - sif::debug << "LibgpiodTest::performPeriodicAction: MIO 0 state = " << gpioState + sif::debug << "LibgpiodTest::performPeriodicAction: MIO 0 state = " << static_cast(gpioState) << std::endl; } break; @@ -38,19 +38,19 @@ ReturnValue_t LibgpiodTest::performPeriodicAction() { break; } case (TestCases::BLINK): { - result = gpioInterface->readGpio(gpioIds::TEST_ID_0, &gpioState); + result = gpioInterface->readGpio(gpioIds::TEST_ID_0, gpioState); if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "LibgpiodTest::performPeriodicAction: Failed to read gpio " << std::endl; return RETURN_FAILED; } - if (gpioState == 1) { + if (gpioState == gpio::Levels::HIGH) { result = gpioInterface->pullLow(gpioIds::TEST_ID_0); if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "LibgpiodTest::performPeriodicAction: Could not pull GPIO low!" << std::endl; return HasReturnvaluesIF::RETURN_FAILED; } - } else if (gpioState == 0) { + } else if (gpioState == gpio::Levels::LOW) { result = gpioInterface->pullHigh(gpioIds::TEST_ID_0); if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "LibgpiodTest::performPeriodicAction: Could not pull GPIO high!" @@ -72,7 +72,7 @@ ReturnValue_t LibgpiodTest::performPeriodicAction() { } ReturnValue_t LibgpiodTest::performOneShotAction() { - int gpioState; + gpio::Levels gpioState; ReturnValue_t result; switch (testCase) { @@ -93,8 +93,8 @@ ReturnValue_t LibgpiodTest::performOneShotAction() { << std::endl; return HasReturnvaluesIF::RETURN_OK; } - result = gpioInterface->readGpio(gpioIds::TEST_ID_1, &gpioState); - if (result == HasReturnvaluesIF::RETURN_OK and gpioState == 1) { + result = gpioInterface->readGpio(gpioIds::TEST_ID_1, gpioState); + if (result == HasReturnvaluesIF::RETURN_OK and gpioState == gpio::Levels::HIGH) { sif::info << "LibgpiodTest::performOneShotAction: " "GPIO state read successfully and is high" << std::endl; @@ -110,8 +110,8 @@ ReturnValue_t LibgpiodTest::performOneShotAction() { "GPIO pulled low successfully for loopback test" << std::endl; } - result = gpioInterface->readGpio(gpioIds::TEST_ID_1, &gpioState); - if (result == HasReturnvaluesIF::RETURN_OK and gpioState == 0) { + result = gpioInterface->readGpio(gpioIds::TEST_ID_1, gpioState); + if (result == HasReturnvaluesIF::RETURN_OK and gpioState == gpio::Levels::LOW) { sif::info << "LibgpiodTest::performOneShotAction: " "GPIO state read successfully and is low" << std::endl; diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 1a155186..97b9e453 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 187 translations. + * @brief Auto-generated event translation file. Contains 189 translations. * @details - * Generated on: 2022-05-03 16:32:00 + * Generated on: 2022-05-04 10:07:44 */ #include "translateEvents.h" @@ -90,6 +90,8 @@ const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED"; const char *FDIR_REACTION_IGNORED_STRING = "FDIR_REACTION_IGNORED"; const char *GPIO_PULL_HIGH_FAILED_STRING = "GPIO_PULL_HIGH_FAILED"; const char *GPIO_PULL_LOW_FAILED_STRING = "GPIO_PULL_LOW_FAILED"; +const char *HEATER_WENT_ON_STRING = "HEATER_WENT_ON"; +const char *HEATER_WENT_OFF_STRING = "HEATER_WENT_OFF"; const char *SWITCH_ALREADY_ON_STRING = "SWITCH_ALREADY_ON"; const char *SWITCH_ALREADY_OFF_STRING = "SWITCH_ALREADY_OFF"; const char *MAIN_SWITCH_TIMEOUT_STRING = "MAIN_SWITCH_TIMEOUT"; @@ -362,10 +364,14 @@ const char *translateEvents(Event event) { case (11401): return GPIO_PULL_LOW_FAILED_STRING; case (11402): - return SWITCH_ALREADY_ON_STRING; + return HEATER_WENT_ON_STRING; case (11403): - return SWITCH_ALREADY_OFF_STRING; + return HEATER_WENT_OFF_STRING; case (11404): + return SWITCH_ALREADY_ON_STRING; + case (11405): + return SWITCH_ALREADY_OFF_STRING; + case (11406): return MAIN_SWITCH_TIMEOUT_STRING; case (11500): return MAIN_SWITCH_ON_TIMEOUT_STRING; diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 62e0d583..de03eaf8 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 117 translations. - * Generated on: 2022-05-03 16:32:00 + * Contains 125 translations. + * Generated on: 2022-05-04 10:07:44 */ #include "translateObjects.h" @@ -117,6 +117,14 @@ const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST"; const char *TEST_TASK_STRING = "TEST_TASK"; +const char *HEATER_0_STRING = "HEATER_0"; +const char *HEATER_1_STRING = "HEATER_1"; +const char *HEATER_2_STRING = "HEATER_2"; +const char *HEATER_3_STRING = "HEATER_3"; +const char *HEATER_4_STRING = "HEATER_4"; +const char *HEATER_5_STRING = "HEATER_5"; +const char *HEATER_6_STRING = "HEATER_6"; +const char *HEATER_7_STRING = "HEATER_7"; const char *ACS_BOARD_ASS_STRING = "ACS_BOARD_ASS"; const char *SUS_BOARD_ASS_STRING = "SUS_BOARD_ASS"; const char *TCS_BOARD_ASS_STRING = "TCS_BOARD_ASS"; @@ -348,6 +356,22 @@ const char *translateObject(object_id_t object) { return LIBGPIOD_TEST_STRING; case 0x54694269: return TEST_TASK_STRING; + case 0x60000000: + return HEATER_0_STRING; + case 0x60000001: + return HEATER_1_STRING; + case 0x60000002: + return HEATER_2_STRING; + case 0x60000003: + return HEATER_3_STRING; + case 0x60000004: + return HEATER_4_STRING; + case 0x60000005: + return HEATER_5_STRING; + case 0x60000006: + return HEATER_6_STRING; + case 0x60000007: + return HEATER_7_STRING; case 0x73000001: return ACS_BOARD_ASS_STRING; case 0x73000002: diff --git a/linux/obc/PapbVcInterface.cpp b/linux/obc/PapbVcInterface.cpp index 5636975a..643104d7 100644 --- a/linux/obc/PapbVcInterface.cpp +++ b/linux/obc/PapbVcInterface.cpp @@ -42,17 +42,17 @@ void PapbVcInterface::startPacketTransfer() { *vcBaseReg = CONFIG_START; } void PapbVcInterface::endPacketTransfer() { *vcBaseReg = CONFIG_END; } ReturnValue_t PapbVcInterface::pollPapbBusySignal() { - int papbBusyState = 0; + gpio::Levels papbBusyState = gpio::Levels::LOW; ReturnValue_t result = RETURN_OK; /** Check if PAPB interface is ready to receive data */ - result = gpioComIF->readGpio(papbBusyId, &papbBusyState); + result = gpioComIF->readGpio(papbBusyId, papbBusyState); if (result != RETURN_OK) { sif::warning << "PapbVcInterface::pollPapbBusySignal: Failed to read papb busy signal" << std::endl; return RETURN_FAILED; } - if (!papbBusyState) { + if (papbBusyState == gpio::Levels::LOW) { sif::warning << "PapbVcInterface::pollPapbBusySignal: PAPB busy" << std::endl; return PAPB_BUSY; } @@ -62,9 +62,9 @@ ReturnValue_t PapbVcInterface::pollPapbBusySignal() { void PapbVcInterface::isVcInterfaceBufferEmpty() { ReturnValue_t result = RETURN_OK; - int papbEmptyState = 1; + gpio::Levels papbEmptyState = gpio::Levels::HIGH; - result = gpioComIF->readGpio(papbEmptyId, &papbEmptyState); + result = gpioComIF->readGpio(papbEmptyId, papbEmptyState); if (result != RETURN_OK) { sif::warning << "PapbVcInterface::isVcInterfaceBufferEmpty: Failed to read papb empty signal" @@ -72,7 +72,7 @@ void PapbVcInterface::isVcInterfaceBufferEmpty() { return; } - if (papbEmptyState == 1) { + if (papbEmptyState == gpio::Levels::HIGH) { sif::debug << "PapbVcInterface::isVcInterfaceBufferEmpty: Buffer is empty" << std::endl; } else { sif::debug << "PapbVcInterface::isVcInterfaceBufferEmpty: Buffer is not empty" << std::endl; diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 5771e27b..a969ad54 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -77,7 +77,13 @@ ReturnValue_t HeaterHandler::initialize() { ReturnValue_t HeaterHandler::initializeHeaterMap() { for (power::Switch_t switchNr = 0; switchNr < heater::NUMBER_OF_SWITCHES; switchNr++) { - heaterVec.push_back(HeaterWrapper(helper.heaters[switchNr])); + gpio::Levels level; + gpioInterface->readGpio(helper.heaters[switchNr].second, level); + SwitchState initState = SwitchState::OFF; + if(level == gpio::Levels::HIGH) { + + } + heaterVec.push_back(HeaterWrapper(helper.heaters[switchNr], initState)); } return RETURN_OK; } @@ -107,11 +113,11 @@ ReturnValue_t HeaterHandler::executeAction(ActionId_t actionId, MessageQueueId_t if (actionId != SWITCH_HEATER) { return COMMAND_NOT_SUPPORTED; } - auto switchNr = *data; + auto switchNr = data[0]; if (switchNr > 7) { return HasActionsIF::INVALID_PARAMETERS; } - auto heater = heaterVec.at(switchNr); + auto& heater = heaterVec.at(switchNr); HasHealthIF::HealthState health = heater.healthDevice->getHealth(); if (health == HasHealthIF::FAULTY or health == HasHealthIF::PERMANENT_FAULTY or health == HasHealthIF::NEEDS_RECOVERY) { @@ -202,7 +208,7 @@ void HeaterHandler::handleSwitchOnCommand(heater::Switchers heaterIdx) { // Check state of main line switch ReturnValue_t mainSwitchState = mainLineSwitcher->getSwitchState(mainLineSwitch); if (mainSwitchState == PowerSwitchIF::SWITCH_ON) { - if (!checkSwitchState(heaterIdx)) { + if (checkSwitchState(heaterIdx) == SwitchState::ON) { gpioId_t gpioId = heater.gpioId; result = gpioInterface->pullHigh(gpioId); if (result != RETURN_OK) { @@ -210,6 +216,7 @@ void HeaterHandler::handleSwitchOnCommand(heater::Switchers heaterIdx) { << " high" << std::endl; triggerEvent(GPIO_PULL_HIGH_FAILED, result); } else { + triggerEvent(HEATER_WENT_ON, heaterIdx, 0); heater.switchState = ON; } } else { @@ -256,6 +263,7 @@ void HeaterHandler::handleSwitchOffCommand(heater::Switchers heaterIdx) { triggerEvent(GPIO_PULL_LOW_FAILED, result); } else { heater.switchState = OFF; + triggerEvent(HEATER_WENT_OFF, heaterIdx, 0); // When all switches are off, also main line switch will be turned off if (allSwitchesOff()) { mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); diff --git a/mission/devices/HeaterHandler.h b/mission/devices/HeaterHandler.h index 40685ced..b88fc103 100644 --- a/mission/devices/HeaterHandler.h +++ b/mission/devices/HeaterHandler.h @@ -73,11 +73,13 @@ class HeaterHandler : public ExecutableObjectIF, private: static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::HEATER_HANDLER; - static const Event GPIO_PULL_HIGH_FAILED = MAKE_EVENT(0, severity::LOW); - static const Event GPIO_PULL_LOW_FAILED = MAKE_EVENT(1, severity::LOW); - static const Event SWITCH_ALREADY_ON = MAKE_EVENT(2, severity::LOW); - static const Event SWITCH_ALREADY_OFF = MAKE_EVENT(3, severity::LOW); - static const Event MAIN_SWITCH_TIMEOUT = MAKE_EVENT(4, severity::LOW); + static constexpr Event GPIO_PULL_HIGH_FAILED = MAKE_EVENT(0, severity::LOW); + static constexpr Event GPIO_PULL_LOW_FAILED = MAKE_EVENT(1, severity::LOW); + static constexpr Event HEATER_WENT_ON = event::makeEvent(SUBSYSTEM_ID, 2, severity::INFO); + static constexpr Event HEATER_WENT_OFF = event::makeEvent(SUBSYSTEM_ID, 3, severity::INFO); + static constexpr Event SWITCH_ALREADY_ON = MAKE_EVENT(4, severity::LOW); + static constexpr Event SWITCH_ALREADY_OFF = MAKE_EVENT(5, severity::LOW); + static constexpr Event MAIN_SWITCH_TIMEOUT = MAKE_EVENT(6, severity::MEDIUM); static const MessageQueueId_t NO_COMMANDER = 0; @@ -95,7 +97,8 @@ class HeaterHandler : public ExecutableObjectIF, * @param mainSwitchCountdown Sets timeout to wait for main switch being set on. */ struct HeaterWrapper { - HeaterWrapper(HeaterPair pair) : healthDevice(pair.first), gpioId(pair.second) {} + HeaterWrapper(HeaterPair pair, SwitchState initState) + : healthDevice(pair.first), gpioId(pair.second), switchState(initState) {} HealthDevice* healthDevice = nullptr; gpioId_t gpioId = gpio::NO_GPIO; SwitchAction action = SwitchAction::NONE; diff --git a/tmtc b/tmtc index 8bc51b29..6f8fe84d 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8bc51b293bc5fbd224b6638d8e7c00fd9ab85930 +Subproject commit 6f8fe84d67e79a1f480feacf8d33f048a2801aee From 86dd67bf0647fa231fede814bd0e24f5182123a2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 4 May 2022 10:36:45 +0200 Subject: [PATCH 0057/2058] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 3556eca8..8ee26f81 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 3556eca8e875aaa4aab1c96e60f0b1eaefc7e982 +Subproject commit 8ee26f81f9449e28566a8d34fbb3454cfd1da01c From d0e18f8b352a7294cf95384156b833d19dac9cc0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 4 May 2022 11:11:29 +0200 Subject: [PATCH 0058/2058] add mutex protections for switcher states --- bsp_hosted/ObjectFactory.cpp | 2 +- bsp_q7s/boardtest/Q7STestTask.cpp | 233 +++++++++++++++--------------- bsp_q7s/boardtest/Q7STestTask.h | 1 + linux/boardtest/LibgpiodTest.cpp | 4 +- mission/devices/HeaterHandler.cpp | 49 +++++-- mission/devices/HeaterHandler.h | 26 ++-- 6 files changed, 169 insertions(+), 146 deletions(-) diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index 7ad599ea..55ebda0f 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -7,9 +7,9 @@ #include #include #include -#include "fsfw_tests/integration/task/TestTask.h" #include "OBSWConfig.h" +#include "fsfw_tests/integration/task/TestTask.h" #if OBSW_USE_TMTC_TCP_BRIDGE == 0 #include "fsfw/osal/common/UdpTcPollingTask.h" diff --git a/bsp_q7s/boardtest/Q7STestTask.cpp b/bsp_q7s/boardtest/Q7STestTask.cpp index 0f6734b6..6cf4e734 100644 --- a/bsp_q7s/boardtest/Q7STestTask.cpp +++ b/bsp_q7s/boardtest/Q7STestTask.cpp @@ -156,13 +156,13 @@ void Q7STestTask::testDummyParams() { result = param.getValue(DummyParameter::DUMMY_KEY_PARAM_1, test); if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "Q7STestTask::testDummyParams: Key " << DummyParameter::DUMMY_KEY_PARAM_1 - << " does not exist" << std::endl; + << " does not exist" << std::endl; } std::string test2; result = param.getValue(DummyParameter::DUMMY_KEY_PARAM_2, test2); if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "Q7STestTask::testDummyParams: Key " << DummyParameter::DUMMY_KEY_PARAM_1 - << " does not exist" << std::endl; + << " does not exist" << std::endl; } sif::info << "Test value (3 expected): " << test << std::endl; sif::info << "Test value 2 (\"blirb\" expected): " << test2 << std::endl; @@ -172,7 +172,7 @@ ReturnValue_t Q7STestTask::initialize() { coreController = ObjectManager::instance()->get(objects::CORE_CONTROLLER); if (coreController == nullptr) { sif::warning << "Q7STestTask::initialize: Could not retrieve CORE_CONTROLLER object" - << std::endl; + << std::endl; } return TestTask::initialize(); } @@ -182,14 +182,14 @@ void Q7STestTask::testProtHandler() { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; // If any chips are unlocked, lock them here result = coreController->setBootCopyProtection(xsc::Chip::ALL_CHIP, xsc::Copy::ALL_COPY, true, - opPerformed, true); + opPerformed, true); if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl; } // unlock own copy result = coreController->setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, false, - opPerformed, true); + opPerformed, true); if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl; } @@ -203,7 +203,7 @@ void Q7STestTask::testProtHandler() { // lock own copy result = coreController->setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, true, - opPerformed, true); + opPerformed, true); if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl; } @@ -217,7 +217,7 @@ void Q7STestTask::testProtHandler() { // unlock specific copy result = coreController->setBootCopyProtection(xsc::Chip::CHIP_1, xsc::Copy::COPY_1, false, - opPerformed, true); + opPerformed, true); if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl; } @@ -231,7 +231,7 @@ void Q7STestTask::testProtHandler() { // lock specific copy result = coreController->setBootCopyProtection(xsc::Chip::CHIP_1, xsc::Copy::COPY_1, true, - opPerformed, true); + opPerformed, true); if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl; } @@ -273,7 +273,7 @@ void Q7STestTask::testGpsDaemonShm() { } void Q7STestTask::testGpsDaemonSocket() { - if(gpsmmShmPtr == nullptr) { + if (gpsmmShmPtr == nullptr) { gpsmmShmPtr = new gpsmm("localhost", DEFAULT_GPSD_PORT); } // The data from the device will generally be read all at once. Therefore, we @@ -283,7 +283,7 @@ void Q7STestTask::testGpsDaemonSocket() { // Opening failed #if FSFW_VERBOSE_LEVEL >= 1 sif::warning << "Q7STestTask::testGpsDaemonSocket: Opening GPSMM failed | " - << "Error " << errno << " | " << gps_errstr(errno) << std::endl; + << "Error " << errno << " | " << gps_errstr(errno) << std::endl; #endif gpsNotOpenSwitch = false; @@ -291,17 +291,16 @@ void Q7STestTask::testGpsDaemonSocket() { return; } // Stopwatch watch; - gps_data_t *gps = nullptr; + gps_data_t* gps = nullptr; gpsmmShmPtr->stream(WATCH_ENABLE | WATCH_JSON); - if(not gpsmmShmPtr->waiting(50000000)) { + if (not gpsmmShmPtr->waiting(50000000)) { return; } gps = gpsmmShmPtr->read(); if (gps == nullptr) { if (gpsReadFailedSwitch) { gpsReadFailedSwitch = false; - sif::warning << "Q7STestTask::testGpsDaemonSocket: Reading GPS data failed" - << std::endl; + sif::warning << "Q7STestTask::testGpsDaemonSocket: Reading GPS data failed" << std::endl; } return; } @@ -312,8 +311,8 @@ void Q7STestTask::testGpsDaemonSocket() { if (noModeSetCntr == 10) { // TODO: Trigger event here sif::warning << "Q7STestTask::testGpsDaemonSocket: No mode could be " - "read for 10 consecutive reads" - << std::endl; + "read for 10 consecutive reads" + << std::endl; noModeSetCntr = -1; } return; @@ -339,7 +338,7 @@ void Q7STestTask::testFileSystemHandlerDirect(FsOpCodes opCode) { auto fsHandler = ObjectManager::instance()->get(objects::FILE_SYSTEM_HANDLER); if (fsHandler == nullptr) { sif::warning << "Q7STestTask::testFileSystemHandlerDirect: No FS handler running.." - << std::endl; + << std::endl; } FileSystemHandler::FsCommandCfg cfg = {}; ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; @@ -366,115 +365,115 @@ void Q7STestTask::testFileSystemHandlerDirect(FsOpCodes opCode) { }; switch (opCode) { - case (FsOpCodes::CREATE_EMPTY_FILE_IN_TMP): { - // No mount prefix, cause file is created in tmp - cfg.useMountPrefix = false; - sif::info << "Creating empty file in /tmp folder" << std::endl; - // Do not delete file, user can check existence in shell - fsHandler->createFile("/tmp/", "test.txt", nullptr, 0, &cfg); - break; - } - case (FsOpCodes::REMOVE_TMP_FILE): { - sif::info << "Deleting /tmp/test.txt sample file" << std::endl; - // No mount prefix, cause file is created in tmp - cfg.useMountPrefix = false; - if (not std::filesystem::exists("/tmp/test.txt")) { - // Creating sample file - sif::info << "Creating sample file /tmp/test.txt to delete" << std::endl; + case (FsOpCodes::CREATE_EMPTY_FILE_IN_TMP): { + // No mount prefix, cause file is created in tmp + cfg.useMountPrefix = false; + sif::info << "Creating empty file in /tmp folder" << std::endl; + // Do not delete file, user can check existence in shell fsHandler->createFile("/tmp/", "test.txt", nullptr, 0, &cfg); + break; } - result = fsHandler->removeFile("/tmp", "test.txt", &cfg); - if (result == HasReturnvaluesIF::RETURN_OK) { - sif::info << "File removed successfully" << std::endl; - } else { - sif::warning << "File removal failed!" << std::endl; + case (FsOpCodes::REMOVE_TMP_FILE): { + sif::info << "Deleting /tmp/test.txt sample file" << std::endl; + // No mount prefix, cause file is created in tmp + cfg.useMountPrefix = false; + if (not std::filesystem::exists("/tmp/test.txt")) { + // Creating sample file + sif::info << "Creating sample file /tmp/test.txt to delete" << std::endl; + fsHandler->createFile("/tmp/", "test.txt", nullptr, 0, &cfg); + } + result = fsHandler->removeFile("/tmp", "test.txt", &cfg); + if (result == HasReturnvaluesIF::RETURN_OK) { + sif::info << "File removed successfully" << std::endl; + } else { + sif::warning << "File removal failed!" << std::endl; + } + break; } - break; - } - case (FsOpCodes::CREATE_DIR_IN_TMP): { - // No mount prefix, cause file is created in tmp - cfg.useMountPrefix = false; - sif::info << "Creating empty file in /tmp folder" << std::endl; - // Do not delete file, user can check existence in shell - ReturnValue_t result = fsHandler->createDirectory("/tmp/", "test", false, &cfg); - if (result == HasReturnvaluesIF::RETURN_OK) { - sif::info << "Directory created successfully" << std::endl; - } else { - sif::warning << "Directory creation failed!" << std::endl; + case (FsOpCodes::CREATE_DIR_IN_TMP): { + // No mount prefix, cause file is created in tmp + cfg.useMountPrefix = false; + sif::info << "Creating empty file in /tmp folder" << std::endl; + // Do not delete file, user can check existence in shell + ReturnValue_t result = fsHandler->createDirectory("/tmp/", "test", false, &cfg); + if (result == HasReturnvaluesIF::RETURN_OK) { + sif::info << "Directory created successfully" << std::endl; + } else { + sif::warning << "Directory creation failed!" << std::endl; + } + break; } - break; - } - case (FsOpCodes::REMOVE_EMPTY_DIR_IN_TMP): { - // No mount prefix, cause file is created in tmp - cfg.useMountPrefix = false; - if (not std::filesystem::exists("/tmp/test")) { - result = fsHandler->createDirectory("/tmp", "test", false, &cfg); - } else { - // Delete any leftover files to regular dir removal works - std::remove("/tmp/test/*"); + case (FsOpCodes::REMOVE_EMPTY_DIR_IN_TMP): { + // No mount prefix, cause file is created in tmp + cfg.useMountPrefix = false; + if (not std::filesystem::exists("/tmp/test")) { + result = fsHandler->createDirectory("/tmp", "test", false, &cfg); + } else { + // Delete any leftover files to regular dir removal works + std::remove("/tmp/test/*"); + } + result = fsHandler->removeDirectory("/tmp/", "test", false, &cfg); + if (result == HasReturnvaluesIF::RETURN_OK) { + sif::info << "Directory removed successfully" << std::endl; + } else { + sif::warning << "Directory removal failed!" << std::endl; + } + break; } - result = fsHandler->removeDirectory("/tmp/", "test", false, &cfg); - if (result == HasReturnvaluesIF::RETURN_OK) { - sif::info << "Directory removed successfully" << std::endl; - } else { - sif::warning << "Directory removal failed!" << std::endl; + case (FsOpCodes::REMOVE_FILLED_DIR_IN_TMP): { + result = createNonEmptyTmpDir(); + if (result != HasReturnvaluesIF::RETURN_OK) { + return; + } + result = fsHandler->removeDirectory("/tmp/", "test", true, &cfg); + if (result == HasReturnvaluesIF::RETURN_OK) { + sif::info << "Directory removed recursively successfully" << std::endl; + } else { + sif::warning << "Recursive directory removal failed!" << std::endl; + } + break; } - break; - } - case (FsOpCodes::REMOVE_FILLED_DIR_IN_TMP): { - result = createNonEmptyTmpDir(); - if (result != HasReturnvaluesIF::RETURN_OK) { - return; + case (FsOpCodes::ATTEMPT_DIR_REMOVAL_NON_EMPTY): { + result = createNonEmptyTmpDir(); + if (result != HasReturnvaluesIF::RETURN_OK) { + return; + } + result = fsHandler->removeDirectory("/tmp/", "test", false, &cfg); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::info << "Directory removal attempt failed as expected" << std::endl; + } else { + sif::warning << "Directory removal worked when it should not have!" << std::endl; + } + break; } - result = fsHandler->removeDirectory("/tmp/", "test", true, &cfg); - if (result == HasReturnvaluesIF::RETURN_OK) { - sif::info << "Directory removed recursively successfully" << std::endl; - } else { - sif::warning << "Recursive directory removal failed!" << std::endl; + case (FsOpCodes::RENAME_FILE): { + // No mount prefix, cause file is created in tmp + cfg.useMountPrefix = false; + if (std::filesystem::exists("/tmp/test.txt")) { + fsHandler->removeDirectory("/tmp/", "test", false, &cfg); + } + sif::info << "Creating empty file /tmp/test.txt and rename to /tmp/test2.txt" << std::endl; + // Do not delete file, user can check existence in shell + fsHandler->createFile("/tmp/", "test.txt", nullptr, 0, &cfg); + fsHandler->renameFile("/tmp/", "test.txt", "test2.txt", &cfg); + break; } - break; - } - case (FsOpCodes::ATTEMPT_DIR_REMOVAL_NON_EMPTY): { - result = createNonEmptyTmpDir(); - if (result != HasReturnvaluesIF::RETURN_OK) { - return; + case (FsOpCodes::APPEND_TO_FILE): { + // No mount prefix, cause file is created in tmp + cfg.useMountPrefix = false; + if (std::filesystem::exists("/tmp/test.txt")) { + fsHandler->removeDirectory("/tmp/", "test", false, &cfg); + } + if (std::filesystem::exists("/tmp/test.txt")) { + fsHandler->removeDirectory("/tmp/", "test", false, &cfg); + } + sif::info << "Creating empty file /tmp/test.txt and adding content" << std::endl; + std::string content = "Hello World\n"; + // Do not delete file, user can check existence in shell + fsHandler->createFile("/tmp/", "test.txt", nullptr, 0, &cfg); + fsHandler->appendToFile("/tmp/", "test.txt", reinterpret_cast(content.data()), + content.size(), 0, &cfg); } - result = fsHandler->removeDirectory("/tmp/", "test", false, &cfg); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::info << "Directory removal attempt failed as expected" << std::endl; - } else { - sif::warning << "Directory removal worked when it should not have!" << std::endl; - } - break; - } - case (FsOpCodes::RENAME_FILE): { - // No mount prefix, cause file is created in tmp - cfg.useMountPrefix = false; - if (std::filesystem::exists("/tmp/test.txt")) { - fsHandler->removeDirectory("/tmp/", "test", false, &cfg); - } - sif::info << "Creating empty file /tmp/test.txt and rename to /tmp/test2.txt" << std::endl; - // Do not delete file, user can check existence in shell - fsHandler->createFile("/tmp/", "test.txt", nullptr, 0, &cfg); - fsHandler->renameFile("/tmp/", "test.txt", "test2.txt", &cfg); - break; - } - case (FsOpCodes::APPEND_TO_FILE): { - // No mount prefix, cause file is created in tmp - cfg.useMountPrefix = false; - if (std::filesystem::exists("/tmp/test.txt")) { - fsHandler->removeDirectory("/tmp/", "test", false, &cfg); - } - if (std::filesystem::exists("/tmp/test.txt")) { - fsHandler->removeDirectory("/tmp/", "test", false, &cfg); - } - sif::info << "Creating empty file /tmp/test.txt and adding content" << std::endl; - std::string content = "Hello World\n"; - // Do not delete file, user can check existence in shell - fsHandler->createFile("/tmp/", "test.txt", nullptr, 0, &cfg); - fsHandler->appendToFile("/tmp/", "test.txt", reinterpret_cast(content.data()), - content.size(), 0, &cfg); - } } } diff --git a/bsp_q7s/boardtest/Q7STestTask.h b/bsp_q7s/boardtest/Q7STestTask.h index ad58889f..7fadbe6b 100644 --- a/bsp_q7s/boardtest/Q7STestTask.h +++ b/bsp_q7s/boardtest/Q7STestTask.h @@ -2,6 +2,7 @@ #define BSP_Q7S_BOARDTEST_Q7STESTTASK_H_ #include + #include "test/testtasks/TestTask.h" class CoreController; diff --git a/linux/boardtest/LibgpiodTest.cpp b/linux/boardtest/LibgpiodTest.cpp index 9a36352c..66e26e3b 100644 --- a/linux/boardtest/LibgpiodTest.cpp +++ b/linux/boardtest/LibgpiodTest.cpp @@ -29,8 +29,8 @@ ReturnValue_t LibgpiodTest::performPeriodicAction() { sif::warning << "LibgpiodTest::performPeriodicAction: Failed to read gpio " << std::endl; return RETURN_FAILED; } else { - sif::debug << "LibgpiodTest::performPeriodicAction: MIO 0 state = " << static_cast(gpioState) - << std::endl; + sif::debug << "LibgpiodTest::performPeriodicAction: MIO 0 state = " + << static_cast(gpioState) << std::endl; } break; } diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index a969ad54..eeaa0504 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -29,6 +29,10 @@ HeaterHandler::HeaterHandler(object_id_t setObjectId_, GpioIF* gpioInterface_, H if (mainLineSwitcher == nullptr) { throw std::invalid_argument("HeaterHandler::HeaterHandler: Invalid PowerSwitchIF"); } + heaterMutex = MutexFactory::instance()->createMutex(); + if (heaterMutex == nullptr) { + throw std::runtime_error("HeaterHandler::HeaterHandler: Creating Mutex failed"); + } auto mqArgs = MqArgs(setObjectId_, static_cast(this)); commandQueue = QueueFactory::instance()->createMessageQueue( cmdQueueSize, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs); @@ -43,9 +47,14 @@ ReturnValue_t HeaterHandler::performOperation(uint8_t operationCode) { for (const auto& heater : helper.heaters) { heater.first->performOperation(0); } - } catch(const std::out_of_range& e) { + for (const auto& heater : heaterVec) { + sif::info << heater.switchState << ","; + } + sif::info << std::endl; + } catch (const std::out_of_range& e) { sif::warning << "HeaterHandler::performOperation: " - "Out of range error | " << e.what() << std::endl; + "Out of range error | " + << e.what() << std::endl; } return RETURN_OK; } @@ -77,13 +86,7 @@ ReturnValue_t HeaterHandler::initialize() { ReturnValue_t HeaterHandler::initializeHeaterMap() { for (power::Switch_t switchNr = 0; switchNr < heater::NUMBER_OF_SWITCHES; switchNr++) { - gpio::Levels level; - gpioInterface->readGpio(helper.heaters[switchNr].second, level); - SwitchState initState = SwitchState::OFF; - if(level == gpio::Levels::HIGH) { - - } - heaterVec.push_back(HeaterWrapper(helper.heaters[switchNr], initState)); + heaterVec.push_back(HeaterWrapper(helper.heaters[switchNr], SwitchState::OFF)); } return RETURN_OK; } @@ -208,7 +211,7 @@ void HeaterHandler::handleSwitchOnCommand(heater::Switchers heaterIdx) { // Check state of main line switch ReturnValue_t mainSwitchState = mainLineSwitcher->getSwitchState(mainLineSwitch); if (mainSwitchState == PowerSwitchIF::SWITCH_ON) { - if (checkSwitchState(heaterIdx) == SwitchState::ON) { + if (checkSwitchState(heaterIdx) == SwitchState::OFF) { gpioId_t gpioId = heater.gpioId; result = gpioInterface->pullHigh(gpioId); if (result != RETURN_OK) { @@ -216,7 +219,7 @@ void HeaterHandler::handleSwitchOnCommand(heater::Switchers heaterIdx) { << " high" << std::endl; triggerEvent(GPIO_PULL_HIGH_FAILED, result); } else { - triggerEvent(HEATER_WENT_ON, heaterIdx, 0); + triggerEvent(HEATER_WENT_ON, heaterIdx, 0); heater.switchState = ON; } } else { @@ -262,8 +265,12 @@ void HeaterHandler::handleSwitchOffCommand(heater::Switchers heaterIdx) { << " low" << std::endl; triggerEvent(GPIO_PULL_LOW_FAILED, result); } else { + auto result = heaterMutex->lockMutex(); heater.switchState = OFF; - triggerEvent(HEATER_WENT_OFF, heaterIdx, 0); + if (result == HasReturnvaluesIF::RETURN_OK) { + heaterMutex->unlockMutex(); + } + triggerEvent(HEATER_WENT_OFF, heaterIdx, 0); // When all switches are off, also main line switch will be turned off if (allSwitchesOff()) { mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF); @@ -284,12 +291,14 @@ void HeaterHandler::handleSwitchOffCommand(heater::Switchers heaterIdx) { heater.active = false; } -HeaterHandler::SwitchState HeaterHandler::checkSwitchState(heater::Switchers switchNr) { +HeaterHandler::SwitchState HeaterHandler::checkSwitchState(heater::Switchers switchNr) const { + MutexGuard mg(heaterMutex); return heaterVec.at(switchNr).switchState; } bool HeaterHandler::allSwitchesOff() { bool allSwitchesOrd = false; + MutexGuard mg(heaterMutex); /* Or all switches. As soon one switch is on, allSwitchesOrd will be true */ for (power::Switch_t switchNr = 0; switchNr < heater::NUMBER_OF_SWITCHES; switchNr++) { allSwitchesOrd = allSwitchesOrd || heaterVec.at(switchNr).switchState; @@ -301,7 +310,19 @@ MessageQueueId_t HeaterHandler::getCommandQueue() const { return commandQueue->g ReturnValue_t HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) { return RETURN_OK; } -ReturnValue_t HeaterHandler::getSwitchState(uint8_t switchNr) const { return 0; } +ReturnValue_t HeaterHandler::getSwitchState(uint8_t switchNr) const { + ReturnValue_t mainSwitchState = mainLineSwitcher->getSwitchState(mainLineSwitch); + if (mainSwitchState == PowerSwitchIF::SWITCH_OFF) { + return PowerSwitchIF::SWITCH_OFF; + } + if (switchNr > 7) { + return PowerSwitchIF::RETURN_FAILED; + } + if (checkSwitchState(static_cast(switchNr)) == SwitchState::ON) { + return PowerSwitchIF::SWITCH_ON; + } + return PowerSwitchIF::SWITCH_OFF; +} ReturnValue_t HeaterHandler::getFuseState(uint8_t fuseNr) const { return 0; } diff --git a/mission/devices/HeaterHandler.h b/mission/devices/HeaterHandler.h index b88fc103..598d256a 100644 --- a/mission/devices/HeaterHandler.h +++ b/mission/devices/HeaterHandler.h @@ -54,22 +54,22 @@ class HeaterHandler : public ExecutableObjectIF, virtual ~HeaterHandler(); - virtual ReturnValue_t performOperation(uint8_t operationCode = 0) override; + ReturnValue_t performOperation(uint8_t operationCode = 0) override; - virtual ReturnValue_t sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) override; - virtual ReturnValue_t sendFuseOnCommand(uint8_t fuseNr) override; + ReturnValue_t sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) override; + ReturnValue_t sendFuseOnCommand(uint8_t fuseNr) override; /** * @brief This function will be called from the Heater object to check * the current switch state. */ - virtual ReturnValue_t getSwitchState(uint8_t switchNr) const override; - virtual ReturnValue_t getFuseState(uint8_t fuseNr) const override; - virtual uint32_t getSwitchDelayMs(void) const override; + ReturnValue_t getSwitchState(uint8_t switchNr) const override; + ReturnValue_t getFuseState(uint8_t fuseNr) const override; + uint32_t getSwitchDelayMs(void) const override; - virtual MessageQueueId_t getCommandQueue() const override; - virtual ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, - const uint8_t* data, size_t size) override; - virtual ReturnValue_t initialize() override; + MessageQueueId_t getCommandQueue() const override; + ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, + const uint8_t* data, size_t size) override; + ReturnValue_t initialize() override; private: static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::HEATER_HANDLER; @@ -98,7 +98,7 @@ class HeaterHandler : public ExecutableObjectIF, */ struct HeaterWrapper { HeaterWrapper(HeaterPair pair, SwitchState initState) - : healthDevice(pair.first), gpioId(pair.second), switchState(initState) {} + : healthDevice(pair.first), gpioId(pair.second), switchState(initState) {} HealthDevice* healthDevice = nullptr; gpioId_t gpioId = gpio::NO_GPIO; SwitchAction action = SwitchAction::NONE; @@ -113,6 +113,8 @@ class HeaterHandler : public ExecutableObjectIF, HeaterMap heaterVec = {}; + MutexIF* heaterMutex = nullptr; + HeaterHelper helper; /** Size of command queue */ @@ -141,7 +143,7 @@ class HeaterHandler : public ExecutableObjectIF, * @brief Returns the state of a switch (ON - true, or OFF - false). * @param switchNr The number of the switch to check. */ - SwitchState checkSwitchState(heater::Switchers switchNr); + SwitchState checkSwitchState(heater::Switchers switchNr) const; /** * @brief This function runs commands waiting for execution. From 92f95b2b979bea031e0b4e3905a061b3cb2eec10 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 4 May 2022 13:25:42 +0200 Subject: [PATCH 0059/2058] comment out debug printout --- mission/devices/HeaterHandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index eeaa0504..d96c1bae 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -47,10 +47,10 @@ ReturnValue_t HeaterHandler::performOperation(uint8_t operationCode) { for (const auto& heater : helper.heaters) { heater.first->performOperation(0); } - for (const auto& heater : heaterVec) { - sif::info << heater.switchState << ","; - } - sif::info << std::endl; +// for (const auto& heater : heaterVec) { +// sif::info << heater.switchState << ","; +// } +// sif::info << std::endl; } catch (const std::out_of_range& e) { sif::warning << "HeaterHandler::performOperation: " "Out of range error | " From 73e4b0cc8111db3ba4f87a0018edf6895871ef0f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 4 May 2022 16:38:02 +0200 Subject: [PATCH 0060/2058] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 6f8fe84d..72552c50 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 6f8fe84d67e79a1f480feacf8d33f048a2801aee +Subproject commit 72552c509062b5d7e04644ea82f8387aa96753ed From 9c888e75bc0f70df96281cb1580ef02972c2cc01 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 4 May 2022 17:23:56 +0200 Subject: [PATCH 0061/2058] bump tmtc again --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 5e9f83cd..72552c50 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 5e9f83cd68c307617b2b05ccc0f9902f5795f8cf +Subproject commit 72552c509062b5d7e04644ea82f8387aa96753ed From bcb6df87b0092dfd408581125001c51586a41acd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 5 May 2022 00:47:50 +0200 Subject: [PATCH 0062/2058] update tmtc, gen files and formatting in config file --- common/config/commonClassIds.h | 54 +- generators/bsp_q7s_returnvalues.csv | 600 +++++++++--------- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- tmtc | 2 +- 7 files changed, 332 insertions(+), 332 deletions(-) diff --git a/common/config/commonClassIds.h b/common/config/commonClassIds.h index 03d51888..6d172594 100644 --- a/common/config/commonClassIds.h +++ b/common/config/commonClassIds.h @@ -6,33 +6,33 @@ namespace CLASS_ID { enum commonClassIds: uint8_t { - COMMON_CLASS_ID_START = FW_CLASS_ID_COUNT, - PCDU_HANDLER, //PCDU - HEATER_HANDLER, //HEATER - SYRLINKS_HANDLER, //SYRLINKS - IMTQ_HANDLER, //IMTQ - RW_HANDLER, //RWHA - STR_HANDLER, //STRH - DWLPWRON_CMD, //DWLPWRON - MPSOC_TM, //MPTM - PLOC_SUPERVISOR_HANDLER, //PLSV - SUS_HANDLER, //SUSS - CCSDS_IP_CORE_BRIDGE, //IPCI - PTME, //PTME - PLOC_UPDATER, //PLUD - STR_HELPER, //STRHLP - GOM_SPACE_HANDLER, //GOMS - PLOC_MEMORY_DUMPER, //PLMEMDUMP - PDEC_HANDLER, //PDEC - CCSDS_HANDLER, //CCSDS - RATE_SETTER, //RS - ARCSEC_JSON_BASE, //JSONBASE - NVM_PARAM_BASE, //NVMB - FILE_SYSTEM_HELPER, //FSHLP - PLOC_MPSOC_HELPER, // PLMPHLP - SA_DEPL_HANDLER, //SADPL - MPSOC_RETURN_VALUES_IF, //MPSOCRTVIF - COMMON_CLASS_ID_END // [EXPORT] : [END] + COMMON_CLASS_ID_START = FW_CLASS_ID_COUNT, + PCDU_HANDLER, //PCDU + HEATER_HANDLER, //HEATER + SYRLINKS_HANDLER, //SYRLINKS + IMTQ_HANDLER, //IMTQ + RW_HANDLER, //RWHA + STR_HANDLER, //STRH + DWLPWRON_CMD, //DWLPWRON + MPSOC_TM, //MPTM + PLOC_SUPERVISOR_HANDLER, //PLSV + SUS_HANDLER, //SUSS + CCSDS_IP_CORE_BRIDGE, //IPCI + PTME, //PTME + PLOC_UPDATER, //PLUD + STR_HELPER, //STRHLP + GOM_SPACE_HANDLER, //GOMS + PLOC_MEMORY_DUMPER, //PLMEMDUMP + PDEC_HANDLER, //PDEC + CCSDS_HANDLER, //CCSDS + RATE_SETTER, //RS + ARCSEC_JSON_BASE, //JSONBASE + NVM_PARAM_BASE, //NVMB + FILE_SYSTEM_HELPER, //FSHLP + PLOC_MPSOC_HELPER, // PLMPHLP + SA_DEPL_HANDLER, //SADPL + MPSOC_RETURN_VALUES_IF, //MPSOCRTVIF + COMMON_CLASS_ID_END // [EXPORT] : [END] }; } diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 2e31206c..eb63b103 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -1,13 +1,12 @@ 0x0;OK;System-wide code for ok.;RETURN_OK;HasReturnvaluesIF.h;HasReturnvaluesIF 0x1;Failed;Unspecified system-wide code for failed.;RETURN_FAILED;HasReturnvaluesIF.h;HasReturnvaluesIF 0x62a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;0xA0;mission/tmtc/CCSDSHandler.h;CCSDS_HANDLER -0x68a0;SADPL_CommandNotSupported;;0xA0;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x68a1;SADPL_DeploymentAlreadyExecuting;;0xA1;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x68a2;SADPL_MainSwitchTimeoutFailure;;0xA2;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x68a3;SADPL_SwitchingDeplSa1Failed;;0xA3;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x68a4;SADPL_SwitchingDeplSa2Failed;;0xA4;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x5aa0;SUSS_ErrorUnlockMutex;;0xA0;mission/devices/SusHandler.h;SUS_HANDLER -0x5aa1;SUSS_ErrorLockMutex;;0xA1;mission/devices/SusHandler.h;SUS_HANDLER +0x5f00;GOMS_PacketTooLong;;0;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f01;GOMS_InvalidTableId;;1;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f02;GOMS_InvalidAddress;;2;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f03;GOMS_InvalidParamSize;;3;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f04;GOMS_InvalidPayloadSize;;4;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f05;GOMS_UnknownReplyId;;5;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x55b0;RWHA_SpiWriteFailure;;0xB0;mission/devices/RwHandler.h;RW_HANDLER 0x55b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;0xB1;mission/devices/RwHandler.h;RW_HANDLER 0x55b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;0xB2;mission/devices/RwHandler.h;RW_HANDLER @@ -20,6 +19,13 @@ 0x55a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;0xA2;mission/devices/RwHandler.h;RW_HANDLER 0x55a3;RWHA_ExecutionFailed;Command execution failed;0xA3;mission/devices/RwHandler.h;RW_HANDLER 0x55a4;RWHA_CrcError;Reaction wheel reply has invalid crc;0xA4;mission/devices/RwHandler.h;RW_HANDLER +0x52a1;HEATER_CommandNotSupported;;0xA1;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x52a2;HEATER_InitFailed;;0xA2;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x52a3;HEATER_InvalidSwitchNr;;0xA3;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x52a4;HEATER_MainSwitchSetTimeout;;0xA4;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x52a5;HEATER_CommandAlreadyWaiting;;0xA5;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x5aa0;SUSS_ErrorUnlockMutex;;0xA0;mission/devices/SusHandler.h;SUS_HANDLER +0x5aa1;SUSS_ErrorLockMutex;;0xA1;mission/devices/SusHandler.h;SUS_HANDLER 0x54a0;IMTQ_InvalidCommandCode;;0xA0;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a1;IMTQ_ParameterMissing;;0xA1;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a2;IMTQ_ParameterInvalid;;0xA2;mission/devices/IMTQHandler.h;IMTQ_HANDLER @@ -28,17 +34,6 @@ 0x54a5;IMTQ_RejectedWithoutReason;;0xA5;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a6;IMTQ_CmdErrUnknown;;0xA6;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;0xA7;mission/devices/IMTQHandler.h;IMTQ_HANDLER -0x52a1;HEATER_CommandNotSupported;;0xA1;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x52a2;HEATER_InitFailed;;0xA2;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x52a3;HEATER_InvalidSwitchNr;;0xA3;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x52a4;HEATER_MainSwitchSetTimeout;;0xA4;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x52a5;HEATER_CommandAlreadyWaiting;;0xA5;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x5f00;GOMS_PacketTooLong;;0;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f01;GOMS_InvalidTableId;;1;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f02;GOMS_InvalidAddress;;2;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f03;GOMS_InvalidParamSize;;3;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f04;GOMS_InvalidPayloadSize;;4;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f05;GOMS_UnknownReplyId;;5;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x53a0;SYRLINKS_CrcFailure;;0xA0;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a1;SYRLINKS_UartFraminOrParityErrorAck;;0xA1;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a2;SYRLINKS_BadCharacterAck;;0xA2;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER @@ -48,10 +43,15 @@ 0x53a6;SYRLINKS_BadCrcAck;;0xA6;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a7;SYRLINKS_ReplyWrongSize;;0xA7;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a8;SYRLINKS_MissingStartFrameCharacter;;0xA8;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER +0x68a0;SADPL_CommandNotSupported;;0xA0;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER +0x68a1;SADPL_DeploymentAlreadyExecuting;;0xA1;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER +0x68a2;SADPL_MainSwitchTimeoutFailure;;0xA2;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER +0x68a3;SADPL_SwitchingDeplSa1Failed;;0xA3;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER +0x68a4;SADPL_SwitchingDeplSa2Failed;;0xA4;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x65a0;NVMB_KeyNotExists;Specified key does not exist in json file;0xA0;mission/memory/NVMParameterBase.h;NVM_PARAM_BASE -0x4300; HSPI_OpeningFileFailed;;0;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI -0x4301; HSPI_FullDuplexTransferFailed;;1;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI -0x4302; HSPI_HalfDuplexTransferFailed;;2;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI +0x4300; HSPI_HalTimeoutRetval;;0;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h;HAL_SPI +0x4301; HSPI_HalBusyRetval;;1;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h;HAL_SPI +0x4302; HSPI_HalErrorRetval;;2;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h;HAL_SPI 0x4401; HURT_UartReadFailure;;1;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART 0x4402; HURT_UartReadSizeMissmatch;;2;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART 0x4403; HURT_UartRxBufferTooSmall;;3;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART @@ -67,119 +67,36 @@ 0x4203; UXOS_CommandError;Command execution failed;3;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL 0x4204; UXOS_NoCommandLoadedOrPending;;4;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL 0x4206; UXOS_PcloseCallError;;6;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL -0x3b00; LPIF_PoolEntryNotFound;;0x00;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF -0x3b01; LPIF_PoolEntryTypeConflict;;0x01;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF -0x3d00; HKM_QueueOrDestinationInvalid;;0;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d01; HKM_WrongHkPacketType;;1;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d02; HKM_ReportingStatusUnchanged;;2;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d03; HKM_PeriodicHelperInvalid;;3;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d04; HKM_PoolobjectNotFound;;4;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d05; HKM_DatasetNotFound;;5;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3501; CFDP_InvalidTlvType;;1;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3502; CFDP_InvalidDirectiveFields;;2;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3503; CFDP_InvalidPduDatafieldLen;;3;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3504; CFDP_InvalidAckDirectiveFields;;4;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3505; CFDP_MetadataCantParseOptions;;5;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3506; CFDP_FinishedCantParseFsResponses;;6;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3508; CFDP_FilestoreRequiresSecondFile;;8;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3509; CFDP_FilestoreResponseCantParseFsMessage;;9;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3101; CF_ObjectHasNoFunctions;;1;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF -0x3102; CF_AlreadyCommanding;;2;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF -0x3201; HF_IsBusy;;1;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF -0x3202; HF_InvalidParameters;;2;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF -0x3203; HF_ExecutionFinished;;3;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF -0x3204; HF_InvalidActionId;;4;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF -0x2d01; HPA_InvalidIdentifierId;;0x01;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF -0x2d02; HPA_InvalidDomainId;;0x02;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF -0x2d03; HPA_InvalidValue;;0x03;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF -0x2d05; HPA_ReadOnly;;0x05;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF -0x2c01; PAW_UnknownDatatype;;0x01;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c02; PAW_DatatypeMissmatch;;0x02;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c03; PAW_Readonly;;0x03;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c04; PAW_TooBig;;0x04;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c05; PAW_SourceNotSet;;0x05;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c06; PAW_OutOfBounds;;0x06;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c07; PAW_NotSet;;0x07;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c08; PAW_ColumnOrRowsZero;;0x08;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x1701; HHI_ObjectNotHealthy;;1;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF -0x1702; HHI_InvalidHealthState;;2;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF -0x2701; SM_DataTooLarge;;1;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF -0x2702; SM_DataStorageFull;;2;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF -0x2703; SM_IllegalStorageId;;3;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF -0x2704; SM_DataDoesNotExist;;4;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF -0x2705; SM_IllegalAddress;;5;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF -0x2706; SM_PoolTooLarge;;6;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF -0x2301; MT_TooDetailedRequest;;1;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x2302; MT_TooGeneralRequest;;2;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x2303; MT_NoMatch;;3;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x2304; MT_Full;;4;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x2305; MT_NewNodeCreated;;5;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x3e01; DLEE_StreamTooShort;;0x01;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER -0x3e02; DLEE_DecodingError;;0x02;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER -0x2e01; ASC_TooLongForTargetType;;1;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER -0x2e02; ASC_InvalidCharacters;;2;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER -0x2e03; ASC_BufferTooSmall;;0x3;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER -0x1c01; TCD_PacketLost;;1;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION -0x1c02; TCD_DestinationNotFound;;2;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION -0x1c03; TCD_ServiceIdAlreadyExists;;3;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION -0x1b00; TCC_IllegalApid;;0;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b01; TCC_IncompletePacket;;1;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b02; TCC_IncorrectChecksum;;2;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b03; TCC_IllegalPacketType;;3;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b04; TCC_IllegalPacketSubtype;;4;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b05; TCC_IncorrectPrimaryHeader;;5;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b06; TCC_IncorrectSecondaryHeader;;6;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x3901; MQI_Empty;;1;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF -0x3902; MQI_Full;No space left for more messages;2;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF -0x3903; MQI_NoReplyPartner;Returned if a reply method was called without partner;3;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF -0x3904; MQI_DestinationInvalid;Returned if the target destination is invalid.;4;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF -0xf01; CM_UnknownCommand;;1;fsfw/src/fsfw/ipc/CommandMessageIF.h;COMMAND_MESSAGE -0x3801; MUX_NotEnoughResources;;1;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3802; MUX_InsufficientMemory;;2;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3803; MUX_NoPrivilege;;3;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3804; MUX_WrongAttributeSetting;;4;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3805; MUX_MutexAlreadyLocked;;5;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3806; MUX_MutexNotFound;;6;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3807; MUX_MutexMaxLocks;;7;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3808; MUX_CurrThreadAlreadyOwnsMutex;;8;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3809; MUX_CurrThreadDoesNotOwnMutex;;9;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x380a; MUX_MutexTimeout;;10;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x380b; MUX_MutexInvalidId;;11;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x380c; MUX_MutexDestroyedWhileWaiting;;12;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x2801; TC_InvalidTargetState;;1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF -0x28f1; TC_AboveOperationalLimit;;0xF1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF -0x28f2; TC_BelowOperationalLimit;;0xF2;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF -0x801; DPS_InvalidParameterDefinition;;1;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x802; DPS_SetWasAlreadyRead;;2;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x803; DPS_CommitingWithoutReading;;3;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x804; DPS_DataSetUninitialised;;4;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x805; DPS_DataSetFull;;5;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x806; DPS_PoolVarNull;;6;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x3ca0; PVA_InvalidReadWriteMode;;0xA0;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF -0x3ca1; PVA_InvalidPoolEntry;;0xA1;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF -0xc02; MS_InvalidEntry;;0x02;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF -0xc03; MS_TooManyElements;;0x03;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF -0xc04; MS_CantStoreEmpty;;0x04;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF -0xd01; SS_SequenceAlreadyExists;;0x01;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd02; SS_TableAlreadyExists;;0x02;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd03; SS_TableDoesNotExist;;0x03;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd04; SS_TableOrSequenceLengthInvalid;;0x04;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd05; SS_SequenceDoesNotExist;;0x05;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd06; SS_TableContainsInvalidObjectId;;0x06;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd07; SS_FallbackSequenceDoesNotExist;;0x07;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd08; SS_NoTargetTable;;0x08;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd09; SS_SequenceOrTableTooLong;;0x09;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd0b; SS_IsFallbackSequence;;0x0B;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd0c; SS_AccessDenied;;0x0C;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd0e; SS_TableInUse;;0x0E;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xda1; SS_TargetTableNotReached;;0xA1;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xda2; SS_TableCheckFailed;;0xA2;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xb01; SB_ChildNotFound;;0x01;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb02; SB_ChildInfoUpdated;;0x02;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb03; SB_ChildDoesntHaveModes;;0x03;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb04; SB_CouldNotInsertChild;;0x04;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb05; SB_TableContainsInvalidObjectId;;0x05;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb00; SB_ConnBroken;;0;fsfw/src/fsfw/osal/common/TcpTmTcServer.h;SUBSYSTEM_BASE +0x2b01; CCS_BcIsSetVrCommand;;0x01;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2b02; CCS_BcIsUnlockCommand;;0x02;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bb0; CCS_BcIllegalCommand;;0xB0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bb1; CCS_BoardReadingNotFinished;;0xB1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf0; CCS_NsPositiveW;;0xF0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf1; CCS_NsNegativeW;;0xF1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf2; CCS_NsLockout;;0xF2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf3; CCS_FarmInLockout;;0xF3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf4; CCS_FarmInWait;;0xF4;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be0; CCS_WrongSymbol;;0xE0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be1; CCS_DoubleStart;;0xE1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be2; CCS_StartSymbolMissed;;0xE2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be3; CCS_EndWithoutStart;;0xE3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be4; CCS_TooLarge;;0xE4;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be5; CCS_TooShort;;0xE5;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be6; CCS_WrongTfVersion;;0xE6;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be7; CCS_WrongSpacecraftId;;0xE7;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be8; CCS_NoValidFrameType;;0xE8;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be9; CCS_CrcFailed;;0xE9;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bea; CCS_VcNotFound;;0xEA;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2beb; CCS_ForwardingFailed;;0xEB;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bec; CCS_ContentTooLarge;;0xEC;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bed; CCS_ResidualData;;0xED;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bee; CCS_DataCorrupted;;0xEE;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bef; CCS_IllegalSegmentationFlag;;0xEF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bd0; CCS_IllegalFlagCombination;;0xD0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bd1; CCS_ShorterThanHeader;;0xD1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bd2; CCS_TooShortBlockedPacket;;0xD2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bd3; CCS_TooShortMapExtraction;;0xD3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x3a00; SPH_ConnBroken;;0;fsfw/src/fsfw/osal/common/TcpTmTcServer.h;SEMAPHORE_IF 0x2901; IEC_NoConfigurationTable;;0x01;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES 0x2902; IEC_NoCpuTable;;0x02;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES 0x2903; IEC_InvalidWorkspaceAddress;;0x03;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES @@ -201,26 +118,69 @@ 0x2913; IEC_ImplementationBlockingOperationCancel;;0x13;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES 0x2914; IEC_MutexObtainFromBadState;;0x14;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES 0x2915; IEC_UnlimitedAndMaximumIs0;;0x15;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x1401; SE_BufferTooShort;;1;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF -0x1402; SE_StreamTooShort;;2;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF -0x1403; SE_TooManyElements;;3;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF -0x4a00; SPPA_NoPacketFound;;0x00;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER -0x4a01; SPPA_SplitPacket;;0x01;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER -0x1d01; PUS_ActivityStarted;;1;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1d02; PUS_InvalidSubservice;;2;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1d03; PUS_IllegalApplicationData;;3;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1d04; PUS_SendTmFailed;;4;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1d05; PUS_Timeout;;5;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1f01; CSB_ExecutionComplete;;1;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f02; CSB_NoStepMessage;;2;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f03; CSB_ObjectBusy;;3;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f04; CSB_Busy;;4;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f05; CSB_InvalidTc;;5;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f06; CSB_InvalidObject;;6;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f07; CSB_InvalidReply;;7;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0xe01; HM_InvalidMode;;0x01;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF +0xe02; HM_TransNotAllowed;;0x02;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF +0xe03; HM_InTransition;;0x03;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF +0xe04; HM_InvalidSubmode;;0x04;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF +0x2d01; HPA_InvalidIdentifierId;;0x01;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2d02; HPA_InvalidDomainId;;0x02;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2d03; HPA_InvalidValue;;0x03;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2d05; HPA_ReadOnly;;0x05;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2c01; PAW_UnknownDatatype;;0x01;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c02; PAW_DatatypeMissmatch;;0x02;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c03; PAW_Readonly;;0x03;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c04; PAW_TooBig;;0x04;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c05; PAW_SourceNotSet;;0x05;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c06; PAW_OutOfBounds;;0x06;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c07; PAW_NotSet;;0x07;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c08; PAW_ColumnOrRowsZero;;0x08;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x3101; CF_ObjectHasNoFunctions;;1;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF +0x3102; CF_AlreadyCommanding;;2;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF +0x3201; HF_IsBusy;;1;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x3202; HF_InvalidParameters;;2;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x3203; HF_ExecutionFinished;;3;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x3204; HF_InvalidActionId;;4;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x201; OM_InsertionFailed;;1;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x202; OM_NotFound;;2;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x203; OM_ChildInitFailed;;3;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x204; OM_InternalErrReporterUninit;;4;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF 0x2500; FDI_YourFault;;0;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF 0x2501; FDI_MyFault;;1;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF 0x2502; FDI_ConfirmLater;;2;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF +0x2101; TMF_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2102; TMF_LastPacketFound;;2;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2103; TMF_StopFetch;;3;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2104; TMF_Timeout;;4;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2105; TMF_TmChannelFull;;5;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2106; TMF_NotStored;;6;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2107; TMF_AllDeleted;;7;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2108; TMF_InvalidData;;8;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2109; TMF_NotReady;;9;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2001; TMB_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2002; TMB_Full;;2;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2003; TMB_Empty;;3;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2004; TMB_NullRequested;;4;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2005; TMB_TooLarge;;5;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2006; TMB_NotReady;;6;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2007; TMB_DumpError;;7;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2008; TMB_CrcError;;8;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2009; TMB_Timeout;;9;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200a; TMB_IdlePacketFound;;10;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200b; TMB_TelecommandFound;;11;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200c; TMB_NoPusATm;;12;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200d; TMB_TooSmall;;13;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200e; TMB_BlockNotFound;;14;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200f; TMB_InvalidRequest;;15;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x1c01; TCD_PacketLost;;1;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION +0x1c02; TCD_DestinationNotFound;;2;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION +0x1c03; TCD_ServiceIdAlreadyExists;;3;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION +0x1b00; TCC_IllegalApid;;0;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b01; TCC_IncompletePacket;;1;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b02; TCC_IncorrectChecksum;;2;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b03; TCC_IllegalPacketType;;3;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b04; TCC_IllegalPacketSubtype;;4;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b05; TCC_IncorrectPrimaryHeader;;5;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b06; TCC_IncorrectSecondaryHeader;;6;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK 0x4e1; RMP_CommandNoDescriptorsAvailable;;0xE1;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL 0x4e2; RMP_CommandBufferFull;;0xE2;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL 0x4e3; RMP_CommandChannelOutOfRange;;0xE3;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL @@ -261,35 +221,12 @@ 0x40a; RMP_ReplyCommandNotImplementedOrNotAuthorised;;10;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL 0x40b; RMP_ReplyRmwDataLengthError;;11;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL 0x40c; RMP_ReplyInvalidTargetLogicalAddress;;12;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL -0x2b01; CCS_BcIsSetVrCommand;;0x01;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2b02; CCS_BcIsUnlockCommand;;0x02;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bb0; CCS_BcIllegalCommand;;0xB0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bb1; CCS_BoardReadingNotFinished;;0xB1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bf0; CCS_NsPositiveW;;0xF0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bf1; CCS_NsNegativeW;;0xF1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bf2; CCS_NsLockout;;0xF2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bf3; CCS_FarmInLockout;;0xF3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bf4; CCS_FarmInWait;;0xF4;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be0; CCS_WrongSymbol;;0xE0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be1; CCS_DoubleStart;;0xE1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be2; CCS_StartSymbolMissed;;0xE2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be3; CCS_EndWithoutStart;;0xE3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be4; CCS_TooLarge;;0xE4;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be5; CCS_TooShort;;0xE5;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be6; CCS_WrongTfVersion;;0xE6;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be7; CCS_WrongSpacecraftId;;0xE7;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be8; CCS_NoValidFrameType;;0xE8;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be9; CCS_CrcFailed;;0xE9;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bea; CCS_VcNotFound;;0xEA;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2beb; CCS_ForwardingFailed;;0xEB;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bec; CCS_ContentTooLarge;;0xEC;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bed; CCS_ResidualData;;0xED;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bee; CCS_DataCorrupted;;0xEE;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bef; CCS_IllegalSegmentationFlag;;0xEF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bd0; CCS_IllegalFlagCombination;;0xD0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bd1; CCS_ShorterThanHeader;;0xD1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bd2; CCS_TooShortBlockedPacket;;0xD2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bd3; CCS_TooShortMapExtraction;;0xD3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2701; SM_DataTooLarge;;1;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2702; SM_DataStorageFull;;2;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2703; SM_IllegalStorageId;;3;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2704; SM_DataDoesNotExist;;4;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2705; SM_IllegalAddress;;5;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2706; SM_PoolTooLarge;;6;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF 0x37a1; SGP4_InvalidEccentricity;;0xA1;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS 0x37a2; SGP4_InvalidMeanMotion;;0xA2;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS 0x37a3; SGP4_InvalidPerturbationElements;;0xA3;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS @@ -298,10 +235,142 @@ 0x37a6; SGP4_SatelliteHasDecayed;;0xA6;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS 0x37b1; SGP4_TleTooOld;;0xB1;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS 0x37b2; SGP4_TleNotInitialized;;0xB2;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS -0x13e0; MH_UnknownCmd;;0xE0;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER -0x13e1; MH_InvalidAddress;;0xE1;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER -0x13e2; MH_InvalidSize;;0xE2;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER -0x13e3; MH_StateMismatch;;0xE3;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x2301; MT_TooDetailedRequest;;1;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2302; MT_TooGeneralRequest;;2;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2303; MT_NoMatch;;3;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2304; MT_Full;;4;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2305; MT_NewNodeCreated;;5;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x3e01; DLEE_StreamTooShort;;0x01;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER +0x3e02; DLEE_DecodingError;;0x02;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER +0x2e01; ASC_TooLongForTargetType;;1;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER +0x2e02; ASC_InvalidCharacters;;2;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER +0x2e03; ASC_BufferTooSmall;;0x3;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER +0xf01; CM_UnknownCommand;;1;fsfw/src/fsfw/ipc/CommandMessageIF.h;COMMAND_MESSAGE +0x3901; MQI_Empty;;1;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3902; MQI_Full;No space left for more messages;2;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3903; MQI_NoReplyPartner;Returned if a reply method was called without partner;3;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3904; MQI_DestinationInvalid;Returned if the target destination is invalid.;4;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3801; MUX_NotEnoughResources;;1;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3802; MUX_InsufficientMemory;;2;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3803; MUX_NoPrivilege;;3;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3804; MUX_WrongAttributeSetting;;4;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3805; MUX_MutexAlreadyLocked;;5;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3806; MUX_MutexNotFound;;6;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3807; MUX_MutexMaxLocks;;7;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3808; MUX_CurrThreadAlreadyOwnsMutex;;8;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3809; MUX_CurrThreadDoesNotOwnMutex;;9;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x380a; MUX_MutexTimeout;;10;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x380b; MUX_MutexInvalidId;;11;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x380c; MUX_MutexDestroyedWhileWaiting;;12;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3a01; SPH_SemaphoreTimeout;;1;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF +0x3a02; SPH_SemaphoreNotOwned;;2;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF +0x3a03; SPH_SemaphoreInvalid;;3;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF +0x3501; CFDP_InvalidTlvType;;1;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3502; CFDP_InvalidDirectiveFields;;2;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3503; CFDP_InvalidPduDatafieldLen;;3;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3504; CFDP_InvalidAckDirectiveFields;;4;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3505; CFDP_MetadataCantParseOptions;;5;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3506; CFDP_FinishedCantParseFsResponses;;6;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3508; CFDP_FilestoreRequiresSecondFile;;8;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3509; CFDP_FilestoreResponseCantParseFsMessage;;9;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x2801; TC_InvalidTargetState;;1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF +0x28f1; TC_AboveOperationalLimit;;0xF1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF +0x28f2; TC_BelowOperationalLimit;;0xF2;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF +0xc02; MS_InvalidEntry;;0x02;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF +0xc03; MS_TooManyElements;;0x03;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF +0xc04; MS_CantStoreEmpty;;0x04;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF +0xd01; SS_SequenceAlreadyExists;;0x01;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd02; SS_TableAlreadyExists;;0x02;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd03; SS_TableDoesNotExist;;0x03;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd04; SS_TableOrSequenceLengthInvalid;;0x04;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd05; SS_SequenceDoesNotExist;;0x05;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd06; SS_TableContainsInvalidObjectId;;0x06;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd07; SS_FallbackSequenceDoesNotExist;;0x07;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd08; SS_NoTargetTable;;0x08;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd09; SS_SequenceOrTableTooLong;;0x09;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd0b; SS_IsFallbackSequence;;0x0B;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd0c; SS_AccessDenied;;0x0C;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd0e; SS_TableInUse;;0x0E;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xda1; SS_TargetTableNotReached;;0xA1;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xda2; SS_TableCheckFailed;;0xA2;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xb01; SB_ChildNotFound;;0x01;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb02; SB_ChildInfoUpdated;;0x02;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb03; SB_ChildDoesntHaveModes;;0x03;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb04; SB_CouldNotInsertChild;;0x04;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb05; SB_TableContainsInvalidObjectId;;0x05;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0x3d00; HKM_QueueOrDestinationInvalid;;0;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d01; HKM_WrongHkPacketType;;1;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d02; HKM_ReportingStatusUnchanged;;2;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d03; HKM_PeriodicHelperInvalid;;3;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d04; HKM_PoolobjectNotFound;;4;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d05; HKM_DatasetNotFound;;5;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3b00; LPIF_PoolEntryNotFound;;0x00;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF +0x3b01; LPIF_PoolEntryTypeConflict;;0x01;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF +0x3ca0; PVA_InvalidReadWriteMode;;0xA0;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF +0x3ca1; PVA_InvalidPoolEntry;;0xA1;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF +0x801; DPS_InvalidParameterDefinition;;1;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x802; DPS_SetWasAlreadyRead;;2;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x803; DPS_CommitingWithoutReading;;3;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x804; DPS_DataSetUninitialised;;4;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x805; DPS_DataSetFull;;5;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x806; DPS_PoolVarNull;;6;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x1000; TIM_UnsupportedTimeFormat;;0;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1001; TIM_NotEnoughInformationForTargetFormat;;1;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1002; TIM_LengthMismatch;;2;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1003; TIM_InvalidTimeFormat;;3;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1004; TIM_InvalidDayOfYear;;4;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1005; TIM_TimeDoesNotFitFormat;;5;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x3601; TSI_BadTimestamp;;1;fsfw/src/fsfw/timemanager/TimeStamperIF.h;TIME_STAMPER_IF +0x1d01; PUS_ActivityStarted;;1;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d02; PUS_InvalidSubservice;;2;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d03; PUS_IllegalApplicationData;;3;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d04; PUS_SendTmFailed;;4;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d05; PUS_Timeout;;5;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x4a00; SPPA_NoPacketFound;;0x00;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER +0x4a01; SPPA_SplitPacket;;0x01;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER +0x1f01; CSB_ExecutionComplete;;1;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f02; CSB_NoStepMessage;;2;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f03; CSB_ObjectBusy;;3;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f04; CSB_Busy;;4;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f05; CSB_InvalidTc;;5;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f06; CSB_InvalidObject;;6;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f07; CSB_InvalidReply;;7;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1101; AL_Full;;0x01;fsfw/src/fsfw/container/ArrayList.h;ARRAY_LIST +0x1801; FF_Full;;1;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS +0x1802; FF_Empty;;2;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS +0x1601; FMM_MapFull;;0x01;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP +0x1602; FMM_KeyDoesNotExist;;0x02;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP +0x1501; FM_KeyAlreadyExists;;0x01;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP +0x1502; FM_MapFull;;0x02;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP +0x1503; FM_KeyDoesNotExist;;0x03;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP +0x2401; EV_ListenerNotFound;;1;fsfw/src/fsfw/events/EventManagerIF.h;EVENT_MANAGER_IF +0x1701; HHI_ObjectNotHealthy;;1;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF +0x1702; HHI_InvalidHealthState;;2;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF +0x2f01; POS_InPowerTransition;;1;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER +0x2f02; POS_SwitchStateMismatch;;2;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER +0x501; PS_SwitchOn;;1;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x500; PS_SwitchOff;;0;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x502; PS_SwitchTimeout;;2;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x503; PS_FuseOn;;3;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x504; PS_FuseOff;;4;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x1a01; TRC_NotEnoughSensors;;1;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a02; TRC_LowestValueOol;;2;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a03; TRC_HighestValueOol;;3;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a04; TRC_BothValuesOol;;4;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a05; TRC_DuplexOol;;5;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x3001; LIM_Unchecked;;1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3002; LIM_Invalid;;2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3003; LIM_Unselected;;3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3004; LIM_BelowLowLimit;;4;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3005; LIM_AboveHighLimit;;5;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3006; LIM_UnexpectedValue;;6;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3007; LIM_OutOfRange;;7;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30a0; LIM_FirstSample;;0xA0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e0; LIM_InvalidSize;;0xE0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e1; LIM_WrongType;;0xE1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e2; LIM_WrongPid;;0xE2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e3; LIM_WrongLimitId;;0xE3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30ee; LIM_MonitorNotFound;;0xEE;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF 0x4100; FILS_GenericFileError;;0;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM 0x4101; FILS_IsBusy;;1;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM 0x4102; FILS_InvalidParameters;;2;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM @@ -327,60 +396,16 @@ 0x6e2; PP_InvalidContent;;0xE2;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF 0x6e3; PP_UnalignedAccess;;0xE3;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF 0x6e4; PP_WriteProtected;;0xE4;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x201; OM_InsertionFailed;;1;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF -0x202; OM_NotFound;;2;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF -0x203; OM_ChildInitFailed;;3;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF -0x204; OM_InternalErrReporterUninit;;4;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF -0x501; PS_SwitchOn;;1;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x500; PS_SwitchOff;;0;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x502; PS_SwitchTimeout;;2;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x503; PS_FuseOn;;3;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x504; PS_FuseOff;;4;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x2f01; POS_InPowerTransition;;1;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER -0x2f02; POS_SwitchStateMismatch;;2;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER -0x1000; TIM_UnsupportedTimeFormat;;0;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1001; TIM_NotEnoughInformationForTargetFormat;;1;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1002; TIM_LengthMismatch;;2;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1003; TIM_InvalidTimeFormat;;3;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1004; TIM_InvalidDayOfYear;;4;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1005; TIM_TimeDoesNotFitFormat;;5;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x3601; TSI_BadTimestamp;;1;fsfw/src/fsfw/timemanager/TimeStamperIF.h;TIME_STAMPER_IF -0x2101; TMF_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2102; TMF_LastPacketFound;;2;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2103; TMF_StopFetch;;3;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2104; TMF_Timeout;;4;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2105; TMF_TmChannelFull;;5;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2106; TMF_NotStored;;6;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2107; TMF_AllDeleted;;7;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2108; TMF_InvalidData;;8;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2109; TMF_NotReady;;9;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2001; TMB_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2002; TMB_Full;;2;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2003; TMB_Empty;;3;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2004; TMB_NullRequested;;4;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2005; TMB_TooLarge;;5;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2006; TMB_NotReady;;6;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2007; TMB_DumpError;;7;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2008; TMB_CrcError;;8;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2009; TMB_Timeout;;9;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200a; TMB_IdlePacketFound;;10;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200b; TMB_TelecommandFound;;11;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200c; TMB_NoPusATm;;12;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200d; TMB_TooSmall;;13;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200e; TMB_BlockNotFound;;14;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200f; TMB_InvalidRequest;;15;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0xe01; HM_InvalidMode;;0x01;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF -0xe02; HM_TransNotAllowed;;0x02;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF -0xe03; HM_InTransition;;0x03;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF -0xe04; HM_InvalidSubmode;;0x04;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF -0x1501; FM_KeyAlreadyExists;;0x01;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP -0x1502; FM_MapFull;;0x02;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP -0x1503; FM_KeyDoesNotExist;;0x03;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP -0x1101; AL_Full;;0x01;fsfw/src/fsfw/container/ArrayList.h;ARRAY_LIST -0x1601; FMM_MapFull;;0x01;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP -0x1602; FMM_KeyDoesNotExist;;0x02;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP -0x1801; FF_Full;;1;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS -0x1802; FF_Empty;;2;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS +0x13e0; MH_UnknownCmd;;0xE0;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x13e1; MH_InvalidAddress;;0xE1;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x13e2; MH_InvalidSize;;0xE2;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x13e3; MH_StateMismatch;;0xE3;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x1201; AB_NeedSecondStep;;0x01;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x1202; AB_NeedToReconfigure;;0x02;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x1203; AB_ModeFallback;;0x03;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x1204; AB_ChildNotCommandable;;0x04;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x1205; AB_NeedToChangeHealth;;0x05;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x12a1; AB_NotEnoughChildrenInCorrectState;;0xa1;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE 0x3a0; DHB_InvalidChannel;;0xA0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE 0x3b0; DHB_AperiodicReply;;0xB0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE 0x3b1; DHB_IgnoreReplyData;;0xB1;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE @@ -390,12 +415,12 @@ 0x3d0; DHB_NoSwitch;;0xD0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE 0x3e0; DHB_ChildTimeout;;0xE0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE 0x3e1; DHB_SwitchFailed;;0xE1;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE -0x1201; AB_NeedSecondStep;;0x01;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE -0x1202; AB_NeedToReconfigure;;0x02;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE -0x1203; AB_ModeFallback;;0x03;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE -0x1204; AB_ChildNotCommandable;;0x04;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE -0x1205; AB_NeedToChangeHealth;;0x05;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE -0x12a1; AB_NotEnoughChildrenInCorrectState;;0xa1;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x3301; DC_NoReplyReceived;;0x01;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3302; DC_ProtocolError;;0x02;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3303; DC_Nullpointer;;0x03;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3304; DC_InvalidCookieType;;0x04;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3305; DC_NotActive;;0x05;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3306; DC_TooMuchData;;0x06;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF 0x26a0; DHI_NoCommandData;;0xA0;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF 0x26a1; DHI_CommandNotSupported;;0xA1;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF 0x26a2; DHI_CommandAlreadySent;;0xA2;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF @@ -417,34 +442,11 @@ 0x26c3; DHI_DeviceReplyInvalid;;0xC3;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF 0x26d0; DHI_InvalidCommandParameter;;0xD0;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF 0x26d1; DHI_InvalidNumberOrLengthOfParameters;;0xD1;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF -0x3301; DC_NoReplyReceived;;0x01;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3302; DC_ProtocolError;;0x02;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3303; DC_Nullpointer;;0x03;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3304; DC_InvalidCookieType;;0x04;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3305; DC_NotActive;;0x05;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3306; DC_TooMuchData;;0x06;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x2401; EV_ListenerNotFound;;1;fsfw/src/fsfw/events/EventManagerIF.h;EVENT_MANAGER_IF -0x1a01; TRC_NotEnoughSensors;;1;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x1a02; TRC_LowestValueOol;;2;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x1a03; TRC_HighestValueOol;;3;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x1a04; TRC_BothValuesOol;;4;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x1a05; TRC_DuplexOol;;5;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x3001; LIM_Unchecked;;1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3002; LIM_Invalid;;2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3003; LIM_Unselected;;3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3004; LIM_BelowLowLimit;;4;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3005; LIM_AboveHighLimit;;5;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3006; LIM_UnexpectedValue;;6;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3007; LIM_OutOfRange;;7;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30a0; LIM_FirstSample;;0xA0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30e0; LIM_InvalidSize;;0xE0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30e1; LIM_WrongType;;0xE1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30e2; LIM_WrongPid;;0xE2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30e3; LIM_WrongLimitId;;0xE3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30ee; LIM_MonitorNotFound;;0xEE;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3a01; SPH_SemaphoreTimeout;;1;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF -0x3a02; SPH_SemaphoreNotOwned;;2;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF -0x3a03; SPH_SemaphoreInvalid;;3;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF +0x1401; SE_BufferTooShort;;1;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF +0x1402; SE_StreamTooShort;;2;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF +0x1403; SE_TooManyElements;;3;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF +0x66a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;0xA0;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER +0x66a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER 0x7000; SDMA_OpOngoing;;0;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x7001; SDMA_AlreadyOn;;1;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x7002; SDMA_AlreadyMounted;;2;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER @@ -456,27 +458,6 @@ 0x700e; SDMA_SystemCallError;;14;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x700f; SDMA_PopenCallError;;15;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x7100; SCBU_KeyNotFound;;0;bsp_q7s/memory/scratchApi.h;SCRATCH_BUFFER -0x66a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;0xA0;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER -0x66a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER -0x69a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;0xA0;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;0xA1;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;0xA2;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;0xA3;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;0xA4;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;0xA5;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;0xA6;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);0xA7;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;0xA8;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;0xA9;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x57e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);0xE0;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD -0x57e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);0xE1;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD -0x60a0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;0xA0;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER -0x60a1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;0xA1;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER -0x67a0; PLMPHLP_FileClosedAccidentally;File accidentally close;0xA0;linux/devices/ploc/PlocMPSoCHelper.h;PLOC_MPSOC_HELPER -0x5da0;PLUD_UpdaterBusy;Updater is already performing an update;0xA0;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER -0x5da1;PLUD_NameTooLong;Received update command with invalid path string (too long).;0xA1;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER -0x5da2;PLUD_SdNotMounted;Received command to initiate update but SD card with update image not mounted.;0xA2;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER -0x5da3;PLUD_FileNotExists;Update file received with update command does not exist.;0xA3;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER 0x59a0;PLSV_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;0xA0;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59a1;PLSV_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;0xA1;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59a2;PLSV_ReceivedExeFailure;Received execution failure reply from PLOC supervisor;0xA2;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER @@ -492,12 +473,19 @@ 0x59ac;PLSV_NoMramPacket;Expect reception of an MRAM dump packet but received space packet with other apid.;0xAC;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59ad;PLSV_PathDoesNotExist;Path to PLOC directory on SD card does not exist;0xAD;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59ae;PLSV_MramFileNotExists;MRAM dump file does not exists. The file should actually already have been created with the reception of the first dump packet.;0xAE;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x6401;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE -0x6402;JSONBASE_SetNotExists;Requested set does not exist in json file;2;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE -0x6403;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE +0x67a0; PLMPHLP_FileClosedAccidentally;File accidentally close;0xA0;linux/devices/ploc/PlocMPSoCHelper.h;PLOC_MPSOC_HELPER +0x60a0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;0xA0;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER +0x60a1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;0xA1;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER +0x5da0;PLUD_UpdaterBusy;Updater is already performing an update;0xA0;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER +0x5da1;PLUD_NameTooLong;Received update command with invalid path string (too long).;0xA1;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER +0x5da2;PLUD_SdNotMounted;Received command to initiate update but SD card with update image not mounted.;0xA2;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER +0x5da3;PLUD_FileNotExists;Update file received with update command does not exist.;0xA3;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER 0x56a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;0xA0;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a1;STRH_PingFailed;Ping command failed;0xA1;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a2;STRH_VersionReqFailed;Status in version reply signals error;0xA2;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER +0x6401;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE +0x6402;JSONBASE_SetNotExists;Requested set does not exist in json file;2;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE +0x6403;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE 0x56a3;STRH_InterfaceReqFailed;Status in interface reply signals error;0xA3;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a4;STRH_PowerReqFailed;Status in power reply signals error;0xA4;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;0xA5;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER @@ -529,12 +517,20 @@ 0x5ea6;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;0xA6;linux/devices/startracker/StrHelper.h;STR_HELPER 0x5ea7;STRHLP_StatusError;Status field in reply signals error;0xA7;linux/devices/startracker/StrHelper.h;STR_HELPER 0x5ea8;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);0xA8;linux/devices/startracker/StrHelper.h;STR_HELPER +0x69a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;0xA0;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;0xA1;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;0xA2;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;0xA3;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;0xA4;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;0xA5;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;0xA6;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);0xA7;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;0xA8;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;0xA9;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x57e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);0xE0;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD +0x57e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);0xE1;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD 0x5ba0;IPCI_PapbBusy;;0xA0;linux/obc/PapbVcInterface.h;CCSDS_IP_CORE_BRIDGE 0x5ca0;PTME_UnknownVcId;;0xA0;linux/obc/Ptme.h;PTME -0x63a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;0xA0;linux/obc/PtmeConfig.h;RATE_SETTER -0x63a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);0xA1;linux/obc/PtmeConfig.h;RATE_SETTER -0x63a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;0xA2;linux/obc/PtmeConfig.h;RATE_SETTER -0x63a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;0xA3;linux/obc/PtmeConfig.h;RATE_SETTER 0x61a0;PDEC_AbandonedCltu;;0xA0;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61a1;PDEC_FrameDirty;;0xA1;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61a2;PDEC_FrameIllegalMultipleReasons;;0xA2;linux/obc/PdecHandler.h;PDEC_HANDLER @@ -550,3 +546,7 @@ 0x61ab;PDEC_InvalidVcIdLsb;;0xAB;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61ac;PDEC_NsNotZero;;0xAC;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61ae;PDEC_InvalidBcCc;;0xAE;linux/obc/PdecHandler.h;PDEC_HANDLER +0x63a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;0xA0;linux/obc/PtmeConfig.h;RATE_SETTER +0x63a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);0xA1;linux/obc/PtmeConfig.h;RATE_SETTER +0x63a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;0xA2;linux/obc/PtmeConfig.h;RATE_SETTER +0x63a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;0xA3;linux/obc/PtmeConfig.h;RATE_SETTER diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 97b9e453..f119298a 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 189 translations. * @details - * Generated on: 2022-05-04 10:07:44 + * Generated on: 2022-05-05 00:44:20 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index de03eaf8..44939492 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 125 translations. - * Generated on: 2022-05-04 10:07:44 + * Generated on: 2022-05-05 00:44:20 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 97b9e453..f119298a 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 189 translations. * @details - * Generated on: 2022-05-04 10:07:44 + * Generated on: 2022-05-05 00:44:20 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index de03eaf8..44939492 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 125 translations. - * Generated on: 2022-05-04 10:07:44 + * Generated on: 2022-05-05 00:44:20 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index 72552c50..4bf58da1 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 72552c509062b5d7e04644ea82f8387aa96753ed +Subproject commit 4bf58da187000f141ea1afdc3de3a1cc583ee531 From 4c809e354d13e6ffa676975a0205669534f340ef Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 5 May 2022 16:23:46 +0200 Subject: [PATCH 0063/2058] better heater obj id names --- bsp_q7s/fm/fmObjectFactory.cpp | 16 ++++++++-------- common/config/commonObjects.h | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bsp_q7s/fm/fmObjectFactory.cpp b/bsp_q7s/fm/fmObjectFactory.cpp index 9689a003..3e97c4fd 100644 --- a/bsp_q7s/fm/fmObjectFactory.cpp +++ b/bsp_q7s/fm/fmObjectFactory.cpp @@ -611,14 +611,14 @@ void ObjectFactory::createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwi gpioIF->addGpios(heaterGpiosCookie); HeaterHelper helper({{ - {new HealthDevice(objects::HEATER_0, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_0}, - {new HealthDevice(objects::HEATER_1, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_1}, - {new HealthDevice(objects::HEATER_2, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_2}, - {new HealthDevice(objects::HEATER_3, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_3}, - {new HealthDevice(objects::HEATER_4, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_4}, - {new HealthDevice(objects::HEATER_5, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_5}, - {new HealthDevice(objects::HEATER_6, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_6}, - {new HealthDevice(objects::HEATER_7, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7}, + {new HealthDevice(objects::HEATER_0_OBC_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_0}, + {new HealthDevice(objects::HEATER_1_PLOC_PROC_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_1}, + {new HealthDevice(objects::HEATER_2_ACS_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_2}, + {new HealthDevice(objects::HEATER_3_PCDU_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_3}, + {new HealthDevice(objects::HEATER_4_CAMERA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_4}, + {new HealthDevice(objects::HEATER_5_STR, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_5}, + {new HealthDevice(objects::HEATER_6_DRO, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_6}, + {new HealthDevice(objects::HEATER_7_HPA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7}, }}); new HeaterHandler(objects::HEATER_HANDLER, gpioIF, helper, pwrSwitcher, pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index 38b735c0..0a69ea32 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -98,14 +98,14 @@ enum commonObjects: uint32_t { PTME_CONFIG = 44330005, // 0x60 for other stuff - HEATER_0 = 0x60000000, - HEATER_1 = 0x60000001, - HEATER_2 = 0x60000002, - HEATER_3 = 0x60000003, - HEATER_4 = 0x60000004, - HEATER_5 = 0x60000005, - HEATER_6 = 0x60000006, - HEATER_7 = 0x60000007, + HEATER_0_OBC_BRD = 0x60000000, + HEATER_1_PLOC_PROC_BRD = 0x60000001, + HEATER_2_ACS_BRD = 0x60000002, + HEATER_3_PCDU_BRD = 0x60000003, + HEATER_4_CAMERA = 0x60000004, + HEATER_5_STR = 0x60000005, + HEATER_6_DRO = 0x60000006, + HEATER_7_HPA = 0x60000007, // 0x73 ('s') for assemblies and system/subsystem components ACS_BOARD_ASS = 0x73000001, From 68938c3b428fb89a2b249d9694d4e9dd82aa1cb2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 5 May 2022 20:27:20 +0200 Subject: [PATCH 0064/2058] remove duplicate object ID --- common/config/commonObjects.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index 64b30d35..c80d8e56 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -115,9 +115,6 @@ enum commonObjects: uint32_t { SUS_5_N_LOC_XFYMZB_PT_ZB = 0x44120037, SUS_11_R_LOC_XBYMZB_PT_ZB = 0x44120043, - GPS_CONTROLLER = 0x44130045, - - SYRLINKS_HK_HANDLER = 0x445300A3, AXI_PTME_CONFIG = 44330004, PTME_CONFIG = 44330005, From 646925c571f43a0adfbe09473d485d299b6e0e5d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 8 May 2022 13:08:49 +0200 Subject: [PATCH 0065/2058] removed redundant SUS OBJ ID defs --- common/config/commonObjects.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index 46488fd6..db2bd777 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -30,18 +30,6 @@ enum commonObjects: uint32_t { GYRO_1_L3G_HANDLER = 0x44120111, GYRO_2_ADIS_HANDLER = 0x44120212, GYRO_3_L3G_HANDLER = 0x44120313, - SUS_0 = 0x44120032, - SUS_1 = 0x44120033, - SUS_2 = 0x44120034, - SUS_3 = 0x44120035, - SUS_4 = 0x44120036, - SUS_5 = 0x44120037, - SUS_6 = 0x44120038, - SUS_7 = 0x44120039, - SUS_8 = 0x44120040, - SUS_9 = 0x44120041, - SUS_10 = 0x44120042, - SUS_11 = 0x44120043, RW1 = 0x44120047, RW2 = 0x44120148, RW3 = 0x44120249, From 48643945901b88536cd305d7ed52fbc13135e36f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 9 May 2022 16:13:33 +0200 Subject: [PATCH 0066/2058] renamed heaters --- bsp_q7s/fm/fmObjectFactory.cpp | 6 +++--- common/config/commonObjects.h | 6 +++--- tmtc | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bsp_q7s/fm/fmObjectFactory.cpp b/bsp_q7s/fm/fmObjectFactory.cpp index 9d8db750..a3a208c9 100644 --- a/bsp_q7s/fm/fmObjectFactory.cpp +++ b/bsp_q7s/fm/fmObjectFactory.cpp @@ -605,10 +605,10 @@ void ObjectFactory::createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwi gpioIF->addGpios(heaterGpiosCookie); HeaterHelper helper({{ - {new HealthDevice(objects::HEATER_0_OBC_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_0}, - {new HealthDevice(objects::HEATER_1_PLOC_PROC_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_1}, + {new HealthDevice(objects::HEATER_0_PLOC_PROC_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_0}, + {new HealthDevice(objects::HEATER_1_PCDU_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_1}, {new HealthDevice(objects::HEATER_2_ACS_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_2}, - {new HealthDevice(objects::HEATER_3_PCDU_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_3}, + {new HealthDevice(objects::HEATER_3_OBC_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_3}, {new HealthDevice(objects::HEATER_4_CAMERA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_4}, {new HealthDevice(objects::HEATER_5_STR, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_5}, {new HealthDevice(objects::HEATER_6_DRO, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_6}, diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index db2bd777..d797c208 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -108,10 +108,10 @@ enum commonObjects: uint32_t { SYRLINKS_HK_HANDLER = 0x445300A3, // 0x60 for other stuff - HEATER_0_OBC_BRD = 0x60000000, - HEATER_1_PLOC_PROC_BRD = 0x60000001, + HEATER_0_PLOC_PROC_BRD = 0x60000000, + HEATER_1_PCDU_BRD = 0x60000001, HEATER_2_ACS_BRD = 0x60000002, - HEATER_3_PCDU_BRD = 0x60000003, + HEATER_3_OBC_BRD = 0x60000003, HEATER_4_CAMERA = 0x60000004, HEATER_5_STR = 0x60000005, HEATER_6_DRO = 0x60000006, diff --git a/tmtc b/tmtc index e0671e08..6b7b07c3 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit e0671e080799ff502ef22814df1fe3db0f7e96d6 +Subproject commit 6b7b07c3409fc24a8585c39e308156b3657c655e From 50c363fb6f4ef490fca06e121ec04e995449e10e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 9 May 2022 21:29:54 +0200 Subject: [PATCH 0067/2058] new RTD reader module handling all RTD SPI Communication --- linux/ObjectFactory.cpp | 48 +-- linux/devices/CMakeLists.txt | 4 + linux/devices/Max31865RtdReader.cpp | 289 ++++++++++++++++++ linux/devices/Max31865RtdReader.h | 92 ++++++ mission/devices/Max31865PT1000Handler.cpp | 122 ++++---- mission/devices/Max31865PT1000Handler.h | 5 +- .../devicedefinitions/Max31865Definitions.h | 26 +- .../Max31865DeviceDefinitions.cpp | 1 + mission/system/TcsBoardAssembly.cpp | 12 +- mission/system/TcsBoardAssembly.h | 5 +- tmtc | 2 +- 11 files changed, 510 insertions(+), 96 deletions(-) create mode 100644 linux/devices/Max31865RtdReader.cpp create mode 100644 linux/devices/Max31865RtdReader.h create mode 100644 mission/devices/devicedefinitions/Max31865DeviceDefinitions.cpp diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index fcf1f81f..5a740c33 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -265,34 +265,36 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, {addresses::RTD_IC_17, gpioIds::RTD_IC_17}, {addresses::RTD_IC_18, gpioIds::RTD_IC_18}, }}; - std::array rtdIds = {objects::RTD_0_IC3_PLOC_HEATSPREADER, - objects::RTD_1_IC4_PLOC_MISSIONBOARD, - objects::RTD_2_IC5_4K_CAMERA, - objects::RTD_3_IC6_DAC_HEATSPREADER, - objects::RTD_4_IC7_STARTRACKER, - objects::RTD_5_IC8_RW1_MX_MY, - objects::RTD_6_IC9_DRO, - objects::RTD_7_IC10_SCEX, - objects::RTD_8_IC11_X8, - objects::RTD_9_IC12_HPA, - objects::RTD_10_IC13_PL_TX, - objects::RTD_11_IC14_MPA, - objects::RTD_12_IC15_ACU, - objects::RTD_13_IC16_PLPCDU_HEATSPREADER, - objects::RTD_14_IC17_TCS_BOARD, - objects::RTD_15_IC18_IMTQ}; + std::array, NUMBER_RTDS> rtdInfos = {{ + {objects::RTD_0_IC3_PLOC_HEATSPREADER, "RTD_0_PLOC_HEATSPREADER"}, + {objects::RTD_1_IC4_PLOC_MISSIONBOARD, "RTD_1_PLOC_MISSIONBOARD"}, + {objects::RTD_2_IC5_4K_CAMERA, "RTD_2_4K_CAMERA"}, + {objects::RTD_3_IC6_DAC_HEATSPREADER, "RTD_3_DAC_HEATSPREADER"}, + {objects::RTD_4_IC7_STARTRACKER, "RTD_4_STARTRACKER"}, + {objects::RTD_5_IC8_RW1_MX_MY, "RTD_5_RW1_MX_MY"}, + {objects::RTD_6_IC9_DRO, "RTD_6_DRO"}, + {objects::RTD_7_IC10_SCEX, "RTD_7_SCEX"}, + {objects::RTD_8_IC11_X8, "RTD_8_X8"}, + {objects::RTD_9_IC12_HPA, "RTD_9_HPA"}, + {objects::RTD_10_IC13_PL_TX, "RTD_10_PL_TX,"}, + {objects::RTD_11_IC14_MPA, "RTD_11_MPA"}, + {objects::RTD_12_IC15_ACU, "RTD_12_ACU"}, + {objects::RTD_13_IC16_PLPCDU_HEATSPREADER, "RTD_13_PLPCDU_HEATSPREADER"}, + {objects::RTD_14_IC17_TCS_BOARD, "RTD_14_TCS_BOARD"}, + {objects::RTD_15_IC18_IMTQ, "RTD_15_IMTQ"}, + }}; std::array rtdCookies = {}; std::array rtds = {}; RtdFdir* rtdFdir = nullptr; for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) { - rtdCookies[idx] = - new SpiCookie(cookieArgs[idx].first, cookieArgs[idx].second, spiDev, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - rtds[idx] = new Max31865PT1000Handler(rtdIds[idx], objects::SPI_COM_IF, rtdCookies[idx]); + rtdCookies[idx] = new SpiCookie(cookieArgs[idx].first, cookieArgs[idx].second, spiDev, + MAX31865::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); + rtds[idx] = + new Max31865PT1000Handler(rtdInfos[idx].first, objects::SPI_COM_IF, rtdCookies[idx]); rtds[idx]->setParent(objects::TCS_BOARD_ASS); - rtdFdir = new RtdFdir(rtdIds[idx]); + rtdFdir = new RtdFdir(rtdInfos[idx].first); rtds[idx]->setCustomFdir(rtdFdir); - rtds[idx]->setDeviceIdx(idx + 3); + rtds[idx]->setDeviceInfo(idx + 3, rtdInfos[idx].second); #if OBSW_DEBUG_RTD == 1 rtds[idx]->setDebugMode(true); #endif @@ -306,7 +308,7 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, } } #endif // OBSW_TEST_RTD == 1 - TcsBoardHelper helper(rtdIds); + TcsBoardHelper helper(rtdInfos); TcsBoardAssembly* tcsBoardAss = new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); diff --git a/linux/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt index 00d407e8..e65987c6 100644 --- a/linux/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -4,5 +4,9 @@ if(EIVE_BUILD_GPSD_GPS_HANDLER) ) endif() +target_sources(${OBSW_NAME} PRIVATE + Max31865RtdReader.cpp +) + add_subdirectory(ploc) add_subdirectory(startracker) diff --git a/linux/devices/Max31865RtdReader.cpp b/linux/devices/Max31865RtdReader.cpp new file mode 100644 index 00000000..0e2f9724 --- /dev/null +++ b/linux/devices/Max31865RtdReader.cpp @@ -0,0 +1,289 @@ +#include +#include + +Max31865RtdReader::Max31865RtdReader(object_id_t objectId, SpiComIF* comIF) + : SystemObject(objectId), rtds(NUM_RTDS), comIF(comIF) { + readerMutex = MutexFactory::instance()->createMutex(); +} + +ReturnValue_t Max31865RtdReader::performOperation(uint8_t operationCode) { + using namespace MAX31865; + while (true) { + rtdMainLoop(); + // Read all RTDs at once every 500 ms for now + TaskFactory::delayTask(500); + } +} + +void Max31865RtdReader::rtdMainLoop() { + using namespace MAX31865; + if (periodicInitHandling()) { + // 10 ms delay for VBIAS startup + TaskFactory::delayTask(10); + } else { + // No devices usable (e.g. TCS board off) + return; + } + + periodicReadReqHandling(); + // After requesting, 65 milliseconds delay required + TaskFactory::delayTask(65); + + periodicReadHandling(); +} + +bool Max31865RtdReader::rtdCanBeUsed(uint8_t idx) { + if (rtds[idx]->active and rtds[idx]->configured) { + return true; + } + return false; +} + +bool Max31865RtdReader::periodicInitHandling() { + using namespace MAX31865; + MutexGuard mg(readerMutex); + ReturnValue_t result = RETURN_OK; + if (mg.getLockResult() != RETURN_OK) { + // TODO: Emit warning, return + return false; + } + + bool someRtdActive = false; + for (auto& rtd : rtds) { + if (rtd == nullptr) { + continue; + } + if (rtd->active and not rtd->configured) { + someRtdActive = true; + uint8_t cfg = (Bias::OFF << CfgBitPos::BIAS_SEL) | (Wires::FOUR_WIRE << CfgBitPos::WIRE_SEL) | + (ConvMode::NORM_OFF << CfgBitPos::CONV_MODE) | + (1 << CfgBitPos::FAULTY_STATUS_CLEAR); + result = writeCfgReg(rtd->spiCookie, cfg); + if (result != HasReturnvaluesIF::RETURN_OK) { + // TODO: Check retval + } + rtd->configured = true; + } + } + if (not someRtdActive) { + return false; + } + bool someRtdUsable = false; + for (auto& rtd : rtds) { + if (rtd == nullptr) { + continue; + } + if (rtdCanBeUsed(rtd->idx)) { + someRtdUsable = true; + result = biasSel(Bias::ON, rtd->spiCookie); + } + } + return someRtdUsable; +} + +void Max31865RtdReader::periodicReadReqHandling() { + using namespace MAX31865; + MutexGuard mg(readerMutex); + if (mg.getLockResult() != RETURN_OK) { + // TODO: Emit warning, return + return; + } + // Now request one shot config for all active RTDs + for (auto& rtd : rtds) { + if (rtd == nullptr) { + continue; + } + if (rtd->active) { + uint8_t currentCfg = 0; + auto result = readCfgReg(rtd->spiCookie, currentCfg); + if (result != RETURN_OK) { + // TODO: Emit warning, FDIR? + continue; + } + currentCfg |= (1 << CfgBitPos::ONE_SHOT); + result = writeCfgReg(rtd->spiCookie, currentCfg); + } + } +} + +void Max31865RtdReader::periodicReadHandling() { + using namespace MAX31865; + auto result = RETURN_OK; + MutexGuard mg(readerMutex); + if (mg.getLockResult() != RETURN_OK) { + // TODO: Emit warning, return + return; + } + // Now read the RTD values + for (auto& rtd : rtds) { + if (rtd == nullptr) { + continue; + } + if (rtd->active) { + uint16_t rtdVal = 0; + bool faultBitSet = false; + result = readRtdVal(rtd->spiCookie, rtdVal, faultBitSet); + if (result != RETURN_OK) { + // TODO: Emit warning, FDIR? + continue; + } + if (faultBitSet) { + rtd->db.faultBitSet = faultBitSet; + } + rtd->db.rtdVal = rtdVal; + } + } + for (auto& rtd : rtds) { + if (rtd == nullptr) { + continue; + } + if (rtd->active) { + result = biasSel(Bias::OFF, rtd->spiCookie); + } + } +} + +ReturnValue_t Max31865RtdReader::initializeInterface(CookieIF* cookie) { + if (cookie == nullptr) { + throw std::invalid_argument("Invalid MAX31865 Reader Cookie"); + } + auto* rtdCookie = dynamic_cast(cookie); + ReturnValue_t result = comIF->initializeInterface(rtdCookie->spiCookie); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + if (rtdCookie->idx > NUM_RTDS) { + throw std::invalid_argument("Invalid RTD index"); + } + rtds[rtdCookie->idx] = rtdCookie; + return RETURN_OK; +} + +ReturnValue_t Max31865RtdReader::sendMessage(CookieIF* cookie, const uint8_t* sendData, + size_t sendLen) { + if (cookie == nullptr) { + return RETURN_FAILED; + } + if (sendLen < 1) { + return RETURN_OK; + } + MutexGuard mg(readerMutex); + if (mg.getLockResult() != RETURN_OK) { + // TODO: Emit warning, return + return RETURN_FAILED; + } + auto* rtdCookie = dynamic_cast(cookie); + uint8_t cmdRaw = sendData[0]; + if (cmdRaw > 2) { + // TODO: Emit warning, invalid command + return RETURN_OK; + } + auto cmd = static_cast(sendData[0]); + switch (cmd) { + case (RtdCommands::ON): { + if (not rtdCookie->active) { + rtdCookie->active = true; + rtdCookie->configured = false; + } + break; + } + case (RtdCommands::OFF): { + rtdCookie->active = false; + rtdCookie->configured = false; + break; + } + case (RtdCommands::CFG): { + // TODO: Only implement if needed + break; + } + } + return RETURN_OK; +} + +ReturnValue_t Max31865RtdReader::getSendSuccess(CookieIF* cookie) { return RETURN_OK; } + +ReturnValue_t Max31865RtdReader::requestReceiveMessage(CookieIF* cookie, size_t requestLen) { + return RETURN_OK; +} + +ReturnValue_t Max31865RtdReader::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, + size_t* size) { + MutexGuard mg(readerMutex); + if (mg.getLockResult() != RETURN_OK) { + // TODO: Emit warning + return RETURN_FAILED; + } + auto* rtdCookie = dynamic_cast(cookie); + uint8_t* exchangePtr = rtdCookie->exchangeBuf.data(); + size_t serLen = 0; + auto result = rtdCookie->db.serialize(&exchangePtr, &serLen, rtdCookie->exchangeBuf.size(), + SerializeIF::Endianness::MACHINE); + if (result != RETURN_OK) { + // TODO: Emit warning + return RETURN_FAILED; + } + *buffer = reinterpret_cast(rtdCookie->exchangeBuf.data()); + *size = rtdCookie->db.getSerializedSize(); + return RETURN_OK; +} + +ReturnValue_t Max31865RtdReader::writeCfgReg(SpiCookie* cookie, uint8_t cfg) { + using namespace MAX31865; + uint8_t cmd[2] = {REG_CONFIG | WRITE_BIT, cfg}; + return comIF->sendMessage(cookie, cmd, 2); +} + +ReturnValue_t Max31865RtdReader::biasSel(MAX31865::Bias bias, SpiCookie* cookie) { + using namespace MAX31865; + uint8_t currentCfg = 0; + auto result = readCfgReg(cookie, currentCfg); + if (result != RETURN_OK) { + return result; + } + if (bias == MAX31865::Bias::OFF) { + currentCfg &= ~(1 << CfgBitPos::BIAS_SEL); + } else { + currentCfg |= (1 << CfgBitPos::BIAS_SEL); + } + return writeCfgReg(cookie, currentCfg); +} + +ReturnValue_t Max31865RtdReader::readCfgReg(SpiCookie* cookie, uint8_t& cfg) { + using namespace MAX31865; + uint8_t cmd[2] = {REG_CONFIG, 0}; + ReturnValue_t result = comIF->sendMessage(cookie, cmd, 2); + if (result != RETURN_OK) { + return RETURN_FAILED; + } + uint8_t reply[2] = {}; + uint8_t* replyPtr = reply; + size_t dummyLen = 0; + result = comIF->readReceivedMessage(cookie, &replyPtr, &dummyLen); + if (result != RETURN_OK) { + return result; + } + cfg = reply[1]; + return RETURN_OK; +} + +ReturnValue_t Max31865RtdReader::readRtdVal(SpiCookie* cookie, uint16_t& val, bool& faultBitSet) { + using namespace MAX31865; + uint8_t cmd[3] = {REG_RTD, 0, 0}; + auto result = comIF->sendMessage(cookie, cmd, 3); + if (result != RETURN_OK) { + return RETURN_FAILED; + } + uint8_t reply[3] = {}; + uint8_t* replyPtr = reply; + size_t dummyLen = 0; + result = comIF->readReceivedMessage(cookie, &replyPtr, &dummyLen); + if (result != RETURN_OK) { + return result; + } + if (reply[2] & 0b0000'0001) { + faultBitSet = true; + } + // Shift 1 to the right to remove fault bit + val = ((reply[1] << 8) | reply[2]) >> 1; + return result; +} diff --git a/linux/devices/Max31865RtdReader.h b/linux/devices/Max31865RtdReader.h new file mode 100644 index 00000000..4a1bbb47 --- /dev/null +++ b/linux/devices/Max31865RtdReader.h @@ -0,0 +1,92 @@ +#ifndef LINUX_DEVICES_MAX31865RTDREADER_H_ +#define LINUX_DEVICES_MAX31865RTDREADER_H_ + +#include +#include +#include +#include + +#include "fsfw/devicehandlers/DeviceCommunicationIF.h" +#include "mission/devices/devicedefinitions/Max31865Definitions.h" + +static constexpr uint8_t NUM_RTDS = 16; + +enum RtdCommands : uint8_t { ON = 0, OFF = 1, CFG = 2 }; + +class ReadOutStruct : public SerialLinkedListAdapter { + public: + ReadOutStruct() { setLinks(); } + ReadOutStruct(uint32_t spiErrCnt, bool faultBitSet, uint8_t faultVal, uint16_t rtdVal) + : spiErrorCount(spiErrCnt), faultBitSet(faultBitSet), faultValue(faultVal), rtdVal(rtdVal) { + setLinks(); + } + + SerializeElement spiErrorCount = 0; + SerializeElement faultBitSet = false; + SerializeElement faultValue = 0; + SerializeElement rtdVal = 0; + + private: + void setLinks() { + setStart(&spiErrorCount); + spiErrorCount.setNext(&faultBitSet); + faultBitSet.setNext(&faultValue); + faultValue.setNext(&rtdVal); + }; +}; + +struct Max31865ReaderCookie { + Max31865ReaderCookie(){}; + Max31865ReaderCookie(object_id_t handlerId_, uint8_t idx_, const std::string& locString_, + SpiCookie* spiCookie_) + : idx(idx_), handlerId(handlerId_), locString(locString_), spiCookie(spiCookie_) {} + + uint8_t idx = 0; + object_id_t handlerId = objects::NO_OBJECT; + + std::string locString = ""; + std::array exchangeBuf{}; + bool active = false; + + bool configured = false; + + SpiCookie* spiCookie = nullptr; + + // Exchange data buffer struct + ReadOutStruct db; +}; + +class Max31865RtdReader : public SystemObject, + public ExecutableObjectIF, + public DeviceCommunicationIF { + public: + Max31865RtdReader(object_id_t objectId, SpiComIF* comIF); + void addRtd(Max31865ReaderCookie rtdCookie); + + [[noreturn]] ReturnValue_t performOperation(uint8_t operationCode) override; + + private: + std::vector rtds; + MutexIF* readerMutex; + + void rtdMainLoop(); + bool periodicInitHandling(); + void periodicReadReqHandling(); + void periodicReadHandling(); + + bool rtdCanBeUsed(uint8_t idx); + ReturnValue_t writeCfgReg(SpiCookie* cookie, uint8_t cfg); + ReturnValue_t biasSel(MAX31865::Bias bias, SpiCookie* cookie); + ReturnValue_t readCfgReg(SpiCookie* cookie, uint8_t& cfg); + ReturnValue_t readRtdVal(SpiCookie* cookie, uint16_t& val, bool& faultBitSet); + + ReturnValue_t initializeInterface(CookieIF* cookie) override; + ReturnValue_t sendMessage(CookieIF* cookie, const uint8_t* sendData, size_t sendLen) override; + ReturnValue_t getSendSuccess(CookieIF* cookie) override; + ReturnValue_t requestReceiveMessage(CookieIF* cookie, size_t requestLen) override; + ReturnValue_t readReceivedMessage(CookieIF* cookie, uint8_t** buffer, size_t* size) override; + + SpiComIF* comIF; +}; + +#endif /* LINUX_DEVICES_MAX31865RTDREADER_H_ */ diff --git a/mission/devices/Max31865PT1000Handler.cpp b/mission/devices/Max31865PT1000Handler.cpp index 580c8637..6ac888cd 100644 --- a/mission/devices/Max31865PT1000Handler.cpp +++ b/mission/devices/Max31865PT1000Handler.cpp @@ -93,13 +93,13 @@ void Max31865PT1000Handler::doShutDown() { ReturnValue_t Max31865PT1000Handler::buildNormalDeviceCommand(DeviceCommandId_t *id) { if (internalState == InternalState::RUNNING) { - *id = Max31865Definitions::REQUEST_RTD; + *id = MAX31865::REQUEST_RTD; return buildCommandFromCommand(*id, nullptr, 0); } else if (internalState == InternalState::REQUEST_FAULT_BYTE) { - *id = Max31865Definitions::REQUEST_FAULT_BYTE; + *id = MAX31865::REQUEST_FAULT_BYTE; return buildCommandFromCommand(*id, nullptr, 0); } else if (internalState == InternalState::CLEAR_FAULT_BYTE) { - *id = Max31865Definitions::CLEAR_FAULT_BYTE; + *id = MAX31865::CLEAR_FAULT_BYTE; return buildCommandFromCommand(*id, nullptr, 0); } else { return DeviceHandlerBase::NOTHING_TO_SEND; @@ -113,32 +113,32 @@ ReturnValue_t Max31865PT1000Handler::buildTransitionDeviceCommand(DeviceCommandI case (InternalState::RUNNING): return DeviceHandlerBase::NOTHING_TO_SEND; case (InternalState::CONFIGURE): { - *id = Max31865Definitions::CONFIG_CMD; + *id = MAX31865::CONFIG_CMD; uint8_t config[1] = {DEFAULT_CONFIG}; return buildCommandFromCommand(*id, config, 1); } case (InternalState::REQUEST_CONFIG): { - *id = Max31865Definitions::REQUEST_CONFIG; + *id = MAX31865::REQUEST_CONFIG; return buildCommandFromCommand(*id, nullptr, 0); } case (InternalState::CONFIG_HIGH_THRESHOLD): { - *id = Max31865Definitions::WRITE_HIGH_THRESHOLD; + *id = MAX31865::WRITE_HIGH_THRESHOLD; return buildCommandFromCommand(*id, nullptr, 0); } case (InternalState::REQUEST_HIGH_THRESHOLD): { - *id = Max31865Definitions::REQUEST_HIGH_THRESHOLD; + *id = MAX31865::REQUEST_HIGH_THRESHOLD; return buildCommandFromCommand(*id, nullptr, 0); } case (InternalState::CONFIG_LOW_THRESHOLD): { - *id = Max31865Definitions::WRITE_LOW_THRESHOLD; + *id = MAX31865::WRITE_LOW_THRESHOLD; return buildCommandFromCommand(*id, nullptr, 0); } case (InternalState::REQUEST_LOW_THRESHOLD): { - *id = Max31865Definitions::REQUEST_LOW_THRESHOLD; + *id = MAX31865::REQUEST_LOW_THRESHOLD; return buildCommandFromCommand(*id, nullptr, 0); } case (InternalState::CLEAR_FAULT_BYTE): { - *id = Max31865Definitions::CLEAR_FAULT_BYTE; + *id = MAX31865::CLEAR_FAULT_BYTE; return buildCommandFromCommand(*id, nullptr, 0); } @@ -156,8 +156,8 @@ ReturnValue_t Max31865PT1000Handler::buildCommandFromCommand(DeviceCommandId_t d const uint8_t *commandData, size_t commandDataLen) { switch (deviceCommand) { - case (Max31865Definitions::CONFIG_CMD): { - commandBuffer[0] = static_cast(Max31865Definitions::CONFIG_CMD); + case (MAX31865::CONFIG_CMD): { + commandBuffer[0] = static_cast(MAX31865::CONFIG_CMD); if (commandDataLen == 1) { commandBuffer[1] = commandData[0]; DeviceHandlerBase::rawPacketLen = 2; @@ -167,54 +167,54 @@ ReturnValue_t Max31865PT1000Handler::buildCommandFromCommand(DeviceCommandId_t d return DeviceHandlerIF::NO_COMMAND_DATA; } } - case (Max31865Definitions::CLEAR_FAULT_BYTE): { - commandBuffer[0] = static_cast(Max31865Definitions::CONFIG_CMD); - commandBuffer[1] = Max31865Definitions::CLEAR_FAULT_BIT_VAL; + case (MAX31865::CLEAR_FAULT_BYTE): { + commandBuffer[0] = static_cast(MAX31865::CONFIG_CMD); + commandBuffer[1] = MAX31865::CLEAR_FAULT_BIT_VAL; DeviceHandlerBase::rawPacketLen = 2; DeviceHandlerBase::rawPacket = commandBuffer.data(); return HasReturnvaluesIF::RETURN_OK; } - case (Max31865Definitions::REQUEST_CONFIG): { - commandBuffer[0] = static_cast(Max31865Definitions::REQUEST_CONFIG); + case (MAX31865::REQUEST_CONFIG): { + commandBuffer[0] = static_cast(MAX31865::REQUEST_CONFIG); commandBuffer[1] = 0x00; // dummy byte DeviceHandlerBase::rawPacketLen = 2; DeviceHandlerBase::rawPacket = commandBuffer.data(); return HasReturnvaluesIF::RETURN_OK; } - case (Max31865Definitions::WRITE_HIGH_THRESHOLD): { - commandBuffer[0] = static_cast(Max31865Definitions::WRITE_HIGH_THRESHOLD); + case (MAX31865::WRITE_HIGH_THRESHOLD): { + commandBuffer[0] = static_cast(MAX31865::WRITE_HIGH_THRESHOLD); commandBuffer[1] = static_cast(HIGH_THRESHOLD >> 8); commandBuffer[2] = static_cast(HIGH_THRESHOLD & 0xFF); DeviceHandlerBase::rawPacketLen = 3; DeviceHandlerBase::rawPacket = commandBuffer.data(); return HasReturnvaluesIF::RETURN_OK; } - case (Max31865Definitions::REQUEST_HIGH_THRESHOLD): { - commandBuffer[0] = static_cast(Max31865Definitions::REQUEST_HIGH_THRESHOLD); + case (MAX31865::REQUEST_HIGH_THRESHOLD): { + commandBuffer[0] = static_cast(MAX31865::REQUEST_HIGH_THRESHOLD); commandBuffer[1] = 0x00; // dummy byte commandBuffer[2] = 0x00; // dummy byte DeviceHandlerBase::rawPacketLen = 3; DeviceHandlerBase::rawPacket = commandBuffer.data(); return HasReturnvaluesIF::RETURN_OK; } - case (Max31865Definitions::WRITE_LOW_THRESHOLD): { - commandBuffer[0] = static_cast(Max31865Definitions::WRITE_LOW_THRESHOLD); + case (MAX31865::WRITE_LOW_THRESHOLD): { + commandBuffer[0] = static_cast(MAX31865::WRITE_LOW_THRESHOLD); commandBuffer[1] = static_cast(LOW_THRESHOLD >> 8); commandBuffer[2] = static_cast(LOW_THRESHOLD & 0xFF); DeviceHandlerBase::rawPacketLen = 3; DeviceHandlerBase::rawPacket = commandBuffer.data(); return HasReturnvaluesIF::RETURN_OK; } - case (Max31865Definitions::REQUEST_LOW_THRESHOLD): { - commandBuffer[0] = static_cast(Max31865Definitions::REQUEST_LOW_THRESHOLD); + case (MAX31865::REQUEST_LOW_THRESHOLD): { + commandBuffer[0] = static_cast(MAX31865::REQUEST_LOW_THRESHOLD); commandBuffer[1] = 0x00; // dummy byte commandBuffer[2] = 0x00; // dummy byte DeviceHandlerBase::rawPacketLen = 3; DeviceHandlerBase::rawPacket = commandBuffer.data(); return HasReturnvaluesIF::RETURN_OK; } - case (Max31865Definitions::REQUEST_RTD): { - commandBuffer[0] = static_cast(Max31865Definitions::REQUEST_RTD); + case (MAX31865::REQUEST_RTD): { + commandBuffer[0] = static_cast(MAX31865::REQUEST_RTD); // two dummy bytes commandBuffer[1] = 0x00; commandBuffer[2] = 0x00; @@ -222,8 +222,8 @@ ReturnValue_t Max31865PT1000Handler::buildCommandFromCommand(DeviceCommandId_t d DeviceHandlerBase::rawPacket = commandBuffer.data(); return HasReturnvaluesIF::RETURN_OK; } - case (Max31865Definitions::REQUEST_FAULT_BYTE): { - commandBuffer[0] = static_cast(Max31865Definitions::REQUEST_FAULT_BYTE); + case (MAX31865::REQUEST_FAULT_BYTE): { + commandBuffer[0] = static_cast(MAX31865::REQUEST_FAULT_BYTE); commandBuffer[1] = 0x00; DeviceHandlerBase::rawPacketLen = 2; DeviceHandlerBase::rawPacket = commandBuffer.data(); @@ -236,15 +236,15 @@ ReturnValue_t Max31865PT1000Handler::buildCommandFromCommand(DeviceCommandId_t d } void Max31865PT1000Handler::fillCommandAndReplyMap() { - insertInCommandAndReplyMap(Max31865Definitions::CONFIG_CMD, 3); - insertInCommandAndReplyMap(Max31865Definitions::REQUEST_CONFIG, 3); - insertInCommandAndReplyMap(Max31865Definitions::WRITE_LOW_THRESHOLD, 3); - insertInCommandAndReplyMap(Max31865Definitions::REQUEST_LOW_THRESHOLD, 3); - insertInCommandAndReplyMap(Max31865Definitions::WRITE_HIGH_THRESHOLD, 3); - insertInCommandAndReplyMap(Max31865Definitions::REQUEST_HIGH_THRESHOLD, 3); - insertInCommandAndReplyMap(Max31865Definitions::REQUEST_RTD, 3, &sensorDataset); - insertInCommandAndReplyMap(Max31865Definitions::REQUEST_FAULT_BYTE, 3); - insertInCommandAndReplyMap(Max31865Definitions::CLEAR_FAULT_BYTE, 3); + insertInCommandAndReplyMap(MAX31865::CONFIG_CMD, 3); + insertInCommandAndReplyMap(MAX31865::REQUEST_CONFIG, 3); + insertInCommandAndReplyMap(MAX31865::WRITE_LOW_THRESHOLD, 3); + insertInCommandAndReplyMap(MAX31865::REQUEST_LOW_THRESHOLD, 3); + insertInCommandAndReplyMap(MAX31865::WRITE_HIGH_THRESHOLD, 3); + insertInCommandAndReplyMap(MAX31865::REQUEST_HIGH_THRESHOLD, 3); + insertInCommandAndReplyMap(MAX31865::REQUEST_RTD, 3, &sensorDataset); + insertInCommandAndReplyMap(MAX31865::REQUEST_FAULT_BYTE, 3); + insertInCommandAndReplyMap(MAX31865::CLEAR_FAULT_BYTE, 3); } ReturnValue_t Max31865PT1000Handler::scanForReply(const uint8_t *start, size_t remainingSize, @@ -253,7 +253,7 @@ ReturnValue_t Max31865PT1000Handler::scanForReply(const uint8_t *start, size_t r size_t configReplySize = 2; if (remainingSize == rtdReplySize and internalState == InternalState::RUNNING) { - *foundId = Max31865Definitions::REQUEST_RTD; + *foundId = MAX31865::REQUEST_RTD; *foundLen = rtdReplySize; return RETURN_OK; } @@ -262,24 +262,24 @@ ReturnValue_t Max31865PT1000Handler::scanForReply(const uint8_t *start, size_t r switch (internalState) { case (InternalState::CONFIG_HIGH_THRESHOLD): { *foundLen = 3; - *foundId = Max31865Definitions::WRITE_HIGH_THRESHOLD; + *foundId = MAX31865::WRITE_HIGH_THRESHOLD; commandExecuted = true; return RETURN_OK; } case (InternalState::REQUEST_HIGH_THRESHOLD): { *foundLen = 3; - *foundId = Max31865Definitions::REQUEST_HIGH_THRESHOLD; + *foundId = MAX31865::REQUEST_HIGH_THRESHOLD; return RETURN_OK; } case (InternalState::CONFIG_LOW_THRESHOLD): { *foundLen = 3; - *foundId = Max31865Definitions::WRITE_LOW_THRESHOLD; + *foundId = MAX31865::WRITE_LOW_THRESHOLD; commandExecuted = true; return RETURN_OK; } case (InternalState::REQUEST_LOW_THRESHOLD): { *foundLen = 3; - *foundId = Max31865Definitions::REQUEST_LOW_THRESHOLD; + *foundId = MAX31865::REQUEST_LOW_THRESHOLD; return RETURN_OK; } default: { @@ -293,13 +293,13 @@ ReturnValue_t Max31865PT1000Handler::scanForReply(const uint8_t *start, size_t r if (internalState == InternalState::CONFIGURE) { commandExecuted = true; *foundLen = configReplySize; - *foundId = Max31865Definitions::CONFIG_CMD; + *foundId = MAX31865::CONFIG_CMD; } else if (internalState == InternalState::REQUEST_FAULT_BYTE) { - *foundId = Max31865Definitions::REQUEST_FAULT_BYTE; + *foundId = MAX31865::REQUEST_FAULT_BYTE; *foundLen = 2; internalState = InternalState::RUNNING; } else if (internalState == InternalState::CLEAR_FAULT_BYTE) { - *foundId = Max31865Definitions::CLEAR_FAULT_BYTE; + *foundId = MAX31865::CLEAR_FAULT_BYTE; *foundLen = 2; if (mode == _MODE_START_UP) { commandExecuted = true; @@ -307,7 +307,7 @@ ReturnValue_t Max31865PT1000Handler::scanForReply(const uint8_t *start, size_t r internalState = InternalState::RUNNING; } } else { - *foundId = Max31865Definitions::REQUEST_CONFIG; + *foundId = MAX31865::REQUEST_CONFIG; *foundLen = configReplySize; } } @@ -318,7 +318,7 @@ ReturnValue_t Max31865PT1000Handler::scanForReply(const uint8_t *start, size_t r ReturnValue_t Max31865PT1000Handler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { switch (id) { - case (Max31865Definitions::REQUEST_CONFIG): { + case (MAX31865::REQUEST_CONFIG): { if (packet[1] != DEFAULT_CONFIG) { if (warningSwitch) { #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -342,7 +342,7 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply(DeviceCommandId_t id, } break; } - case (Max31865Definitions::REQUEST_LOW_THRESHOLD): { + case (MAX31865::REQUEST_LOW_THRESHOLD): { uint16_t readLowThreshold = packet[1] << 8 | packet[2]; if (readLowThreshold != LOW_THRESHOLD) { #if FSFW_VERBOSE_LEVEL >= 1 @@ -360,7 +360,7 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply(DeviceCommandId_t id, commandExecuted = true; break; } - case (Max31865Definitions::REQUEST_HIGH_THRESHOLD): { + case (MAX31865::REQUEST_HIGH_THRESHOLD): { uint16_t readHighThreshold = packet[1] << 8 | packet[2]; if (readHighThreshold != HIGH_THRESHOLD) { #if FSFW_VERBOSE_LEVEL >= 1 @@ -378,7 +378,7 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply(DeviceCommandId_t id, commandExecuted = true; break; } - case (Max31865Definitions::REQUEST_RTD): { + case (MAX31865::REQUEST_RTD): { // first bit of LSB reply byte is the fault bit uint8_t faultBit = packet[2] & 0b0000'0001; if (resetFaultBit) { @@ -403,9 +403,9 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply(DeviceCommandId_t id, #if OBSW_VERBOSE_LEVEL >= 1 if (debugDivider->checkAndIncrement()) { #if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::info << "Max31865: ObjID " << std::hex << this->getObjectId() << " | RTD " - << std::dec << static_cast(deviceIdx) << ": R[Ohm] " << rtdValue - << " Ohms | Approx T[C]: " << approxTemp << std::endl; + sif::info << "Max31865: " << std::setw(28) << std::left << locString << std::right + << " | R[Ohm] " << rtdValue << " Ohms | Approx T[C]: " << approxTemp + << std::endl; #else sif::printInfo("Max31685: Measured resistance is %f Ohms\n", rtdValue); sif::printInfo("Approximated temperature is %f C\n", approxTemp); @@ -438,7 +438,7 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply(DeviceCommandId_t id, sensorDataset.temperatureCelcius = approxTemp; break; } - case (Max31865Definitions::REQUEST_FAULT_BYTE): { + case (MAX31865::REQUEST_FAULT_BYTE): { faultByte = packet[1]; #if OBSW_VERBOSE_LEVEL >= 1 #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -512,10 +512,9 @@ ReturnValue_t Max31865PT1000Handler::getSwitches(const uint8_t **switches, ReturnValue_t Max31865PT1000Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(Max31865Definitions::PoolIds::RTD_VALUE, new PoolEntry({0})); - localDataPoolMap.emplace(Max31865Definitions::PoolIds::TEMPERATURE_C, - new PoolEntry({0}, 1, true)); - localDataPoolMap.emplace(Max31865Definitions::PoolIds::FAULT_BYTE, new PoolEntry({0})); + localDataPoolMap.emplace(MAX31865::PoolIds::RTD_VALUE, new PoolEntry({0})); + localDataPoolMap.emplace(MAX31865::PoolIds::TEMPERATURE_C, new PoolEntry({0}, 1, true)); + localDataPoolMap.emplace(MAX31865::PoolIds::FAULT_BYTE, new PoolEntry({0})); poolManager.subscribeForPeriodicPacket(sensorDataset.getSid(), false, 30.0, false); return HasReturnvaluesIF::RETURN_OK; } @@ -530,6 +529,9 @@ void Max31865PT1000Handler::modeChanged() { } } -void Max31865PT1000Handler::setDeviceIdx(uint8_t idx) { deviceIdx = idx; } +void Max31865PT1000Handler::setDeviceInfo(uint8_t idx, const std::string &locString_) { + deviceIdx = idx; + locString = locString_; +} void Max31865PT1000Handler::setDebugMode(bool enable) { this->debugMode = enable; } diff --git a/mission/devices/Max31865PT1000Handler.h b/mission/devices/Max31865PT1000Handler.h index 4f617b9d..9a6b5add 100644 --- a/mission/devices/Max31865PT1000Handler.h +++ b/mission/devices/Max31865PT1000Handler.h @@ -48,7 +48,7 @@ class Max31865PT1000Handler : public DeviceHandlerBase { static constexpr uint8_t DEFAULT_CONFIG = 0b11000001; void setInstantNormal(bool instantNormal); - void setDeviceIdx(uint8_t idx); + void setDeviceInfo(uint8_t idx, const std::string &locString); /** * Expected temperature range is -100 C and 100 C. @@ -109,11 +109,12 @@ class Max31865PT1000Handler : public DeviceHandlerBase { bool resetFaultBit = false; dur_millis_t startTime = 0; + std::string locString; uint8_t faultByte = 0; uint8_t deviceIdx = 0; std::array commandBuffer{0}; - Max31865Definitions::Max31865Set sensorDataset; + MAX31865::Max31865Set sensorDataset; sid_t sensorDatasetSid; #if OBSW_VERBOSE_LEVEL >= 1 diff --git a/mission/devices/devicedefinitions/Max31865Definitions.h b/mission/devices/devicedefinitions/Max31865Definitions.h index 58faaf97..efd81681 100644 --- a/mission/devices/devicedefinitions/Max31865Definitions.h +++ b/mission/devices/devicedefinitions/Max31865Definitions.h @@ -7,9 +7,26 @@ #include "objects/systemObjectList.h" -namespace Max31865Definitions { +namespace MAX31865 { enum PoolIds : lp_id_t { RTD_VALUE, TEMPERATURE_C, FAULT_BYTE }; +enum Wires : unsigned int { TWO_WIRE = 0, THREE_WIRE = 1, FOUR_WIRE = 0 }; + +enum ConvMode : unsigned int { NORM_OFF = 0, AUTO = 1 }; + +enum Bias : unsigned int { ON = 0, OFF = 1 }; + +enum FilterSel : unsigned int { FIFTY_HERTZ = 1, SIXTY_HERTZ = 0 }; + +enum CfgBitPos { + FILTER_SEL = 0, + FAULTY_STATUS_CLEAR = 1, + FDCC = 2, + WIRE_SEL = 4, + ONE_SHOT = 5, + CONV_MODE = 6, + BIAS_SEL = 7 +}; static constexpr DeviceCommandId_t CONFIG_CMD = 0x80; static constexpr DeviceCommandId_t WRITE_HIGH_THRESHOLD = 0x83; @@ -26,6 +43,11 @@ static constexpr DeviceCommandId_t CLEAR_FAULT_BYTE = 0x08; static constexpr uint32_t MAX31865_SET_ID = REQUEST_RTD; static constexpr uint8_t CLEAR_FAULT_BIT_VAL = 0b0000'0010; +static constexpr uint8_t WRITE_BIT = 0b10000000; + +static constexpr uint8_t REG_CONFIG = 0x00; +static constexpr uint8_t REG_RTD = 0x01; + static constexpr size_t MAX_REPLY_SIZE = 5; class Max31865Set : public StaticLocalDataSet { @@ -48,6 +70,6 @@ class Max31865Set : public StaticLocalDataSet { lp_var_t errorByte = lp_var_t(sid.objectId, PoolIds::FAULT_BYTE, this); }; -} // namespace Max31865Definitions +} // namespace MAX31865 #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_MAX13865DEFINITIONS_H_ */ diff --git a/mission/devices/devicedefinitions/Max31865DeviceDefinitions.cpp b/mission/devices/devicedefinitions/Max31865DeviceDefinitions.cpp new file mode 100644 index 00000000..0f050093 --- /dev/null +++ b/mission/devices/devicedefinitions/Max31865DeviceDefinitions.cpp @@ -0,0 +1 @@ +#include "Max31865Definitions.h" diff --git a/mission/system/TcsBoardAssembly.cpp b/mission/system/TcsBoardAssembly.cpp index f011c931..ec4bce70 100644 --- a/mission/system/TcsBoardAssembly.cpp +++ b/mission/system/TcsBoardAssembly.cpp @@ -10,7 +10,7 @@ TcsBoardAssembly::TcsBoardAssembly(object_id_t objectId, object_id_t parentId, eventQueue = QueueFactory::instance()->createMessageQueue(24); ModeListEntry entry; for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) { - entry.setObject(helper.rtdIds[idx]); + entry.setObject(helper.rtdInfos[idx].first); entry.setMode(MODE_OFF); entry.setSubmode(SUBMODE_NONE); entry.setInheritSubmode(false); @@ -57,7 +57,7 @@ ReturnValue_t TcsBoardAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_ int devsInWrongMode = 0; try { for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) { - if (childrenMap.at(helper.rtdIds[idx]).mode != wantedMode) { + if (childrenMap.at(helper.rtdInfos[idx].first).mode != wantedMode) { devsInWrongMode++; } } @@ -93,8 +93,8 @@ ReturnValue_t TcsBoardAssembly::isModeCombinationValid(Mode_t mode, Submode_t su ReturnValue_t TcsBoardAssembly::initialize() { ReturnValue_t result = RETURN_OK; - for (const auto& obj : helper.rtdIds) { - result = registerChild(obj); + for (const auto& obj : helper.rtdInfos) { + result = registerChild(obj.first); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } @@ -126,8 +126,8 @@ ReturnValue_t TcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s object_id_t objId = 0; try { for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) { - devMode = childrenMap.at(helper.rtdIds[idx]).mode; - objId = helper.rtdIds[idx]; + devMode = childrenMap.at(helper.rtdInfos[idx].first).mode; + objId = helper.rtdInfos[idx].first; if (mode == devMode) { modeTable[idx].setMode(mode); } else if (mode == DeviceHandlerIF::MODE_NORMAL) { diff --git a/mission/system/TcsBoardAssembly.h b/mission/system/TcsBoardAssembly.h index 832f335d..eb42abbf 100644 --- a/mission/system/TcsBoardAssembly.h +++ b/mission/system/TcsBoardAssembly.h @@ -6,9 +6,10 @@ #include struct TcsBoardHelper { - TcsBoardHelper(std::array rtdIds) : rtdIds(rtdIds) {} + TcsBoardHelper(std::array, 16> rtdInfos) + : rtdInfos(std::move(rtdInfos)) {} - std::array rtdIds = {}; + std::array, 16> rtdInfos = {}; }; class TcsBoardAssembly : public AssemblyBase, public ConfirmsFailuresIF { diff --git a/tmtc b/tmtc index 1e25b08e..6b7b07c3 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 1e25b08e40db28103b91814f7de5a47dae5b9e76 +Subproject commit 6b7b07c3409fc24a8585c39e308156b3657c655e From 907b8f4a5d4a6469708ea042ef3f85a72e6bdd3f Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 10 May 2022 07:48:36 +0200 Subject: [PATCH 0068/2058] ccsds config for te0720-1cfa --- bsp_q7s/boardconfig/busConf.h | 2 +- bsp_te0720_1cfa/ObjectFactory.cpp | 120 ++++++++++++++++++++---- bsp_te0720_1cfa/ObjectFactory.h | 5 + bsp_te0720_1cfa/boardconfig/busConf.h | 26 ++++- linux/devices/ploc/PlocMemoryDumper.cpp | 2 +- 5 files changed, 134 insertions(+), 21 deletions(-) diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index e8cc5bd2..f5addf5b 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -15,9 +15,9 @@ static constexpr char UART_SYRLINKS_DEV[] = "/dev/ul-syrlinks"; static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ul-str"; static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0"; +static constexpr char UIO_PTME[] = "/dev/uio1"; static constexpr char UIO_PDEC_CONFIG_MEMORY[] = "/dev/uio2"; static constexpr char UIO_PDEC_RAM[] = "/dev/uio3"; -static constexpr char UIO_PTME[] = "/dev/uio1"; static constexpr int MAP_ID_PTME_CONFIG = 3; namespace uiomapids { diff --git a/bsp_te0720_1cfa/ObjectFactory.cpp b/bsp_te0720_1cfa/ObjectFactory.cpp index 9fe7f3b0..6be712bd 100644 --- a/bsp_te0720_1cfa/ObjectFactory.cpp +++ b/bsp_te0720_1cfa/ObjectFactory.cpp @@ -1,10 +1,9 @@ #include "ObjectFactory.h" -#include - #include "OBSWConfig.h" #include "busConf.h" #include "devConf.h" +#include "ccsdsConfig.h" #include "devices/addresses.h" #include "devices/gpioIds.h" #include "fsfw/datapoollocal/LocalDataPoolManager.h" @@ -15,14 +14,22 @@ #include "fsfw_hal/linux/i2c/I2cCookie.h" #include "fsfw_hal/linux/uart/UartComIF.h" #include "fsfw_hal/linux/uart/UartCookie.h" +#include "fsfw_hal/common/gpio/GpioCookie.h" #include "linux/devices/ploc/PlocMPSoCHandler.h" #include "linux/devices/ploc/PlocMPSoCHelper.h" #include "linux/devices/ploc/PlocMemoryDumper.h" #include "linux/devices/ploc/PlocSupervisorHandler.h" #include "linux/devices/ploc/PlocSupvHelper.h" +#include "linux/obc/AxiPtmeConfig.h" +#include "linux/obc/PapbVcInterface.h" +#include "linux/obc/PdecHandler.h" +#include "linux/obc/Ptme.h" +#include "linux/obc/PtmeConfig.h" #include "mission/core/GenericFactory.h" #include "mission/devices/Tmp1075Handler.h" #include "mission/utility/TmFunnel.h" +#include "mission/tmtc/CCSDSHandler.h" +#include "mission/tmtc/VirtualChannel.h" #include "objects/systemObjectList.h" #include "test/gpio/DummyGpioIF.h" #include "tmtc/apid.h" @@ -46,6 +53,7 @@ void ObjectFactory::produce(void* args) { Factory::setStaticFrameworkObjectIds(); ObjectFactory::produceGenericObjects(); + LinuxLibgpioIF* gpioComIF = new LinuxLibgpioIF(objects::GPIO_IF);; new UartComIF(objects::UART_COM_IF); #if OBSW_ADD_PLOC_MPSOC == 1 @@ -71,9 +79,10 @@ void ObjectFactory::produce(void* args) { supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, supvGpioIF), pcdu::PDU1_CH6_PLOC_12V, supvHelper); - new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER); #endif + new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER); + #if OBSW_TEST_LIBGPIOD == 1 #if OBSW_TEST_GPIO_OPEN_BYLABEL == 1 /* Configure MIO0 as input */ @@ -104,21 +113,6 @@ void ObjectFactory::produce(void* args) { new SusHandler(objects::SUS_0, objects::SPI_COM_IF, spiCookieSus, gpioComIF, gpioIds::CS_SUS_0); #endif -#if OBSW_TEST_CCSDS_BRIDGE == 1 - GpioCookie* gpioCookieCcsdsIp = new GpioCookie; - GpiodRegular* papbBusyN = - new GpiodRegular(std::string("gpiochip0"), 0, std::string("PAPBBusy_VC0")); - gpioCookieCcsdsIp->addGpio(gpioIds::PAPB_BUSY_N, papbBusyN); - GpiodRegular* papbEmpty = - new GpiodRegular(std::string("gpiochip0"), 1, std::string("PAPBEmpty_VC0")); - gpioCookieCcsdsIp->addGpio(gpioIds::PAPB_EMPTY, papbEmpty); - gpioComIF->addGpios(gpioCookieCcsdsIp); - - new CCSDSIPCoreBridge(objects::CCSDS_IP_CORE_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR, - objects::TM_STORE, objects::TC_STORE, gpioComIF, std::string("/dev/uio0"), - gpioIds::PAPB_BUSY_N, gpioIds::PAPB_EMPTY); -#endif - #if OBSW_TEST_RAD_SENSOR == 1 GpioCookie* gpioCookieRadSensor = new GpioCookie; GpiodRegular* chipSelectRadSensor = new GpiodRegular( @@ -156,3 +150,93 @@ void ObjectFactory::produce(void* args) { new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1); new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2); } + +void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) { + using namespace gpio; + // GPIO definitions of signals connected to the virtual channel interfaces of the PTME IP Core + GpioCookie* gpioCookiePtmeIp = new GpioCookie; + GpiodRegularByLineName* gpio = nullptr; + std::stringstream consumer; + consumer.str("PAPB VC0"); + gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PAPB_BUSY_SIGNAL_VC0, consumer.str()); + gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_BUSY, gpio); + consumer.str("PAPB VC0"); + gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PAPB_EMPTY_SIGNAL_VC0, consumer.str()); + gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_EMPTY, gpio); + consumer.str("PAPB VC 1"); + gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PAPB_BUSY_SIGNAL_VC1, consumer.str()); + gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_BUSY, gpio); + consumer.str(""); + consumer.str("PAPB VC 1"); + gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_EMPTY, gpio); + consumer.str(""); + consumer.str("PAPB VC 2"); + gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PAPB_BUSY_SIGNAL_VC2, consumer.str()); + gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_BUSY, gpio); + consumer.str(""); + consumer.str("PAPB VC 2"); + gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PAPB_EMPTY_SIGNAL_VC2, consumer.str()); + gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_EMPTY, gpio); + consumer.str(""); + consumer.str("PAPB VC 3"); + gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PAPB_BUSY_SIGNAL_VC3, consumer.str()); + gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_BUSY, gpio); + consumer.str(""); + consumer.str("PAPB VC 3"); + gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PAPB_EMPTY_SIGNAL_VC3, consumer.str()); + gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio); + + gpioComIF->addGpios(gpioCookiePtmeIp); + + // Creating virtual channel interfaces + VcInterfaceIF* vc0 = + new PapbVcInterface(gpioComIF, gpioIds::VC0_PAPB_BUSY, gpioIds::VC0_PAPB_EMPTY, te0720_1cfa::UIO_PTME, + te0720_1cfa::uiomapids::PTME_VC0); + VcInterfaceIF* vc1 = + new PapbVcInterface(gpioComIF, gpioIds::VC1_PAPB_BUSY, gpioIds::VC1_PAPB_EMPTY, te0720_1cfa::UIO_PTME, + te0720_1cfa::uiomapids::PTME_VC1); + VcInterfaceIF* vc2 = + new PapbVcInterface(gpioComIF, gpioIds::VC2_PAPB_BUSY, gpioIds::VC2_PAPB_EMPTY, te0720_1cfa::UIO_PTME, + te0720_1cfa::uiomapids::PTME_VC2); + VcInterfaceIF* vc3 = + new PapbVcInterface(gpioComIF, gpioIds::VC3_PAPB_BUSY, gpioIds::VC3_PAPB_EMPTY, te0720_1cfa::UIO_PTME, + te0720_1cfa::uiomapids::PTME_VC3); + + // Creating ptme object and adding virtual channel interfaces + Ptme* ptme = new Ptme(objects::PTME); + ptme->addVcInterface(ccsds::VC0, vc0); + ptme->addVcInterface(ccsds::VC1, vc1); + ptme->addVcInterface(ccsds::VC2, vc2); + ptme->addVcInterface(ccsds::VC3, vc3); + + AxiPtmeConfig* axiPtmeConfig = new AxiPtmeConfig(objects::AXI_PTME_CONFIG, te0720_1cfa::UIO_PTME, + te0720_1cfa::uiomapids::PTME_CONFIG); + PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig); + CCSDSHandler* ccsdsHandler = new CCSDSHandler( + objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig, + gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA, TRANSMITTER_TIMEOUT); + + VirtualChannel* vc = nullptr; + vc = new VirtualChannel(ccsds::VC0, common::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER); + ccsdsHandler->addVirtualChannel(ccsds::VC0, vc); + vc = new VirtualChannel(ccsds::VC1, common::VC1_QUEUE_SIZE, objects::CCSDS_HANDLER); + ccsdsHandler->addVirtualChannel(ccsds::VC1, vc); + vc = new VirtualChannel(ccsds::VC2, common::VC2_QUEUE_SIZE, objects::CCSDS_HANDLER); + ccsdsHandler->addVirtualChannel(ccsds::VC2, vc); + vc = new VirtualChannel(ccsds::VC3, common::VC3_QUEUE_SIZE, objects::CCSDS_HANDLER); + ccsdsHandler->addVirtualChannel(ccsds::VC3, vc); + + GpioCookie* gpioCookiePdec = new GpioCookie; + consumer.str(""); + consumer << "0x" << std::hex << objects::PDEC_HANDLER; + // GPIO also low after linux boot (specified by device-tree) + gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PDEC_RESET, consumer.str(), Direction::OUT, + Levels::LOW); + gpioCookiePdec->addGpio(gpioIds::PDEC_RESET, gpio); + + gpioComIF->addGpios(gpioCookiePdec); + + new PdecHandler(objects::PDEC_HANDLER, objects::CCSDS_HANDLER, gpioComIF, gpioIds::PDEC_RESET, + te0720_1cfa::UIO_PDEC_CONFIG_MEMORY, te0720_1cfa::UIO_PDEC_RAM, + te0720_1cfa::UIO_PDEC_REGISTERS); +} diff --git a/bsp_te0720_1cfa/ObjectFactory.h b/bsp_te0720_1cfa/ObjectFactory.h index b24dd321..19dc5f23 100644 --- a/bsp_te0720_1cfa/ObjectFactory.h +++ b/bsp_te0720_1cfa/ObjectFactory.h @@ -1,8 +1,13 @@ #ifndef BSP_LINUX_OBJECTFACTORY_H_ #define BSP_LINUX_OBJECTFACTORY_H_ +#include +#include + namespace ObjectFactory { +static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day void produce(void* args); +void createCcsdsComponents(LinuxLibgpioIF* gpioComIF); }; // namespace ObjectFactory #endif /* BSP_LINUX_OBJECTFACTORY_H_ */ diff --git a/bsp_te0720_1cfa/boardconfig/busConf.h b/bsp_te0720_1cfa/boardconfig/busConf.h index 893014c1..540d39a2 100644 --- a/bsp_te0720_1cfa/boardconfig/busConf.h +++ b/bsp_te0720_1cfa/boardconfig/busConf.h @@ -3,9 +3,33 @@ namespace te0720_1cfa { static constexpr char MPSOC_UART[] = "/dev/ttyPS1"; -namespace baudrate { +static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0"; +static constexpr char UIO_PTME[] = "/dev/uio1"; +static constexpr char UIO_PDEC_CONFIG_MEMORY[] = "/dev/uio2"; +static constexpr char UIO_PDEC_RAM[] = "/dev/uio3"; +static constexpr int MAP_ID_PTME_CONFIG = 3; + +namespace uiomapids { +static const int PTME_VC0 = 0; +static const int PTME_VC1 = 1; +static const int PTME_VC2 = 2; +static const int PTME_VC3 = 3; +static const int PTME_CONFIG = 4; +} // namespace uiomapids + +namespace gpioNames { + static constexpr char PAPB_BUSY_SIGNAL_VC0[] = "papb_busy_signal_vc0"; + static constexpr char PAPB_EMPTY_SIGNAL_VC0[] = "papb_empty_signal_vc0"; + static constexpr char PAPB_BUSY_SIGNAL_VC1[] = "papb_busy_signal_vc1"; + static constexpr char PAPB_EMPTY_SIGNAL_VC1[] = "papb_empty_signal_vc1"; + static constexpr char PAPB_BUSY_SIGNAL_VC2[] = "papb_busy_signal_vc2"; + static constexpr char PAPB_EMPTY_SIGNAL_VC2[] = "papb_empty_signal_vc2"; + static constexpr char PAPB_BUSY_SIGNAL_VC3[] = "papb_busy_signal_vc3"; + static constexpr char PAPB_EMPTY_SIGNAL_VC3[] = "papb_empty_signal_vc3"; + static constexpr char PDEC_RESET[] = "pdec_reset"; } + } #endif /* BSP_EGSE_BOARDCONFIG_BUSCONF_H_ */ diff --git a/linux/devices/ploc/PlocMemoryDumper.cpp b/linux/devices/ploc/PlocMemoryDumper.cpp index 568c6152..e1fce10e 100644 --- a/linux/devices/ploc/PlocMemoryDumper.cpp +++ b/linux/devices/ploc/PlocMemoryDumper.cpp @@ -78,7 +78,7 @@ MessageQueueIF* PlocMemoryDumper::getCommandQueuePtr() { return commandQueue; } void PlocMemoryDumper::readCommandQueue() { CommandMessage message; - ReturnValue_t result; + ReturnValue_t result = RETURN_OK; for (result = commandQueue->receiveMessage(&message); result == HasReturnvaluesIF::RETURN_OK; result = commandQueue->receiveMessage(&message)) { From 5a82fe93d9524004e339d6d35f26c2d68d75d390 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 May 2022 17:02:57 +0200 Subject: [PATCH 0069/2058] core ctrl remount sd handling --- bsp_q7s/core/CoreController.cpp | 36 ++++++++++++++++---- bsp_q7s/core/CoreController.h | 3 +- bsp_q7s/memory/SdCardManager.cpp | 56 ++++++++++++++++++++++++++++++++ bsp_q7s/memory/SdCardManager.h | 6 ++++ fsfw | 2 +- 5 files changed, 95 insertions(+), 8 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 208999c2..00175067 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -1235,18 +1235,42 @@ void CoreController::performWatchdogControlOperation() { void CoreController::performMountedSdCardOperations() { currMntPrefix = sdcMan->getCurrentMountPrefix(); - if (doPerformMountedSdCardOps) { + if (performMountedSdCardOpsSwitch) { bool sdCardMounted = false; + bool mountedReadOnly = false; + ReturnValue_t result = sdcMan->isSdCardMountedReadOnly(sdInfo.pref, mountedReadOnly); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "CoreController::performMountedSdCardOperations: Could not check " + "read-only mount state" << std::endl; + mountedReadOnly = true; + } + if (mountedReadOnly) { + int linuxErrno = 0; + result = sdcMan->performFsck(sdInfo.pref, true, linuxErrno); + if(result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "CoreController::performMountedSdCardOperations: fsck command on SD Card " + << sdInfo.prefChar << " failed with code " << linuxErrno << " | " << strerror(linuxErrno); + } + result = sdcMan->remountReadWrite(sdInfo.pref); + if(result == HasReturnvaluesIF::RETURN_OK) { + sif::warning << "CoreController::performMountedSdCardOperations: Remounted SD Card " << + sdInfo.prefChar << " read-write"; + } else { + sif::error << "CoreController::performMountedSdCardOperations: Remounting SD Card " << + sdInfo.prefChar << " read-write failed"; + } + } sdCardMounted = sdcMan->isSdCardMounted(sdInfo.pref); - if (sdCardMounted) { - std::string path = currMntPrefix + "/" + CONF_FOLDER; - if (not std::filesystem::exists(path)) { - std::filesystem::create_directory(path); + if (sdCardMounted and not performOneShotSdCardOpsSwitch) { + std::ostringstream path; + path << currMntPrefix << "/" << CONF_FOLDER; + if (not std::filesystem::exists(path.str())) { + std::filesystem::create_directory(path.str()); } initVersionFile(); initClockFromTimeFile(); performRebootFileHandling(false); - doPerformMountedSdCardOps = false; + performOneShotSdCardOpsSwitch = true; } } timeFileHandler(); diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index fb4f02b0..dd817bff 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -179,7 +179,8 @@ class CoreController : public ExtendedControllerBase { } sdInfo; RebootFile rebootFile = {}; std::string currMntPrefix; - bool doPerformMountedSdCardOps = true; + bool performOneShotSdCardOpsSwitch = true; + bool performMountedSdCardOpsSwitch = true; /** * Index 0: Chip 0 Copy 0 diff --git a/bsp_q7s/memory/SdCardManager.cpp b/bsp_q7s/memory/SdCardManager.cpp index 4ca11787..d5a91dac 100644 --- a/bsp_q7s/memory/SdCardManager.cpp +++ b/bsp_q7s/memory/SdCardManager.cpp @@ -466,3 +466,59 @@ bool SdCardManager::isSdCardMounted(sd::SdCard sdCard) { } return false; } + +ReturnValue_t SdCardManager::isSdCardMountedReadOnly(sd::SdCard sdcard, bool& readOnly) { + std::ostringstream command; + if(sdcard == sd::SdCard::SLOT_0) { + command << "grep -q \"" << SD_0_DEV_NAME << " vfat ro, \" /proc/mounts"; + } else { + command << "grep -q \"" << SD_1_DEV_NAME << " vfat ro, \" /proc/mounts"; + } + ReturnValue_t result = cmdExecutor.load(command.str(), true, false); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + result = cmdExecutor.execute(); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + auto& readVec = cmdExecutor.getReadVector(); + size_t readLen = strnlen(readVec.data(), readVec.size()); + if(readLen == 0) { + readOnly = false; + } + readOnly = true; + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t SdCardManager::remountReadWrite(sd::SdCard sdcard) { + std::ostringstream command; + if(sdcard == sd::SdCard::SLOT_0) { + command << "mount -o remount,rw " << SD_0_DEV_NAME << " " << SD_0_MOUNT_POINT; + } else { + command << "mount -o remount,rw " << SD_1_DEV_NAME << " " << SD_1_MOUNT_POINT; + } + ReturnValue_t result = cmdExecutor.load(command.str(), true, false); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + return cmdExecutor.execute(); +} + +ReturnValue_t SdCardManager::performFsck(sd::SdCard sdcard, bool printOutput, int& linuxError) { + std::ostringstream command; + if(sdcard == sd::SdCard::SLOT_0) { + command << "fsck -y " << SD_0_DEV_NAME; + } else { + command << "fsck -y " << SD_1_DEV_NAME; + } + ReturnValue_t result = cmdExecutor.load(command.str(), true, printOutput); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + result = cmdExecutor.execute(); + if(result != HasReturnvaluesIF::RETURN_OK) { + linuxError = cmdExecutor.getLastError(); + } + return result; +} diff --git a/bsp_q7s/memory/SdCardManager.h b/bsp_q7s/memory/SdCardManager.h index 37660f75..01a50050 100644 --- a/bsp_q7s/memory/SdCardManager.h +++ b/bsp_q7s/memory/SdCardManager.h @@ -194,6 +194,12 @@ class SdCardManager : public SystemObject, public SdCardMountedIF { */ bool isSdCardMounted(sd::SdCard sdCard) override; + ReturnValue_t isSdCardMountedReadOnly(sd::SdCard sdcard, bool& readOnly); + + ReturnValue_t remountReadWrite(sd::SdCard sdcard); + + ReturnValue_t performFsck(sd::SdCard sdcard, bool printOutput, int& linuxError); + private: CommandExecutor cmdExecutor; Operations currentOp = Operations::IDLE; diff --git a/fsfw b/fsfw index dafcaa60..d1ff32bf 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit dafcaa60079ba8e57753d389e6a569ee3eb0b7cb +Subproject commit d1ff32bf968cbf769ca8daa37265af70e050d9c0 From 5f96d157a76a6a78aeb43259d6903bbbedafcbe6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 May 2022 17:04:31 +0200 Subject: [PATCH 0070/2058] repoint fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index dafcaa60..c0ff84bb 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit dafcaa60079ba8e57753d389e6a569ee3eb0b7cb +Subproject commit c0ff84bb9d81bc3444992fef38b74d260d54d5a0 From 56f491befb64dcad4adc88bd140678def8ed39d1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 12 May 2022 00:48:49 +0200 Subject: [PATCH 0071/2058] compile fix --- linux/ObjectFactory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 3a8f52d4..e28f41fa 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -288,8 +288,8 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) { rtdCookies[idx] = new SpiCookie(cookieArgs[idx].first, cookieArgs[idx].second, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - rtds[idx] = new Max31865PT1000Handler(rtdIds[idx], objects::SPI_MAIN_COM_IF, rtdCookies[idx]); + MAX31865::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); + rtds[idx] = new Max31865PT1000Handler(rtdInfos[idx].first, objects::SPI_MAIN_COM_IF, rtdCookies[idx]); rtds[idx]->setParent(objects::TCS_BOARD_ASS); rtdFdir = new RtdFdir(rtdInfos[idx].first); rtds[idx]->setCustomFdir(rtdFdir); From 23f209fb077fb8b311a3cfc78eebcc96003536f3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 12 May 2022 09:48:41 +0200 Subject: [PATCH 0072/2058] added eive specific max31865 handler --- linux/ObjectFactory.cpp | 8 +- linux/devices/Max31865RtdReader.cpp | 73 ++++++---- linux/devices/Max31865RtdReader.h | 36 +---- mission/devices/CMakeLists.txt | 1 + mission/devices/Max31865EiveHandler.cpp | 132 ++++++++++++++++++ mission/devices/Max31865EiveHandler.h | 37 +++++ mission/devices/Max31865PT1000Handler.cpp | 2 +- .../devicedefinitions/Max31865Definitions.h | 54 ++++++- .../Max31865DeviceDefinitions.cpp | 1 - 9 files changed, 279 insertions(+), 65 deletions(-) create mode 100644 mission/devices/Max31865EiveHandler.cpp create mode 100644 mission/devices/Max31865EiveHandler.h delete mode 100644 mission/devices/devicedefinitions/Max31865DeviceDefinitions.cpp diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index e28f41fa..35d1cff9 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -286,10 +286,10 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, std::array rtds = {}; RtdFdir* rtdFdir = nullptr; for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) { - rtdCookies[idx] = - new SpiCookie(cookieArgs[idx].first, cookieArgs[idx].second, - MAX31865::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - rtds[idx] = new Max31865PT1000Handler(rtdInfos[idx].first, objects::SPI_MAIN_COM_IF, rtdCookies[idx]); + rtdCookies[idx] = new SpiCookie(cookieArgs[idx].first, cookieArgs[idx].second, + MAX31865::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); + rtds[idx] = + new Max31865PT1000Handler(rtdInfos[idx].first, objects::SPI_MAIN_COM_IF, rtdCookies[idx]); rtds[idx]->setParent(objects::TCS_BOARD_ASS); rtdFdir = new RtdFdir(rtdInfos[idx].first); rtds[idx]->setCustomFdir(rtdFdir); diff --git a/linux/devices/Max31865RtdReader.cpp b/linux/devices/Max31865RtdReader.cpp index 0e2f9724..132467e9 100644 --- a/linux/devices/Max31865RtdReader.cpp +++ b/linux/devices/Max31865RtdReader.cpp @@ -2,7 +2,7 @@ #include Max31865RtdReader::Max31865RtdReader(object_id_t objectId, SpiComIF* comIF) - : SystemObject(objectId), rtds(NUM_RTDS), comIF(comIF) { + : SystemObject(objectId), rtds(EiveMax31855::NUM_RTDS), comIF(comIF) { readerMutex = MutexFactory::instance()->createMutex(); } @@ -32,8 +32,8 @@ void Max31865RtdReader::rtdMainLoop() { periodicReadHandling(); } -bool Max31865RtdReader::rtdCanBeUsed(uint8_t idx) { - if (rtds[idx]->active and rtds[idx]->configured) { +bool Max31865RtdReader::rtdIsActive(uint8_t idx) { + if (rtds[idx]->on and rtds[idx]->active and rtds[idx]->configured) { return true; } return false; @@ -48,24 +48,26 @@ bool Max31865RtdReader::periodicInitHandling() { return false; } - bool someRtdActive = false; + bool someRtdOn = false; for (auto& rtd : rtds) { if (rtd == nullptr) { continue; } - if (rtd->active and not rtd->configured) { - someRtdActive = true; - uint8_t cfg = (Bias::OFF << CfgBitPos::BIAS_SEL) | (Wires::FOUR_WIRE << CfgBitPos::WIRE_SEL) | - (ConvMode::NORM_OFF << CfgBitPos::CONV_MODE) | - (1 << CfgBitPos::FAULTY_STATUS_CLEAR); - result = writeCfgReg(rtd->spiCookie, cfg); - if (result != HasReturnvaluesIF::RETURN_OK) { - // TODO: Check retval + if (rtd->on and not rtd->configured) { + if (rtd->cd.hasTimedOut()) { + uint8_t cfg = + (Bias::OFF << CfgBitPos::BIAS_SEL) | (Wires::FOUR_WIRE << CfgBitPos::WIRE_SEL) | + (ConvMode::NORM_OFF << CfgBitPos::CONV_MODE) | (1 << CfgBitPos::FAULTY_STATUS_CLEAR); + result = writeCfgReg(rtd->spiCookie, cfg); + if (result != HasReturnvaluesIF::RETURN_OK) { + // TODO: Check retval + } + someRtdOn = true; + rtd->configured = true; } - rtd->configured = true; } } - if (not someRtdActive) { + if (not someRtdOn) { return false; } bool someRtdUsable = false; @@ -73,7 +75,7 @@ bool Max31865RtdReader::periodicInitHandling() { if (rtd == nullptr) { continue; } - if (rtdCanBeUsed(rtd->idx)) { + if (rtdIsActive(rtd->idx)) { someRtdUsable = true; result = biasSel(Bias::ON, rtd->spiCookie); } @@ -93,7 +95,7 @@ void Max31865RtdReader::periodicReadReqHandling() { if (rtd == nullptr) { continue; } - if (rtd->active) { + if (rtdIsActive(rtd->idx)) { uint8_t currentCfg = 0; auto result = readCfgReg(rtd->spiCookie, currentCfg); if (result != RETURN_OK) { @@ -119,7 +121,7 @@ void Max31865RtdReader::periodicReadHandling() { if (rtd == nullptr) { continue; } - if (rtd->active) { + if (rtdIsActive(rtd->idx)) { uint16_t rtdVal = 0; bool faultBitSet = false; result = readRtdVal(rtd->spiCookie, rtdVal, faultBitSet); @@ -137,7 +139,9 @@ void Max31865RtdReader::periodicReadHandling() { if (rtd == nullptr) { continue; } - if (rtd->active) { + // Even if a device was made inactive, turn off the bias here. If it was turned off, not + // necessary anymore.. + if (rtd->on) { result = biasSel(Bias::OFF, rtd->spiCookie); } } @@ -152,7 +156,7 @@ ReturnValue_t Max31865RtdReader::initializeInterface(CookieIF* cookie) { if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - if (rtdCookie->idx > NUM_RTDS) { + if (rtdCookie->idx > EiveMax31855::NUM_RTDS) { throw std::invalid_argument("Invalid RTD index"); } rtds[rtdCookie->idx] = rtdCookie; @@ -178,21 +182,40 @@ ReturnValue_t Max31865RtdReader::sendMessage(CookieIF* cookie, const uint8_t* se // TODO: Emit warning, invalid command return RETURN_OK; } - auto cmd = static_cast(sendData[0]); + auto cmd = static_cast(sendData[0]); switch (cmd) { - case (RtdCommands::ON): { - if (not rtdCookie->active) { - rtdCookie->active = true; + case (EiveMax31855::RtdCommands::ON): { + if (not rtdCookie->on) { + rtdCookie->cd.setTimeout(MAX31865::WARMUP_MS); + rtdCookie->cd.resetTimer(); + rtdCookie->on = true; + rtdCookie->active = false; rtdCookie->configured = false; } break; } - case (RtdCommands::OFF): { + case (EiveMax31855::RtdCommands::ACTIVE): { + if (not rtdCookie->on) { + rtdCookie->cd.setTimeout(MAX31865::WARMUP_MS); + rtdCookie->cd.resetTimer(); + rtdCookie->on = true; + rtdCookie->active = true; + rtdCookie->configured = false; + } else { + rtdCookie->active = true; + } + break; + } + case (EiveMax31855::RtdCommands::OFF): { + rtdCookie->on = false; rtdCookie->active = false; rtdCookie->configured = false; break; } - case (RtdCommands::CFG): { + case (EiveMax31855::RtdCommands::HIGH_TRESHOLD): + case (EiveMax31855::RtdCommands::LOW_THRESHOLD): + case (EiveMax31855::RtdCommands::CFG): + default: { // TODO: Only implement if needed break; } diff --git a/linux/devices/Max31865RtdReader.h b/linux/devices/Max31865RtdReader.h index 4a1bbb47..79ae1786 100644 --- a/linux/devices/Max31865RtdReader.h +++ b/linux/devices/Max31865RtdReader.h @@ -9,32 +9,6 @@ #include "fsfw/devicehandlers/DeviceCommunicationIF.h" #include "mission/devices/devicedefinitions/Max31865Definitions.h" -static constexpr uint8_t NUM_RTDS = 16; - -enum RtdCommands : uint8_t { ON = 0, OFF = 1, CFG = 2 }; - -class ReadOutStruct : public SerialLinkedListAdapter { - public: - ReadOutStruct() { setLinks(); } - ReadOutStruct(uint32_t spiErrCnt, bool faultBitSet, uint8_t faultVal, uint16_t rtdVal) - : spiErrorCount(spiErrCnt), faultBitSet(faultBitSet), faultValue(faultVal), rtdVal(rtdVal) { - setLinks(); - } - - SerializeElement spiErrorCount = 0; - SerializeElement faultBitSet = false; - SerializeElement faultValue = 0; - SerializeElement rtdVal = 0; - - private: - void setLinks() { - setStart(&spiErrorCount); - spiErrorCount.setNext(&faultBitSet); - faultBitSet.setNext(&faultValue); - faultValue.setNext(&rtdVal); - }; -}; - struct Max31865ReaderCookie { Max31865ReaderCookie(){}; Max31865ReaderCookie(object_id_t handlerId_, uint8_t idx_, const std::string& locString_, @@ -46,14 +20,14 @@ struct Max31865ReaderCookie { std::string locString = ""; std::array exchangeBuf{}; - bool active = false; - + Countdown cd = Countdown(MAX31865::WARMUP_MS); + bool on = false; bool configured = false; - + bool active = false; SpiCookie* spiCookie = nullptr; // Exchange data buffer struct - ReadOutStruct db; + EiveMax31855::ReadOutStruct db; }; class Max31865RtdReader : public SystemObject, @@ -74,7 +48,7 @@ class Max31865RtdReader : public SystemObject, void periodicReadReqHandling(); void periodicReadHandling(); - bool rtdCanBeUsed(uint8_t idx); + bool rtdIsActive(uint8_t idx); ReturnValue_t writeCfgReg(SpiCookie* cookie, uint8_t cfg); ReturnValue_t biasSel(MAX31865::Bias bias, SpiCookie* cookie); ReturnValue_t readCfgReg(SpiCookie* cookie, uint8_t& cfg); diff --git a/mission/devices/CMakeLists.txt b/mission/devices/CMakeLists.txt index 2919ff1f..d5f33e39 100644 --- a/mission/devices/CMakeLists.txt +++ b/mission/devices/CMakeLists.txt @@ -8,6 +8,7 @@ target_sources(${LIB_EIVE_MISSION} PRIVATE PDU2Handler.cpp ACUHandler.cpp SyrlinksHkHandler.cpp + Max31865EiveHandler.cpp Max31865PT1000Handler.cpp IMTQHandler.cpp HeaterHandler.cpp diff --git a/mission/devices/Max31865EiveHandler.cpp b/mission/devices/Max31865EiveHandler.cpp new file mode 100644 index 00000000..17afa718 --- /dev/null +++ b/mission/devices/Max31865EiveHandler.cpp @@ -0,0 +1,132 @@ +#include "Max31865EiveHandler.h" + +Max31865EiveHandler::Max31865EiveHandler(object_id_t objectId, object_id_t comIF, + CookieIF* comCookie) + : DeviceHandlerBase(objectId, comIF, comCookie, nullptr), + sensorDataset(this, EiveMax31855::RtdCommands::EXCHANGE_SET_ID) {} + +void Max31865EiveHandler::doStartUp() { + if (state == InternalState::NONE or state == InternalState::INACTIVE) { + if (instantNormal) { + state = InternalState::ACTIVE; + } else { + state = InternalState::ON; + } + transitionOk = false; + } + if ((state == InternalState::ON or state == InternalState::ACTIVE) and transitionOk) { + if (instantNormal) { + setMode(_MODE_TO_NORMAL); + } else { + setMode(MODE_ON); + } + } +} + +void Max31865EiveHandler::doShutDown() { + if (state == InternalState::NONE or state == InternalState::ACTIVE or + state == InternalState::ON) { + state = InternalState::INACTIVE; + transitionOk = false; + } else { + transitionOk = true; + } + if (state == InternalState::INACTIVE and transitionOk) { + setMode(_MODE_POWER_DOWN); + } +} + +ReturnValue_t Max31865EiveHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { + *id = EiveMax31855::RtdCommands::EXCHANGE_SET_ID; + return RETURN_OK; +} + +ReturnValue_t Max31865EiveHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { + if (state == InternalState::ON) { + *id = EiveMax31855::RtdCommands::ON; + buildCommandFromCommand(*id, nullptr, 0); + } + if (state == InternalState::ACTIVE) { + *id = EiveMax31855::RtdCommands::ACTIVE; + buildCommandFromCommand(*id, nullptr, 0); + } + if (state == InternalState::INACTIVE) { + *id = EiveMax31855::RtdCommands::OFF; + buildCommandFromCommand(*id, nullptr, 0); + } + return NOTHING_TO_SEND; +} + +ReturnValue_t Max31865EiveHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t* commandData, + size_t commandDataLen) { + auto cmdTyped = static_cast(deviceCommand); + switch (cmdTyped) { + case (EiveMax31855::RtdCommands::ON): + case (EiveMax31855::RtdCommands::ACTIVE): + case (EiveMax31855::RtdCommands::OFF): { + simpleCommand(cmdTyped); + break; + } + case (EiveMax31855::RtdCommands::LOW_THRESHOLD): + case (EiveMax31855::RtdCommands::HIGH_TRESHOLD): { + break; + } + case (EiveMax31855::RtdCommands::CFG): { + break; + } + default: + return NOTHING_TO_SEND; + } + return RETURN_OK; +} + +void Max31865EiveHandler::simpleCommand(EiveMax31855::RtdCommands cmd) { + cmdBuf[0] = cmd; + rawPacket = cmdBuf.data(); + rawPacketLen = 1; +} +void Max31865EiveHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) { + if (mode == _MODE_TO_NORMAL) { + state = InternalState::ACTIVE; + transitionOk = false; + if (transitionOk) { + setMode(MODE_NORMAL); + } + } else { + DeviceHandlerBase::doTransition(modeFrom, subModeFrom); + } +} + +void Max31865EiveHandler::fillCommandAndReplyMap() { + insertInReplyMap(EiveMax31855::RtdCommands::EXCHANGE_SET_ID, 2, &sensorDataset); +} + +ReturnValue_t Max31865EiveHandler::scanForReply(const uint8_t* start, size_t remainingSize, + DeviceCommandId_t* foundId, size_t* foundLen) { + if (remainingSize != exchangeStruct.getSerializedSize()) { + sif::error << "Invalid reply from RTD reader detected, reply size " << remainingSize + << "not equal to exchange struct size" << exchangeStruct.getSerializedSize() + << std::endl; + return RETURN_FAILED; + } + *foundId = EiveMax31855::RtdCommands::EXCHANGE_SET_ID; + *foundLen = remainingSize; + return RETURN_OK; +} + +ReturnValue_t Max31865EiveHandler::interpretDeviceReply(DeviceCommandId_t id, + const uint8_t* packet) { + return RETURN_OK; +} + +uint32_t Max31865EiveHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 2000; } + +ReturnValue_t Max31865EiveHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) { + localDataPoolMap.emplace(MAX31865::PoolIds::RTD_VALUE, new PoolEntry({0})); + localDataPoolMap.emplace(MAX31865::PoolIds::TEMPERATURE_C, new PoolEntry({0})); + localDataPoolMap.emplace(MAX31865::PoolIds::FAULT_BYTE, new PoolEntry({0})); + poolManager.subscribeForPeriodicPacket(sensorDataset.getSid(), false, 30.0, false); + return RETURN_OK; +} diff --git a/mission/devices/Max31865EiveHandler.h b/mission/devices/Max31865EiveHandler.h new file mode 100644 index 00000000..9214c680 --- /dev/null +++ b/mission/devices/Max31865EiveHandler.h @@ -0,0 +1,37 @@ +#ifndef MISSION_DEVICES_MAX31865EIVEHANDLER_H_ +#define MISSION_DEVICES_MAX31865EIVEHANDLER_H_ + +#include + +#include "devicedefinitions/Max31865Definitions.h" + +class Max31865EiveHandler : public DeviceHandlerBase { + public: + Max31865EiveHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); + + private: + void doStartUp() override; + void doShutDown() override; + void doTransition(Mode_t modeFrom, Submode_t subModeFrom) override; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override; + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t* id) override; + void fillCommandAndReplyMap() override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData, + size_t commandDataLen) override; + ReturnValue_t scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId, + size_t* foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; + + void simpleCommand(EiveMax31855::RtdCommands cmd); + std::array cmdBuf = {}; + EiveMax31855::ReadOutStruct exchangeStruct; + bool instantNormal = false; + MAX31865::Max31865Set sensorDataset; + enum class InternalState { NONE, ON, ACTIVE, INACTIVE } state = InternalState::NONE; + bool transitionOk = false; +}; + +#endif /* MISSION_DEVICES_MAX31865EIVEHANDLER_H_ */ diff --git a/mission/devices/Max31865PT1000Handler.cpp b/mission/devices/Max31865PT1000Handler.cpp index 6ac888cd..debe60e9 100644 --- a/mission/devices/Max31865PT1000Handler.cpp +++ b/mission/devices/Max31865PT1000Handler.cpp @@ -8,7 +8,7 @@ Max31865PT1000Handler::Max31865PT1000Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) : DeviceHandlerBase(objectId, comIF, comCookie), - sensorDataset(this), + sensorDataset(this, MAX31865::REQUEST_RTD), sensorDatasetSid(sensorDataset.getSid()) { #if OBSW_VERBOSE_LEVEL >= 1 debugDivider = new PeriodicOperationDivider(10); diff --git a/mission/devices/devicedefinitions/Max31865Definitions.h b/mission/devices/devicedefinitions/Max31865Definitions.h index efd81681..d1b67429 100644 --- a/mission/devices/devicedefinitions/Max31865Definitions.h +++ b/mission/devices/devicedefinitions/Max31865Definitions.h @@ -28,6 +28,8 @@ enum CfgBitPos { BIAS_SEL = 7 }; +static constexpr uint32_t WARMUP_MS = 100; + static constexpr DeviceCommandId_t CONFIG_CMD = 0x80; static constexpr DeviceCommandId_t WRITE_HIGH_THRESHOLD = 0x83; static constexpr DeviceCommandId_t WRITE_LOW_THRESHOLD = 0x85; @@ -50,20 +52,20 @@ static constexpr uint8_t REG_RTD = 0x01; static constexpr size_t MAX_REPLY_SIZE = 5; -class Max31865Set : public StaticLocalDataSet { +class Max31865Set : public StaticLocalDataSet<3> { public: /** * Constructor used by owner and data creators like device handlers. * @param owner * @param setId */ - Max31865Set(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, MAX31865_SET_ID) {} + Max31865Set(HasLocalDataPoolIF* owner, uint32_t setId) : StaticLocalDataSet(owner, setId) {} /** * Constructor used by data users like controllers. * @param sid */ - Max31865Set(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, MAX31865_SET_ID)) {} + Max31865Set(object_id_t objectId, uint32_t setId) : StaticLocalDataSet(sid_t(objectId, setId)) {} lp_var_t rtdValue = lp_var_t(sid.objectId, PoolIds::RTD_VALUE, this); lp_var_t temperatureCelcius = lp_var_t(sid.objectId, PoolIds::TEMPERATURE_C, this); @@ -72,4 +74,50 @@ class Max31865Set : public StaticLocalDataSet { } // namespace MAX31865 +namespace EiveMax31855 { + +static constexpr uint8_t NUM_RTDS = 16; + +enum RtdCommands : DeviceCommandId_t { + ON = 0, + EXCHANGE_SET_ID = MAX31865::REQUEST_RTD, + ACTIVE = 2, + LOW_THRESHOLD = 3, + HIGH_TRESHOLD = 4, + OFF = 5, + CFG = 6, + +}; + +class ReadOutStruct : public SerialLinkedListAdapter { + public: + ReadOutStruct() { setLinks(); } + ReadOutStruct(bool active, uint32_t spiErrCnt, bool faultBitSet, uint8_t faultVal, + uint16_t rtdVal) + : active(active), + rtdVal(rtdVal), + faultBitSet(faultBitSet), + faultValue(faultVal), + spiErrorCount(spiErrCnt) { + setLinks(); + } + + SerializeElement active = false; + SerializeElement rtdVal = 0; + SerializeElement faultBitSet = false; + SerializeElement faultValue = 0; + SerializeElement spiErrorCount = 0; + + private: + void setLinks() { + setStart(&active); + active.setNext(&rtdVal); + rtdVal.setNext(&faultBitSet); + faultBitSet.setNext(&faultValue); + faultValue.setNext(&spiErrorCount); + }; +}; + +}; // namespace EiveMax31855 + #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_MAX13865DEFINITIONS_H_ */ diff --git a/mission/devices/devicedefinitions/Max31865DeviceDefinitions.cpp b/mission/devices/devicedefinitions/Max31865DeviceDefinitions.cpp deleted file mode 100644 index 0f050093..00000000 --- a/mission/devices/devicedefinitions/Max31865DeviceDefinitions.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "Max31865Definitions.h" From 6b9e49e6326e35d973a294fcf7f68f79c371d104 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 12 May 2022 11:27:30 +0200 Subject: [PATCH 0073/2058] continued low level MAX31865 handler --- linux/devices/CMakeLists.txt | 2 +- ...der.cpp => Max31865RtdLowlevelHandler.cpp} | 205 ++++++++++++++---- ...dReader.h => Max31865RtdLowlevelHandler.h} | 20 +- mission/devices/Max31865EiveHandler.cpp | 7 +- mission/devices/Max31865PT1000Handler.cpp | 11 +- mission/devices/Max31865PT1000Handler.h | 1 + .../devicedefinitions/Max31865Definitions.h | 39 ++-- 7 files changed, 221 insertions(+), 64 deletions(-) rename linux/devices/{Max31865RtdReader.cpp => Max31865RtdLowlevelHandler.cpp} (56%) rename linux/devices/{Max31865RtdReader.h => Max31865RtdLowlevelHandler.h} (70%) diff --git a/linux/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt index e65987c6..ec8127c9 100644 --- a/linux/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -5,7 +5,7 @@ if(EIVE_BUILD_GPSD_GPS_HANDLER) endif() target_sources(${OBSW_NAME} PRIVATE - Max31865RtdReader.cpp + Max31865RtdLowlevelHandler.cpp ) add_subdirectory(ploc) diff --git a/linux/devices/Max31865RtdReader.cpp b/linux/devices/Max31865RtdLowlevelHandler.cpp similarity index 56% rename from linux/devices/Max31865RtdReader.cpp rename to linux/devices/Max31865RtdLowlevelHandler.cpp index 132467e9..32a700b7 100644 --- a/linux/devices/Max31865RtdReader.cpp +++ b/linux/devices/Max31865RtdLowlevelHandler.cpp @@ -1,5 +1,6 @@ +#include "Max31865RtdLowlevelHandler.h" + #include -#include Max31865RtdReader::Max31865RtdReader(object_id_t objectId, SpiComIF* comIF) : SystemObject(objectId), rtds(EiveMax31855::NUM_RTDS), comIF(comIF) { @@ -44,7 +45,7 @@ bool Max31865RtdReader::periodicInitHandling() { MutexGuard mg(readerMutex); ReturnValue_t result = RETURN_OK; if (mg.getLockResult() != RETURN_OK) { - // TODO: Emit warning, return + sif::warning << "Max31865RtdReader::periodicInitHandling: Mutex lock failed" << std::endl; return false; } @@ -60,7 +61,28 @@ bool Max31865RtdReader::periodicInitHandling() { (ConvMode::NORM_OFF << CfgBitPos::CONV_MODE) | (1 << CfgBitPos::FAULTY_STATUS_CLEAR); result = writeCfgReg(rtd->spiCookie, cfg); if (result != HasReturnvaluesIF::RETURN_OK) { - // TODO: Check retval + handleSpiError(rtd, result, "writeCfgReg"); + } + bool additionalCfg = false; + if (rtd->writeLowThreshold) { + additionalCfg = true; + result = writeLowThreshold(rtd->spiCookie, rtd->lowThreshold); + if (result != HasReturnvaluesIF::RETURN_OK) { + handleSpiError(rtd, result, "writeLowThreshold"); + } + } + if (rtd->writeHighThreshold) { + additionalCfg = true; + result = writeHighThreshold(rtd->spiCookie, rtd->highThreshold); + if (result != HasReturnvaluesIF::RETURN_OK) { + handleSpiError(rtd, result, "writeHighThreshold"); + } + } + if (additionalCfg) { + result = clearFaultStatus(rtd->spiCookie); + if (result != HasReturnvaluesIF::RETURN_OK) { + handleSpiError(rtd, result, "clearFaultStatus"); + } } someRtdOn = true; rtd->configured = true; @@ -77,7 +99,7 @@ bool Max31865RtdReader::periodicInitHandling() { } if (rtdIsActive(rtd->idx)) { someRtdUsable = true; - result = biasSel(Bias::ON, rtd->spiCookie); + result = writeBiasSel(Bias::ON, rtd->spiCookie); } } return someRtdUsable; @@ -87,7 +109,7 @@ void Max31865RtdReader::periodicReadReqHandling() { using namespace MAX31865; MutexGuard mg(readerMutex); if (mg.getLockResult() != RETURN_OK) { - // TODO: Emit warning, return + sif::warning << "Max31865RtdReader::periodicReadReqHandling: Mutex lock failed" << std::endl; return; } // Now request one shot config for all active RTDs @@ -99,7 +121,7 @@ void Max31865RtdReader::periodicReadReqHandling() { uint8_t currentCfg = 0; auto result = readCfgReg(rtd->spiCookie, currentCfg); if (result != RETURN_OK) { - // TODO: Emit warning, FDIR? + handleSpiError(rtd, result, "readCfgReg"); continue; } currentCfg |= (1 << CfgBitPos::ONE_SHOT); @@ -113,7 +135,7 @@ void Max31865RtdReader::periodicReadHandling() { auto result = RETURN_OK; MutexGuard mg(readerMutex); if (mg.getLockResult() != RETURN_OK) { - // TODO: Emit warning, return + sif::warning << "Max31865RtdReader::periodicReadReqHandling: Mutex lock failed" << std::endl; return; } // Now read the RTD values @@ -126,7 +148,7 @@ void Max31865RtdReader::periodicReadHandling() { bool faultBitSet = false; result = readRtdVal(rtd->spiCookie, rtdVal, faultBitSet); if (result != RETURN_OK) { - // TODO: Emit warning, FDIR? + handleSpiError(rtd, result, "readRtdVal"); continue; } if (faultBitSet) { @@ -142,7 +164,7 @@ void Max31865RtdReader::periodicReadHandling() { // Even if a device was made inactive, turn off the bias here. If it was turned off, not // necessary anymore.. if (rtd->on) { - result = biasSel(Bias::OFF, rtd->spiCookie); + result = writeBiasSel(Bias::OFF, rtd->spiCookie); } } } @@ -168,20 +190,29 @@ ReturnValue_t Max31865RtdReader::sendMessage(CookieIF* cookie, const uint8_t* se if (cookie == nullptr) { return RETURN_FAILED; } + // Empty command.. don't fail for now if (sendLen < 1) { return RETURN_OK; } MutexGuard mg(readerMutex); if (mg.getLockResult() != RETURN_OK) { - // TODO: Emit warning, return + sif::warning << "Max31865RtdReader::sendMessage: Mutex lock failed" << std::endl; return RETURN_FAILED; } auto* rtdCookie = dynamic_cast(cookie); uint8_t cmdRaw = sendData[0]; - if (cmdRaw > 2) { - // TODO: Emit warning, invalid command - return RETURN_OK; + if (cmdRaw > EiveMax31855::RtdCommands::NUM_CMDS) { + sif::warning << "Max31865RtdReader::sendMessage: Invalid command" << std::endl; + return RETURN_FAILED; } + + auto thresholdHandler = [](Max31865ReaderCookie* rtdCookie, const uint8_t* sendData) { + rtdCookie->lowThreshold = (sendData[1] << 8) | sendData[2]; + rtdCookie->highThreshold = (sendData[3] << 8) | sendData[4]; + rtdCookie->writeLowThreshold = true; + rtdCookie->writeHighThreshold = true; + }; + auto cmd = static_cast(sendData[0]); switch (cmd) { case (EiveMax31855::RtdCommands::ON): { @@ -191,6 +222,9 @@ ReturnValue_t Max31865RtdReader::sendMessage(CookieIF* cookie, const uint8_t* se rtdCookie->on = true; rtdCookie->active = false; rtdCookie->configured = false; + if (sendLen == 5) { + thresholdHandler(rtdCookie, sendData); + } } break; } @@ -204,6 +238,9 @@ ReturnValue_t Max31865RtdReader::sendMessage(CookieIF* cookie, const uint8_t* se } else { rtdCookie->active = true; } + if (sendLen == 5) { + thresholdHandler(rtdCookie, sendData); + } break; } case (EiveMax31855::RtdCommands::OFF): { @@ -212,8 +249,24 @@ ReturnValue_t Max31865RtdReader::sendMessage(CookieIF* cookie, const uint8_t* se rtdCookie->configured = false; break; } - case (EiveMax31855::RtdCommands::HIGH_TRESHOLD): - case (EiveMax31855::RtdCommands::LOW_THRESHOLD): + case (EiveMax31855::RtdCommands::HIGH_TRESHOLD): { + if (sendLen == 3) { + rtdCookie->highThreshold = (sendData[1] << 8) | sendData[2]; + rtdCookie->writeHighThreshold = true; + } else { + return RETURN_FAILED; + } + break; + } + case (EiveMax31855::RtdCommands::LOW_THRESHOLD): { + if (sendLen == 3) { + rtdCookie->lowThreshold = (sendData[1] << 8) | sendData[2]; + rtdCookie->writeLowThreshold = true; + } else { + return RETURN_FAILED; + } + break; + } case (EiveMax31855::RtdCommands::CFG): default: { // TODO: Only implement if needed @@ -252,11 +305,11 @@ ReturnValue_t Max31865RtdReader::readReceivedMessage(CookieIF* cookie, uint8_t** ReturnValue_t Max31865RtdReader::writeCfgReg(SpiCookie* cookie, uint8_t cfg) { using namespace MAX31865; - uint8_t cmd[2] = {REG_CONFIG | WRITE_BIT, cfg}; - return comIF->sendMessage(cookie, cmd, 2); + uint8_t cmd = cfg; + return writeNToReg(cookie, CONFIG, 1, &cmd, nullptr); } -ReturnValue_t Max31865RtdReader::biasSel(MAX31865::Bias bias, SpiCookie* cookie) { +ReturnValue_t Max31865RtdReader::writeBiasSel(MAX31865::Bias bias, SpiCookie* cookie) { using namespace MAX31865; uint8_t currentCfg = 0; auto result = readCfgReg(cookie, currentCfg); @@ -271,42 +324,118 @@ ReturnValue_t Max31865RtdReader::biasSel(MAX31865::Bias bias, SpiCookie* cookie) return writeCfgReg(cookie, currentCfg); } -ReturnValue_t Max31865RtdReader::readCfgReg(SpiCookie* cookie, uint8_t& cfg) { +ReturnValue_t Max31865RtdReader::clearFaultStatus(SpiCookie* cookie) { using namespace MAX31865; - uint8_t cmd[2] = {REG_CONFIG, 0}; - ReturnValue_t result = comIF->sendMessage(cookie, cmd, 2); - if (result != RETURN_OK) { - return RETURN_FAILED; - } - uint8_t reply[2] = {}; - uint8_t* replyPtr = reply; - size_t dummyLen = 0; - result = comIF->readReceivedMessage(cookie, &replyPtr, &dummyLen); + // Read back the current configuration to avoid overwriting it when clearing te fault status + uint8_t currentCfg = 0; + auto result = readCfgReg(cookie, currentCfg); if (result != RETURN_OK) { return result; } - cfg = reply[1]; - return RETURN_OK; + currentCfg |= (1 << CfgBitPos::FAULTY_STATUS_CLEAR); + return writeCfgReg(cookie, currentCfg); +} + +ReturnValue_t Max31865RtdReader::readCfgReg(SpiCookie* cookie, uint8_t& cfg) { + using namespace MAX31865; + uint8_t* replyPtr = nullptr; + auto result = readNFromReg(cookie, CONFIG, 1, &replyPtr); + if (result == RETURN_OK) { + cfg = replyPtr[0]; + } + return result; +} + +ReturnValue_t Max31865RtdReader::writeLowThreshold(SpiCookie* cookie, uint16_t val) { + using namespace MAX31865; + uint8_t cmd[2] = {static_cast((val >> 8) & 0xff), static_cast(val & 0xff)}; + return writeNToReg(cookie, LOW_THRESHOLD, 2, cmd, nullptr); +} + +ReturnValue_t Max31865RtdReader::writeHighThreshold(SpiCookie* cookie, uint16_t val) { + using namespace MAX31865; + uint8_t cmd[2] = {static_cast((val >> 8) & 0xff), static_cast(val & 0xff)}; + return writeNToReg(cookie, HIGH_THRESHOLD, 2, cmd, nullptr); +} + +ReturnValue_t Max31865RtdReader::readLowThreshold(SpiCookie* cookie, uint16_t& lowThreshold) { + using namespace MAX31865; + uint8_t* replyPtr = nullptr; + auto result = readNFromReg(cookie, LOW_THRESHOLD, 2, &replyPtr); + if (result == RETURN_OK) { + lowThreshold = (replyPtr[0] << 8) | replyPtr[1]; + } + return result; +} + +ReturnValue_t Max31865RtdReader::readHighThreshold(SpiCookie* cookie, uint16_t& highThreshold) { + using namespace MAX31865; + uint8_t* replyPtr = nullptr; + auto result = readNFromReg(cookie, HIGH_THRESHOLD, 2, &replyPtr); + if (result == RETURN_OK) { + highThreshold = (replyPtr[0] << 8) | replyPtr[1]; + } + return result; +} + +ReturnValue_t Max31865RtdReader::writeNToReg(SpiCookie* cookie, uint8_t reg, size_t n, uint8_t* cmd, + uint8_t** reply) { + using namespace MAX31865; + if (n > cmdBuf.size() - 1) { + return HasReturnvaluesIF::RETURN_FAILED; + } + cmdBuf[0] = reg | WRITE_BIT; + for (size_t idx = 0; idx < n; idx++) { + cmdBuf[idx + 1] = cmd[idx]; + } + return comIF->sendMessage(cookie, cmd, 2); } ReturnValue_t Max31865RtdReader::readRtdVal(SpiCookie* cookie, uint16_t& val, bool& faultBitSet) { using namespace MAX31865; - uint8_t cmd[3] = {REG_RTD, 0, 0}; - auto result = comIF->sendMessage(cookie, cmd, 3); + uint8_t* replyPtr = nullptr; + auto result = readNFromReg(cookie, RTD, 2, &replyPtr); + if (result != RETURN_OK) { + return result; + } + if (replyPtr[1] & 0b0000'0001) { + faultBitSet = true; + } + // Shift 1 to the right to remove fault bit + val = ((replyPtr[0] << 8) | replyPtr[1]) >> 1; + return result; +} + +ReturnValue_t Max31865RtdReader::readNFromReg(SpiCookie* cookie, uint8_t reg, size_t n, + uint8_t** reply) { + using namespace MAX31865; + if (n > 4) { + return HasReturnvaluesIF::RETURN_FAILED; + } + // Clear write bit in any case + reg &= ~WRITE_BIT; + cmdBuf[0] = reg; + std::memset(cmdBuf.data() + 1, 0, n); + ReturnValue_t result = comIF->sendMessage(cookie, cmdBuf.data(), n); if (result != RETURN_OK) { return RETURN_FAILED; } - uint8_t reply[3] = {}; - uint8_t* replyPtr = reply; + uint8_t* replyPtr = replyBuf.data(); size_t dummyLen = 0; result = comIF->readReceivedMessage(cookie, &replyPtr, &dummyLen); if (result != RETURN_OK) { return result; } - if (reply[2] & 0b0000'0001) { - faultBitSet = true; + if (reply != nullptr) { + *reply = replyBuf.data() + 1; } - // Shift 1 to the right to remove fault bit - val = ((reply[1] << 8) | reply[2]) >> 1; + return RETURN_OK; +} + +ReturnValue_t Max31865RtdReader::handleSpiError(Max31865ReaderCookie* cookie, ReturnValue_t result, + const char* ctx) { + cookie->db.spiErrorCount.value += 1; + sif::warning << "Max31865RtdReader::handleSpiError: " << ctx << " | Failed with result " << result + << std::endl; return result; } diff --git a/linux/devices/Max31865RtdReader.h b/linux/devices/Max31865RtdLowlevelHandler.h similarity index 70% rename from linux/devices/Max31865RtdReader.h rename to linux/devices/Max31865RtdLowlevelHandler.h index 79ae1786..5e9a7c26 100644 --- a/linux/devices/Max31865RtdReader.h +++ b/linux/devices/Max31865RtdLowlevelHandler.h @@ -24,6 +24,10 @@ struct Max31865ReaderCookie { bool on = false; bool configured = false; bool active = false; + bool writeLowThreshold = false; + bool writeHighThreshold = false; + uint16_t lowThreshold = 0; + uint16_t highThreshold = 0; SpiCookie* spiCookie = nullptr; // Exchange data buffer struct @@ -35,12 +39,13 @@ class Max31865RtdReader : public SystemObject, public DeviceCommunicationIF { public: Max31865RtdReader(object_id_t objectId, SpiComIF* comIF); - void addRtd(Max31865ReaderCookie rtdCookie); [[noreturn]] ReturnValue_t performOperation(uint8_t operationCode) override; private: std::vector rtds; + std::array cmdBuf = {}; + std::array replyBuf = {}; MutexIF* readerMutex; void rtdMainLoop(); @@ -50,9 +55,18 @@ class Max31865RtdReader : public SystemObject, bool rtdIsActive(uint8_t idx); ReturnValue_t writeCfgReg(SpiCookie* cookie, uint8_t cfg); - ReturnValue_t biasSel(MAX31865::Bias bias, SpiCookie* cookie); + ReturnValue_t writeBiasSel(MAX31865::Bias bias, SpiCookie* cookie); ReturnValue_t readCfgReg(SpiCookie* cookie, uint8_t& cfg); ReturnValue_t readRtdVal(SpiCookie* cookie, uint16_t& val, bool& faultBitSet); + ReturnValue_t writeLowThreshold(SpiCookie* cookie, uint16_t val); + ReturnValue_t writeHighThreshold(SpiCookie* cookie, uint16_t val); + ReturnValue_t readLowThreshold(SpiCookie* cookie, uint16_t& val); + ReturnValue_t readHighThreshold(SpiCookie* cookie, uint16_t& val); + ReturnValue_t clearFaultStatus(SpiCookie* cookie); + + ReturnValue_t readNFromReg(SpiCookie* cookie, uint8_t reg, size_t n, uint8_t** reply); + ReturnValue_t writeNToReg(SpiCookie* cookie, uint8_t reg, size_t n, uint8_t* cmd, + uint8_t** reply); ReturnValue_t initializeInterface(CookieIF* cookie) override; ReturnValue_t sendMessage(CookieIF* cookie, const uint8_t* sendData, size_t sendLen) override; @@ -60,6 +74,8 @@ class Max31865RtdReader : public SystemObject, ReturnValue_t requestReceiveMessage(CookieIF* cookie, size_t requestLen) override; ReturnValue_t readReceivedMessage(CookieIF* cookie, uint8_t** buffer, size_t* size) override; + ReturnValue_t handleSpiError(Max31865ReaderCookie* cookie, ReturnValue_t result, const char* ctx); + SpiComIF* comIF; }; diff --git a/mission/devices/Max31865EiveHandler.cpp b/mission/devices/Max31865EiveHandler.cpp index 17afa718..98265600 100644 --- a/mission/devices/Max31865EiveHandler.cpp +++ b/mission/devices/Max31865EiveHandler.cpp @@ -124,9 +124,10 @@ uint32_t Max31865EiveHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeT ReturnValue_t Max31865EiveHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { - localDataPoolMap.emplace(MAX31865::PoolIds::RTD_VALUE, new PoolEntry({0})); - localDataPoolMap.emplace(MAX31865::PoolIds::TEMPERATURE_C, new PoolEntry({0})); - localDataPoolMap.emplace(MAX31865::PoolIds::FAULT_BYTE, new PoolEntry({0})); + using namespace MAX31865; + localDataPoolMap.emplace(static_cast(PoolIds::RTD_VALUE), new PoolEntry({0})); + localDataPoolMap.emplace(static_cast(PoolIds::TEMPERATURE_C), new PoolEntry({0})); + localDataPoolMap.emplace(static_cast(PoolIds::FAULT_BYTE), new PoolEntry({0})); poolManager.subscribeForPeriodicPacket(sensorDataset.getSid(), false, 30.0, false); return RETURN_OK; } diff --git a/mission/devices/Max31865PT1000Handler.cpp b/mission/devices/Max31865PT1000Handler.cpp index debe60e9..e82a0d9f 100644 --- a/mission/devices/Max31865PT1000Handler.cpp +++ b/mission/devices/Max31865PT1000Handler.cpp @@ -160,6 +160,7 @@ ReturnValue_t Max31865PT1000Handler::buildCommandFromCommand(DeviceCommandId_t d commandBuffer[0] = static_cast(MAX31865::CONFIG_CMD); if (commandDataLen == 1) { commandBuffer[1] = commandData[0]; + currentCfg = commandData[0]; DeviceHandlerBase::rawPacketLen = 2; DeviceHandlerBase::rawPacket = commandBuffer.data(); return HasReturnvaluesIF::RETURN_OK; @@ -169,7 +170,7 @@ ReturnValue_t Max31865PT1000Handler::buildCommandFromCommand(DeviceCommandId_t d } case (MAX31865::CLEAR_FAULT_BYTE): { commandBuffer[0] = static_cast(MAX31865::CONFIG_CMD); - commandBuffer[1] = MAX31865::CLEAR_FAULT_BIT_VAL; + commandBuffer[1] = currentCfg | MAX31865::CLEAR_FAULT_BIT_VAL; DeviceHandlerBase::rawPacketLen = 2; DeviceHandlerBase::rawPacket = commandBuffer.data(); return HasReturnvaluesIF::RETURN_OK; @@ -512,9 +513,11 @@ ReturnValue_t Max31865PT1000Handler::getSwitches(const uint8_t **switches, ReturnValue_t Max31865PT1000Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(MAX31865::PoolIds::RTD_VALUE, new PoolEntry({0})); - localDataPoolMap.emplace(MAX31865::PoolIds::TEMPERATURE_C, new PoolEntry({0}, 1, true)); - localDataPoolMap.emplace(MAX31865::PoolIds::FAULT_BYTE, new PoolEntry({0})); + using namespace MAX31865; + localDataPoolMap.emplace(static_cast(PoolIds::RTD_VALUE), new PoolEntry({0})); + localDataPoolMap.emplace(static_cast(PoolIds::TEMPERATURE_C), + new PoolEntry({0}, 1, true)); + localDataPoolMap.emplace(static_cast(PoolIds::FAULT_BYTE), new PoolEntry({0})); poolManager.subscribeForPeriodicPacket(sensorDataset.getSid(), false, 30.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/Max31865PT1000Handler.h b/mission/devices/Max31865PT1000Handler.h index 9a6b5add..0d3e4bb3 100644 --- a/mission/devices/Max31865PT1000Handler.h +++ b/mission/devices/Max31865PT1000Handler.h @@ -109,6 +109,7 @@ class Max31865PT1000Handler : public DeviceHandlerBase { bool resetFaultBit = false; dur_millis_t startTime = 0; + uint8_t currentCfg = 0; std::string locString; uint8_t faultByte = 0; uint8_t deviceIdx = 0; diff --git a/mission/devices/devicedefinitions/Max31865Definitions.h b/mission/devices/devicedefinitions/Max31865Definitions.h index d1b67429..1a3cca7a 100644 --- a/mission/devices/devicedefinitions/Max31865Definitions.h +++ b/mission/devices/devicedefinitions/Max31865Definitions.h @@ -9,7 +9,7 @@ namespace MAX31865 { -enum PoolIds : lp_id_t { RTD_VALUE, TEMPERATURE_C, FAULT_BYTE }; +enum class PoolIds : lp_id_t { RTD_VALUE, TEMPERATURE_C, FAULT_BYTE }; enum Wires : unsigned int { TWO_WIRE = 0, THREE_WIRE = 1, FOUR_WIRE = 0 }; enum ConvMode : unsigned int { NORM_OFF = 0, AUTO = 1 }; @@ -30,26 +30,30 @@ enum CfgBitPos { static constexpr uint32_t WARMUP_MS = 100; +static constexpr uint8_t WRITE_BIT = 0b10000000; + +enum Regs : uint8_t { + CONFIG = 0x00, + RTD = 0x01, + HIGH_THRESHOLD = 0x03, + LOW_THRESHOLD = 0x05, + FAULT_BYTE = 0x07 +}; + static constexpr DeviceCommandId_t CONFIG_CMD = 0x80; static constexpr DeviceCommandId_t WRITE_HIGH_THRESHOLD = 0x83; static constexpr DeviceCommandId_t WRITE_LOW_THRESHOLD = 0x85; -static constexpr DeviceCommandId_t REQUEST_CONFIG = 0x00; -static constexpr DeviceCommandId_t REQUEST_RTD = 0x01; -static constexpr DeviceCommandId_t REQUEST_HIGH_THRESHOLD = 0x03; -static constexpr DeviceCommandId_t REQUEST_LOW_THRESHOLD = 0x05; -static constexpr DeviceCommandId_t REQUEST_FAULT_BYTE = 0x07; - +static constexpr DeviceCommandId_t REQUEST_CONFIG = CONFIG; +static constexpr DeviceCommandId_t REQUEST_RTD = RTD; +static constexpr DeviceCommandId_t REQUEST_HIGH_THRESHOLD = HIGH_THRESHOLD; +static constexpr DeviceCommandId_t REQUEST_LOW_THRESHOLD = LOW_THRESHOLD; +static constexpr DeviceCommandId_t REQUEST_FAULT_BYTE = FAULT_BYTE; static constexpr DeviceCommandId_t CLEAR_FAULT_BYTE = 0x08; static constexpr uint32_t MAX31865_SET_ID = REQUEST_RTD; static constexpr uint8_t CLEAR_FAULT_BIT_VAL = 0b0000'0010; -static constexpr uint8_t WRITE_BIT = 0b10000000; - -static constexpr uint8_t REG_CONFIG = 0x00; -static constexpr uint8_t REG_RTD = 0x01; - static constexpr size_t MAX_REPLY_SIZE = 5; class Max31865Set : public StaticLocalDataSet<3> { @@ -67,9 +71,12 @@ class Max31865Set : public StaticLocalDataSet<3> { */ Max31865Set(object_id_t objectId, uint32_t setId) : StaticLocalDataSet(sid_t(objectId, setId)) {} - lp_var_t rtdValue = lp_var_t(sid.objectId, PoolIds::RTD_VALUE, this); - lp_var_t temperatureCelcius = lp_var_t(sid.objectId, PoolIds::TEMPERATURE_C, this); - lp_var_t errorByte = lp_var_t(sid.objectId, PoolIds::FAULT_BYTE, this); + lp_var_t rtdValue = + lp_var_t(sid.objectId, static_cast(PoolIds::RTD_VALUE), this); + lp_var_t temperatureCelcius = + lp_var_t(sid.objectId, static_cast(PoolIds::TEMPERATURE_C), this); + lp_var_t errorByte = + lp_var_t(sid.objectId, static_cast(PoolIds::FAULT_BYTE), this); }; } // namespace MAX31865 @@ -86,7 +93,7 @@ enum RtdCommands : DeviceCommandId_t { HIGH_TRESHOLD = 4, OFF = 5, CFG = 6, - + NUM_CMDS }; class ReadOutStruct : public SerialLinkedListAdapter { From a173ef43082b88de21a63cec982cf901ff7a0645 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 12 May 2022 12:12:47 +0200 Subject: [PATCH 0074/2058] create low level rtd handler in obj factory --- linux/ObjectFactory.cpp | 49 ++++++++++++++-------- linux/devices/Max31865RtdLowlevelHandler.h | 2 +- misc/eclipse/.cproject | 22 +++++----- mission/devices/Max31865EiveHandler.cpp | 9 ++++ mission/devices/Max31865EiveHandler.h | 4 ++ mission/devices/Max31865PT1000Handler.cpp | 4 +- mission/devices/Max31865PT1000Handler.h | 2 +- 7 files changed, 60 insertions(+), 32 deletions(-) diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 35d1cff9..3e760c1f 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include #include #include @@ -245,8 +247,8 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, gpioChecker(gpioComIF->addGpios(rtdGpioCookie), "RTDs"); #if OBSW_ADD_RTD_DEVICES == 1 - static constexpr uint8_t NUMBER_RTDS = 16; - std::array, NUMBER_RTDS> cookieArgs = {{ + using namespace EiveMax31855; + std::array, NUM_RTDS> cookieArgs = {{ {addresses::RTD_IC_3, gpioIds::RTD_IC_3}, {addresses::RTD_IC_4, gpioIds::RTD_IC_4}, {addresses::RTD_IC_5, gpioIds::RTD_IC_5}, @@ -264,7 +266,7 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, {addresses::RTD_IC_17, gpioIds::RTD_IC_17}, {addresses::RTD_IC_18, gpioIds::RTD_IC_18}, }}; - std::array, NUMBER_RTDS> rtdInfos = {{ + std::array, NUM_RTDS> rtdInfos = {{ {objects::RTD_0_IC3_PLOC_HEATSPREADER, "RTD_0_PLOC_HEATSPREADER"}, {objects::RTD_1_IC4_PLOC_MISSIONBOARD, "RTD_1_PLOC_MISSIONBOARD"}, {objects::RTD_2_IC5_4K_CAMERA, "RTD_2_4K_CAMERA"}, @@ -282,31 +284,44 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, {objects::RTD_14_IC17_TCS_BOARD, "RTD_14_TCS_BOARD"}, {objects::RTD_15_IC18_IMTQ, "RTD_15_IMTQ"}, }}; - std::array rtdCookies = {}; - std::array rtds = {}; + std::array rtdCookies = {}; + std::array rtds = {}; RtdFdir* rtdFdir = nullptr; - for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) { + bool useDirectHandler = false; + auto directRtdsCreator = [&](uint8_t idx) { + auto typedHandler = + new Max31865PT1000Handler(rtdInfos[idx].first, objects::SPI_MAIN_COM_IF, rtdCookies[idx]); + rtds[idx] = typedHandler; + typedHandler->setDeviceInfo(idx + 3, rtdInfos[idx].second); + }; + auto lowLevelRtdsCreator = [&](uint8_t idx) { + Max31865ReaderCookie* rtdLowLevelCookie = + new Max31865ReaderCookie(rtdInfos[idx].first, idx, rtdInfos[idx].second, rtdCookies[idx]); + auto typedHandler = + new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_MAIN_COM_IF, rtdLowLevelCookie); + rtds[idx] = typedHandler; + typedHandler->setDeviceInfo(idx, rtdInfos[idx].second); + }; + for (uint8_t idx = 0; idx < NUM_RTDS; idx++) { rtdCookies[idx] = new SpiCookie(cookieArgs[idx].first, cookieArgs[idx].second, MAX31865::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - rtds[idx] = - new Max31865PT1000Handler(rtdInfos[idx].first, objects::SPI_MAIN_COM_IF, rtdCookies[idx]); + if (useDirectHandler) { + directRtdsCreator(idx); + } else { + lowLevelRtdsCreator(idx); + } rtds[idx]->setParent(objects::TCS_BOARD_ASS); rtdFdir = new RtdFdir(rtdInfos[idx].first); rtds[idx]->setCustomFdir(rtdFdir); - rtds[idx]->setDeviceInfo(idx + 3, rtdInfos[idx].second); #if OBSW_DEBUG_RTD == 1 rtds[idx]->setDebugMode(true); #endif +#if OBSW_TEST_RTD == 1 + rtds[idx]->setStartUpImmediately(); + rtds[idx]->setInstantNormal(true); +#endif // OBSW_TEST_RTD == 1 } -#if OBSW_TEST_RTD == 1 - for (auto& rtd : rtds) { - if (rtd != nullptr) { - rtd->setStartUpImmediately(); - rtd->setInstantNormal(true); - } - } -#endif // OBSW_TEST_RTD == 1 TcsBoardHelper helper(rtdInfos); TcsBoardAssembly* tcsBoardAss = new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, diff --git a/linux/devices/Max31865RtdLowlevelHandler.h b/linux/devices/Max31865RtdLowlevelHandler.h index 5e9a7c26..8194b1a8 100644 --- a/linux/devices/Max31865RtdLowlevelHandler.h +++ b/linux/devices/Max31865RtdLowlevelHandler.h @@ -9,7 +9,7 @@ #include "fsfw/devicehandlers/DeviceCommunicationIF.h" #include "mission/devices/devicedefinitions/Max31865Definitions.h" -struct Max31865ReaderCookie { +struct Max31865ReaderCookie : public CookieIF { Max31865ReaderCookie(){}; Max31865ReaderCookie(object_id_t handlerId_, uint8_t idx_, const std::string& locString_, SpiCookie* spiCookie_) diff --git a/misc/eclipse/.cproject b/misc/eclipse/.cproject index f40535b7..d30ef1ec 100644 --- a/misc/eclipse/.cproject +++ b/misc/eclipse/.cproject @@ -57,7 +57,7 @@ - + @@ -119,7 +119,7 @@ - + @@ -187,7 +187,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -750,7 +750,7 @@ - + @@ -851,7 +851,7 @@