From 6be7cb4d0cd1ae1cb44c3b3aef755b41a41102eb Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" Date: Fri, 28 Jan 2022 12:43:26 +0100 Subject: [PATCH 01/61] some adaptions to new firmware --- bsp_q7s/core/ObjectFactory.cpp | 2 ++ bsp_q7s/devices/startracker/ArcsecJsonKeys.h | 5 +++-- .../startracker/ArcsecJsonParamBase.cpp | 6 +++++ .../startracker/StarTrackerHandler.cpp | 15 +++++++------ .../startracker/StarTrackerJsonCommands.cpp | 22 ++++++++++++------- .../startracker/StarTrackerJsonCommands.h | 6 ++--- 6 files changed, 36 insertions(+), 20 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index c7e039f9..17b22830 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -149,6 +149,8 @@ void ObjectFactory::produce(void* args) { #if OBSW_DEBUG_IMTQ == 1 imtqHandler->setToGoToNormal(true); imtqHandler->setStartUpImmediately(); +#else + (void) imtqHandler; #endif #endif createReactionWheelComponents(gpioComIF); diff --git a/bsp_q7s/devices/startracker/ArcsecJsonKeys.h b/bsp_q7s/devices/startracker/ArcsecJsonKeys.h index 67a80b88..a32e380e 100644 --- a/bsp_q7s/devices/startracker/ArcsecJsonKeys.h +++ b/bsp_q7s/devices/startracker/ArcsecJsonKeys.h @@ -53,7 +53,6 @@ static const char VAL_7[] = "val7"; static const char REG_8[] = "reg8"; static const char VAL_8[] = "val8"; static const char FREQ_1[] = "freq1"; -static const char FREQ_2[] = "freq2"; static const char BLOB[] = "blob"; static const char MIN_VALUE[] = "minValue"; @@ -66,7 +65,7 @@ static const char MIN_BRIGHT_NEIGHBOURS[] = "minBrightNeighbours"; static const char MAX_BRIGHT_NEIGHBOURS[] = "maxBrightNeighbours"; static const char MAX_PIXEL_TO_CONSIDER[] = "maxPixelsToConsider"; static const char SIGNAL_THRESHOLD[] = "signalThreshold"; -static const char DARK_THRESHOLD[] = "darkThreshold"; +static const char BLOB_DARK_THRESHOLD[] = "darkThreshold"; static const char ENABLE_HISTOGRAM[] = "enableHistogram"; static const char ENABLE_CONTRAST[] = "enableContrast"; static const char BIN_MODE[] = "binMode"; @@ -74,6 +73,7 @@ static const char BIN_MODE[] = "binMode"; static const char CENTROIDING[] = "centroiding"; static const char ENABLE_FILTER[] = "enableFilter"; static const char MAX_QUALITY[] = "maxquality"; +static const char DARK_THRESHOLD[] = "darkthreshold"; static const char MIN_QUALITY[] = "minquality"; static const char MAX_INTENSITY[] = "maxintensity"; static const char MIN_INTENSITY[] = "minintensity"; @@ -86,6 +86,7 @@ static const char TRANSMATRIX_10[] = "transmatrix10"; static const char TRANSMATRIX_11[] = "transmatrix11"; static const char LISA[] = "lisa"; +static const char LISA_MODE[] = "mode"; static const char PREFILTER_DIST_THRESHOLD[] = "prefilterDistThreshold"; static const char PREFILTER_ANGLE_THRESHOLD[] = "prefilterAngleThreshold"; static const char FOV_WIDTH[] = "fov_width"; diff --git a/bsp_q7s/devices/startracker/ArcsecJsonParamBase.cpp b/bsp_q7s/devices/startracker/ArcsecJsonParamBase.cpp index 3ecd1d91..3824f752 100644 --- a/bsp_q7s/devices/startracker/ArcsecJsonParamBase.cpp +++ b/bsp_q7s/devices/startracker/ArcsecJsonParamBase.cpp @@ -8,9 +8,15 @@ ReturnValue_t ArcsecJsonParamBase::create(std::string fullname, uint8_t* buffer) ReturnValue_t result = RETURN_OK; result = init(fullname); if (result != RETURN_OK) { + sif::warning << "ArcsecJsonParamBase::create: Failed to init parameter command for set " + << setName << std::endl; return result; } result = createCommand(buffer); + if (result != RETURN_OK) { + sif::warning << "ArcsecJsonParamBase::create: Failed to create parameter command for set " + << setName << std::endl; + } return result; } diff --git a/bsp_q7s/devices/startracker/StarTrackerHandler.cpp b/bsp_q7s/devices/startracker/StarTrackerHandler.cpp index 71df6b0b..a7f5bb01 100644 --- a/bsp_q7s/devices/startracker/StarTrackerHandler.cpp +++ b/bsp_q7s/devices/startracker/StarTrackerHandler.cpp @@ -321,11 +321,11 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t *id = StarTracker::CAMERA; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); - case StartupState::BLOB: - startupState = StartupState::WAIT_FOR_EXECUTION; - *id = StarTracker::BLOB; - return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), - paramJsonFile.size()); +// case StartupState::BLOB: +// startupState = StartupState::WAIT_FOR_EXECUTION; +// *id = StarTracker::BLOB; +// return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), +// paramJsonFile.size()); case StartupState::CENTROIDING: startupState = StartupState::WAIT_FOR_EXECUTION; *id = StarTracker::CENTROIDING; @@ -785,7 +785,7 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, void StarTrackerHandler::setNormalDatapoolEntriesInvalid() {} -uint32_t StarTrackerHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 20000; } +uint32_t StarTrackerHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 30000; } ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { @@ -2069,7 +2069,8 @@ void StarTrackerHandler::handleStartup(const uint8_t* parameterId) { break; } case (StarTracker::ID::CAMERA): { - startupState = StartupState::BLOB; +// startupState = StartupState::BLOB; + startupState = StartupState::CENTROIDING; break; } case (StarTracker::ID::BLOB): { diff --git a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp b/bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp index b912c03e..9563f3e6 100644 --- a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp +++ b/bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp @@ -304,13 +304,7 @@ ReturnValue_t Camera::createCommand(uint8_t* buffer) { if (result != RETURN_OK) { return result; } - addfloat(param, buffer + offset); - offset += sizeof(float); - result = getParam(arcseckeys::FREQ_2, param); - if (result != RETURN_OK) { - return result; - } - addfloat(param, buffer + offset); + adduint32(param, buffer + offset); return RETURN_OK; } @@ -390,7 +384,7 @@ ReturnValue_t Blob::createCommand(uint8_t* buffer) { } adduint8(param, buffer + offset); offset += sizeof(uint8_t); - result = getParam(arcseckeys::DARK_THRESHOLD, param); + result = getParam(arcseckeys::BLOB_DARK_THRESHOLD, param); if (result != RETURN_OK) { return result; } @@ -439,6 +433,12 @@ ReturnValue_t Centroiding::createCommand(uint8_t* buffer) { } addfloat(param, buffer + offset); offset += sizeof(float); + result = getParam(arcseckeys::DARK_THRESHOLD, param); + if (result != RETURN_OK) { + return result; + } + addfloat(param, buffer + offset); + offset += sizeof(float); result = getParam(arcseckeys::MIN_QUALITY, param); if (result != RETURN_OK) { return result; @@ -511,6 +511,12 @@ ReturnValue_t Lisa::createCommand(uint8_t* buffer) { std::string param; addSetParamHeader(buffer, StarTracker::ID::LISA); offset = 2; + result = getParam(arcseckeys::LISA_MODE, param); + if (result != RETURN_OK) { + return result; + } + adduint32(param, buffer + offset); + offset += sizeof(uint32_t); result = getParam(arcseckeys::PREFILTER_DIST_THRESHOLD, param); if (result != RETURN_OK) { return result; diff --git a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.h b/bsp_q7s/devices/startracker/StarTrackerJsonCommands.h index 96c52fa2..b94fa231 100644 --- a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.h +++ b/bsp_q7s/devices/startracker/StarTrackerJsonCommands.h @@ -71,7 +71,7 @@ class Camera : public ArcsecJsonParamBase { size_t getSize(); private: - static const size_t COMMAND_SIZE = 43; + static const size_t COMMAND_SIZE = 39; ReturnValue_t createCommand(uint8_t* buffer) override; }; @@ -103,7 +103,7 @@ class Centroiding : public ArcsecJsonParamBase { size_t getSize(); private: - static const size_t COMMAND_SIZE = 47; + static const size_t COMMAND_SIZE = 51; ReturnValue_t createCommand(uint8_t* buffer) override; }; @@ -119,7 +119,7 @@ class Lisa : public ArcsecJsonParamBase { size_t getSize(); private: - static const size_t COMMAND_SIZE = 48; + static const size_t COMMAND_SIZE = 52; ReturnValue_t createCommand(uint8_t* buffer) override; }; From 6043a827ed9c833dd870b524548ece68b611a645 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 29 Jan 2022 12:27:26 +0100 Subject: [PATCH 02/61] removed blob command --- bsp_q7s/devices/startracker/ArcsecJsonKeys.h | 9 +- .../startracker/ArcsecJsonParamBase.cpp | 2 + .../startracker/StarTrackerDefinitions.h | 87 +++--------------- .../startracker/StarTrackerHandler.cpp | 88 ++++++------------- .../devices/startracker/StarTrackerHandler.h | 23 ++--- .../startracker/StarTrackerJsonCommands.cpp | 42 +++++++++ .../startracker/StarTrackerJsonCommands.h | 16 ++++ fsfw | 2 +- linux/obc/PtmeRateSetter.cpp | 2 +- tmtc | 2 +- 10 files changed, 114 insertions(+), 159 deletions(-) diff --git a/bsp_q7s/devices/startracker/ArcsecJsonKeys.h b/bsp_q7s/devices/startracker/ArcsecJsonKeys.h index a32e380e..044bef8d 100644 --- a/bsp_q7s/devices/startracker/ArcsecJsonKeys.h +++ b/bsp_q7s/devices/startracker/ArcsecJsonKeys.h @@ -28,6 +28,13 @@ static const char qx[] = "qx"; static const char qy[] = "qy"; static const char qz[] = "qz"; +static const char IMAGE_PROCESSOR[] = "imageprocessor"; +static const char IMAGE_PROCESSOR_MODE[] = "mode"; +static const char STORE[] = "store"; +static const char SIGNAL_THRESHOLD[] = "signalThreshold"; +static const char IMAGE_PROCESSOR_DARK_THRESHOLD[] = "darkThreshold"; +static const char BACKGROUND_COMPENSATION[] = "backgroundcompensation"; + static const char CAMERA[] = "camera"; static const char MODE[] = "mode"; static const char FOCALLENGTH[] = "focallength"; @@ -64,7 +71,7 @@ static const char MAX_TOTAL_VALUE[] = "maxTotalValue"; static const char MIN_BRIGHT_NEIGHBOURS[] = "minBrightNeighbours"; static const char MAX_BRIGHT_NEIGHBOURS[] = "maxBrightNeighbours"; static const char MAX_PIXEL_TO_CONSIDER[] = "maxPixelsToConsider"; -static const char SIGNAL_THRESHOLD[] = "signalThreshold"; +//static const char SIGNAL_THRESHOLD[] = "signalThreshold"; static const char BLOB_DARK_THRESHOLD[] = "darkThreshold"; static const char ENABLE_HISTOGRAM[] = "enableHistogram"; static const char ENABLE_CONTRAST[] = "enableContrast"; diff --git a/bsp_q7s/devices/startracker/ArcsecJsonParamBase.cpp b/bsp_q7s/devices/startracker/ArcsecJsonParamBase.cpp index 3824f752..36aa8ea3 100644 --- a/bsp_q7s/devices/startracker/ArcsecJsonParamBase.cpp +++ b/bsp_q7s/devices/startracker/ArcsecJsonParamBase.cpp @@ -97,5 +97,7 @@ ReturnValue_t ArcsecJsonParamBase::initSet() { return RETURN_OK; } } + sif::warning << "ArcsecJsonParamBase::initSet: Set " << setName << "not present in json file" + << std::endl; return SET_NOT_EXISTS; } diff --git a/bsp_q7s/devices/startracker/StarTrackerDefinitions.h b/bsp_q7s/devices/startracker/StarTrackerDefinitions.h index 1e0564d9..dda013b2 100644 --- a/bsp_q7s/devices/startracker/StarTrackerDefinitions.h +++ b/bsp_q7s/devices/startracker/StarTrackerDefinitions.h @@ -60,6 +60,7 @@ enum PoolIds : lp_id_t { TIME_TEMPERATURE_SET, MCU_TEMPERATURE, CMOS_TEMPERATURE, + FPGA_TEMPERATURE, TICKS_SOLUTION_SET, TIME_SOLUTION_SET, CALI_QW, @@ -257,6 +258,7 @@ static const DeviceCommandId_t TAKE_IMAGE = 15; static const DeviceCommandId_t DOWNLOAD_CENTROID = 16; static const DeviceCommandId_t UPLOAD_CENTROID = 17; static const DeviceCommandId_t SUBSCRIBE_TO_TM = 18; +static const DeviceCommandId_t IMAGE_PROCESSOR = 19; static const DeviceCommandId_t REQ_SOLUTION = 24; static const DeviceCommandId_t REQ_TEMPERATURE = 25; static const DeviceCommandId_t REQ_HISTOGRAM = 28; @@ -264,7 +266,6 @@ static const DeviceCommandId_t REQ_CONTRAST = 29; static const DeviceCommandId_t LIMITS = 40; static const DeviceCommandId_t MOUNTING = 41; static const DeviceCommandId_t CAMERA = 42; -static const DeviceCommandId_t BLOB = 43; static const DeviceCommandId_t CENTROIDING = 44; static const DeviceCommandId_t LISA = 45; static const DeviceCommandId_t MATCHING = 46; @@ -289,7 +290,6 @@ static const DeviceCommandId_t UPLOAD_FPGA_IMAGE = 65; static const DeviceCommandId_t FPGA_ACTION = 66; static const DeviceCommandId_t REQ_CAMERA = 67; static const DeviceCommandId_t REQ_LIMITS = 68; -static const DeviceCommandId_t REQ_BLOB_PARAMS = 69; static const DeviceCommandId_t NONE = 0xFFFFFFFF; static const uint32_t VERSION_SET_ID = REQ_VERSION; @@ -307,12 +307,11 @@ static const uint32_t DOWNLOAD_DBIMAGE_SET_ID = DOWNLOAD_DBIMAGE; static const uint32_t DOWNLOAD_BLOBPIXEL_SET_ID = DOWNLOAD_BLOBPIXEL; static const uint32_t CAMERA_SET_ID = REQ_CAMERA; static const uint32_t LIMITS_SET_ID = REQ_LIMITS; -static const uint32_t BLOB_SET_ID = REQ_BLOB_PARAMS; /** Max size of unencoded frame */ static const size_t MAX_FRAME_SIZE = 1200; -static const uint8_t TEMPERATURE_SET_ENTRIES = 4; +static const uint8_t TEMPERATURE_SET_ENTRIES = 5; static const uint8_t VERSION_SET_ENTRIES = 5; static const uint8_t INTERFACE_SET_ENTRIES = 4; static const uint8_t POWER_SET_ENTRIES = 18; @@ -327,7 +326,6 @@ static const uint8_t DOWNLOAD_DBIMAGE_SET_ENTRIES = 6; static const uint8_t DOWNLOAD_BLOBPIXEL_SET_ENTRIES = 7; static const uint8_t CAMERA_SET_ENTRIES = 15; static const uint8_t LIMITS_SET_ENTRIES = 11; -static const uint8_t BLOB_SET_ENTRIES = 15; // Action, parameter and telemetry IDs namespace ID { @@ -337,8 +335,8 @@ static const uint8_t VERSION = 2; static const uint8_t INTERFACE = 3; static const uint8_t LIMITS = 5; static const uint8_t MOUNTING = 6; +static const uint8_t IMAGE_PROCESSOR = 10; static const uint8_t CAMERA = 9; -static const uint8_t BLOB = 10; static const uint8_t CENTROIDING = 11; static const uint8_t LISA = 12; static const uint8_t MATCHING = 13; @@ -351,7 +349,7 @@ static const uint8_t POWER = 11; static const uint8_t SET_TIME = 14; static const uint8_t SUBSCRIBE = 18; static const uint8_t SOLUTION = 24; -static const uint8_t TEMPERATURE = 25; +static const uint8_t TEMPERATURE = 27; static const uint8_t HISTOGRAM = 28; static const uint8_t CONTRAST = 29; static const uint8_t TIME = 1; @@ -380,7 +378,7 @@ static const uint8_t FIRMWARE = 2; */ class TemperatureSet : public StaticLocalDataSet { public: - static const size_t SIZE = 20; + static const size_t SIZE = 24; TemperatureSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, TEMPERATURE_SET_ID) {} @@ -392,14 +390,17 @@ class TemperatureSet : public StaticLocalDataSet { lp_var_t time = lp_var_t(sid.objectId, PoolIds::TIME_TEMPERATURE_SET, this); lp_var_t mcuTemperature = lp_var_t(sid.objectId, PoolIds::MCU_TEMPERATURE, this); lp_var_t cmosTemperature = lp_var_t(sid.objectId, PoolIds::CMOS_TEMPERATURE, this); + lp_var_t fpgaTemperature = lp_var_t(sid.objectId, PoolIds::FPGA_TEMPERATURE, this); void printSet() { sif::info << "TemperatureSet::printSet: Ticks: " << this->ticks << std::endl; sif::info << "TemperatureSet::printSet: Time: " << this->time << " us" << std::endl; sif::info << "TemperatureSet::printSet: MCU Temperature: " << this->mcuTemperature << " °C" << std::endl; - sif::info << "TemperatureSet::printSet: CMOS Temperature: " << this->cmosTemperature << " °C" + sif::info << "TemperatureSet::printSet: CMOS Temperature (raw): " << this->cmosTemperature << std::endl; + sif::info << "TemperatureSet::printSet: FPGA Temperature (random value): " + << this->fpgaTemperature << " °C" << std::endl; } }; @@ -1201,73 +1202,5 @@ class LimitsSet : public StaticLocalDataSet { sif::info << "CameraSet::printSet: CMOSTemperature: " << this->cmosTemperature << std::endl; } }; - -/** - * @brief Will store the request of the blob parameters. - */ -class BlobSet : public StaticLocalDataSet { - public: - // Size of dataset - static const size_t SIZE = 22; - - BlobSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, BLOB_SET_ID) {} - - BlobSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, BLOB_SET_ID)) {} - - lp_var_t mode = lp_var_t(sid.objectId, PoolIds::BLOB_MODE, this); - lp_var_t minValue = lp_var_t(sid.objectId, PoolIds::BLOB_MIN_VALUE, this); - lp_var_t minDistance = lp_var_t(sid.objectId, PoolIds::BLOB_MIN_DISTANCE, this); - lp_var_t neighbourDistance = - lp_var_t(sid.objectId, PoolIds::BLOB_NEIGHBOUR_DISTANCE, this); - lp_var_t neighbourBrightPixels = - lp_var_t(sid.objectId, PoolIds::BLOB_NEIGHBOUR_BRIGHTPIXELS, this); - lp_var_t minTotalValue = - lp_var_t(sid.objectId, PoolIds::BLOB_MIN_TOTAL_VALUE, this); - lp_var_t maxTotalValue = - lp_var_t(sid.objectId, PoolIds::BLOB_MAX_TOTAL_VALUE, this); - lp_var_t minBrightNeighbours = - lp_var_t(sid.objectId, PoolIds::BLOB_MIN_BRIGHT_NEIGHBOURS, this); - lp_var_t maxBrightNeighbours = - lp_var_t(sid.objectId, PoolIds::BLOB_MAX_BRIGHT_NEIGHBOURS, this); - lp_var_t maxPixelsToConsider = - lp_var_t(sid.objectId, PoolIds::BLOB_MAX_PIXELSTOCONSIDER, this); - lp_var_t signalThreshold = - lp_var_t(sid.objectId, PoolIds::BLOB_SIGNAL_THRESHOLD, this); - lp_var_t darkThreshold = - lp_var_t(sid.objectId, PoolIds::BLOB_DARK_THRESHOLD, this); - lp_var_t enableContrast = - lp_var_t(sid.objectId, PoolIds::BLOB_ENABLE_CONTRAST, this); - lp_var_t enableBinMode = lp_var_t(sid.objectId, PoolIds::BLOB_BIN_MODE, this); - - void printSet() { - PoolReadGuard rg(this); - sif::info << "BlobSet::printSet: mode: " << static_cast(this->mode.value) - << std::endl; - sif::info << "BlobSet::printSet: minValue: " << static_cast(this->minValue.value) - << std::endl; - sif::info << "BlobSet::printSet: minDistance: " - << static_cast(this->minDistance.value) << std::endl; - sif::info << "BlobSet::printSet: neighboutDistance: " - << static_cast(this->neighbourDistance.value) << std::endl; - sif::info << "BlobSet::printSet: neighboutBrightPixels: " - << static_cast(this->neighbourBrightPixels.value) << std::endl; - sif::info << "BlobSet::printSet: minTotalValue: " << this->minTotalValue << std::endl; - sif::info << "BlobSet::printSet: maxTotalValue: " << this->maxTotalValue << std::endl; - sif::info << "BlobSet::printSet: minBrightNeighbours: " << this->minBrightNeighbours - << std::endl; - sif::info << "BlobSet::printSet: maxBrightNeighbours: " << this->maxBrightNeighbours - << std::endl; - sif::info << "BlobSet::printSet: maxPixelsToConsider: " << this->maxPixelsToConsider - << std::endl; - sif::info << "BlobSet::printSet: signalThreshold: " - << static_cast(this->signalThreshold.value) << std::endl; - sif::info << "BlobSet::printSet: darkThreshold: " - << static_cast(this->darkThreshold.value) << std::endl; - sif::info << "BlobSet::printSet: enableContrast: " - << static_cast(this->enableContrast.value) << std::endl; - sif::info << "BlobSet::printSet: enableBinMode: " - << static_cast(this->enableBinMode.value) << std::endl; - } -}; } // namespace StarTracker #endif /* MISSION_STARTRACKER_DEFINITIONS_H_ */ diff --git a/bsp_q7s/devices/startracker/StarTrackerHandler.cpp b/bsp_q7s/devices/startracker/StarTrackerHandler.cpp index a7f5bb01..0ca02118 100644 --- a/bsp_q7s/devices/startracker/StarTrackerHandler.cpp +++ b/bsp_q7s/devices/startracker/StarTrackerHandler.cpp @@ -12,7 +12,6 @@ extern "C" { #include #include #include - #include "common/misc.h" } @@ -109,7 +108,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu } if (strHelperExecuting == true) { - return IMAGE_LOADER_EXECUTING; + return STR_HELPER_EXECUTING; } result = checkMode(actionId); @@ -316,16 +315,16 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t *id = StarTracker::MOUNTING; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); + case StartupState::IMAGE_PROCESSOR: + startupState = StartupState::WAIT_FOR_EXECUTION; + *id = StarTracker::IMAGE_PROCESSOR; + return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), + paramJsonFile.size()); case StartupState::CAMERA: startupState = StartupState::WAIT_FOR_EXECUTION; *id = StarTracker::CAMERA; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); -// case StartupState::BLOB: -// startupState = StartupState::WAIT_FOR_EXECUTION; -// *id = StarTracker::BLOB; -// return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), -// paramJsonFile.size()); case StartupState::CENTROIDING: startupState = StartupState::WAIT_FOR_EXECUTION; *id = StarTracker::CENTROIDING; @@ -428,16 +427,16 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi result = prepareParamCommand(commandData, commandDataLen, mounting); return result; } + case (StarTracker::IMAGE_PROCESSOR): { + ImageProcessor imageProcessor; + result = prepareParamCommand(commandData, commandDataLen, imageProcessor); + return result; + } case (StarTracker::CAMERA): { Camera camera; result = prepareParamCommand(commandData, commandDataLen, camera); return result; } - case (StarTracker::BLOB): { - Blob blob; - result = prepareParamCommand(commandData, commandDataLen, blob); - return result; - } case (StarTracker::CENTROIDING): { Centroiding centroiding; result = prepareParamCommand(commandData, commandDataLen, centroiding); @@ -558,9 +557,9 @@ void StarTrackerHandler::fillCommandAndReplyMap() { StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::MOUNTING, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::CAMERA, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::IMAGE_PROCESSOR, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::BLOB, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::CAMERA, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::CENTROIDING, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); @@ -751,12 +750,12 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, case (StarTracker::LIMITS): case (StarTracker::MOUNTING): case (StarTracker::CAMERA): - case (StarTracker::BLOB): case (StarTracker::CENTROIDING): case (StarTracker::LISA): case (StarTracker::MATCHING): case (StarTracker::TRACKING): case (StarTracker::VALIDATION): + case (StarTracker::IMAGE_PROCESSOR): case (StarTracker::ALGO): { result = handleSetParamReply(); break; @@ -769,10 +768,6 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, handleParamRequest(limitsSet, StarTracker::LimitsSet::SIZE); break; } - case (StarTracker::REQ_BLOB_PARAMS): { - handleParamRequest(blobSet, StarTracker::BlobSet::SIZE); - break; - } default: { sif::debug << "StarTrackerHandler::interpretDeviceReply: Unknown device reply id:" << id << std::endl; @@ -836,6 +831,7 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(StarTracker::TIME_TEMPERATURE_SET, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::MCU_TEMPERATURE, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::CMOS_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::FPGA_TEMPERATURE, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::TICKS_SOLUTION_SET, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::TIME_SOLUTION_SET, new PoolEntry({0})); @@ -1002,23 +998,6 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(StarTracker::LIMITS_CMOS33CURRENT, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::LIMITS_CMOSVRESCURRENT, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::LIMITS_CMOSTEMPERATURE, new PoolEntry({0})); - - localDataPoolMap.emplace(StarTracker::BLOB_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_MIN_VALUE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_MIN_DISTANCE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_NEIGHBOUR_DISTANCE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_NEIGHBOUR_BRIGHTPIXELS, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_NEIGHBOUR_BRIGHTPIXELS, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_MIN_TOTAL_VALUE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_MAX_TOTAL_VALUE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_MIN_BRIGHT_NEIGHBOURS, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_MAX_BRIGHT_NEIGHBOURS, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_MAX_PIXELSTOCONSIDER, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_SIGNAL_THRESHOLD, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_DARK_THRESHOLD, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_ENABLE_HISTOGRAM, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_ENABLE_CONTRAST, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOB_BIN_MODE, new PoolEntry({0})); return RETURN_OK; } @@ -1136,12 +1115,12 @@ ReturnValue_t StarTrackerHandler::scanForSetParameterReply(DeviceCommandId_t* fo *foundId = StarTracker::MOUNTING; break; } - case (StarTracker::ID::CAMERA): { - *foundId = StarTracker::CAMERA; + case (StarTracker::ID::IMAGE_PROCESSOR): { + *foundId = StarTracker::IMAGE_PROCESSOR; break; } - case (StarTracker::ID::BLOB): { - *foundId = StarTracker::BLOB; + case (StarTracker::ID::CAMERA): { + *foundId = StarTracker::CAMERA; break; } case (StarTracker::ID::CENTROIDING): { @@ -1187,10 +1166,6 @@ ReturnValue_t StarTrackerHandler::scanForGetParameterReply(DeviceCommandId_t* fo *foundId = StarTracker::REQ_LIMITS; break; } - case (StarTracker::ID::BLOB): { - *foundId = StarTracker::REQ_BLOB_PARAMS; - break; - } default: { sif::warning << "tarTrackerHandler::scanForGetParameterReply: UnkNown ID" << std::endl; return RETURN_FAILED; @@ -1236,8 +1211,8 @@ ReturnValue_t StarTrackerHandler::scanForTmReply(DeviceCommandId_t* foundId) { break; } default: { - sif::debug << "StarTrackerHandler::scanForTmReply: Reply contains invalid reply id" - << std::endl; + sif::debug << "StarTrackerHandler::scanForTmReply: Reply contains invalid reply id: " + << static_cast(*reply) << std::endl; return RETURN_FAILED; break; } @@ -1730,9 +1705,6 @@ ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData result = paramSet.create(fullName, commandBuffer); if (result != RETURN_OK) { - sif::warning << "StarTrackerHandler::prepareParamCommand: Failed to create parameter " - "command" - << std::endl; return result; } dataLinkLayer.encodeFrame(commandBuffer, paramSet.getSize()); @@ -1826,15 +1798,6 @@ ReturnValue_t StarTrackerHandler::prepareRequestLimitsParams() { return RETURN_OK; } -ReturnValue_t StarTrackerHandler::prepareRequestBlobParams() { - uint32_t length = 0; - arc_pack_blob_parameter_req(commandBuffer, &length); - dataLinkLayer.encodeFrame(commandBuffer, length); - rawPacket = dataLinkLayer.getEncodedFrame(); - rawPacketLen = dataLinkLayer.getEncodedLength(); - return RETURN_OK; -} - ReturnValue_t StarTrackerHandler::handleSetParamReply() { const uint8_t* reply = dataLinkLayer.getReply(); uint8_t status = *(reply + STATUS_OFFSET); @@ -2065,15 +2028,14 @@ void StarTrackerHandler::handleStartup(const uint8_t* parameterId) { break; } case (StarTracker::ID::MOUNTING): { + startupState = StartupState::IMAGE_PROCESSOR; + break; + } + case (StarTracker::ID::IMAGE_PROCESSOR): { startupState = StartupState::CAMERA; break; } case (StarTracker::ID::CAMERA): { -// startupState = StartupState::BLOB; - startupState = StartupState::CENTROIDING; - break; - } - case (StarTracker::ID::BLOB): { startupState = StartupState::CENTROIDING; break; } diff --git a/bsp_q7s/devices/startracker/StarTrackerHandler.h b/bsp_q7s/devices/startracker/StarTrackerHandler.h index 70be3099..235663a4 100644 --- a/bsp_q7s/devices/startracker/StarTrackerHandler.h +++ b/bsp_q7s/devices/startracker/StarTrackerHandler.h @@ -72,15 +72,6 @@ class StarTrackerHandler : public DeviceHandlerBase { private: static const uint8_t INTERFACE_ID = CLASS_ID::STR_HANDLER; - //! [EXPORT] : [COMMENT] Received reply is too short - static const ReturnValue_t REPLY_TOO_SHORT = MAKE_RETURN_CODE(0xB0); - //! [EXPORT] : [COMMENT] Received reply with invalid CRC - static const ReturnValue_t CRC_FAILURE = MAKE_RETURN_CODE(0xB1); - //! [EXPORT] : [COMMENT] Image loader executing - static const ReturnValue_t IMAGE_LOADER_EXECUTING = MAKE_RETURN_CODE(0xB2); - - static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::STR_HANDLER; - //! [EXPORT] : [COMMENT] Status in temperature reply signals error static const ReturnValue_t TEMPERATURE_REQ_FAILED = MAKE_RETURN_CODE(0xA0); //! [EXPORT] : [COMMENT] Ping command failed @@ -132,6 +123,13 @@ class StarTrackerHandler : public DeviceHandlerBase { static const ReturnValue_t INVALID_TYPE = MAKE_RETURN_CODE(0xB6); //! [EXPORT] : [COMMENT] Received FPGA action command with invalid ID static const ReturnValue_t INVALID_ID = MAKE_RETURN_CODE(0xB7); + //! [EXPORT] : [COMMENT] Received reply is too short + static const ReturnValue_t REPLY_TOO_SHORT = MAKE_RETURN_CODE(0xB8); + //! [EXPORT] : [COMMENT] Received reply with invalid CRC + static const ReturnValue_t CRC_FAILURE = MAKE_RETURN_CODE(0xB9); + //! [EXPORT] : [COMMENT] Star tracker handler currently executing a command and using the + //! communication interface + static const ReturnValue_t STR_HELPER_EXECUTING = MAKE_RETURN_CODE(0xBA); static const size_t MAX_PATH_SIZE = 50; static const size_t MAX_FILE_NAME = 30; @@ -262,7 +260,6 @@ class StarTrackerHandler : public DeviceHandlerBase { StarTracker::DownloadBlobPixel downloadBlobPixel; StarTracker::CameraSet cameraSet; StarTracker::LimitsSet limitsSet; - StarTracker::BlobSet blobSet; // Pointer to object responsible for uploading and downloading images to/from the star tracker StrHelper* strHelper = nullptr; @@ -286,6 +283,7 @@ class StarTrackerHandler : public DeviceHandlerBase { LIMITS, TRACKING, MOUNTING, + IMAGE_PROCESSOR, CAMERA, BLOB, CENTROIDING, @@ -502,11 +500,6 @@ class StarTrackerHandler : public DeviceHandlerBase { */ ReturnValue_t prepareRequestLimitsParams(); - /** - * @brief Will fill the command buffer with the command to request the set blob parameters. - */ - ReturnValue_t prepareRequestBlobParams(); - /** * @brief Handles action replies with datasets. */ diff --git a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp b/bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp index 9563f3e6..4b675e93 100644 --- a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp +++ b/bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp @@ -152,6 +152,48 @@ ReturnValue_t Mounting::createCommand(uint8_t* buffer) { return RETURN_OK; } +ImageProcessor::ImageProcessor() : ArcsecJsonParamBase(arcseckeys::IMAGE_PROCESSOR) {} + +size_t ImageProcessor::getSize() { return COMMAND_SIZE; } + +ReturnValue_t ImageProcessor::createCommand(uint8_t* buffer) { + ReturnValue_t result = RETURN_OK; + uint8_t offset = 0; + std::string param; + addSetParamHeader(buffer, StarTracker::ID::IMAGE_PROCESSOR); + offset = 2; + result = getParam(arcseckeys::IMAGE_PROCESSOR_MODE, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::STORE, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::SIGNAL_THRESHOLD, param); + if (result != RETURN_OK) { + return result; + } + adduint16(param, buffer + offset); + offset += sizeof(uint16_t); + result = getParam(arcseckeys::IMAGE_PROCESSOR_DARK_THRESHOLD, param); + if (result != RETURN_OK) { + return result; + } + adduint16(param, buffer + offset); + offset += sizeof(uint16_t); + result = getParam(arcseckeys::BACKGROUND_COMPENSATION, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + return RETURN_OK; +} + Camera::Camera() : ArcsecJsonParamBase(arcseckeys::CAMERA) {} size_t Camera::getSize() { return COMMAND_SIZE; } diff --git a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.h b/bsp_q7s/devices/startracker/StarTrackerJsonCommands.h index b94fa231..eef4c57e 100644 --- a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.h +++ b/bsp_q7s/devices/startracker/StarTrackerJsonCommands.h @@ -60,6 +60,22 @@ class Mounting : public ArcsecJsonParamBase { ReturnValue_t createCommand(uint8_t* buffer) override; }; +/** + * @brief Generates the command to configure the image processor + * + */ +class ImageProcessor : public ArcsecJsonParamBase { + public: + ImageProcessor(); + + size_t getSize(); + + private: + static const size_t COMMAND_SIZE = 9; + + ReturnValue_t createCommand(uint8_t* buffer) override; +}; + /** * @brief Generates the command to set the mounting quaternion * diff --git a/fsfw b/fsfw index cc7a3a5a..faf7da27 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit cc7a3a5a342aa274ba85805ebdfef65224bbe80c +Subproject commit faf7da2743dcd30d83c3ab2f7b4d85277878e636 diff --git a/linux/obc/PtmeRateSetter.cpp b/linux/obc/PtmeRateSetter.cpp index cace128b..8275e8fe 100644 --- a/linux/obc/PtmeRateSetter.cpp +++ b/linux/obc/PtmeRateSetter.cpp @@ -16,7 +16,7 @@ ReturnValue_t PtmeRateSetter::initialize() { } ReturnValue_t PtmeRateSetter::setRate(uint32_t bitRate) { - if (bitRate == 0) { + if (bitRate <= 1) { return BAD_BIT_RATE; } uint32_t rateVal = PtmeConfig::BIT_CLK_FREQ / bitRate - 1; diff --git a/tmtc b/tmtc index b06211d0..598635ee 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit b06211d0865f5d904572635340303d8b4aec30eb +Subproject commit 598635ee4fb1eb246980564ae9f3a0feb1f4da30 From ab4b39791881f63ad37090bd0d58513123afaf3e Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 29 Jan 2022 12:42:40 +0100 Subject: [PATCH 03/61] some fixed after blob set was removed --- .../startracker/StarTrackerHandler.cpp | 9 +- .../startracker/StarTrackerJsonCommands.cpp | 103 ------------------ .../startracker/StarTrackerJsonCommands.h | 16 --- 3 files changed, 2 insertions(+), 126 deletions(-) diff --git a/bsp_q7s/devices/startracker/StarTrackerHandler.cpp b/bsp_q7s/devices/startracker/StarTrackerHandler.cpp index 0ca02118..96c47fe9 100644 --- a/bsp_q7s/devices/startracker/StarTrackerHandler.cpp +++ b/bsp_q7s/devices/startracker/StarTrackerHandler.cpp @@ -35,7 +35,6 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, downloadBlobPixel(this), cameraSet(this), limitsSet(this), - blobSet(this), strHelper(strHelper) { if (comCookie == nullptr) { sif::error << "StarTrackerHandler: Invalid com cookie" << std::endl; @@ -515,10 +514,6 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi result = prepareRequestLimitsParams(); return result; } - case (StarTracker::REQ_BLOB_PARAMS): { - result = prepareRequestBlobParams(); - return result; - } default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -561,6 +556,8 @@ void StarTrackerHandler::fillCommandAndReplyMap() { StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::CAMERA, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::CAMERA, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::CENTROIDING, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::LISA, 3, nullptr, @@ -601,8 +598,6 @@ void StarTrackerHandler::fillCommandAndReplyMap() { StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::REQ_LIMITS, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_BLOB_PARAMS, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); } ReturnValue_t StarTrackerHandler::scanForReply(const uint8_t* start, size_t remainingSize, diff --git a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp b/bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp index 4b675e93..c9d09a96 100644 --- a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp +++ b/bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp @@ -350,109 +350,6 @@ ReturnValue_t Camera::createCommand(uint8_t* buffer) { return RETURN_OK; } -Blob::Blob() : ArcsecJsonParamBase(arcseckeys::BLOB) {} - -size_t Blob::getSize() { return COMMAND_SIZE; } - -ReturnValue_t Blob::createCommand(uint8_t* buffer) { - ReturnValue_t result = RETURN_OK; - uint8_t offset = 0; - std::string param; - addSetParamHeader(buffer, StarTracker::ID::BLOB); - offset = 2; - result = getParam(arcseckeys::MODE, param); - if (result != RETURN_OK) { - return result; - } - adduint8(param, buffer + offset); - offset += sizeof(uint8_t); - result = getParam(arcseckeys::MIN_VALUE, param); - if (result != RETURN_OK) { - return result; - } - adduint8(param, buffer + offset); - offset += sizeof(uint8_t); - result = getParam(arcseckeys::MIN_DISTANCE, param); - if (result != RETURN_OK) { - return result; - } - adduint8(param, buffer + offset); - offset += sizeof(uint8_t); - result = getParam(arcseckeys::NEIGHBOUR_DISTANCE, param); - if (result != RETURN_OK) { - return result; - } - adduint8(param, buffer + offset); - offset += sizeof(uint8_t); - result = getParam(arcseckeys::NEIGHBOUR_BRIGHT_PIXELS, param); - if (result != RETURN_OK) { - return result; - } - adduint8(param, buffer + offset); - offset += sizeof(uint8_t); - result = getParam(arcseckeys::MIN_TOTAL_VALUE, param); - if (result != RETURN_OK) { - return result; - } - adduint16(param, buffer + offset); - offset += sizeof(uint16_t); - result = getParam(arcseckeys::MAX_TOTAL_VALUE, param); - if (result != RETURN_OK) { - return result; - } - adduint16(param, buffer + offset); - offset += sizeof(uint16_t); - result = getParam(arcseckeys::MIN_BRIGHT_NEIGHBOURS, param); - if (result != RETURN_OK) { - return result; - } - adduint16(param, buffer + offset); - offset += sizeof(uint16_t); - result = getParam(arcseckeys::MAX_BRIGHT_NEIGHBOURS, param); - if (result != RETURN_OK) { - return result; - } - adduint16(param, buffer + offset); - offset += sizeof(uint16_t); - result = getParam(arcseckeys::MAX_PIXEL_TO_CONSIDER, param); - if (result != RETURN_OK) { - return result; - } - adduint32(param, buffer + offset); - offset += sizeof(uint32_t); - result = getParam(arcseckeys::SIGNAL_THRESHOLD, param); - if (result != RETURN_OK) { - return result; - } - adduint8(param, buffer + offset); - offset += sizeof(uint8_t); - result = getParam(arcseckeys::BLOB_DARK_THRESHOLD, param); - if (result != RETURN_OK) { - return result; - } - adduint8(param, buffer + offset); - offset += sizeof(uint8_t); - result = getParam(arcseckeys::ENABLE_HISTOGRAM, param); - if (result != RETURN_OK) { - return result; - } - adduint8(param, buffer + offset); - offset += sizeof(uint8_t); - result = getParam(arcseckeys::ENABLE_CONTRAST, param); - if (result != RETURN_OK) { - return result; - } - adduint8(param, buffer + offset); - offset += sizeof(uint8_t); - result = getParam(arcseckeys::BIN_MODE, param); - if (result != RETURN_OK) { - return result; - } - adduint8(param, buffer + offset); - offset += sizeof(uint8_t); - return RETURN_OK; -} - Centroiding::Centroiding() : ArcsecJsonParamBase(arcseckeys::CENTROIDING) {} size_t Centroiding::getSize() { return COMMAND_SIZE; } diff --git a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.h b/bsp_q7s/devices/startracker/StarTrackerJsonCommands.h index eef4c57e..0c6c1b99 100644 --- a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.h +++ b/bsp_q7s/devices/startracker/StarTrackerJsonCommands.h @@ -92,22 +92,6 @@ class Camera : public ArcsecJsonParamBase { ReturnValue_t createCommand(uint8_t* buffer) override; }; -/** - * @brief Generates the command to configure the blob algorithm - * - */ -class Blob : public ArcsecJsonParamBase { - public: - Blob(); - - size_t getSize(); - - private: - static const size_t COMMAND_SIZE = 24; - - ReturnValue_t createCommand(uint8_t* buffer) override; -}; - /** * @brief Generates the command to configure the centroiding algorithm * From 4edbbf223c7e5f3569cc9fb347bcfb13ab23cb74 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 1 Feb 2022 11:45:22 +0100 Subject: [PATCH 04/61] firmware update wip --- .../devices/startracker/StarTrackerHandler.h | 7 +++- bsp_q7s/devices/startracker/StrHelper.cpp | 42 ++++++++++++------- bsp_q7s/devices/startracker/StrHelper.h | 38 ++++++++++------- linux/fsfwconfig/OBSWConfig.h.in | 1 + 4 files changed, 58 insertions(+), 30 deletions(-) diff --git a/bsp_q7s/devices/startracker/StarTrackerHandler.h b/bsp_q7s/devices/startracker/StarTrackerHandler.h index 235663a4..bcec92ce 100644 --- a/bsp_q7s/devices/startracker/StarTrackerHandler.h +++ b/bsp_q7s/devices/startracker/StarTrackerHandler.h @@ -269,8 +269,11 @@ class StarTrackerHandler : public DeviceHandlerBase { // Countdown to insert delay for star tracker to switch from bootloader to firmware program Countdown bootCountdown; - std::string paramJsonFile = "/mnt/sd0/startracker/full.json"; - +#if OBSW_STAR_TRACKER_GROUND_CONFIG == 1 + std::string paramJsonFile = "/mnt/sd0/startracker/ground-config.json"; +#else + std::string paramJsonFile = "/mnt/sd0/startracker/flight-config.json"; +#endif enum class InternalState { TEMPERATURE_REQUEST }; InternalState internalState = InternalState::TEMPERATURE_REQUEST; diff --git a/bsp_q7s/devices/startracker/StrHelper.cpp b/bsp_q7s/devices/startracker/StrHelper.cpp index 417ea248..a37d5a38 100644 --- a/bsp_q7s/devices/startracker/StrHelper.cpp +++ b/bsp_q7s/devices/startracker/StrHelper.cpp @@ -48,16 +48,6 @@ ReturnValue_t StrHelper::performOperation(uint8_t operationCode) { internalState = InternalState::IDLE; break; } - case InternalState::FLASH_WRITE: { - result = performFlashWrite(); - if (result == RETURN_OK) { - triggerEvent(FLASH_WRITE_SUCCESSFUL); - } else { - triggerEvent(FLASH_WRITE_FAILED); - } - internalState = InternalState::IDLE; - break; - } case InternalState::FLASH_READ: { result = performFlashRead(); if (result == RETURN_OK) { @@ -88,6 +78,16 @@ ReturnValue_t StrHelper::performOperation(uint8_t operationCode) { internalState = InternalState::IDLE; break; } + case InternalState::FIRMWARE_UPDATE: { + result = performFirmwareUpdate(); + if (result == RETURN_OK) { + triggerEvent(FIRMWARE_UPDATE_SUCCESSFUL); + } else { + triggerEvent(FIRMWARE_UPDATE_FAILED); + } + internalState = InternalState::IDLE; + break; + } default: sif::debug << "StrHelper::performOperation: Invalid state" << std::endl; break; @@ -144,7 +144,7 @@ void StrHelper::setFlashReadFilename(std::string filename) { flashRead.filename void StrHelper::setDownloadFpgaImage(std::string filename) { fpgaDownload.fileName = filename; } -ReturnValue_t StrHelper::startFlashWrite(std::string fullname, uint8_t region, uint32_t address) { +ReturnValue_t StrHelper::startFirmwareUpdate(std::string fullname) { ReturnValue_t result = checkPath(fullname); if (result != RETURN_OK) { return result; @@ -153,9 +153,9 @@ ReturnValue_t StrHelper::startFlashWrite(std::string fullname, uint8_t region, u if (not std::filesystem::exists(flashWrite.fullname)) { return FILE_NOT_EXISTS; } - flashWrite.address = address; - flashWrite.region = region; - internalState = InternalState::FLASH_WRITE; + flashWrite.address = 0; + flashWrite.region = static_cast(RegionId::MAIN_FIRMWARE_SECTION); + internalState = InternalState::FIRMWARE_UPDATE; semaphore.release(); terminate = false; return RETURN_OK; @@ -316,6 +316,20 @@ ReturnValue_t StrHelper::performImageUpload() { return RETURN_OK; } +ReturnValue_t StrHelper::performFirmwareUpdate() { + ReturnValue_t result = RETURN_OK; + result = unlock(flashWrite.region); + if (result != RETURN_OK) { + return result; + } + eraseF(flashWrite.region); + if (result != RETURN_OK) { + return result; + } + result = performFlashWrite(); + return result; +} + ReturnValue_t StrHelper::performFlashWrite() { ReturnValue_t result = RETURN_OK; uint32_t size = 0; diff --git a/bsp_q7s/devices/startracker/StrHelper.h b/bsp_q7s/devices/startracker/StrHelper.h index 77fe7d2a..0e19bca7 100644 --- a/bsp_q7s/devices/startracker/StrHelper.h +++ b/bsp_q7s/devices/startracker/StrHelper.h @@ -48,37 +48,41 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu static const Event FPGA_UPLOAD_SUCCESSFUL = MAKE_EVENT(10, severity::LOW); //! [EXPORT] : [COMMENT] Upload of FPGA image failed static const Event FPGA_UPLOAD_FAILED = MAKE_EVENT(11, severity::LOW); + //! [EXPORT] : [COMMENT] Firmware update was successful + static const Event FIRMWARE_UPDATE_SUCCESSFUL = MAKE_EVENT(12, severity::LOW); + //! [EXPORT] : [COMMENT] Firmware update failed + static const Event FIRMWARE_UPDATE_FAILED = MAKE_EVENT(13, severity::LOW); //! [EXPORT] : [COMMENT] Failed to read communication interface reply data //! P1: Return code of failed communication interface read call //! P1: Upload/download position for which the read call failed - static const Event STR_HELPER_READING_REPLY_FAILED = MAKE_EVENT(12, severity::LOW); + static const Event STR_HELPER_READING_REPLY_FAILED = MAKE_EVENT(14, severity::LOW); //! [EXPORT] : [COMMENT] Unexpected stop of decoding sequence //! P1: Return code of failed communication interface read call //! P1: Upload/download position for which the read call failed - static const Event STR_HELPER_COM_ERROR = MAKE_EVENT(13, severity::LOW); + static const Event STR_HELPER_COM_ERROR = MAKE_EVENT(15, severity::LOW); //! [EXPORT] : [COMMENT] Star tracker did not send replies (maybe device is powered off) //! P1: Position of upload or download packet for which no reply was sent - static const Event STR_HELPER_NO_REPLY = MAKE_EVENT(14, severity::LOW); + static const Event STR_HELPER_NO_REPLY = MAKE_EVENT(16, severity::LOW); //! [EXPORT] : [COMMENT] Error during decoding of received reply occurred // P1: Return value of decoding function // P2: Position of upload/download packet, or address of flash write/read request - static const Event STR_HELPER_DEC_ERROR = MAKE_EVENT(15, severity::LOW); + static const Event STR_HELPER_DEC_ERROR = MAKE_EVENT(17, severity::LOW); //! [EXPORT] : [COMMENT] Position mismatch //! P1: The expected position and thus the position for which the image upload/download failed - static const Event POSITION_MISMATCH = MAKE_EVENT(16, severity::LOW); + static const Event POSITION_MISMATCH = MAKE_EVENT(18, severity::LOW); //! [EXPORT] : [COMMENT] Specified file does not exist //! P1: Internal state of str helper - static const Event STR_HELPER_FILE_NOT_EXISTS = MAKE_EVENT(17, severity::LOW); + static const Event STR_HELPER_FILE_NOT_EXISTS = MAKE_EVENT(19, severity::LOW); //! [EXPORT] : [COMMENT] Sending packet to star tracker failed //! P1: Return code of communication interface sendMessage function //! P2: Position of upload/download packet, or address of flash write/read request for which //! sending failed - static const Event STR_HELPER_SENDING_PACKET_FAILED = MAKE_EVENT(18, severity::LOW); + static const Event STR_HELPER_SENDING_PACKET_FAILED = MAKE_EVENT(20, severity::LOW); //! [EXPORT] : [COMMENT] Communication interface requesting reply failed //! P1: Return code of failed request //! P1: Upload/download position, or address of flash write/read request for which transmission //! failed - static const Event STR_HELPER_REQUESTING_MSG_FAILED = MAKE_EVENT(19, severity::LOW); + static const Event STR_HELPER_REQUESTING_MSG_FAILED = MAKE_EVENT(21, severity::LOW); StrHelper(object_id_t objectId); virtual ~StrHelper(); @@ -105,13 +109,12 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu ReturnValue_t startImageDownload(std::string path); /** - * @brief Starts the flash write procedure + * @brief Will start the firmware update * - * @param fullname Full name including absolute path of file to write to flash - * @param region Region ID of flash region to write to - * @param address Start address of flash write procedure + * @param fullname Full name including absolute path of file containing firmware + * update. */ - ReturnValue_t startFlashWrite(std::string fullname, uint8_t region, uint32_t address); + ReturnValue_t startFirmwareUpdate(std::string fullname); /** * @brief Starts the flash read procedure @@ -234,7 +237,8 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu FLASH_WRITE, FLASH_READ, DOWNLOAD_FPGA_IMAGE, - UPLOAD_FPGA_IMAGE + UPLOAD_FPGA_IMAGE, + FIRMWARE_UPDATE }; InternalState internalState = InternalState::IDLE; @@ -287,6 +291,12 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu }; FlashRead flashRead; + enum class RegionId : uint8_t { + BOOTLOADER_SECTION = 0, + MAIN_FIRMWARE_SECTION = 1, + ARC_CONFIG_SECTION = 2, + }; + SdCardManager* sdcMan = nullptr; uint8_t commandBuffer[StarTracker::MAX_FRAME_SIZE]; diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index c3caf1a9..3162eeb1 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -54,6 +54,7 @@ debugging. */ #define OBSW_ADD_SYRLINKS 0 #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 #define OBSW_SYRLINKS_SIMULATED 1 +#define OBSW_STAR_TRACKER_GROUND_CONFIG 1 #endif From 18d018b7d744481b7b6330122f68521632355ea5 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 4 Feb 2022 13:06:56 +0100 Subject: [PATCH 05/61] firmware update wip --- .../startracker/StarTrackerDefinitions.h | 52 +- .../startracker/StarTrackerHandler.cpp | 1010 ++++++++--------- .../devices/startracker/StarTrackerHandler.h | 32 +- bsp_q7s/devices/startracker/StrHelper.cpp | 46 +- bsp_q7s/devices/startracker/StrHelper.h | 24 +- fsfw | 2 +- 6 files changed, 624 insertions(+), 542 deletions(-) diff --git a/bsp_q7s/devices/startracker/StarTrackerDefinitions.h b/bsp_q7s/devices/startracker/StarTrackerDefinitions.h index dda013b2..0c04e1c5 100644 --- a/bsp_q7s/devices/startracker/StarTrackerDefinitions.h +++ b/bsp_q7s/devices/startracker/StarTrackerDefinitions.h @@ -9,7 +9,7 @@ #include "objects/systemObjectList.h" -namespace StarTracker { +namespace startracker { /** This is the address of the star tracker */ static const uint8_t ADDRESS = 33; @@ -373,6 +373,56 @@ static const uint8_t BOOTLOADER = 1; static const uint8_t FIRMWARE = 2; } // namespace Program +namespace region_secrets { + static const uint32_t REGION_0_SECRET = 0xd1a220d3; + static const uint32_t REGION_1_SECRET = 0xdc770fa8; + static const uint32_t REGION_2_SECRET = 0xdf9066b0; + static const uint32_t REGION_3_SECRET = 0x5f6a0423; + static const uint32_t REGION_4_SECRET = 0xbbaad5d8; + static const uint32_t REGION_5_SECRET = 0xa81c3678; + static const uint32_t REGION_6_SECRET = 0xe10f76f8; + static const uint32_t REGION_7_SECRET = 0x83220919; + static const uint32_t REGION_8_SECRET = 0xec37289d; + static const uint32_t REGION_9_SECRET = 0x27ac0ef8; + static const uint32_t REGION_10_SECRET = 0xf017e43d; + static const uint32_t REGION_11_SECRET = 0xbc7f7f49; + static const uint32_t REGION_12_SECRET = 0x42fedef6; + static const uint32_t REGION_13_SECRET = 0xe53cf10d; + static const uint32_t REGION_14_SECRET = 0xe862b70b; + static const uint32_t REGION_15_SECRET = 0x79b537ca; + uint32_t secret[16] { + REGION_0_SECRET, + REGION_1_SECRET, + REGION_2_SECRET, + REGION_3_SECRET, + REGION_4_SECRET, + REGION_5_SECRET, + REGION_6_SECRET, + REGION_7_SECRET, + REGION_8_SECRET, + REGION_9_SECRET, + REGION_10_SECRET, + REGION_11_SECRET, + REGION_12_SECRET, + REGION_13_SECRET, + REGION_14_SECRET, + REGION_15_SECRET + }; +} + +enum class FlashSections: uint8_t { + BOOTLOADER_SECTION = 0, + MAIN_FIRMWARE_SECTION = 1, + ARC_CONFIG_SECTION = 2 +}; + +enum class FirmwareRegions: uint32_t { + START = 1, + END = 8 +}; + +static const uint32_t FLASH_REGION_SIZE = 0x20000; + /** * @brief This dataset can be used to store the temperature of a reaction wheel. */ diff --git a/bsp_q7s/devices/startracker/StarTrackerHandler.cpp b/bsp_q7s/devices/startracker/StarTrackerHandler.cpp index c0db5089..95cf4d21 100644 --- a/bsp_q7s/devices/startracker/StarTrackerHandler.cpp +++ b/bsp_q7s/devices/startracker/StarTrackerHandler.cpp @@ -91,11 +91,11 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu ReturnValue_t result = RETURN_OK; switch (actionId) { - case (StarTracker::STOP_IMAGE_LOADER): { + case (startracker::STOP_IMAGE_LOADER): { strHelper->stopProcess(); return EXECUTION_FINISHED; } - case (StarTracker::SET_JSON_FILE_NAME): { + case (startracker::SET_JSON_FILE_NAME): { if (size > MAX_PATH_SIZE) { return FILE_PATH_TOO_LONG; } @@ -117,7 +117,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu // Intercept image loader commands which do not follow the common DHB communication flow switch (actionId) { - case (StarTracker::UPLOAD_IMAGE): { + case (startracker::UPLOAD_IMAGE): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -132,7 +132,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu strHelperExecuting = true; return EXECUTION_FINISHED; } - case (StarTracker::DOWNLOAD_IMAGE): { + case (startracker::DOWNLOAD_IMAGE): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -148,7 +148,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu strHelperExecuting = true; return EXECUTION_FINISHED; } - case (StarTracker::WRITE): { + case (startracker::WRITE): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -161,7 +161,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu strHelperExecuting = true; return EXECUTION_FINISHED; } - case (StarTracker::READ): { + case (startracker::READ): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -173,28 +173,28 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu strHelperExecuting = true; return EXECUTION_FINISHED; } - case (StarTracker::CHANGE_DOWNLOAD_FILE): { + case (startracker::CHANGE_DOWNLOAD_FILE): { if (size > MAX_FILE_NAME) { return FILENAME_TOO_LONG; } strHelper->setDownloadImageName(std::string(reinterpret_cast(data), size)); return EXECUTION_FINISHED; } - case (StarTracker::CHANGE_FPGA_DOWNLOAD_FILE): { + case (startracker::CHANGE_FPGA_DOWNLOAD_FILE): { if (size > MAX_FILE_NAME) { return FILENAME_TOO_LONG; } strHelper->setDownloadFpgaImage(std::string(reinterpret_cast(data), size)); return EXECUTION_FINISHED; } - case (StarTracker::SET_READ_FILENAME): { + case (startracker::SET_READ_FILENAME): { if (size > MAX_FILE_NAME) { return FILENAME_TOO_LONG; } strHelper->setDownloadImageName(std::string(reinterpret_cast(data), size)); return EXECUTION_FINISHED; } - case (StarTracker::DOWNLOAD_FPGA_IMAGE): { + case (startracker::DOWNLOAD_FPGA_IMAGE): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -209,7 +209,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu strHelperExecuting = true; return EXECUTION_FINISHED; } - case (StarTracker::UPLOAD_FPGA_IMAGE): { + case (startracker::UPLOAD_FPGA_IMAGE): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -275,7 +275,7 @@ void StarTrackerHandler::doOffActivity() { startupState = StartupState::IDLE; } ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { switch (internalState) { case InternalState::TEMPERATURE_REQUEST: - *id = StarTracker::REQ_TEMPERATURE; + *id = startracker::REQ_TEMPERATURE; break; default: sif::debug << "StarTrackerHandler::buildNormalDeviceCommand: Invalid internal step" @@ -291,62 +291,62 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t } switch (startupState) { case StartupState::CHECK_BOOT_STATE: - *id = StarTracker::REQ_VERSION; + *id = startracker::REQ_VERSION; startupState = StartupState::WAIT_FOR_EXECUTION; return buildCommandFromCommand(*id, nullptr, 0); case StartupState::BOOT: - *id = StarTracker::BOOT; + *id = startracker::BOOT; bootCountdown.setTimeout(BOOT_TIMEOUT); startupState = StartupState::BOOT_DELAY; return buildCommandFromCommand(*id, nullptr, 0); case StartupState::LIMITS: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = StarTracker::LIMITS; + *id = startracker::LIMITS; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::TRACKING: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = StarTracker::TRACKING; + *id = startracker::TRACKING; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::MOUNTING: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = StarTracker::MOUNTING; + *id = startracker::MOUNTING; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::IMAGE_PROCESSOR: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = StarTracker::IMAGE_PROCESSOR; + *id = startracker::IMAGE_PROCESSOR; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::CAMERA: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = StarTracker::CAMERA; + *id = startracker::CAMERA; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::CENTROIDING: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = StarTracker::CENTROIDING; + *id = startracker::CENTROIDING; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::LISA: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = StarTracker::LISA; + *id = startracker::LISA; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::MATCHING: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = StarTracker::MATCHING; + *id = startracker::MATCHING; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::VALIDATION: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = StarTracker::VALIDATION; + *id = startracker::VALIDATION; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::ALGO: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = StarTracker::ALGO; + *id = startracker::ALGO; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); default: @@ -360,157 +360,157 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi size_t commandDataLen) { ReturnValue_t result = RETURN_OK; switch (deviceCommand) { - case (StarTracker::PING_REQUEST): { + case (startracker::PING_REQUEST): { preparePingRequest(); return RETURN_OK; } - case (StarTracker::REQ_TIME): { + case (startracker::REQ_TIME): { prepareTimeRequest(); return RETURN_OK; } - case (StarTracker::BOOT): { + case (startracker::BOOT): { prepareBootCommand(); return RETURN_OK; } - case (StarTracker::REQ_VERSION): { + case (startracker::REQ_VERSION): { prepareVersionRequest(); return RETURN_OK; } - case (StarTracker::REQ_INTERFACE): { + case (startracker::REQ_INTERFACE): { prepareInterfaceRequest(); return RETURN_OK; } - case (StarTracker::REQ_POWER): { + case (startracker::REQ_POWER): { preparePowerRequest(); return RETURN_OK; } - case (StarTracker::SWITCH_TO_BOOTLOADER_PROGRAM): { + case (startracker::SWITCH_TO_BOOTLOADER_PROGRAM): { prepareRebootCommand(); return RETURN_OK; } - case (StarTracker::TAKE_IMAGE): { + case (startracker::TAKE_IMAGE): { prepareTakeImageCommand(commandData); return RETURN_OK; } - case (StarTracker::SUBSCRIBE_TO_TM): { + case (startracker::SUBSCRIBE_TO_TM): { prepareSubscriptionCommand(commandData); return RETURN_OK; } - case (StarTracker::REQ_SOLUTION): { + case (startracker::REQ_SOLUTION): { prepareSolutionRequest(); return RETURN_OK; } - case (StarTracker::REQ_TEMPERATURE): { + case (startracker::REQ_TEMPERATURE): { prepareTemperatureRequest(); return RETURN_OK; } - case (StarTracker::REQ_HISTOGRAM): { + case (startracker::REQ_HISTOGRAM): { prepareHistogramRequest(); return RETURN_OK; } - case (StarTracker::REQ_CONTRAST): { + case (startracker::REQ_CONTRAST): { prepareContrastRequest(); return RETURN_OK; } - case (StarTracker::RESET_ERROR): { + case (startracker::RESET_ERROR): { prepareErrorResetRequest(); return RETURN_OK; } - case (StarTracker::LIMITS): { + case (startracker::LIMITS): { Limits limits; result = prepareParamCommand(commandData, commandDataLen, limits); return result; } - case (StarTracker::MOUNTING): { + case (startracker::MOUNTING): { Mounting mounting; result = prepareParamCommand(commandData, commandDataLen, mounting); return result; } - case (StarTracker::IMAGE_PROCESSOR): { + case (startracker::IMAGE_PROCESSOR): { ImageProcessor imageProcessor; result = prepareParamCommand(commandData, commandDataLen, imageProcessor); return result; } - case (StarTracker::CAMERA): { + case (startracker::CAMERA): { Camera camera; result = prepareParamCommand(commandData, commandDataLen, camera); return result; } - case (StarTracker::CENTROIDING): { + case (startracker::CENTROIDING): { Centroiding centroiding; result = prepareParamCommand(commandData, commandDataLen, centroiding); return result; } - case (StarTracker::LISA): { + case (startracker::LISA): { Lisa lisa; result = prepareParamCommand(commandData, commandDataLen, lisa); return result; } - case (StarTracker::MATCHING): { + case (startracker::MATCHING): { Matching matching; result = prepareParamCommand(commandData, commandDataLen, matching); return result; } - case (StarTracker::VALIDATION): { + case (startracker::VALIDATION): { Validation validation; result = prepareParamCommand(commandData, commandDataLen, validation); return result; } - case (StarTracker::ALGO): { + case (startracker::ALGO): { Algo algo; result = prepareParamCommand(commandData, commandDataLen, algo); return result; } - case (StarTracker::TRACKING): { + case (startracker::TRACKING): { Tracking tracking; result = prepareParamCommand(commandData, commandDataLen, tracking); return result; } - case (StarTracker::ERASE): { + case (startracker::ERASE): { result = prepareEraseCommand(commandData, commandDataLen); return result; } - case (StarTracker::UNLOCK): { + case (startracker::UNLOCK): { result = prepareUnlockCommand(commandData, commandDataLen); return result; } - case (StarTracker::CHECKSUM): { + case (startracker::CHECKSUM): { result = prepareChecksumCommand(commandData, commandDataLen); return result; } - case (StarTracker::SET_TIME): { + case (startracker::SET_TIME): { result = prepareSetTimeCommand(commandData, commandDataLen); return result; } - case (StarTracker::DOWNLOAD_CENTROID): { + case (startracker::DOWNLOAD_CENTROID): { result = prepareDownloadCentroidCommand(commandData, commandDataLen); return result; } - case (StarTracker::UPLOAD_CENTROID): { + case (startracker::UPLOAD_CENTROID): { result = prepareUploadCentroidCommand(commandData, commandDataLen); return result; } - case (StarTracker::DOWNLOAD_MATCHED_STAR): { + case (startracker::DOWNLOAD_MATCHED_STAR): { result = prepareDownloadMatchedStarCommand(commandData, commandDataLen); return result; } - case (StarTracker::DOWNLOAD_DBIMAGE): { + case (startracker::DOWNLOAD_DBIMAGE): { result = prepareDownloadDbImageCommand(commandData, commandDataLen); return result; } - case (StarTracker::DOWNLOAD_BLOBPIXEL): { + case (startracker::DOWNLOAD_BLOBPIXEL): { result = prepareDownloadBlobPixelCommand(commandData, commandDataLen); return result; } - case (StarTracker::FPGA_ACTION): { + case (startracker::FPGA_ACTION): { result = prepareFpgaActionCommand(commandData, commandDataLen); return result; } - case (StarTracker::REQ_CAMERA): { + case (startracker::REQ_CAMERA): { result = prepareRequestCameraParams(); return result; } - case (StarTracker::REQ_LIMITS): { + case (startracker::REQ_LIMITS): { result = prepareRequestLimitsParams(); return result; } @@ -523,81 +523,81 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi void StarTrackerHandler::fillCommandAndReplyMap() { /** Reply lengths are unknown because of the slip encoding. Thus always maximum reply size * is specified */ - this->insertInCommandAndReplyMap(StarTracker::PING_REQUEST, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandMap(StarTracker::BOOT); - this->insertInCommandAndReplyMap(StarTracker::REQ_VERSION, 3, &versionSet, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_TIME, 3, &timeSet, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandMap(StarTracker::UPLOAD_IMAGE); - this->insertInCommandMap(StarTracker::DOWNLOAD_IMAGE); - this->insertInCommandAndReplyMap(StarTracker::REQ_POWER, 3, &powerSet, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_INTERFACE, 3, &interfaceSet, - StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::PING_REQUEST, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandMap(startracker::BOOT); + this->insertInCommandAndReplyMap(startracker::REQ_VERSION, 3, &versionSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_TIME, 3, &timeSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandMap(startracker::UPLOAD_IMAGE); + this->insertInCommandMap(startracker::DOWNLOAD_IMAGE); + this->insertInCommandAndReplyMap(startracker::REQ_POWER, 3, &powerSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_INTERFACE, 3, &interfaceSet, + startracker::MAX_FRAME_SIZE * 2 + 2); // Reboot has no reply. Star tracker reboots immediately - this->insertInCommandMap(StarTracker::SWITCH_TO_BOOTLOADER_PROGRAM); - this->insertInCommandAndReplyMap(StarTracker::SUBSCRIBE_TO_TM, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_SOLUTION, 3, &solutionSet, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_TEMPERATURE, 3, &temperatureSet, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_HISTOGRAM, 3, &histogramSet, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_CONTRAST, 3, &contrastSet, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::LIMITS, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::MOUNTING, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::IMAGE_PROCESSOR, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::CAMERA, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::CAMERA, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::CENTROIDING, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::LISA, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::MATCHING, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::TRACKING, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::VALIDATION, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::ALGO, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::TAKE_IMAGE, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::RESET_ERROR, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::ERASE, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::UNLOCK, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::CHECKSUM, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::SET_TIME, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::DOWNLOAD_CENTROID, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::UPLOAD_CENTROID, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::DOWNLOAD_MATCHED_STAR, 3, &downloadMatchedStar, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::DOWNLOAD_DBIMAGE, 3, &downloadDbImage, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::DOWNLOAD_BLOBPIXEL, 3, &downloadBlobPixel, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::FPGA_ACTION, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_CAMERA, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_LIMITS, 3, nullptr, - StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandMap(startracker::SWITCH_TO_BOOTLOADER_PROGRAM); + this->insertInCommandAndReplyMap(startracker::SUBSCRIBE_TO_TM, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_SOLUTION, 3, &solutionSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_TEMPERATURE, 3, &temperatureSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_HISTOGRAM, 3, &histogramSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_CONTRAST, 3, &contrastSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::LIMITS, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::MOUNTING, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::IMAGE_PROCESSOR, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::CAMERA, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::CAMERA, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::CENTROIDING, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::LISA, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::MATCHING, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::TRACKING, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::VALIDATION, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::ALGO, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::TAKE_IMAGE, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::RESET_ERROR, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::ERASE, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::UNLOCK, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::CHECKSUM, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::SET_TIME, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::DOWNLOAD_CENTROID, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::UPLOAD_CENTROID, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::DOWNLOAD_MATCHED_STAR, 3, &downloadMatchedStar, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::DOWNLOAD_DBIMAGE, 3, &downloadDbImage, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::DOWNLOAD_BLOBPIXEL, 3, &downloadBlobPixel, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::FPGA_ACTION, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_CAMERA, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_LIMITS, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); } ReturnValue_t StarTrackerHandler::scanForReply(const uint8_t* start, size_t remainingSize, @@ -658,57 +658,57 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, ReturnValue_t result = RETURN_OK; switch (id) { - case (StarTracker::SUBSCRIBE_TO_TM): { + case (startracker::SUBSCRIBE_TO_TM): { result = handleSetParamReply(); break; } - case (StarTracker::REQ_TIME): { - result = handleTm(timeSet, StarTracker::TimeSet::SIZE); + case (startracker::REQ_TIME): { + result = handleTm(timeSet, startracker::TimeSet::SIZE); break; } - case (StarTracker::PING_REQUEST): { + case (startracker::PING_REQUEST): { result = handlePingReply(); break; } - case (StarTracker::BOOT): - case (StarTracker::TAKE_IMAGE): - case (StarTracker::RESET_ERROR): - case (StarTracker::UNLOCK): - case (StarTracker::SET_TIME): - case (StarTracker::FPGA_ACTION): { + case (startracker::BOOT): + case (startracker::TAKE_IMAGE): + case (startracker::RESET_ERROR): + case (startracker::UNLOCK): + case (startracker::SET_TIME): + case (startracker::FPGA_ACTION): { result = handleActionReply(); break; } - case (StarTracker::DOWNLOAD_CENTROID): { - result = handleActionReplySet(downloadCentroidSet, StarTracker::DownloadCentroidSet::SIZE); + case (startracker::DOWNLOAD_CENTROID): { + result = handleActionReplySet(downloadCentroidSet, startracker::DownloadCentroidSet::SIZE); break; } - case (StarTracker::DOWNLOAD_MATCHED_STAR): { - result = handleActionReplySet(downloadMatchedStar, StarTracker::DownloadMatchedStar::SIZE); + case (startracker::DOWNLOAD_MATCHED_STAR): { + result = handleActionReplySet(downloadMatchedStar, startracker::DownloadMatchedStar::SIZE); break; } - case (StarTracker::DOWNLOAD_DBIMAGE): { - result = handleActionReplySet(downloadDbImage, StarTracker::DownloadDBImage::SIZE); + case (startracker::DOWNLOAD_DBIMAGE): { + result = handleActionReplySet(downloadDbImage, startracker::DownloadDBImage::SIZE); break; } - case (StarTracker::DOWNLOAD_BLOBPIXEL): { - result = handleActionReplySet(downloadBlobPixel, StarTracker::DownloadBlobPixel::SIZE); + case (startracker::DOWNLOAD_BLOBPIXEL): { + result = handleActionReplySet(downloadBlobPixel, startracker::DownloadBlobPixel::SIZE); break; } - case (StarTracker::UPLOAD_CENTROID): { + case (startracker::UPLOAD_CENTROID): { result = handleUploadCentroidReply(); break; } - case (StarTracker::ERASE): { + case (startracker::ERASE): { result = handleEraseReply(); break; } - case (StarTracker::CHECKSUM): { + case (startracker::CHECKSUM): { result = handleChecksumReply(); break; } - case (StarTracker::REQ_VERSION): { - result = handleTm(versionSet, StarTracker::VersionSet::SIZE); + case (startracker::REQ_VERSION): { + result = handleTm(versionSet, startracker::VersionSet::SIZE); if (result != RETURN_OK) { return result; } @@ -718,49 +718,49 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, } break; } - case (StarTracker::REQ_INTERFACE): { - result = handleTm(interfaceSet, StarTracker::InterfaceSet::SIZE); + case (startracker::REQ_INTERFACE): { + result = handleTm(interfaceSet, startracker::InterfaceSet::SIZE); break; } - case (StarTracker::REQ_POWER): { - result = handleTm(powerSet, StarTracker::PowerSet::SIZE); + case (startracker::REQ_POWER): { + result = handleTm(powerSet, startracker::PowerSet::SIZE); break; } - case (StarTracker::REQ_SOLUTION): { - result = handleTm(solutionSet, StarTracker::SolutionSet::SIZE); + case (startracker::REQ_SOLUTION): { + result = handleTm(solutionSet, startracker::SolutionSet::SIZE); break; } - case (StarTracker::REQ_TEMPERATURE): { - result = handleTm(temperatureSet, StarTracker::TemperatureSet::SIZE); + case (startracker::REQ_TEMPERATURE): { + result = handleTm(temperatureSet, startracker::TemperatureSet::SIZE); break; } - case (StarTracker::REQ_HISTOGRAM): { - result = handleTm(histogramSet, StarTracker::HistogramSet::SIZE); + case (startracker::REQ_HISTOGRAM): { + result = handleTm(histogramSet, startracker::HistogramSet::SIZE); break; } - case (StarTracker::REQ_CONTRAST): { - result = handleTm(contrastSet, StarTracker::ContrastSet::SIZE); + case (startracker::REQ_CONTRAST): { + result = handleTm(contrastSet, startracker::ContrastSet::SIZE); break; } - case (StarTracker::LIMITS): - case (StarTracker::MOUNTING): - case (StarTracker::CAMERA): - case (StarTracker::CENTROIDING): - case (StarTracker::LISA): - case (StarTracker::MATCHING): - case (StarTracker::TRACKING): - case (StarTracker::VALIDATION): - case (StarTracker::IMAGE_PROCESSOR): - case (StarTracker::ALGO): { + case (startracker::LIMITS): + case (startracker::MOUNTING): + case (startracker::CAMERA): + case (startracker::CENTROIDING): + case (startracker::LISA): + case (startracker::MATCHING): + case (startracker::TRACKING): + case (startracker::VALIDATION): + case (startracker::IMAGE_PROCESSOR): + case (startracker::ALGO): { result = handleSetParamReply(); break; } - case (StarTracker::REQ_CAMERA): { - handleParamRequest(cameraSet, StarTracker::CameraSet::SIZE); + case (startracker::REQ_CAMERA): { + handleParamRequest(cameraSet, startracker::CameraSet::SIZE); break; } - case (StarTracker::REQ_LIMITS): { - handleParamRequest(limitsSet, StarTracker::LimitsSet::SIZE); + case (startracker::REQ_LIMITS): { + handleParamRequest(limitsSet, startracker::LimitsSet::SIZE); break; } default: { @@ -779,225 +779,225 @@ uint32_t StarTrackerHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { - localDataPoolMap.emplace(StarTracker::TICKS_TIME_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TIME_TIME_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::RUN_TIME, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::UNIX_TIME, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_TIME_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_TIME_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::RUN_TIME, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::UNIX_TIME, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TICKS_VERSION_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TIME_VERSION_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::PROGRAM, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MAJOR, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MINOR, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_VERSION_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_VERSION_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::PROGRAM, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MAJOR, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MINOR, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TICKS_INTERFACE_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TIME_INTERFACE_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::FRAME_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CHECKSUM_ERROR_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::SET_PARAM_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::SET_PARAM_REPLY_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::PARAM_REQUEST_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::PARAM_REPLY_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::REQ_TM_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TM_REPLY_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::ACTION_REQ_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::ACTION_REPLY_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_INTERFACE_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_INTERFACE_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FRAME_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CHECKSUM_ERROR_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SET_PARAM_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SET_PARAM_REPLY_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::PARAM_REQUEST_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::PARAM_REPLY_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::REQ_TM_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TM_REPLY_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::ACTION_REQ_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::ACTION_REPLY_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TICKS_POWER_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TIME_POWER_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MCU_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MCU_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::FPGA_CORE_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::FPGA_CORE_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::FPGA_18_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::FPGA_18_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::FPGA_25_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::FPGA_25_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CMV_21_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CMV_21_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CMV_PIX_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CMV_PIX_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CMV_33_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CMV_33_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CMV_RES_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CMV_RES_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_POWER_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_POWER_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MCU_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MCU_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_CORE_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_CORE_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_18_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_18_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_25_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_25_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_21_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_21_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_PIX_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_PIX_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_33_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_33_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_RES_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_RES_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TICKS_TEMPERATURE_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TIME_TEMPERATURE_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MCU_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CMOS_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::FPGA_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_TEMPERATURE_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_TEMPERATURE_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MCU_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMOS_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TICKS_SOLUTION_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TIME_SOLUTION_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CALI_QW, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CALI_QX, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CALI_QY, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CALI_QZ, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TRACK_CONFIDENCE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TRACK_QW, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TRACK_QX, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TRACK_QY, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TRACK_QZ, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TRACK_REMOVED, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::STARS_CENTROIDED, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::STARS_MATCHED_DATABASE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LISA_QW, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LISA_QX, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LISA_QY, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LISA_QZ, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LISA_PERC_CLOSE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LISA_NR_CLOSE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TRUST_WORTHY, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::STABLE_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::SOLUTION_STRATEGY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_SOLUTION_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_SOLUTION_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CALI_QW, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CALI_QX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CALI_QY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CALI_QZ, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACK_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACK_QW, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACK_QX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACK_QY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACK_QZ, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACK_REMOVED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::STARS_CENTROIDED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::STARS_MATCHED_DATABASE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_QW, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_QX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_QY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_QZ, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_PERC_CLOSE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_NR_CLOSE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRUST_WORTHY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::STABLE_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SOLUTION_STRATEGY, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TICKS_HISTOGRAM_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TIME_HISTOGRAM_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINA0, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINA1, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINA2, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINA3, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINA4, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINA5, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINA6, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINA7, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINA8, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINB0, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINB1, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINB2, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINB3, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINB4, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINB5, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINB6, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINB7, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINB8, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINC0, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINC1, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINC2, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINC3, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINC4, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINC5, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINC6, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINC7, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BINC8, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BIND0, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BIND1, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BIND2, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BIND3, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BIND4, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BIND5, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BIND6, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BIND7, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::HISTOGRAM_BIND8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_HISTOGRAM_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_HISTOGRAM_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND8, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TICKS_CONTRAST_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TIME_CONTRAST_SET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINA0, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINA1, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINA2, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINA3, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINA4, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINA5, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINA6, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINA7, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINA8, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINB0, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINB1, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINB2, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINB3, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINB4, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINB5, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINB6, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINB7, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINB8, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINC8, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINC0, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINC1, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINC2, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINC3, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINC4, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINC5, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINC6, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINC7, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BINC8, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BIND0, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BIND1, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BIND2, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BIND3, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BIND4, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BIND5, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BIND6, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BIND7, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CONTRAST_BIND8, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CHKSUM, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_CONTRAST_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_CONTRAST_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CHKSUM, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DWL_ID, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DWL_PIXX, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DWL_PIXY, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DWL_X_UNCORRECTED, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DWL_Y_UNCORRECTED, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DWL_X_CORRECTED, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DWL_Y_CORRECTED, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DWL_MAGNITUDE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DWL_CXA, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DWL_CYA, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DWL_QUALITY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_ID, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_PIXX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_PIXY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_X_UNCORRECTED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_Y_UNCORRECTED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_X_CORRECTED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_Y_CORRECTED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_MAGNITUDE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_CXA, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_CYA, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_QUALITY, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_ID, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_CAMFPX, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_CAMFPY, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_CAMCARTX, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_CAMCARTY, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_CAMCARTZ, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_CAMMAGNITUDE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_DBFPX, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_DBFPY, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_DBCARTX, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_DBCARTY, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_DBCARTZ, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_DBMAGNITUDE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::MATCHEDSTR_CATALOGID, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_ID, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMFPX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMFPY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMCARTX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMCARTY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMCARTZ, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMMAGNITUDE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_DBFPX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_DBFPY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_DBCARTX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_DBCARTY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_DBCARTZ, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_DBMAGNITUDE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CATALOGID, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOBPIX_ID, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOBPIX_X, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOBPIX_Y, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOBPIX_TOT_VAL, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOBPIX_IN_USE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOBPIX_BRIGHT_NEIGHBOURS, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::BLOBPIX_REGION, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_ID, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_X, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_Y, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_TOT_VAL, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_IN_USE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_BRIGHT_NEIGHBOURS, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_REGION, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CAMERA_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::FOCALLENGTH, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::EXPOSURE, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::INTERVAL, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CAMERA_OFFSET, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::PGAGAIN, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::ADCGAIN, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CAM_REG1, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CAM_VAL1, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CAM_REG2, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CAM_VAL2, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CAM_REG3, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CAM_VAL3, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CAM_REG4, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::CAM_VAL4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAMERA_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FOCALLENGTH, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::EXPOSURE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::INTERVAL, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAMERA_OFFSET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::PGAGAIN, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::ADCGAIN, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_REG1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_VAL1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_REG2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_VAL2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_REG3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_VAL3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_REG4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_VAL4, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LIMITS_ACTION, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LIMITS_FPGA18CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LIMITS_FPGA25CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LIMITS_FPGA10CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LIMITS_MCUCURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LIMITS_CMOS21CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LIMITS_CMOSPIXCURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LIMITS_CMOS33CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LIMITS_CMOSVRESCURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::LIMITS_CMOSTEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_ACTION, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_FPGA18CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_FPGA25CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_FPGA10CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_MCUCURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_CMOS21CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_CMOSPIXCURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_CMOS33CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_CMOSVRESCURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_CMOSTEMPERATURE, new PoolEntry({0})); return RETURN_OK; } size_t StarTrackerHandler::getNextReplyLength(DeviceCommandId_t commandId) { - return StarTracker::MAX_FRAME_SIZE; + return startracker::MAX_FRAME_SIZE; } ReturnValue_t StarTrackerHandler::doSendReadHook() { @@ -1010,8 +1010,8 @@ ReturnValue_t StarTrackerHandler::doSendReadHook() { ReturnValue_t StarTrackerHandler::checkMode(ActionId_t actionId) { switch (actionId) { - case StarTracker::UPLOAD_IMAGE: - case StarTracker::DOWNLOAD_IMAGE: { + case startracker::UPLOAD_IMAGE: + case startracker::DOWNLOAD_IMAGE: { return DeviceHandlerBase::acceptExternalDeviceCommands(); default: break; @@ -1023,68 +1023,68 @@ ReturnValue_t StarTrackerHandler::checkMode(ActionId_t actionId) { ReturnValue_t StarTrackerHandler::scanForActionReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (StarTracker::ID::PING): { - *foundId = StarTracker::PING_REQUEST; + case (startracker::ID::PING): { + *foundId = startracker::PING_REQUEST; break; } - case (StarTracker::ID::WRITE): { - *foundId = StarTracker::WRITE; + case (startracker::ID::WRITE): { + *foundId = startracker::WRITE; break; } - case (StarTracker::ID::BOOT): { - *foundId = StarTracker::BOOT; + case (startracker::ID::BOOT): { + *foundId = startracker::BOOT; break; } - case (StarTracker::ID::TAKE_IMAGE): { - *foundId = StarTracker::TAKE_IMAGE; + case (startracker::ID::TAKE_IMAGE): { + *foundId = startracker::TAKE_IMAGE; break; } - case (StarTracker::ID::UPLOAD_IMAGE): { - *foundId = StarTracker::UPLOAD_IMAGE; + case (startracker::ID::UPLOAD_IMAGE): { + *foundId = startracker::UPLOAD_IMAGE; break; } - case (StarTracker::ID::ERROR_RESET): { - *foundId = StarTracker::RESET_ERROR; + case (startracker::ID::ERROR_RESET): { + *foundId = startracker::RESET_ERROR; break; } - case (StarTracker::ID::ERASE): { - *foundId = StarTracker::ERASE; + case (startracker::ID::ERASE): { + *foundId = startracker::ERASE; break; } - case (StarTracker::ID::UNLOCK): { - *foundId = StarTracker::UNLOCK; + case (startracker::ID::UNLOCK): { + *foundId = startracker::UNLOCK; break; } - case (StarTracker::ID::CHECKSUM): { - *foundId = StarTracker::CHECKSUM; + case (startracker::ID::CHECKSUM): { + *foundId = startracker::CHECKSUM; break; } - case (StarTracker::ID::SET_TIME): { - *foundId = StarTracker::SET_TIME; + case (startracker::ID::SET_TIME): { + *foundId = startracker::SET_TIME; break; } - case (StarTracker::ID::DOWNLOAD_CENTROID): { - *foundId = StarTracker::DOWNLOAD_CENTROID; + case (startracker::ID::DOWNLOAD_CENTROID): { + *foundId = startracker::DOWNLOAD_CENTROID; break; } - case (StarTracker::ID::UPLOAD_CENTROID): { - *foundId = StarTracker::UPLOAD_CENTROID; + case (startracker::ID::UPLOAD_CENTROID): { + *foundId = startracker::UPLOAD_CENTROID; break; } - case (StarTracker::ID::DOWNLOAD_MATCHED_STAR): { - *foundId = StarTracker::DOWNLOAD_MATCHED_STAR; + case (startracker::ID::DOWNLOAD_MATCHED_STAR): { + *foundId = startracker::DOWNLOAD_MATCHED_STAR; break; } - case (StarTracker::ID::DOWNLOAD_DBIMAGE): { - *foundId = StarTracker::DOWNLOAD_DBIMAGE; + case (startracker::ID::DOWNLOAD_DBIMAGE): { + *foundId = startracker::DOWNLOAD_DBIMAGE; break; } - case (StarTracker::ID::DOWNLOAD_BLOBPIXEL): { - *foundId = StarTracker::DOWNLOAD_BLOBPIXEL; + case (startracker::ID::DOWNLOAD_BLOBPIXEL): { + *foundId = startracker::DOWNLOAD_BLOBPIXEL; break; } - case (StarTracker::ID::FPGA_ACTION): { - *foundId = StarTracker::FPGA_ACTION; + case (startracker::ID::FPGA_ACTION): { + *foundId = startracker::FPGA_ACTION; break; } default: @@ -1098,48 +1098,48 @@ ReturnValue_t StarTrackerHandler::scanForActionReply(DeviceCommandId_t* foundId) ReturnValue_t StarTrackerHandler::scanForSetParameterReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (StarTracker::ID::SUBSCRIBE): { - *foundId = StarTracker::SUBSCRIBE_TO_TM; + case (startracker::ID::SUBSCRIBE): { + *foundId = startracker::SUBSCRIBE_TO_TM; break; } - case (StarTracker::ID::LIMITS): { - *foundId = StarTracker::LIMITS; + case (startracker::ID::LIMITS): { + *foundId = startracker::LIMITS; break; } - case (StarTracker::ID::MOUNTING): { - *foundId = StarTracker::MOUNTING; + case (startracker::ID::MOUNTING): { + *foundId = startracker::MOUNTING; break; } - case (StarTracker::ID::IMAGE_PROCESSOR): { - *foundId = StarTracker::IMAGE_PROCESSOR; + case (startracker::ID::IMAGE_PROCESSOR): { + *foundId = startracker::IMAGE_PROCESSOR; break; } - case (StarTracker::ID::CAMERA): { - *foundId = StarTracker::CAMERA; + case (startracker::ID::CAMERA): { + *foundId = startracker::CAMERA; break; } - case (StarTracker::ID::CENTROIDING): { - *foundId = StarTracker::CENTROIDING; + case (startracker::ID::CENTROIDING): { + *foundId = startracker::CENTROIDING; break; } - case (StarTracker::ID::LISA): { - *foundId = StarTracker::LISA; + case (startracker::ID::LISA): { + *foundId = startracker::LISA; break; } - case (StarTracker::ID::MATCHING): { - *foundId = StarTracker::MATCHING; + case (startracker::ID::MATCHING): { + *foundId = startracker::MATCHING; break; } - case (StarTracker::ID::TRACKING): { - *foundId = StarTracker::TRACKING; + case (startracker::ID::TRACKING): { + *foundId = startracker::TRACKING; break; } - case (StarTracker::ID::VALIDATION): { - *foundId = StarTracker::VALIDATION; + case (startracker::ID::VALIDATION): { + *foundId = startracker::VALIDATION; break; } - case (StarTracker::ID::ALGO): { - *foundId = StarTracker::ALGO; + case (startracker::ID::ALGO): { + *foundId = startracker::ALGO; break; } default: @@ -1153,12 +1153,12 @@ ReturnValue_t StarTrackerHandler::scanForSetParameterReply(DeviceCommandId_t* fo ReturnValue_t StarTrackerHandler::scanForGetParameterReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (StarTracker::ID::CAMERA): { - *foundId = StarTracker::REQ_CAMERA; + case (startracker::ID::CAMERA): { + *foundId = startracker::REQ_CAMERA; break; } - case (StarTracker::ID::LIMITS): { - *foundId = StarTracker::REQ_LIMITS; + case (startracker::ID::LIMITS): { + *foundId = startracker::REQ_LIMITS; break; } default: { @@ -1173,36 +1173,36 @@ ReturnValue_t StarTrackerHandler::scanForGetParameterReply(DeviceCommandId_t* fo ReturnValue_t StarTrackerHandler::scanForTmReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (StarTracker::ID::VERSION): { - *foundId = StarTracker::REQ_VERSION; + case (startracker::ID::VERSION): { + *foundId = startracker::REQ_VERSION; break; } - case (StarTracker::ID::INTERFACE): { - *foundId = StarTracker::REQ_INTERFACE; + case (startracker::ID::INTERFACE): { + *foundId = startracker::REQ_INTERFACE; break; } - case (StarTracker::ID::POWER): { - *foundId = StarTracker::REQ_POWER; + case (startracker::ID::POWER): { + *foundId = startracker::REQ_POWER; break; } - case (StarTracker::ID::TEMPERATURE): { - *foundId = StarTracker::REQ_TEMPERATURE; + case (startracker::ID::TEMPERATURE): { + *foundId = startracker::REQ_TEMPERATURE; break; } - case (StarTracker::ID::HISTOGRAM): { - *foundId = StarTracker::REQ_HISTOGRAM; + case (startracker::ID::HISTOGRAM): { + *foundId = startracker::REQ_HISTOGRAM; break; } - case (StarTracker::ID::CONTRAST): { - *foundId = StarTracker::REQ_CONTRAST; + case (startracker::ID::CONTRAST): { + *foundId = startracker::REQ_CONTRAST; break; } - case (StarTracker::ID::TIME): { - *foundId = StarTracker::REQ_TIME; + case (startracker::ID::TIME): { + *foundId = startracker::REQ_TIME; break; } - case (StarTracker::ID::SOLUTION): { - *foundId = StarTracker::REQ_SOLUTION; + case (startracker::ID::SOLUTION): { + *foundId = startracker::REQ_SOLUTION; break; } default: { @@ -1485,72 +1485,72 @@ ReturnValue_t StarTrackerHandler::prepareUploadCentroidCommand(const uint8_t* co << " does not exist" << std::endl; return result; } - result = j.getValue(StarTracker::UploadCentroidKeys::id, &req.id); + result = j.getValue(startracker::UploadCentroidKeys::id, &req.id); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << StarTracker::UploadCentroidKeys::id << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::id << " does not exist" << std::endl; return result; } - result = j.getValue(StarTracker::UploadCentroidKeys::pixx, &req.pixx); + result = j.getValue(startracker::UploadCentroidKeys::pixx, &req.pixx); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << StarTracker::UploadCentroidKeys::pixx << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::pixx << " does not exist" << std::endl; return result; } - result = j.getValue(StarTracker::UploadCentroidKeys::pixy, &req.pixy); + result = j.getValue(startracker::UploadCentroidKeys::pixy, &req.pixy); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << StarTracker::UploadCentroidKeys::pixy << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::pixy << " does not exist" << std::endl; return result; } - result = j.getValue(StarTracker::UploadCentroidKeys::x_uncorrected, &req.x_uncorrected); + result = j.getValue(startracker::UploadCentroidKeys::x_uncorrected, &req.x_uncorrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << StarTracker::UploadCentroidKeys::x_uncorrected << " does not exist" + << startracker::UploadCentroidKeys::x_uncorrected << " does not exist" << std::endl; return result; } - result = j.getValue(StarTracker::UploadCentroidKeys::y_uncorrected, &req.y_uncorrected); + result = j.getValue(startracker::UploadCentroidKeys::y_uncorrected, &req.y_uncorrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << StarTracker::UploadCentroidKeys::y_uncorrected << " does not exist" + << startracker::UploadCentroidKeys::y_uncorrected << " does not exist" << std::endl; return result; } - result = j.getValue(StarTracker::UploadCentroidKeys::x_corrected, &req.x_corrected); + result = j.getValue(startracker::UploadCentroidKeys::x_corrected, &req.x_corrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << StarTracker::UploadCentroidKeys::x_corrected << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::x_corrected << " does not exist" << std::endl; return result; } - result = j.getValue(StarTracker::UploadCentroidKeys::y_corrected, &req.y_corrected); + result = j.getValue(startracker::UploadCentroidKeys::y_corrected, &req.y_corrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << StarTracker::UploadCentroidKeys::y_corrected << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::y_corrected << " does not exist" << std::endl; return result; } - result = j.getValue(StarTracker::UploadCentroidKeys::magnitude, &req.magnitude); + result = j.getValue(startracker::UploadCentroidKeys::magnitude, &req.magnitude); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << StarTracker::UploadCentroidKeys::magnitude << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::magnitude << " does not exist" << std::endl; return result; } - result = j.getValue(StarTracker::UploadCentroidKeys::cxa, &req.cxa); + result = j.getValue(startracker::UploadCentroidKeys::cxa, &req.cxa); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << StarTracker::UploadCentroidKeys::cxa << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::cxa << " does not exist" << std::endl; return result; } - result = j.getValue(StarTracker::UploadCentroidKeys::cya, &req.cya); + result = j.getValue(startracker::UploadCentroidKeys::cya, &req.cya); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << StarTracker::UploadCentroidKeys::cya << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::cya << " does not exist" << std::endl; return result; } - result = j.getValue(StarTracker::UploadCentroidKeys::quality, &req.quality); + result = j.getValue(startracker::UploadCentroidKeys::quality, &req.quality); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << StarTracker::UploadCentroidKeys::quality << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::quality << " does not exist" << std::endl; return result; } uint32_t length = 0; @@ -1625,7 +1625,7 @@ void StarTrackerHandler::prepareTakeImageCommand(const uint8_t* commandData) { void StarTrackerHandler::prepareSubscriptionCommand(const uint8_t* tmId) { uint32_t length = 18; commandBuffer[0] = TMTC_SETPARAMREQ; - commandBuffer[1] = StarTracker::ID::SUBSCRIBE; + commandBuffer[1] = startracker::ID::SUBSCRIBE; // Fill all other fields with invalid tm id commandBuffer[2] = *tmId; commandBuffer[3] = 0; @@ -1796,7 +1796,7 @@ ReturnValue_t StarTrackerHandler::prepareRequestLimitsParams() { ReturnValue_t StarTrackerHandler::handleSetParamReply() { const uint8_t* reply = dataLinkLayer.getReply(); uint8_t status = *(reply + STATUS_OFFSET); - if (status != StarTracker::STATUS_OK) { + if (status != startracker::STATUS_OK) { sif::warning << "StarTrackerHandler::handleSetParamReply: Failed to execute parameter set " " command with parameter ID" << static_cast(*(reply + PARAMETER_ID_OFFSET)) << std::endl; @@ -1814,7 +1814,7 @@ ReturnValue_t StarTrackerHandler::handleSetParamReply() { ReturnValue_t StarTrackerHandler::handleActionReply() { const uint8_t* reply = dataLinkLayer.getReply(); uint8_t status = *(reply + STATUS_OFFSET); - if (status != StarTracker::STATUS_OK) { + if (status != startracker::STATUS_OK) { sif::warning << "StarTrackerHandler::handleActionReply: Failed to execute action " << "command with action ID " << static_cast(*(reply + ACTION_ID_OFFSET)) << " and status " @@ -1844,7 +1844,7 @@ ReturnValue_t StarTrackerHandler::handleEraseReply() { return result; } const uint8_t* replyData = dataLinkLayer.getReply() + ACTION_DATA_OFFSET; - StarTracker::EraseReply eraseReply(replyData); + startracker::EraseReply eraseReply(replyData); if (eraseReply.getRegion() != eraseCmd.rememberRegion) { sif::warning << "StarTrackerHandler::handleEraseReply: Region mismatch" << std::endl; return REGION_MISMATCH; @@ -1859,7 +1859,7 @@ ReturnValue_t StarTrackerHandler::handleChecksumReply() { return result; } const uint8_t* replyData = dataLinkLayer.getReply() + ACTION_DATA_OFFSET; - StarTracker::ChecksumReply checksumReply(replyData); + startracker::ChecksumReply checksumReply(replyData); if (checksumReply.getRegion() != checksumCmd.rememberRegion) { sif::warning << "StarTrackerHandler::handleChecksumReply: Region mismatch" << std::endl; return REGION_MISMATCH; @@ -1874,7 +1874,7 @@ ReturnValue_t StarTrackerHandler::handleChecksumReply() { } PoolReadGuard rg(&checksumSet); checksumSet.checksum = checksumReply.getChecksum(); - handleDeviceTM(&checksumSet, StarTracker::CHECKSUM); + handleDeviceTM(&checksumSet, startracker::CHECKSUM); #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 checksumReply.printChecksum(); #endif /* OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 */ @@ -1917,7 +1917,7 @@ ReturnValue_t StarTrackerHandler::handlePingReply() { sif::info << "StarTracker: Ping status: " << static_cast(status) << std::endl; sif::info << "Ping id: 0x" << std::hex << pingId << std::endl; #endif /* OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 */ - if (status != StarTracker::STATUS_OK || pingId != PING_ID) { + if (status != startracker::STATUS_OK || pingId != PING_ID) { sif::warning << "StarTrackerHandler::handlePingReply: Ping failed" << std::endl; result = PING_FAILED; } else { @@ -1931,14 +1931,14 @@ ReturnValue_t StarTrackerHandler::handlePingReply() { ReturnValue_t StarTrackerHandler::checkProgram() { PoolReadGuard pg(&versionSet); switch (versionSet.program.value) { - case StarTracker::Program::BOOTLOADER: + case startracker::Program::BOOTLOADER: // Star tracker currently in bootloader program. Need to send boot command to switch to // firmware program if (startupState != StartupState::IDLE) { startupState = StartupState::BOOT; } break; - case StarTracker::Program::FIRMWARE: + case startracker::Program::FIRMWARE: // Firmware already booted if (startupState != StartupState::IDLE) { startupState = StartupState::LIMITS; @@ -1955,7 +1955,7 @@ ReturnValue_t StarTrackerHandler::checkProgram() { ReturnValue_t StarTrackerHandler::handleTm(LocalPoolDataSetBase& dataset, size_t size) { ReturnValue_t result = RETURN_OK; uint8_t status = *(dataLinkLayer.getReply() + STATUS_OFFSET); - if (status != StarTracker::STATUS_OK) { + if (status != startracker::STATUS_OK) { sif::warning << "StarTrackerHandler::handleTm: Reply error: " << static_cast(status) << std::endl; return REPLY_ERROR; @@ -1985,7 +1985,7 @@ ReturnValue_t StarTrackerHandler::handleTm(LocalPoolDataSetBase& dataset, size_t ReturnValue_t StarTrackerHandler::handleActionReplySet(LocalPoolDataSetBase& dataset, size_t size) { ReturnValue_t result = RETURN_OK; uint8_t status = *(dataLinkLayer.getReply() + STATUS_OFFSET); - if (status != StarTracker::STATUS_OK) { + if (status != startracker::STATUS_OK) { sif::warning << "StarTrackerHandler::handleActionReplySet: Reply error: " << static_cast(status) << std::endl; return REPLY_ERROR; @@ -2014,43 +2014,43 @@ ReturnValue_t StarTrackerHandler::handleActionReplySet(LocalPoolDataSetBase& dat void StarTrackerHandler::handleStartup(const uint8_t* parameterId) { switch (*parameterId) { - case (StarTracker::ID::LIMITS): { + case (startracker::ID::LIMITS): { startupState = StartupState::TRACKING; break; } - case (StarTracker::ID::TRACKING): { + case (startracker::ID::TRACKING): { startupState = StartupState::MOUNTING; break; } - case (StarTracker::ID::MOUNTING): { + case (startracker::ID::MOUNTING): { startupState = StartupState::IMAGE_PROCESSOR; break; } - case (StarTracker::ID::IMAGE_PROCESSOR): { + case (startracker::ID::IMAGE_PROCESSOR): { startupState = StartupState::CAMERA; break; } - case (StarTracker::ID::CAMERA): { + case (startracker::ID::CAMERA): { startupState = StartupState::CENTROIDING; break; } - case (StarTracker::ID::CENTROIDING): { + case (startracker::ID::CENTROIDING): { startupState = StartupState::LISA; break; } - case (StarTracker::ID::LISA): { + case (startracker::ID::LISA): { startupState = StartupState::MATCHING; break; } - case (StarTracker::ID::MATCHING): { + case (startracker::ID::MATCHING): { startupState = StartupState::VALIDATION; break; } - case (StarTracker::ID::VALIDATION): { + case (startracker::ID::VALIDATION): { startupState = StartupState::ALGO; break; } - case (StarTracker::ID::ALGO): { + case (startracker::ID::ALGO): { startupState = StartupState::DONE; break; } diff --git a/bsp_q7s/devices/startracker/StarTrackerHandler.h b/bsp_q7s/devices/startracker/StarTrackerHandler.h index bcec92ce..b362b67f 100644 --- a/bsp_q7s/devices/startracker/StarTrackerHandler.h +++ b/bsp_q7s/devices/startracker/StarTrackerHandler.h @@ -245,26 +245,26 @@ class StarTrackerHandler : public DeviceHandlerBase { ArcsecDatalinkLayer dataLinkLayer; - StarTracker::TemperatureSet temperatureSet; - StarTracker::VersionSet versionSet; - StarTracker::PowerSet powerSet; - StarTracker::InterfaceSet interfaceSet; - StarTracker::TimeSet timeSet; - StarTracker::SolutionSet solutionSet; - StarTracker::HistogramSet histogramSet; - StarTracker::ContrastSet contrastSet; - StarTracker::ChecksumSet checksumSet; - StarTracker::DownloadCentroidSet downloadCentroidSet; - StarTracker::DownloadMatchedStar downloadMatchedStar; - StarTracker::DownloadDBImage downloadDbImage; - StarTracker::DownloadBlobPixel downloadBlobPixel; - StarTracker::CameraSet cameraSet; - StarTracker::LimitsSet limitsSet; + startracker::TemperatureSet temperatureSet; + startracker::VersionSet versionSet; + startracker::PowerSet powerSet; + startracker::InterfaceSet interfaceSet; + startracker::TimeSet timeSet; + startracker::SolutionSet solutionSet; + startracker::HistogramSet histogramSet; + startracker::ContrastSet contrastSet; + startracker::ChecksumSet checksumSet; + startracker::DownloadCentroidSet downloadCentroidSet; + startracker::DownloadMatchedStar downloadMatchedStar; + startracker::DownloadDBImage downloadDbImage; + startracker::DownloadBlobPixel downloadBlobPixel; + startracker::CameraSet cameraSet; + startracker::LimitsSet limitsSet; // Pointer to object responsible for uploading and downloading images to/from the star tracker StrHelper* strHelper = nullptr; - uint8_t commandBuffer[StarTracker::MAX_FRAME_SIZE]; + uint8_t commandBuffer[startracker::MAX_FRAME_SIZE]; // Countdown to insert delay for star tracker to switch from bootloader to firmware program Countdown bootCountdown; diff --git a/bsp_q7s/devices/startracker/StrHelper.cpp b/bsp_q7s/devices/startracker/StrHelper.cpp index a37d5a38..7a17260e 100644 --- a/bsp_q7s/devices/startracker/StrHelper.cpp +++ b/bsp_q7s/devices/startracker/StrHelper.cpp @@ -154,7 +154,7 @@ ReturnValue_t StrHelper::startFirmwareUpdate(std::string fullname) { return FILE_NOT_EXISTS; } flashWrite.address = 0; - flashWrite.region = static_cast(RegionId::MAIN_FIRMWARE_SECTION); + flashWrite.section = static_cast(RegionId::MAIN_FIRMWARE_SECTION); internalState = InternalState::FIRMWARE_UPDATE; semaphore.release(); terminate = false; @@ -317,12 +317,10 @@ ReturnValue_t StrHelper::performImageUpload() { } ReturnValue_t StrHelper::performFirmwareUpdate() { + using namespace startracker; ReturnValue_t result = RETURN_OK; - result = unlock(flashWrite.region); - if (result != RETURN_OK) { - return result; - } - eraseF(flashWrite.region); + result = unlockAndEraseRegions(static_cast(FirmwareRegions::START), + static_cast(FirmwareRegions::END)); if (result != RETURN_OK) { return result; } @@ -345,7 +343,7 @@ ReturnValue_t StrHelper::performFlashWrite() { file.seekg(0, file.end); fileSize = file.tellg(); remainingBytes = fileSize; - req.region = flashWrite.region; + req.region = flashWrite.section; req.address = flashWrite.address; req.length = MAX_FLASH_DATA; while (remainingBytes >= MAX_FLASH_DATA) { @@ -357,7 +355,7 @@ ReturnValue_t StrHelper::performFlashWrite() { arc_pack_write_action_req(&req, commandBuffer, &size); result = sendAndRead(size, req.address); if (result != RETURN_OK) { - return RETURN_FAILED; + return result; } result = checkFlashActionReply(req.region, req.address, req.length); if (result != RETURN_OK) { @@ -371,7 +369,7 @@ ReturnValue_t StrHelper::performFlashWrite() { arc_pack_write_action_req(&req, commandBuffer, &size); result = sendAndRead(size, req.address); if (result != RETURN_OK) { - return RETURN_FAILED; + return result; } result = checkFlashActionReply(req.region, req.address, req.length); if (result != RETURN_OK) { @@ -551,7 +549,7 @@ ReturnValue_t StrHelper::sendAndRead(size_t size, uint32_t parameter) { } decResult = ArcsecDatalinkLayer::DEC_IN_PROGRESS; while (decResult == ArcsecDatalinkLayer::DEC_IN_PROGRESS) { - result = uartComIF->requestReceiveMessage(comCookie, StarTracker::MAX_FRAME_SIZE * 2 + 2); + result = uartComIF->requestReceiveMessage(comCookie, startracker::MAX_FRAME_SIZE * 2 + 2); if (result != RETURN_OK) { sif::warning << "StrHelper::sendAndRead: Failed to request reply" << std::endl; triggerEvent(STR_HELPER_REQUESTING_MSG_FAILED, result, parameter); @@ -706,3 +704,31 @@ void StrHelper::printProgress(uint32_t itemsTransferred, uint32_t fullNumItems) nextProgressPrint = 0; } } + +ReturnValue_t StrHelper::unlockAndEraseRegions(uint32_t from, uint32_t to) { + using namespace startracker::region_secrets; + struct UnlockActionRequest unlockReq; + struct EraseActionRequest eraseReq; + uint32_t size = 0; + for (uint8_t idx = from; idx <= to; idx++) { + unlockReq.region = idx; + unlockReq.code = secret[idx]; + arc_pack_unlock_action_req(&req, commandBuffer, &size); + sendAndRead(size, req.region); + result = checkActionReply(); + if (result != RETURN_OK) { + sif::warning << "StrHelper::unlockAndEraseRegions: Failed to unlock region with id " + << static_cast(unlockReq.region) << std::endl; + return result; + } + eraseReq.region = idx; + arc_pack_erase_action_req(&eraseReq, commandBuffer, &size); + result = sendAndRead(size, eraseReq.region); + if (result != RETURN_OK) { + sif::warning << "StrHelper::unlockAndEraseRegions: Failed to erase region with id " + << static_cast(eraseReq.region) << std::endl; + return result; + } + } + return result; +} diff --git a/bsp_q7s/devices/startracker/StrHelper.h b/bsp_q7s/devices/startracker/StrHelper.h index 0e19bca7..e0e402b0 100644 --- a/bsp_q7s/devices/startracker/StrHelper.h +++ b/bsp_q7s/devices/startracker/StrHelper.h @@ -21,6 +21,9 @@ extern "C" { * @brief Helper class for the star tracker handler to accelerate large data transfers. */ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasReturnvaluesIF { + + using namespace startracker; + public: static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::STR_HELPER; @@ -267,8 +270,8 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu public: // File which contains data to write when executing the flash write command std::string fullname; - // Will be set with the flash write command - uint8_t region = 0; + // Section where to write to + uint8_t section = 0; // Will be set with the flash write command and specifies the start address where to write the // flash data to uint32_t address = 0; @@ -291,15 +294,9 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu }; FlashRead flashRead; - enum class RegionId : uint8_t { - BOOTLOADER_SECTION = 0, - MAIN_FIRMWARE_SECTION = 1, - ARC_CONFIG_SECTION = 2, - }; - SdCardManager* sdcMan = nullptr; - uint8_t commandBuffer[StarTracker::MAX_FRAME_SIZE]; + uint8_t commandBuffer[startracker::MAX_FRAME_SIZE]; bool terminate = false; @@ -413,6 +410,15 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu * @param fullNumItems Full number of items to transfer */ void printProgress(uint32_t itemsTransferred, uint32_t fullNumItems); + + /** + * @brief Unlocks a range of flash regions + * + * @param from First region in range to unlock + * @param to Last region in range to unlock + * + */ + ReturnValue_t unlockRegions(uint32_t from, uint32_t to); }; #endif /* BSP_Q7S_DEVICES_STRHELPER_H_ */ diff --git a/fsfw b/fsfw index faf7da27..f08d291e 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit faf7da2743dcd30d83c3ab2f7b4d85277878e636 +Subproject commit f08d291e3e22950e729c327c101d22a943910e9b From e67bcd4e265149d2f64acdbec136b411617194d4 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 5 Feb 2022 13:19:20 +0100 Subject: [PATCH 06/61] setup egse project --- CMakeLists.txt | 22 +- bsp_egse/CMakeLists.txt | 7 + bsp_egse/InitMission.cpp | 188 ++++++++++++++++++ bsp_egse/InitMission.h | 23 +++ bsp_egse/ObjectFactory.cpp | 53 +++++ bsp_egse/ObjectFactory.h | 11 + bsp_egse/boardconfig/CMakeLists.txt | 7 + bsp_egse/boardconfig/etl_profile.h | 38 ++++ bsp_egse/boardconfig/gcov.h | 15 ++ bsp_egse/boardconfig/print.c | 10 + bsp_egse/boardconfig/print.h | 8 + bsp_egse/boardconfig/rpiConfig.h.in | 6 + bsp_egse/main.cpp | 27 +++ bsp_linux_board/InitMission.cpp | 110 +++------- bsp_linux_board/boardconfig/print.c | 2 +- bsp_q7s/core/InitMission.cpp | 8 +- bsp_q7s/devices/CMakeLists.txt | 4 +- cmake/HardwareOsPreConfig.cmake | 4 +- cmake/PreProjectConfig.cmake | 2 +- cmake/scripts/egse/egse_path_helper_win.sh | 13 ++ cmake/scripts/egse/make-debug-cfg.sh | 34 ++++ common/config/devConf.h | 4 +- linux/boardtest/SpiTestClass.cpp | 34 ++-- linux/devices/CMakeLists.txt | 2 + .../StarTrackerDefinitions.h | 6 +- .../startracker/ArcsecDatalinkLayer.cpp | 0 .../devices/startracker/ArcsecDatalinkLayer.h | 2 +- .../devices/startracker/ArcsecJsonKeys.h | 0 .../startracker/ArcsecJsonParamBase.cpp | 0 .../devices/startracker/ArcsecJsonParamBase.h | 2 +- .../devices/startracker/CMakeLists.txt | 0 .../startracker/StarTrackerHandler.cpp | 0 .../devices/startracker/StarTrackerHandler.h | 2 +- .../startracker/StarTrackerJsonCommands.cpp | 0 .../startracker/StarTrackerJsonCommands.h | 0 .../devices/startracker/StrHelper.cpp | 12 ++ .../devices/startracker/StrHelper.h | 8 + linux/fsfwconfig/OBSWConfig.h.in | 1 + .../pollingSequenceFactory.cpp | 1 + scripts/egse-port.sh | 6 + 40 files changed, 548 insertions(+), 124 deletions(-) create mode 100644 bsp_egse/CMakeLists.txt create mode 100644 bsp_egse/InitMission.cpp create mode 100644 bsp_egse/InitMission.h create mode 100644 bsp_egse/ObjectFactory.cpp create mode 100644 bsp_egse/ObjectFactory.h create mode 100644 bsp_egse/boardconfig/CMakeLists.txt create mode 100644 bsp_egse/boardconfig/etl_profile.h create mode 100644 bsp_egse/boardconfig/gcov.h create mode 100644 bsp_egse/boardconfig/print.c create mode 100644 bsp_egse/boardconfig/print.h create mode 100644 bsp_egse/boardconfig/rpiConfig.h.in create mode 100644 bsp_egse/main.cpp create mode 100644 cmake/scripts/egse/egse_path_helper_win.sh create mode 100644 cmake/scripts/egse/make-debug-cfg.sh rename {bsp_q7s/devices/startracker => linux/devices/devicedefinitions}/StarTrackerDefinitions.h (99%) rename {bsp_q7s => linux}/devices/startracker/ArcsecDatalinkLayer.cpp (100%) rename {bsp_q7s => linux}/devices/startracker/ArcsecDatalinkLayer.h (97%) rename {bsp_q7s => linux}/devices/startracker/ArcsecJsonKeys.h (100%) rename {bsp_q7s => linux}/devices/startracker/ArcsecJsonParamBase.cpp (100%) rename {bsp_q7s => linux}/devices/startracker/ArcsecJsonParamBase.h (98%) rename {bsp_q7s => linux}/devices/startracker/CMakeLists.txt (100%) rename {bsp_q7s => linux}/devices/startracker/StarTrackerHandler.cpp (100%) rename {bsp_q7s => linux}/devices/startracker/StarTrackerHandler.h (99%) rename {bsp_q7s => linux}/devices/startracker/StarTrackerJsonCommands.cpp (100%) rename {bsp_q7s => linux}/devices/startracker/StarTrackerJsonCommands.h (100%) rename {bsp_q7s => linux}/devices/startracker/StrHelper.cpp (99%) rename {bsp_q7s => linux}/devices/startracker/StrHelper.h (99%) create mode 100644 scripts/egse-port.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 17796924..7b687ddd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ cmake_minimum_required(VERSION 3.13) set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") if(TGT_BSP MATCHES "arm/q7s") - option(EIVE_BUILD_WATCHDOG "Compile the OBSW watchdog insted" OFF) + option(EIVE_BUILD_WATCHDOG "Compile the OBSW watchdog instead" OFF) option(BUILD_Q7S_SIMPLE_MODE OFF "Simple mode with a minimal main function") endif() @@ -104,7 +104,7 @@ pre_source_hw_os_config() if(TGT_BSP) if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/raspberrypi" - OR TGT_BSP MATCHES "arm/beagleboneblack" + OR TGT_BSP MATCHES "arm/beagleboneblack" OR TGT_BSP MATCHES "arm/egse" ) set(FSFW_CONFIG_PATH "linux/fsfwconfig") if(NOT BUILD_Q7S_SIMPLE_MODE) @@ -114,11 +114,17 @@ if(TGT_BSP) endif() endif() - if(TGT_BSP MATCHES "arm/raspberrypi") + if(TGT_BSP MATCHES "arm/raspberrypi" ) # Used by configure file set(RASPBERRY_PI ON) set(FSFW_HAL_ADD_RASPBERRY_PI ON) endif() + + if(TGT_BSP MATCHES "arm/egse") + # Used by configure file + set(EGSE ON) + set(FSFW_HAL_ADD_LIBGPIOD OFF) + endif() if(TGT_BSP MATCHES "arm/beagleboneblack") # Used by configure file @@ -146,7 +152,7 @@ if(NOT EIVE_BUILD_WATCHDOG) configure_file(${FSFW_CONFIG_PATH}/OBSWConfig.h.in OBSWConfig.h) if(TGT_BSP MATCHES "arm/q7s") configure_file(${BSP_PATH}/boardconfig/q7sConfig.h.in q7sConfig.h) - elseif(TGT_BSP MATCHES "arm/raspberrypi") + elseif(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/egse") configure_file(${BSP_PATH}/boardconfig/rpiConfig.h.in rpiConfig.h) endif() endif() @@ -258,6 +264,12 @@ target_link_libraries(${TARGET_NAME} PRIVATE ${LIB_CXX_FS} ) +if(TGT_BSP MATCHES "arm/egse") +target_link_libraries(${TARGET_NAME} PRIVATE + ${LIB_ARCSEC} + ) +endif() + # Add include paths for all sources. target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} @@ -266,7 +278,7 @@ target_include_directories(${TARGET_NAME} PRIVATE ${LIB_ARCSEC_PATH} ) -if(TGT_BSP MATCHES "arm/q7s") +if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/egse") target_include_directories(${TARGET_NAME} PRIVATE ${ARCSEC_LIB_PATH} ) diff --git a/bsp_egse/CMakeLists.txt b/bsp_egse/CMakeLists.txt new file mode 100644 index 00000000..a8bf5c4f --- /dev/null +++ b/bsp_egse/CMakeLists.txt @@ -0,0 +1,7 @@ +target_sources(${TARGET_NAME} PUBLIC + InitMission.cpp + main.cpp + ObjectFactory.cpp +) + +add_subdirectory(boardconfig) diff --git a/bsp_egse/InitMission.cpp b/bsp_egse/InitMission.cpp new file mode 100644 index 00000000..fcf3c98e --- /dev/null +++ b/bsp_egse/InitMission.cpp @@ -0,0 +1,188 @@ +#include "InitMission.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "OBSWConfig.h" +#include "ObjectFactory.h" +#include "objects/systemObjectList.h" +#include "pollingsequence/pollingSequenceFactory.h" + +ServiceInterfaceStream sif::debug("DEBUG"); +ServiceInterfaceStream sif::info("INFO"); +ServiceInterfaceStream sif::warning("WARNING"); +ServiceInterfaceStream sif::error("ERROR"); + +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); + sif::info << "Initializing all objects.." << std::endl; + ObjectManager::instance()->initialize(); + + /* This function creates and starts all tasks */ + initTasks(); +} + +void initmission::initTasks() { + TaskFactory* factory = TaskFactory::instance(); + ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + if (factory == nullptr) { + /* Should never happen ! */ + return; + } +#if OBSW_PRINT_MISSED_DEADLINES == 1 + void (*missedDeadlineFunc)(void) = TaskFactory::printMissedDeadline; +#else + void (*missedDeadlineFunc)(void) = nullptr; +#endif + + /* TMTC Distribution */ + PeriodicTaskIF* tmtcDistributor = factory->createPeriodicTask( + "DIST", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); + result = tmtcDistributor->addComponent(objects::CCSDS_PACKET_DISTRIBUTOR); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "Object add component failed" << std::endl; + } + result = tmtcDistributor->addComponent(objects::PUS_PACKET_DISTRIBUTOR); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "Object add component failed" << std::endl; + } + result = tmtcDistributor->addComponent(objects::TM_FUNNEL); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "Object add component failed" << std::endl; + } + + PeriodicTaskIF* tmtcBridgeTask = factory->createPeriodicTask( + "TMTC_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); + result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "Add component TMTC Bridge failed" << std::endl; + } + PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask( + "TMTC_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); + result = tmtcPollingTask->addComponent(objects::TMTC_POLLING_TASK); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "Add component TMTC Polling failed" << std::endl; + } + + /* PUS Services */ + std::vector pusTasks; + createPusTasks(*factory, missedDeadlineFunc, pusTasks); + + std::vector pstTasks; + FixedTimeslotTaskIF* pst = factory->createFixedTimeslotTask( + "STAR_TRACKER_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 3.0, missedDeadlineFunc); + result = pst::pstUart(pst); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; + } + pstTasks.push_back(pst); + + PeriodicTaskIF* strHelperTask = factory->createPeriodicTask( + "STR_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); + result = strHelperTask->addComponent(objects::STR_HELPER); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("STR_HELPER", objects::STR_HELPER); + } + pstTasks.push_back(strHelperTask); + + auto taskStarter = [](std::vector& taskVector, std::string name) { + for (const auto& task : taskVector) { + if (task != nullptr) { + task->startTask(); + } else { + sif::error << "Task in vector " << name << " is invalid!" << std::endl; + } + } + }; + + sif::info << "Starting tasks.." << std::endl; + tmtcDistributor->startTask(); + tmtcBridgeTask->startTask(); + tmtcPollingTask->startTask(); + + taskStarter(pstTasks, "PST Tasks"); + taskStarter(pusTasks, "PST Tasks"); + + sif::info << "Tasks started.." << std::endl; +} + +void initmission::createPusTasks(TaskFactory& factory, + TaskDeadlineMissedFunction missedDeadlineFunc, + std::vector& taskVec) { + ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + PeriodicTaskIF* pusVerification = factory.createPeriodicTask( + "PUS_VERIF", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc); + result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "Object add component failed" << std::endl; + } + taskVec.push_back(pusVerification); + + PeriodicTaskIF* pusEvents = factory.createPeriodicTask( + "PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc); + result = pusEvents->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS_EVENTS", objects::PUS_SERVICE_5_EVENT_REPORTING); + } + result = pusEvents->addComponent(objects::EVENT_MANAGER); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS_MGMT", objects::EVENT_MANAGER); + } + taskVec.push_back(pusEvents); + + PeriodicTaskIF* pusHighPrio = factory.createPeriodicTask( + "PUS_HIGH_PRIO", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc); + result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS2", objects::PUS_SERVICE_2_DEVICE_ACCESS); + } + result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS9", objects::PUS_SERVICE_9_TIME_MGMT); + } + taskVec.push_back(pusHighPrio); + + PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask( + "PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); + result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS8", objects::PUS_SERVICE_8_FUNCTION_MGMT); + } + result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS200", objects::PUS_SERVICE_200_MODE_MGMT); + } + result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS20", objects::PUS_SERVICE_20_PARAMETERS); + } + result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS3", objects::PUS_SERVICE_3_HOUSEKEEPING); + } + taskVec.push_back(pusMedPrio); + + PeriodicTaskIF* pusLowPrio = factory.createPeriodicTask( + "PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc); + result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST); + } + result = pusLowPrio->addComponent(objects::INTERNAL_ERROR_REPORTER); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("INT_ERR_RPRT", objects::INTERNAL_ERROR_REPORTER); + } + taskVec.push_back(pusLowPrio); +} diff --git a/bsp_egse/InitMission.h b/bsp_egse/InitMission.h new file mode 100644 index 00000000..f14135dd --- /dev/null +++ b/bsp_egse/InitMission.h @@ -0,0 +1,23 @@ +#ifndef BSP_LINUX_INITMISSION_H_ +#define BSP_LINUX_INITMISSION_H_ + +#include + +#include "fsfw/tasks/Typedef.h" + +class PeriodicTaskIF; +class TaskFactory; + +namespace initmission { +void initMission(); +void initTasks(); + +void createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, + std::vector& taskVec); +void createTestTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, + std::vector& taskVec); +void createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, + std::vector& taskVec); +}; // namespace initmission + +#endif /* BSP_LINUX_INITMISSION_H_ */ diff --git a/bsp_egse/ObjectFactory.cpp b/bsp_egse/ObjectFactory.cpp new file mode 100644 index 00000000..7de917d0 --- /dev/null +++ b/bsp_egse/ObjectFactory.cpp @@ -0,0 +1,53 @@ +#include "ObjectFactory.h" + +#include +#include + +#include "OBSWConfig.h" +#include "fsfw/datapoollocal/LocalDataPoolManager.h" +#include "fsfw/tmtcpacket/pus/tm.h" +#include "fsfw/tmtcservices/CommandingServiceBase.h" +#include "fsfw/tmtcservices/PusServiceBase.h" +#include "mission/core/GenericFactory.h" +#include "mission/utility/TmFunnel.h" +#include "objects/systemObjectList.h" +#include "tmtc/apid.h" +#include "tmtc/pusIds.h" +#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" +#include "linux/devices/startracker/StarTrackerHandler.h" + +#include +#include + +#include +#include + +void Factory::setStaticFrameworkObjectIds() { + PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR; + PusServiceBase::packetDestination = objects::TM_FUNNEL; + + CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; + CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; + + TmFunnel::downlinkDestination = objects::TMTC_BRIDGE; + // No storage object for now. + TmFunnel::storageDestination = objects::NO_OBJECT; + + VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; + TmPacketBase::timeStamperId = objects::TIME_STAMPER; +} + +void ObjectFactory::produce(void* args) { + Factory::setStaticFrameworkObjectIds(); + ObjectFactory::produceGenericObjects(); + + UartCookie* starTrackerCookie = + new UartCookie(objects::STAR_TRACKER, "/dev/serial0", UartModes::NON_CANONICAL, + uart::STAR_TRACKER_BAUD, StarTracker::MAX_FRAME_SIZE * 2 + 2); + new UartComIF(objects::UART_COM_IF); + starTrackerCookie->setNoFixedSizeReply(); + StrHelper* strHelper = new StrHelper(objects::STR_HELPER); + StarTrackerHandler* starTrackerHandler = new StarTrackerHandler( + objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, strHelper); + starTrackerHandler->setStartUpImmediately(); +} diff --git a/bsp_egse/ObjectFactory.h b/bsp_egse/ObjectFactory.h new file mode 100644 index 00000000..909baf06 --- /dev/null +++ b/bsp_egse/ObjectFactory.h @@ -0,0 +1,11 @@ +#ifndef BSP_LINUX_OBJECTFACTORY_H_ +#define BSP_LINUX_OBJECTFACTORY_H_ + +namespace ObjectFactory { +void setStatics(); +void produce(void* args); + +void createTestTasks(); +}; // namespace ObjectFactory + +#endif /* BSP_LINUX_OBJECTFACTORY_H_ */ diff --git a/bsp_egse/boardconfig/CMakeLists.txt b/bsp_egse/boardconfig/CMakeLists.txt new file mode 100644 index 00000000..67fbaf88 --- /dev/null +++ b/bsp_egse/boardconfig/CMakeLists.txt @@ -0,0 +1,7 @@ +target_sources(${TARGET_NAME} PRIVATE + print.c +) + +target_include_directories(${TARGET_NAME} PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/bsp_egse/boardconfig/etl_profile.h b/bsp_egse/boardconfig/etl_profile.h new file mode 100644 index 00000000..54aca344 --- /dev/null +++ b/bsp_egse/boardconfig/etl_profile.h @@ -0,0 +1,38 @@ +///\file + +/****************************************************************************** +The MIT License(MIT) + +Embedded Template Library. +https://github.com/ETLCPP/etl +https://www.etlcpp.com + +Copyright(c) 2019 jwellbelove + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files(the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions : + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +******************************************************************************/ +#ifndef __ETL_PROFILE_H__ +#define __ETL_PROFILE_H__ + +#define ETL_CHECK_PUSH_POP + +#define ETL_CPP11_SUPPORTED 1 +#define ETL_NO_NULLPTR_SUPPORT 0 + +#endif diff --git a/bsp_egse/boardconfig/gcov.h b/bsp_egse/boardconfig/gcov.h new file mode 100644 index 00000000..80acdd86 --- /dev/null +++ b/bsp_egse/boardconfig/gcov.h @@ -0,0 +1,15 @@ +#ifndef LINUX_GCOV_H_ +#define LINUX_GCOV_H_ +#include + +#ifdef GCOV +extern "C" void __gcov_flush(); +#else +void __gcov_flush() { + sif::info << "GCC GCOV: Please supply GCOV=1 in Makefile if " + "coverage information is desired.\n" + << std::flush; +} +#endif + +#endif /* LINUX_GCOV_H_ */ diff --git a/bsp_egse/boardconfig/print.c b/bsp_egse/boardconfig/print.c new file mode 100644 index 00000000..5b3a0f91 --- /dev/null +++ b/bsp_egse/boardconfig/print.c @@ -0,0 +1,10 @@ +#include +#include + +void printChar(const char* character, bool errStream) { + if (errStream) { + putc(*character, stderr); + return; + } + putc(*character, stdout); +} diff --git a/bsp_egse/boardconfig/print.h b/bsp_egse/boardconfig/print.h new file mode 100644 index 00000000..8e7e2e5d --- /dev/null +++ b/bsp_egse/boardconfig/print.h @@ -0,0 +1,8 @@ +#ifndef HOSTED_BOARDCONFIG_PRINT_H_ +#define HOSTED_BOARDCONFIG_PRINT_H_ + +#include + +void printChar(const char* character, bool errStream); + +#endif /* HOSTED_BOARDCONFIG_PRINT_H_ */ diff --git a/bsp_egse/boardconfig/rpiConfig.h.in b/bsp_egse/boardconfig/rpiConfig.h.in new file mode 100644 index 00000000..af4f0dd2 --- /dev/null +++ b/bsp_egse/boardconfig/rpiConfig.h.in @@ -0,0 +1,6 @@ +#ifndef BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_ +#define BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_ + +#include + +#endif /* BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_ */ diff --git a/bsp_egse/main.cpp b/bsp_egse/main.cpp new file mode 100644 index 00000000..661c26b2 --- /dev/null +++ b/bsp_egse/main.cpp @@ -0,0 +1,27 @@ +#include + +#include "InitMission.h" +#include "OBSWConfig.h" +#include "OBSWVersion.h" +#include "fsfw/FSFWVersion.h" +#include "fsfw/tasks/TaskFactory.h" + +/** + * @brief This is the main program and entry point for egse (raspberry pi 4) + * @return + */ +int main(void) { + std::cout << "-- EIVE OBSW --" << std::endl; + std::cout << "-- Compiled for EGSE from Arcsec" << " --" << std::endl; + std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "." + << SW_REVISION << ", FSFW v" << FSFW_VERSION << "." << FSFW_SUBVERSION << FSFW_REVISION + << "--" << std::endl; + std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; + + initmission::initMission(); + + for (;;) { + /* Suspend main thread by sleeping it. */ + TaskFactory::delayTask(5000); + } +} diff --git a/bsp_linux_board/InitMission.cpp b/bsp_linux_board/InitMission.cpp index 86d5fb4b..b8328ee9 100644 --- a/bsp_linux_board/InitMission.cpp +++ b/bsp_linux_board/InitMission.cpp @@ -63,30 +63,38 @@ void initmission::initTasks() { sif::error << "Object add component failed" << std::endl; } - /* UDP bridge */ - PeriodicTaskIF* udpBridgeTask = factory->createPeriodicTask( - "UDP_UNIX_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); - result = udpBridgeTask->addComponent(objects::TMTC_BRIDGE); + PeriodicTaskIF* tmtcBridgeTask = factory->createPeriodicTask( + "TMTC_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); + result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE); if (result != HasReturnvaluesIF::RETURN_OK) { - sif::error << "Add component UDP Unix Bridge failed" << std::endl; + sif::error << "Add component TMTC Bridge failed" << std::endl; } - PeriodicTaskIF* udpPollingTask = factory->createPeriodicTask( - "UDP_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); - result = udpPollingTask->addComponent(objects::TMTC_POLLING_TASK); + PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask( + "TMTC_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); + result = tmtcPollingTask->addComponent(objects::TMTC_POLLING_TASK); if (result != HasReturnvaluesIF::RETURN_OK) { - sif::error << "Add component UDP Polling failed" << std::endl; + sif::error << "Add component TMTC Polling failed" << std::endl; } /* PUS Services */ std::vector pusTasks; createPusTasks(*factory, missedDeadlineFunc, pusTasks); - std::vector pstTasks; - createPstTasks(*factory, missedDeadlineFunc, pstTasks); -#if OBSW_ADD_TEST_CODE == 1 - std::vector testTasks; - createTestTasks(*factory, missedDeadlineFunc, pstTasks); -#endif /* OBSW_ADD_TEST_CODE == 1 */ + FixedTimeslotTaskIF* pst = factory.createFixedTimeslotTask( + "STAR_TRACKER_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 3.0, missedDeadlineFunc); + result = pst::pstUart(Pst); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; + } + taskVec.push_back(pst); + + PeriodicTaskIF* strHelperTask = factory->createPeriodicTask( + "STR_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); + result = strHelperTask->addComponent(objects::STR_HELPER); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("STR_HELPER", objects::STR_HELPER); + } + taskvec.push_back(strHelperTask); auto taskStarter = [](std::vector& taskVector, std::string name) { for (const auto& task : taskVector) { @@ -99,21 +107,12 @@ void initmission::initTasks() { }; sif::info << "Starting tasks.." << std::endl; - tmTcDistributor->startTask(); - udpBridgeTask->startTask(); - udpPollingTask->startTask(); + tmtcDistributor->startTask(); + tmtcBridgeTask->startTask(); + tmtcPollingTask->startTask(); - taskStarter(pusTasks, "PUS Tasks"); -#if OBSW_ADD_TEST_CODE == 1 - taskStarter(testTasks, "Test Tasks"); -#endif /* OBSW_ADD_TEST_CODE == 1 */ taskStarter(pstTasks, "PST Tasks"); -#if OBSW_ADD_TEST_PST == 1 - if (startTestPst) { - pstTestTask->startTask(); - } -#endif /* RPI_TEST_ACS_BOARD == 1 */ sif::info << "Tasks started.." << std::endl; } @@ -185,60 +184,3 @@ void initmission::createPusTasks(TaskFactory& factory, } taskVec.push_back(pusLowPrio); } - -void initmission::createPstTasks(TaskFactory& factory, - TaskDeadlineMissedFunction missedDeadlineFunc, - std::vector& taskVec) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; -#if OBSW_ADD_SPI_TEST_CODE == 0 - FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask( - "SPI_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 3.0, missedDeadlineFunc); - result = pst::pstSpi(spiPst); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; - } - taskVec.push_back(spiPst); -#endif -} - -void initmission::createTestTasks(TaskFactory& factory, - TaskDeadlineMissedFunction missedDeadlineFunc, - std::vector& taskVec) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - PeriodicTaskIF* testTask = factory.createPeriodicTask( - "TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); - result = testTask->addComponent(objects::TEST_TASK); - if (result != HasReturnvaluesIF::RETURN_OK) { - initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK); - } -#if RPI_ADD_SPI_TEST == 1 - result = testTask->addComponent(objects::SPI_TEST); - if (result != HasReturnvaluesIF::RETURN_OK) { - initmission::printAddObjectError("SPI_TEST", objects::SPI_TEST); - } -#endif /* RPI_ADD_SPI_TEST == 1 */ -#if RPI_ADD_GPIO_TEST == 1 - result = testTask->addComponent(objects::LIBGPIOD_TEST); - if (result != HasReturnvaluesIF::RETURN_OK) { - initmission::printAddObjectError("GPIOD_TEST", objects::LIBGPIOD_TEST); - } -#endif /* RPI_ADD_GPIO_TEST == 1 */ -#if RPI_ADD_UART_TEST == 1 - result = testTask->addComponent(objects::UART_TEST); - if (result != HasReturnvaluesIF::RETURN_OK) { - initmission::printAddObjectError("UART_TEST", objects::UART_TEST); - } -#endif /* RPI_ADD_GPIO_TEST == 1 */ - - bool startTestPst = true; - static_cast(startTestPst); -#if OBSW_ADD_TEST_PST == 1 - FixedTimeslotTaskIF* pstTestTask = factory->createFixedTimeslotTask( - "TEST_PST", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 2.0, missedDeadlineFunc); - result = pst::pstTest(pstTestTask); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::info << "initmission::initTasks: ACS PST empty or invalid" << std::endl; - startTestPst = false; - } -#endif /* RPI_TEST_ACS_BOARD == 1 */ -} diff --git a/bsp_linux_board/boardconfig/print.c b/bsp_linux_board/boardconfig/print.c index 3aba2d73..c2b2e15d 100644 --- a/bsp_linux_board/boardconfig/print.c +++ b/bsp_linux_board/boardconfig/print.c @@ -1,4 +1,4 @@ -#include +#include #include void printChar(const char* character, bool errStream) { diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index cb01496c..ab754897 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -86,7 +86,7 @@ void initmission::initTasks() { "TCPIP_TMTC_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE); if (result != HasReturnvaluesIF::RETURN_OK) { - initmission::printAddObjectError("UDP_BRIDGE", objects::TMTC_BRIDGE); + initmission::printAddObjectError("TMTC_BRIDGE", objects::TMTC_BRIDGE); } PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask( "TMTC_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); @@ -135,9 +135,9 @@ void initmission::initTasks() { } #if OBSW_ADD_STAR_TRACKER == 1 - PeriodicTaskIF* strImgLoaderTask = factory->createPeriodicTask( + PeriodicTaskIF* strHelperTask = factory->createPeriodicTask( "STR_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); - result = strImgLoaderTask->addComponent(objects::STR_HELPER); + result = strHelperTask->addComponent(objects::STR_HELPER); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("STR_HELPER", objects::STR_HELPER); } @@ -204,7 +204,7 @@ void initmission::initTasks() { #if BOARD_TE0720 == 0 fsTask->startTask(); #if OBSW_ADD_STAR_TRACKER == 1 - strImgLoaderTask->startTask(); + strHelperTask >startTask(); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ #endif diff --git a/bsp_q7s/devices/CMakeLists.txt b/bsp_q7s/devices/CMakeLists.txt index 70705e83..6347b5f8 100644 --- a/bsp_q7s/devices/CMakeLists.txt +++ b/bsp_q7s/devices/CMakeLists.txt @@ -2,6 +2,4 @@ target_sources(${TARGET_NAME} PRIVATE PlocSupervisorHandler.cpp PlocUpdater.cpp PlocMemoryDumper.cpp -) - -add_subdirectory(startracker) \ No newline at end of file +) \ No newline at end of file diff --git a/cmake/HardwareOsPreConfig.cmake b/cmake/HardwareOsPreConfig.cmake index 3ff67565..88df808c 100644 --- a/cmake/HardwareOsPreConfig.cmake +++ b/cmake/HardwareOsPreConfig.cmake @@ -47,7 +47,7 @@ if(CMAKE_CROSSCOMPILING) set_property(CACHE TGT_BSP PROPERTY STRINGS - "arm/q7s" "arm/raspberrypi" + "arm/q7s" "arm/raspberrypi" "arm/egse" ) endif() @@ -57,6 +57,8 @@ if(TGT_BSP) set(BSP_PATH "bsp_linux_board") elseif(TGT_BSP MATCHES "arm/q7s") set(BSP_PATH "bsp_q7s") + elseif(TGT_BSP MATCHES "arm/egse") + set(BSP_PATH "bsp_egse") else() message(WARNING "CMake not configured for this target!") message(FATAL_ERROR "Target: ${TGT_BSP}!") diff --git a/cmake/PreProjectConfig.cmake b/cmake/PreProjectConfig.cmake index 9f1790bb..9623553c 100644 --- a/cmake/PreProjectConfig.cmake +++ b/cmake/PreProjectConfig.cmake @@ -16,7 +16,7 @@ if(FSFW_OSAL MATCHES linux AND TGT_BSP) "${CMAKE_SCRIPT_PATH}/Q7SCrossCompileConfig.cmake" PARENT_SCOPE ) - elseif(TGT_BSP MATCHES "arm/raspberrypi") + elseif(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/egse") if(NOT DEFINED ENV{LINUX_ROOTFS}) if(NOT DEFINED LINUX_ROOTFS) message(WARNING "No LINUX_ROOTFS environmental or CMake variable set!") diff --git a/cmake/scripts/egse/egse_path_helper_win.sh b/cmake/scripts/egse/egse_path_helper_win.sh new file mode 100644 index 00000000..006d20e7 --- /dev/null +++ b/cmake/scripts/egse/egse_path_helper_win.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# Script to set path to raspberry pi toolchain +# Run script with: source egse_path_helper_win.sh +TOOLCHAIN_PATH="/c/SysGCC/raspberry/bin" +if [ $# -eq 1 ];then + export PATH=$PATH:"$1" +else + echo "Path of toolchain set to $TOOLCHAIN_PATH" + export PATH=$PATH:$TOOLCHAIN_PATH +fi + +export CROSS_COMPILE="arm-linux-gnueabihf" +export RASPBERRY_VERSION="4" \ No newline at end of file diff --git a/cmake/scripts/egse/make-debug-cfg.sh b/cmake/scripts/egse/make-debug-cfg.sh new file mode 100644 index 00000000..9a611373 --- /dev/null +++ b/cmake/scripts/egse/make-debug-cfg.sh @@ -0,0 +1,34 @@ +#!/bin/sh +counter=0 +cfg_script_name="cmake-build-cfg.py" +while [ ${counter} -lt 5 ] +do + cd .. + if [ -f ${cfg_script_name} ];then + break + fi + counter=$((counter=counter + 1)) +done + +if [ "${counter}" -ge 5 ];then + echo "${cfg_script_name} not found in upper directories!" + exit 1 +fi + + +os_fsfw="linux" +tgt_bsp="arm/egse" +build_generator="make" +build_dir="build-Debug-egse" +if [ "${OS}" = "Windows_NT" ]; then + python="py" +# Could be other OS but this works for now. +else + python="python3" +fi + +echo "Running command (without the leading +):" +set -x # Print command +${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l"${build_dir}" +# set +x diff --git a/common/config/devConf.h b/common/config/devConf.h index 78681ec7..3938d312 100644 --- a/common/config/devConf.h +++ b/common/config/devConf.h @@ -42,9 +42,9 @@ namespace uart { static constexpr size_t HYPERION_GPS_REPLY_MAX_BUFFER = 1024; static constexpr uint32_t SYRLINKS_BAUD = 38400; static constexpr uint32_t GNSS_BAUD = 9600; -static constexpr uint32_t PLOC_MPSOC_BAUD = 115200; +static constexpr uint32_t PLOC_MPSOC_BAUD = 921600; static constexpr uint32_t PLOC_SUPERVISOR_BAUD = 115200; -static constexpr uint32_t STAR_TRACKER_BAUD = 115200; +static constexpr uint32_t STAR_TRACKER_BAUD = 921600; } diff --git a/linux/boardtest/SpiTestClass.cpp b/linux/boardtest/SpiTestClass.cpp index 7ef76d95..6a170115 100644 --- a/linux/boardtest/SpiTestClass.cpp +++ b/linux/boardtest/SpiTestClass.cpp @@ -279,66 +279,66 @@ void SpiTestClass::acsInit() { #ifdef RASPBERRY_PI GpiodRegularByChip *gpio = nullptr; std::string rpiGpioName = "gpiochip0"; - gpio = new GpiodRegularByChip(rpiGpioName, mgm0Lis3mdlChipSelect, "MGM_0_LIS3", gpio::DIR_OUT, + gpio = new GpiodRegularByChip(rpiGpioName, mgm0Lis3mdlChipSelect, "MGM_0_LIS3", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_0_LIS3_CS, gpio); - gpio = new GpiodRegularByChip(rpiGpioName, mgm1Rm3100ChipSelect, "MGM_1_RM3100", gpio::DIR_OUT, + gpio = new GpiodRegularByChip(rpiGpioName, mgm1Rm3100ChipSelect, "MGM_1_RM3100", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_1_RM3100_CS, gpio); - gpio = new GpiodRegularByChip(rpiGpioName, gyro0AdisChipSelect, "GYRO_0_ADIS", gpio::DIR_OUT, + gpio = new GpiodRegularByChip(rpiGpioName, gyro0AdisChipSelect, "GYRO_0_ADIS", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio); - gpio = new GpiodRegularByChip(rpiGpioName, gyro1L3gd20ChipSelect, "GYRO_1_L3G", gpio::DIR_OUT, + gpio = new GpiodRegularByChip(rpiGpioName, gyro1L3gd20ChipSelect, "GYRO_1_L3G", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_1_L3G_CS, gpio); - gpio = new GpiodRegularByChip(rpiGpioName, gyro3L3gd20ChipSelect, "GYRO_2_L3G", gpio::DIR_OUT, + gpio = new GpiodRegularByChip(rpiGpioName, gyro3L3gd20ChipSelect, "GYRO_2_L3G", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_3_L3G_CS, gpio); - gpio = new GpiodRegularByChip(rpiGpioName, mgm2Lis3mdlChipSelect, "MGM_2_LIS3", gpio::DIR_OUT, + gpio = new GpiodRegularByChip(rpiGpioName, mgm2Lis3mdlChipSelect, "MGM_2_LIS3", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_2_LIS3_CS, gpio); - gpio = new GpiodRegularByChip(rpiGpioName, mgm3Rm3100ChipSelect, "MGM_3_RM3100", gpio::DIR_OUT, + gpio = new GpiodRegularByChip(rpiGpioName, mgm3Rm3100ChipSelect, "MGM_3_RM3100", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio); #elif defined(XIPHOS_Q7S) GpiodRegularByLineName *gpio = nullptr; gpio = - new GpiodRegularByLineName(q7s::gpioNames::MGM_0_CS, "MGM_0_LIS3", gpio::DIR_OUT, gpio::HIGH); + new GpiodRegularByLineName(q7s::gpioNames::MGM_0_CS, "MGM_0_LIS3", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_0_LIS3_CS, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_1_RM3100", gpio::DIR_OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_1_RM3100", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_1_RM3100_CS, gpio); gpio = - new GpiodRegularByLineName(q7s::gpioNames::MGM_2_CS, "MGM_2_LIS3", gpio::DIR_OUT, gpio::HIGH); + new GpiodRegularByLineName(q7s::gpioNames::MGM_2_CS, "MGM_2_LIS3", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_2_LIS3_CS, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_3_RM3100", gpio::DIR_OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_3_RM3100", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, "GYRO_0_ADIS", gpio::DIR_OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, "GYRO_0_ADIS", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_1_L3G_CS, "GYRO_1_L3G", gpio::DIR_OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_1_L3G_CS, "GYRO_1_L3G", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_1_L3G_CS, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ADIS_CS, "GYRO_2_ADIS", gpio::DIR_OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ADIS_CS, "GYRO_2_ADIS", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_2_ADIS_CS, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_3_L3G_CS, "GYRO_3_L3G", gpio::DIR_OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_3_L3G_CS, "GYRO_3_L3G", gpio::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_3_L3G_CS, gpio); // Enable pins must be pulled low for regular operations - gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_0_ENABLE", gpio::DIR_OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_0_ENABLE", gpio::OUT, gpio::LOW); gpioCookie->addGpio(gpioIds::GYRO_0_ENABLE, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_2_ENABLE", gpio::DIR_OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_2_ENABLE", gpio::OUT, gpio::LOW); gpioCookie->addGpio(gpioIds::GYRO_2_ENABLE, gpio); #endif diff --git a/linux/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt index b02c8e57..0b545a7d 100644 --- a/linux/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -2,3 +2,5 @@ target_sources(${TARGET_NAME} PRIVATE SolarArrayDeploymentHandler.cpp SusHandler.cpp ) + +add_subdirectory(startracker) \ No newline at end of file diff --git a/bsp_q7s/devices/startracker/StarTrackerDefinitions.h b/linux/devices/devicedefinitions/StarTrackerDefinitions.h similarity index 99% rename from bsp_q7s/devices/startracker/StarTrackerDefinitions.h rename to linux/devices/devicedefinitions/StarTrackerDefinitions.h index dda013b2..adfcf9b6 100644 --- a/bsp_q7s/devices/startracker/StarTrackerDefinitions.h +++ b/linux/devices/devicedefinitions/StarTrackerDefinitions.h @@ -1,5 +1,5 @@ -#ifndef MISSION_STARTRACKER_DEFINITIONS_H_ -#define MISSION_STARTRACKER_DEFINITIONS_H_ +#ifndef LINUX_DEVICES_DEVICEDEFINITIONS_DEFINITIONS_H_ +#define LINUX_DEVICES_DEVICEDEFINITIONS_DEFINITIONS_H_ #include #include @@ -1203,4 +1203,4 @@ class LimitsSet : public StaticLocalDataSet { } }; } // namespace StarTracker -#endif /* MISSION_STARTRACKER_DEFINITIONS_H_ */ +#endif /* LINUX_DEVICES_DEVICEDEFINITIONS_DEFINITIONS_H_ */ diff --git a/bsp_q7s/devices/startracker/ArcsecDatalinkLayer.cpp b/linux/devices/startracker/ArcsecDatalinkLayer.cpp similarity index 100% rename from bsp_q7s/devices/startracker/ArcsecDatalinkLayer.cpp rename to linux/devices/startracker/ArcsecDatalinkLayer.cpp diff --git a/bsp_q7s/devices/startracker/ArcsecDatalinkLayer.h b/linux/devices/startracker/ArcsecDatalinkLayer.h similarity index 97% rename from bsp_q7s/devices/startracker/ArcsecDatalinkLayer.h rename to linux/devices/startracker/ArcsecDatalinkLayer.h index 6b4d3095..08c62bb4 100644 --- a/bsp_q7s/devices/startracker/ArcsecDatalinkLayer.h +++ b/linux/devices/startracker/ArcsecDatalinkLayer.h @@ -1,7 +1,7 @@ #ifndef BSP_Q7S_DEVICES_ARCSECDATALINKLAYER_H_ #define BSP_Q7S_DEVICES_ARCSECDATALINKLAYER_H_ -#include "StarTrackerDefinitions.h" +#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h" extern "C" { diff --git a/bsp_q7s/devices/startracker/ArcsecJsonKeys.h b/linux/devices/startracker/ArcsecJsonKeys.h similarity index 100% rename from bsp_q7s/devices/startracker/ArcsecJsonKeys.h rename to linux/devices/startracker/ArcsecJsonKeys.h diff --git a/bsp_q7s/devices/startracker/ArcsecJsonParamBase.cpp b/linux/devices/startracker/ArcsecJsonParamBase.cpp similarity index 100% rename from bsp_q7s/devices/startracker/ArcsecJsonParamBase.cpp rename to linux/devices/startracker/ArcsecJsonParamBase.cpp diff --git a/bsp_q7s/devices/startracker/ArcsecJsonParamBase.h b/linux/devices/startracker/ArcsecJsonParamBase.h similarity index 98% rename from bsp_q7s/devices/startracker/ArcsecJsonParamBase.h rename to linux/devices/startracker/ArcsecJsonParamBase.h index a3e7528f..68e04173 100644 --- a/bsp_q7s/devices/startracker/ArcsecJsonParamBase.h +++ b/linux/devices/startracker/ArcsecJsonParamBase.h @@ -5,7 +5,7 @@ #include #include -#include "StarTrackerDefinitions.h" +#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h" extern "C" { diff --git a/bsp_q7s/devices/startracker/CMakeLists.txt b/linux/devices/startracker/CMakeLists.txt similarity index 100% rename from bsp_q7s/devices/startracker/CMakeLists.txt rename to linux/devices/startracker/CMakeLists.txt diff --git a/bsp_q7s/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp similarity index 100% rename from bsp_q7s/devices/startracker/StarTrackerHandler.cpp rename to linux/devices/startracker/StarTrackerHandler.cpp diff --git a/bsp_q7s/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h similarity index 99% rename from bsp_q7s/devices/startracker/StarTrackerHandler.h rename to linux/devices/startracker/StarTrackerHandler.h index 235663a4..dc820067 100644 --- a/bsp_q7s/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -5,7 +5,7 @@ #include "ArcsecDatalinkLayer.h" #include "ArcsecJsonParamBase.h" -#include "StarTrackerDefinitions.h" +#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "StrHelper.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/src/fsfw/serialize/SerializeAdapter.h" diff --git a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp b/linux/devices/startracker/StarTrackerJsonCommands.cpp similarity index 100% rename from bsp_q7s/devices/startracker/StarTrackerJsonCommands.cpp rename to linux/devices/startracker/StarTrackerJsonCommands.cpp diff --git a/bsp_q7s/devices/startracker/StarTrackerJsonCommands.h b/linux/devices/startracker/StarTrackerJsonCommands.h similarity index 100% rename from bsp_q7s/devices/startracker/StarTrackerJsonCommands.h rename to linux/devices/startracker/StarTrackerJsonCommands.h diff --git a/bsp_q7s/devices/startracker/StrHelper.cpp b/linux/devices/startracker/StrHelper.cpp similarity index 99% rename from bsp_q7s/devices/startracker/StrHelper.cpp rename to linux/devices/startracker/StrHelper.cpp index 417ea248..0c6e714a 100644 --- a/bsp_q7s/devices/startracker/StrHelper.cpp +++ b/linux/devices/startracker/StrHelper.cpp @@ -11,11 +11,13 @@ StrHelper::StrHelper(object_id_t objectId) : SystemObject(objectId) {} StrHelper::~StrHelper() {} ReturnValue_t StrHelper::initialize() { +#ifdef XIPHOS_Q7S sdcMan = SdCardManager::instance(); if (sdcMan == nullptr) { sif::warning << "StrHelper::initialize: Invalid SD Card Manager" << std::endl; return RETURN_FAILED; } +#endif return RETURN_OK; } @@ -107,10 +109,12 @@ ReturnValue_t StrHelper::setComIF(DeviceCommunicationIF* communicationInterface_ void StrHelper::setComCookie(CookieIF* comCookie_) { comCookie = comCookie_; } ReturnValue_t StrHelper::startImageUpload(std::string fullname) { +#ifdef XIPHOS_Q7S ReturnValue_t result = checkPath(fullname); if (result != RETURN_OK) { return result; } +#endif uploadImage.uploadFile = fullname; if (not std::filesystem::exists(fullname)) { return FILE_NOT_EXISTS; @@ -122,10 +126,12 @@ ReturnValue_t StrHelper::startImageUpload(std::string fullname) { } ReturnValue_t StrHelper::startImageDownload(std::string path) { +#ifdef XIPHOS_Q7S ReturnValue_t result = checkPath(path); if (result != RETURN_OK) { return result; } +#endif if (not std::filesystem::exists(path)) { return PATH_NOT_EXISTS; } @@ -145,10 +151,12 @@ void StrHelper::setFlashReadFilename(std::string filename) { flashRead.filename void StrHelper::setDownloadFpgaImage(std::string filename) { fpgaDownload.fileName = filename; } ReturnValue_t StrHelper::startFlashWrite(std::string fullname, uint8_t region, uint32_t address) { +#ifdef XIPHOS_Q7S ReturnValue_t result = checkPath(fullname); if (result != RETURN_OK) { return result; } +#endif flashWrite.fullname = fullname; if (not std::filesystem::exists(flashWrite.fullname)) { return FILE_NOT_EXISTS; @@ -163,10 +171,12 @@ ReturnValue_t StrHelper::startFlashWrite(std::string fullname, uint8_t region, u ReturnValue_t StrHelper::startFlashRead(std::string path, uint8_t region, uint32_t address, uint32_t length) { +#ifdef XIPHOS_Q7S ReturnValue_t result = checkPath(path); if (result != RETURN_OK) { return result; } +#endif flashRead.path = path; if (not std::filesystem::exists(flashRead.path)) { return FILE_NOT_EXISTS; @@ -664,6 +674,7 @@ ReturnValue_t StrHelper::checkFpgaActionReply(uint32_t expectedPosition, uint32_ return result; } +#ifdef XIPHOS_Q7S ReturnValue_t StrHelper::checkPath(std::string name) { if (name.substr(0, sizeof(SdCardManager::SD_0_MOUNT_POINT)) == std::string(SdCardManager::SD_0_MOUNT_POINT)) { @@ -680,6 +691,7 @@ ReturnValue_t StrHelper::checkPath(std::string name) { } return RETURN_OK; } +#endif void StrHelper::printProgress(uint32_t itemsTransferred, uint32_t fullNumItems) { float progressInPercent = diff --git a/bsp_q7s/devices/startracker/StrHelper.h b/linux/devices/startracker/StrHelper.h similarity index 99% rename from bsp_q7s/devices/startracker/StrHelper.h rename to linux/devices/startracker/StrHelper.h index 77fe7d2a..1f8a4882 100644 --- a/bsp_q7s/devices/startracker/StrHelper.h +++ b/linux/devices/startracker/StrHelper.h @@ -4,7 +4,11 @@ #include #include "ArcsecDatalinkLayer.h" + +#ifdef XIPHOS_Q7S #include "bsp_q7s/memory/SdCardManager.h" +#endif + #include "fsfw/devicehandlers/CookieIF.h" #include "fsfw/objectmanager/SystemObject.h" #include "fsfw/osal/linux/BinarySemaphore.h" @@ -287,7 +291,9 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu }; FlashRead flashRead; +#ifdef XIPHOS_Q7S SdCardManager* sdcMan = nullptr; +#endif uint8_t commandBuffer[StarTracker::MAX_FRAME_SIZE]; @@ -389,12 +395,14 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu */ ReturnValue_t checkFpgaActionReply(uint32_t expectedPosition, uint32_t expectedLength); +#ifdef XIPHOS_Q7S /** * @brief Checks if a path points to an sd card and whether the SD card is monuted. * * @return SD_NOT_MOUNTED id SD card is not mounted, otherwise RETURN_OK */ ReturnValue_t checkPath(std::string name); +#endif /** * @brief Prints progress of transfer which can be useful for large data transfers diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index c3caf1a9..15952fa4 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -9,6 +9,7 @@ #cmakedefine RASPBERRY_PI #cmakedefine XIPHOS_Q7S #cmakedefine BEAGLEBONEBLACK +#cmakedefine EGSE #ifdef RASPBERRY_PI #include "rpiConfig.h" diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 70119272..3caf7341 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -526,6 +526,7 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); #endif + static_cast(length); if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) { sif::error << "I2C PST initialization failed" << std::endl; return HasReturnvaluesIF::RETURN_FAILED; diff --git a/scripts/egse-port.sh b/scripts/egse-port.sh new file mode 100644 index 00000000..c390cc63 --- /dev/null +++ b/scripts/egse-port.sh @@ -0,0 +1,6 @@ +#!/bin/bash +echo "-L 1534:localhost:1534 portforwarding for tcf agent" +echo "-L 1537:192.168.133.10:7301 for TMTC commanding using the TCP/IP IF" + +ssh -L 1534:localhost:1534 pi@192.168.18.31 +ssh -L 1537:localhost:7301 pi@192.168.18.31 \ No newline at end of file From 19c97546b6b224e18dcb5d8ee357c0e565ac0a6f Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 5 Feb 2022 15:38:13 +0100 Subject: [PATCH 07/61] improved naming of tmtc bridge and tmtc polling task --- bsp_linux_board/InitMission.cpp | 90 +++++++++++++++++++++++++++------ 1 file changed, 74 insertions(+), 16 deletions(-) diff --git a/bsp_linux_board/InitMission.cpp b/bsp_linux_board/InitMission.cpp index b8328ee9..63e06997 100644 --- a/bsp_linux_board/InitMission.cpp +++ b/bsp_linux_board/InitMission.cpp @@ -63,6 +63,7 @@ void initmission::initTasks() { sif::error << "Object add component failed" << std::endl; } + /* UDP bridge */ PeriodicTaskIF* tmtcBridgeTask = factory->createPeriodicTask( "TMTC_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE); @@ -80,21 +81,12 @@ void initmission::initTasks() { std::vector pusTasks; createPusTasks(*factory, missedDeadlineFunc, pusTasks); - FixedTimeslotTaskIF* pst = factory.createFixedTimeslotTask( - "STAR_TRACKER_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 3.0, missedDeadlineFunc); - result = pst::pstUart(Pst); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; - } - taskVec.push_back(pst); - - PeriodicTaskIF* strHelperTask = factory->createPeriodicTask( - "STR_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); - result = strHelperTask->addComponent(objects::STR_HELPER); - if (result != HasReturnvaluesIF::RETURN_OK) { - initmission::printAddObjectError("STR_HELPER", objects::STR_HELPER); - } - taskvec.push_back(strHelperTask); + std::vector pstTasks; + createPstTasks(*factory, missedDeadlineFunc, pstTasks); +#if OBSW_ADD_TEST_CODE == 1 + std::vector testTasks; + createTestTasks(*factory, missedDeadlineFunc, pstTasks); +#endif /* OBSW_ADD_TEST_CODE == 1 */ auto taskStarter = [](std::vector& taskVector, std::string name) { for (const auto& task : taskVector) { @@ -107,12 +99,21 @@ void initmission::initTasks() { }; sif::info << "Starting tasks.." << std::endl; - tmtcDistributor->startTask(); + tmTcDistributor->startTask(); tmtcBridgeTask->startTask(); tmtcPollingTask->startTask(); + taskStarter(pusTasks, "PUS Tasks"); +#if OBSW_ADD_TEST_CODE == 1 + taskStarter(testTasks, "Test Tasks"); +#endif /* OBSW_ADD_TEST_CODE == 1 */ taskStarter(pstTasks, "PST Tasks"); +#if OBSW_ADD_TEST_PST == 1 + if (startTestPst) { + pstTestTask->startTask(); + } +#endif /* RPI_TEST_ACS_BOARD == 1 */ sif::info << "Tasks started.." << std::endl; } @@ -184,3 +185,60 @@ void initmission::createPusTasks(TaskFactory& factory, } taskVec.push_back(pusLowPrio); } + +void initmission::createPstTasks(TaskFactory& factory, + TaskDeadlineMissedFunction missedDeadlineFunc, + std::vector& taskVec) { + ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; +#if OBSW_ADD_SPI_TEST_CODE == 0 + FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask( + "SPI_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 3.0, missedDeadlineFunc); + result = pst::pstSpi(spiPst); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; + } + taskVec.push_back(spiPst); +#endif +} + +void initmission::createTestTasks(TaskFactory& factory, + TaskDeadlineMissedFunction missedDeadlineFunc, + std::vector& taskVec) { + ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + PeriodicTaskIF* testTask = factory.createPeriodicTask( + "TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); + result = testTask->addComponent(objects::TEST_TASK); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK); + } +#if RPI_ADD_SPI_TEST == 1 + result = testTask->addComponent(objects::SPI_TEST); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("SPI_TEST", objects::SPI_TEST); + } +#endif /* RPI_ADD_SPI_TEST == 1 */ +#if RPI_ADD_GPIO_TEST == 1 + result = testTask->addComponent(objects::LIBGPIOD_TEST); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("GPIOD_TEST", objects::LIBGPIOD_TEST); + } +#endif /* RPI_ADD_GPIO_TEST == 1 */ +#if RPI_ADD_UART_TEST == 1 + result = testTask->addComponent(objects::UART_TEST); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("UART_TEST", objects::UART_TEST); + } +#endif /* RPI_ADD_GPIO_TEST == 1 */ + + bool startTestPst = true; + static_cast(startTestPst); +#if OBSW_ADD_TEST_PST == 1 + FixedTimeslotTaskIF* pstTestTask = factory->createFixedTimeslotTask( + "TEST_PST", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 2.0, missedDeadlineFunc); + result = pst::pstTest(pstTestTask); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::info << "initmission::initTasks: ACS PST empty or invalid" << std::endl; + startTestPst = false; + } +#endif /* RPI_TEST_ACS_BOARD == 1 */ +} From b4d1046928e80556046baef4502df8ed7c533212 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 5 Feb 2022 15:39:16 +0100 Subject: [PATCH 08/61] obsw configuration running on egse --- bsp_egse/InitMission.cpp | 2 +- linux/devices/startracker/StarTrackerHandler.h | 5 ++++- linux/devices/startracker/StrHelper.h | 2 +- linux/fsfwconfig/OBSWConfig.h.in | 11 ++++++++++- .../pollingsequence/pollingSequenceFactory.cpp | 4 +++- scripts/egse-port.sh | 4 ++-- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/bsp_egse/InitMission.cpp b/bsp_egse/InitMission.cpp index fcf3c98e..96e18917 100644 --- a/bsp_egse/InitMission.cpp +++ b/bsp_egse/InitMission.cpp @@ -82,7 +82,7 @@ void initmission::initTasks() { std::vector pstTasks; FixedTimeslotTaskIF* pst = factory->createFixedTimeslotTask( - "STAR_TRACKER_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 3.0, missedDeadlineFunc); + "STAR_TRACKER_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc); result = pst::pstUart(pst); if (result != HasReturnvaluesIF::RETURN_OK) { sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index dc820067..cd760040 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -268,8 +268,11 @@ class StarTrackerHandler : public DeviceHandlerBase { // Countdown to insert delay for star tracker to switch from bootloader to firmware program Countdown bootCountdown; - +#ifdef EGSE std::string paramJsonFile = "/mnt/sd0/startracker/full.json"; +#else + std::string paramJsonFile = "/home/pi/arcsec/flight-config.json"; +#endif enum class InternalState { TEMPERATURE_REQUEST }; diff --git a/linux/devices/startracker/StrHelper.h b/linux/devices/startracker/StrHelper.h index 1f8a4882..db65d0ce 100644 --- a/linux/devices/startracker/StrHelper.h +++ b/linux/devices/startracker/StrHelper.h @@ -122,7 +122,7 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu * * @param path Path where file with read flash data will be created * @param region Region ID of flash region to read from - * @param address Start address of flash section to read + * @param address Start address of flash section to read * @param length Number of bytes to read from flash */ ReturnValue_t startFlashRead(std::string path, uint8_t region, uint32_t address, uint32_t length); diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 15952fa4..d6d98181 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -58,6 +58,10 @@ debugging. */ #endif +#if defined EGSE +#define OBSW_ADD_STAR_TRACKER 1 +#endif + /*******************************************************************/ /** All of the following flags should be disabled for mission code */ /*******************************************************************/ @@ -92,11 +96,16 @@ debugging. */ #define OBSW_DEBUG_SUS 0 #define OBSW_DEBUG_RTD 0 #define OBSW_DEBUG_RW 0 -#define OBSW_DEBUG_STARTRACKER 0 #define OBSW_DEBUG_PLOC_MPSOC 0 #define OBSW_DEBUG_PLOC_SUPERVISOR 0 #define OBSW_DEBUG_PDEC_HANDLER 0 +#if defined EGSE +#define OBSW_DEBUG_STARTRACKER 1 +#else +#define OBSW_DEBUG_STARTRACKER 0 +#endif + #ifdef RASPBERRY_PI #define OBSW_ENABLE_TIMERS 1 diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 3caf7341..b2f2b27d 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -549,9 +549,11 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); #endif +#ifdef XIPHOS_Q7S thisSequence->addSlot(objects::PLOC_UPDATER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::PLOC_MEMORY_DUMPER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); +#endif #if OBSW_ADD_PLOC_SUPERVISOR == 1 thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); @@ -580,7 +582,7 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::STAR_TRACKER, length * 0.6, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::STAR_TRACKER, length * 0.8, DeviceHandlerIF::GET_READ); #endif - + static_cast(length); if (uartPstEmpty) { return HasReturnvaluesIF::RETURN_OK; } diff --git a/scripts/egse-port.sh b/scripts/egse-port.sh index c390cc63..ef4864fc 100644 --- a/scripts/egse-port.sh +++ b/scripts/egse-port.sh @@ -2,5 +2,5 @@ echo "-L 1534:localhost:1534 portforwarding for tcf agent" echo "-L 1537:192.168.133.10:7301 for TMTC commanding using the TCP/IP IF" -ssh -L 1534:localhost:1534 pi@192.168.18.31 -ssh -L 1537:localhost:7301 pi@192.168.18.31 \ No newline at end of file +ssh -L 1534:localhost:1534 \ + -L 1537:localhost:7301 pi@192.168.18.31 \ No newline at end of file From abeb4cdbb17c7078ab20797b5cecc6c8e7a6b534 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 5 Feb 2022 15:43:51 +0100 Subject: [PATCH 09/61] arcsec lib update --- thirdparty/arcsec_star_tracker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/arcsec_star_tracker b/thirdparty/arcsec_star_tracker index 2d10c6b8..aa1ebfc1 160000 --- a/thirdparty/arcsec_star_tracker +++ b/thirdparty/arcsec_star_tracker @@ -1 +1 @@ -Subproject commit 2d10c6b85ea4cab4f4baf1918c51d54eee4202c2 +Subproject commit aa1ebfc154558dad746a175d2efee52470fddefe From 814f6caa43004275034cb43f22aca8a16895f112 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 5 Feb 2022 17:19:00 +0100 Subject: [PATCH 10/61] cmake libgpiod define name changed --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b687ddd..baf78050 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,7 +123,7 @@ if(TGT_BSP) if(TGT_BSP MATCHES "arm/egse") # Used by configure file set(EGSE ON) - set(FSFW_HAL_ADD_LIBGPIOD OFF) + set(FSFW_HAL_LINUX_ADD_LIBGPIOD OFF) endif() if(TGT_BSP MATCHES "arm/beagleboneblack") From 3c4033f83c462ada3a1a20a2cf5e4145249c0c80 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 5 Feb 2022 17:19:28 +0100 Subject: [PATCH 11/61] update fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 9579e94a..018d814f 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 9579e94a7111865c4a9cf2c5d07fbfa32a6ed010 +Subproject commit 018d814f29972929577a020a00de33c34fa2034b From 27e3e446e9aab307b2c958654e3d6ac6ec25d616 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 5 Feb 2022 17:45:28 +0100 Subject: [PATCH 12/61] clean up egse build --- bsp_egse/InitMission.cpp | 2 +- bsp_egse/InitMission.h | 2 -- bsp_egse/ObjectFactory.cpp | 4 ++-- bsp_egse/ObjectFactory.h | 3 --- bsp_egse/boardconfig/busConf.h | 8 ++++++++ bsp_egse/main.cpp | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 bsp_egse/boardconfig/busConf.h diff --git a/bsp_egse/InitMission.cpp b/bsp_egse/InitMission.cpp index 96e18917..920c066d 100644 --- a/bsp_egse/InitMission.cpp +++ b/bsp_egse/InitMission.cpp @@ -113,7 +113,7 @@ void initmission::initTasks() { tmtcPollingTask->startTask(); taskStarter(pstTasks, "PST Tasks"); - taskStarter(pusTasks, "PST Tasks"); + taskStarter(pusTasks, "PUS Tasks"); sif::info << "Tasks started.." << std::endl; } diff --git a/bsp_egse/InitMission.h b/bsp_egse/InitMission.h index f14135dd..c3ba58ec 100644 --- a/bsp_egse/InitMission.h +++ b/bsp_egse/InitMission.h @@ -14,8 +14,6 @@ void initTasks(); void createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, std::vector& taskVec); -void createTestTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, - std::vector& taskVec); void createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, std::vector& taskVec); }; // namespace initmission diff --git a/bsp_egse/ObjectFactory.cpp b/bsp_egse/ObjectFactory.cpp index 7de917d0..2e2ccd68 100644 --- a/bsp_egse/ObjectFactory.cpp +++ b/bsp_egse/ObjectFactory.cpp @@ -4,6 +4,7 @@ #include #include "OBSWConfig.h" +#include "busConf.h" #include "fsfw/datapoollocal/LocalDataPoolManager.h" #include "fsfw/tmtcpacket/pus/tm.h" #include "fsfw/tmtcservices/CommandingServiceBase.h" @@ -30,7 +31,6 @@ void Factory::setStaticFrameworkObjectIds() { CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; TmFunnel::downlinkDestination = objects::TMTC_BRIDGE; - // No storage object for now. TmFunnel::storageDestination = objects::NO_OBJECT; VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; @@ -42,7 +42,7 @@ void ObjectFactory::produce(void* args) { ObjectFactory::produceGenericObjects(); UartCookie* starTrackerCookie = - new UartCookie(objects::STAR_TRACKER, "/dev/serial0", UartModes::NON_CANONICAL, + new UartCookie(objects::STAR_TRACKER, egse::STAR_TRACKER_UART, UartModes::NON_CANONICAL, uart::STAR_TRACKER_BAUD, StarTracker::MAX_FRAME_SIZE * 2 + 2); new UartComIF(objects::UART_COM_IF); starTrackerCookie->setNoFixedSizeReply(); diff --git a/bsp_egse/ObjectFactory.h b/bsp_egse/ObjectFactory.h index 909baf06..b24dd321 100644 --- a/bsp_egse/ObjectFactory.h +++ b/bsp_egse/ObjectFactory.h @@ -2,10 +2,7 @@ #define BSP_LINUX_OBJECTFACTORY_H_ namespace ObjectFactory { -void setStatics(); void produce(void* args); - -void createTestTasks(); }; // namespace ObjectFactory #endif /* BSP_LINUX_OBJECTFACTORY_H_ */ diff --git a/bsp_egse/boardconfig/busConf.h b/bsp_egse/boardconfig/busConf.h new file mode 100644 index 00000000..38822dc6 --- /dev/null +++ b/bsp_egse/boardconfig/busConf.h @@ -0,0 +1,8 @@ +#ifndef BSP_EGSE_BOARDCONFIG_BUSCONF_H_ +#define BSP_EGSE_BOARDCONFIG_BUSCONF_H_ + +namespace egse { + static constexpr char STAR_TRACKER_UART[] = "/dev/serial0"; +} + +#endif /* BSP_EGSE_BOARDCONFIG_BUSCONF_H_ */ diff --git a/bsp_egse/main.cpp b/bsp_egse/main.cpp index 661c26b2..fc2d9a0f 100644 --- a/bsp_egse/main.cpp +++ b/bsp_egse/main.cpp @@ -7,7 +7,7 @@ #include "fsfw/tasks/TaskFactory.h" /** - * @brief This is the main program and entry point for egse (raspberry pi 4) + * @brief This is the main program and entry point for the egse (raspberry pi 4) * @return */ int main(void) { From 68d56c4cd32b3ee90e9bb85180f0a3695832312e Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 5 Feb 2022 18:06:18 +0100 Subject: [PATCH 13/61] star tracker files moved to linux directory --- bsp_q7s/core/ObjectFactory.cpp | 6 ++--- cmake/scripts/Q7S/q7s-env-win.sh | 4 ++-- linux/boardtest/SpiTestClass.cpp | 34 +++++++++++++-------------- linux/devices/startracker/StrHelper.h | 1 + 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index f9b7c10b..b5748cb6 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -13,9 +13,9 @@ #include "bsp_q7s/devices/PlocMemoryDumper.h" #include "bsp_q7s/devices/PlocSupervisorHandler.h" #include "bsp_q7s/devices/PlocUpdater.h" -#include "bsp_q7s/devices/startracker/StarTrackerDefinitions.h" -#include "bsp_q7s/devices/startracker/StarTrackerHandler.h" -#include "bsp_q7s/devices/startracker/StrHelper.h" +#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" +#include "linux/devices/startracker/StarTrackerHandler.h" +#include "linux/devices/startracker/StrHelper.h" #include "bsp_q7s/gpio/gpioCallbacks.h" #include "bsp_q7s/memory/FileSystemHandler.h" #include "busConf.h" diff --git a/cmake/scripts/Q7S/q7s-env-win.sh b/cmake/scripts/Q7S/q7s-env-win.sh index a8352331..cc413b6a 100644 --- a/cmake/scripts/Q7S/q7s-env-win.sh +++ b/cmake/scripts/Q7S/q7s-env-win.sh @@ -1,5 +1,5 @@ #!/bin/sh -export PATH=$PATH:"/c/Xilinx/SDK/2018.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin" +export PATH=$PATH:"/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin" export CROSS_COMPILE="arm-linux-gnueabihf" -export Q7S_SYSROOT="/c/Users/${USER}/Documents/EIVE/cortexa9hf-neon-xiphos-linux-gnueabi" +export Q7S_SYSROOT="/c/Users/${USER}/eive-software/cortexa9hf-neon-xiphos-linux-gnueabi" diff --git a/linux/boardtest/SpiTestClass.cpp b/linux/boardtest/SpiTestClass.cpp index 6a170115..7ef76d95 100644 --- a/linux/boardtest/SpiTestClass.cpp +++ b/linux/boardtest/SpiTestClass.cpp @@ -279,66 +279,66 @@ void SpiTestClass::acsInit() { #ifdef RASPBERRY_PI GpiodRegularByChip *gpio = nullptr; std::string rpiGpioName = "gpiochip0"; - gpio = new GpiodRegularByChip(rpiGpioName, mgm0Lis3mdlChipSelect, "MGM_0_LIS3", gpio::OUT, + gpio = new GpiodRegularByChip(rpiGpioName, mgm0Lis3mdlChipSelect, "MGM_0_LIS3", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_0_LIS3_CS, gpio); - gpio = new GpiodRegularByChip(rpiGpioName, mgm1Rm3100ChipSelect, "MGM_1_RM3100", gpio::OUT, + gpio = new GpiodRegularByChip(rpiGpioName, mgm1Rm3100ChipSelect, "MGM_1_RM3100", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_1_RM3100_CS, gpio); - gpio = new GpiodRegularByChip(rpiGpioName, gyro0AdisChipSelect, "GYRO_0_ADIS", gpio::OUT, + gpio = new GpiodRegularByChip(rpiGpioName, gyro0AdisChipSelect, "GYRO_0_ADIS", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio); - gpio = new GpiodRegularByChip(rpiGpioName, gyro1L3gd20ChipSelect, "GYRO_1_L3G", gpio::OUT, + gpio = new GpiodRegularByChip(rpiGpioName, gyro1L3gd20ChipSelect, "GYRO_1_L3G", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_1_L3G_CS, gpio); - gpio = new GpiodRegularByChip(rpiGpioName, gyro3L3gd20ChipSelect, "GYRO_2_L3G", gpio::OUT, + gpio = new GpiodRegularByChip(rpiGpioName, gyro3L3gd20ChipSelect, "GYRO_2_L3G", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_3_L3G_CS, gpio); - gpio = new GpiodRegularByChip(rpiGpioName, mgm2Lis3mdlChipSelect, "MGM_2_LIS3", gpio::OUT, + gpio = new GpiodRegularByChip(rpiGpioName, mgm2Lis3mdlChipSelect, "MGM_2_LIS3", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_2_LIS3_CS, gpio); - gpio = new GpiodRegularByChip(rpiGpioName, mgm3Rm3100ChipSelect, "MGM_3_RM3100", gpio::OUT, + gpio = new GpiodRegularByChip(rpiGpioName, mgm3Rm3100ChipSelect, "MGM_3_RM3100", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio); #elif defined(XIPHOS_Q7S) GpiodRegularByLineName *gpio = nullptr; gpio = - new GpiodRegularByLineName(q7s::gpioNames::MGM_0_CS, "MGM_0_LIS3", gpio::OUT, gpio::HIGH); + new GpiodRegularByLineName(q7s::gpioNames::MGM_0_CS, "MGM_0_LIS3", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_0_LIS3_CS, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_1_RM3100", gpio::OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_1_RM3100", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_1_RM3100_CS, gpio); gpio = - new GpiodRegularByLineName(q7s::gpioNames::MGM_2_CS, "MGM_2_LIS3", gpio::OUT, gpio::HIGH); + new GpiodRegularByLineName(q7s::gpioNames::MGM_2_CS, "MGM_2_LIS3", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_2_LIS3_CS, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_3_RM3100", gpio::OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_3_RM3100", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, "GYRO_0_ADIS", gpio::OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, "GYRO_0_ADIS", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_1_L3G_CS, "GYRO_1_L3G", gpio::OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_1_L3G_CS, "GYRO_1_L3G", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_1_L3G_CS, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ADIS_CS, "GYRO_2_ADIS", gpio::OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ADIS_CS, "GYRO_2_ADIS", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_2_ADIS_CS, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_3_L3G_CS, "GYRO_3_L3G", gpio::OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_3_L3G_CS, "GYRO_3_L3G", gpio::DIR_OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_3_L3G_CS, gpio); // Enable pins must be pulled low for regular operations - gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_0_ENABLE", gpio::OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_0_ENABLE", gpio::DIR_OUT, gpio::LOW); gpioCookie->addGpio(gpioIds::GYRO_0_ENABLE, gpio); - gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_2_ENABLE", gpio::OUT, + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_2_ENABLE", gpio::DIR_OUT, gpio::LOW); gpioCookie->addGpio(gpioIds::GYRO_2_ENABLE, gpio); #endif diff --git a/linux/devices/startracker/StrHelper.h b/linux/devices/startracker/StrHelper.h index db65d0ce..0c77814c 100644 --- a/linux/devices/startracker/StrHelper.h +++ b/linux/devices/startracker/StrHelper.h @@ -3,6 +3,7 @@ #include +#include "OBSWConfig.h" #include "ArcsecDatalinkLayer.h" #ifdef XIPHOS_Q7S From 83d99a66623639844630ee84d36ccc642918c496 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 5 Feb 2022 18:08:54 +0100 Subject: [PATCH 14/61] run clang format script --- bsp_q7s/core/InitMission.cpp | 4 +- bsp_q7s/core/ObjectFactory.cpp | 8 +- .../devices/startracker/ArcsecDatalinkLayer.h | 2 +- linux/devices/startracker/ArcsecJsonKeys.h | 2 +- .../startracker/ArcsecJsonParamBase.cpp | 10 +- .../devices/startracker/ArcsecJsonParamBase.h | 2 +- .../startracker/StarTrackerHandler.cpp | 1 + .../devices/startracker/StarTrackerHandler.h | 2 +- .../startracker/StarTrackerJsonCommands.h | 2 +- linux/devices/startracker/StrHelper.cpp | 22 +- linux/devices/startracker/StrHelper.h | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 568 +++++++++--------- linux/fsfwconfig/events/translateEvents.h | 2 +- 13 files changed, 314 insertions(+), 313 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 259a009c..069d8ccb 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -204,7 +204,7 @@ void initmission::initTasks() { #if BOARD_TE0720 == 0 fsTask->startTask(); #if OBSW_ADD_STAR_TRACKER == 1 - strHelperTask >startTask(); + strHelperTask > startTask(); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ #endif @@ -266,7 +266,7 @@ void initmission::createPstTasks(TaskFactory& factory, sif::error << "InitMission::initTasks: GomSpace PST initialization failed!" << std::endl; } taskVec.push_back(gomSpacePstTask); -#else /* BOARD_TE7020 == 0 */ +#else /* BOARD_TE7020 == 0 */ FixedTimeslotTaskIF* pollingSequenceTaskTE0720 = factory.createFixedTimeslotTask( "PST_TASK_TE0720", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE * 8, 3.0, missedDeadlineFunc); result = pst::pollingSequenceTE0720(pollingSequenceTaskTE0720); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index b5748cb6..cd34e347 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -13,9 +13,6 @@ #include "bsp_q7s/devices/PlocMemoryDumper.h" #include "bsp_q7s/devices/PlocSupervisorHandler.h" #include "bsp_q7s/devices/PlocUpdater.h" -#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" -#include "linux/devices/startracker/StarTrackerHandler.h" -#include "linux/devices/startracker/StrHelper.h" #include "bsp_q7s/gpio/gpioCallbacks.h" #include "bsp_q7s/memory/FileSystemHandler.h" #include "busConf.h" @@ -44,7 +41,10 @@ #include "linux/csp/CspCookie.h" #include "linux/devices/SolarArrayDeploymentHandler.h" #include "linux/devices/SusHandler.h" +#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "linux/devices/devicedefinitions/SusDefinitions.h" +#include "linux/devices/startracker/StarTrackerHandler.h" +#include "linux/devices/startracker/StrHelper.h" #include "mission/core/GenericFactory.h" #include "mission/devices/ACUHandler.h" #include "mission/devices/BpxBatteryHandler.h" @@ -153,7 +153,7 @@ void ObjectFactory::produce(void* args) { imtqHandler->setToGoToNormal(true); imtqHandler->setStartUpImmediately(); #else - (void) imtqHandler; + (void)imtqHandler; #endif #endif createReactionWheelComponents(gpioComIF); diff --git a/linux/devices/startracker/ArcsecDatalinkLayer.h b/linux/devices/startracker/ArcsecDatalinkLayer.h index 08c62bb4..d287a888 100644 --- a/linux/devices/startracker/ArcsecDatalinkLayer.h +++ b/linux/devices/startracker/ArcsecDatalinkLayer.h @@ -1,8 +1,8 @@ #ifndef BSP_Q7S_DEVICES_ARCSECDATALINKLAYER_H_ #define BSP_Q7S_DEVICES_ARCSECDATALINKLAYER_H_ -#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" extern "C" { #include "common/misc.h" diff --git a/linux/devices/startracker/ArcsecJsonKeys.h b/linux/devices/startracker/ArcsecJsonKeys.h index 044bef8d..28d4ad3f 100644 --- a/linux/devices/startracker/ArcsecJsonKeys.h +++ b/linux/devices/startracker/ArcsecJsonKeys.h @@ -71,7 +71,7 @@ static const char MAX_TOTAL_VALUE[] = "maxTotalValue"; static const char MIN_BRIGHT_NEIGHBOURS[] = "minBrightNeighbours"; static const char MAX_BRIGHT_NEIGHBOURS[] = "maxBrightNeighbours"; static const char MAX_PIXEL_TO_CONSIDER[] = "maxPixelsToConsider"; -//static const char SIGNAL_THRESHOLD[] = "signalThreshold"; +// static const char SIGNAL_THRESHOLD[] = "signalThreshold"; static const char BLOB_DARK_THRESHOLD[] = "darkThreshold"; static const char ENABLE_HISTOGRAM[] = "enableHistogram"; static const char ENABLE_CONTRAST[] = "enableContrast"; diff --git a/linux/devices/startracker/ArcsecJsonParamBase.cpp b/linux/devices/startracker/ArcsecJsonParamBase.cpp index 36aa8ea3..cc8bbc35 100644 --- a/linux/devices/startracker/ArcsecJsonParamBase.cpp +++ b/linux/devices/startracker/ArcsecJsonParamBase.cpp @@ -8,14 +8,14 @@ ReturnValue_t ArcsecJsonParamBase::create(std::string fullname, uint8_t* buffer) ReturnValue_t result = RETURN_OK; result = init(fullname); if (result != RETURN_OK) { - sif::warning << "ArcsecJsonParamBase::create: Failed to init parameter command for set " - << setName << std::endl; + sif::warning << "ArcsecJsonParamBase::create: Failed to init parameter command for set " + << setName << std::endl; return result; } result = createCommand(buffer); if (result != RETURN_OK) { - sif::warning << "ArcsecJsonParamBase::create: Failed to create parameter command for set " - << setName << std::endl; + sif::warning << "ArcsecJsonParamBase::create: Failed to create parameter command for set " + << setName << std::endl; } return result; } @@ -98,6 +98,6 @@ ReturnValue_t ArcsecJsonParamBase::initSet() { } } sif::warning << "ArcsecJsonParamBase::initSet: Set " << setName << "not present in json file" - << std::endl; + << std::endl; return SET_NOT_EXISTS; } diff --git a/linux/devices/startracker/ArcsecJsonParamBase.h b/linux/devices/startracker/ArcsecJsonParamBase.h index 68e04173..2d20fcae 100644 --- a/linux/devices/startracker/ArcsecJsonParamBase.h +++ b/linux/devices/startracker/ArcsecJsonParamBase.h @@ -5,8 +5,8 @@ #include #include -#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" extern "C" { #include "thirdparty/arcsec_star_tracker/common/generated/tmtcstructs.h" diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index c0db5089..e2857f79 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -12,6 +12,7 @@ extern "C" { #include #include #include + #include "common/misc.h" } diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index cd760040..475c1441 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -5,11 +5,11 @@ #include "ArcsecDatalinkLayer.h" #include "ArcsecJsonParamBase.h" -#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "StrHelper.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/src/fsfw/serialize/SerializeAdapter.h" #include "fsfw/timemanager/Countdown.h" +#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "thirdparty/arcsec_star_tracker/common/SLIP.h" /** diff --git a/linux/devices/startracker/StarTrackerJsonCommands.h b/linux/devices/startracker/StarTrackerJsonCommands.h index 0c6c1b99..2c816056 100644 --- a/linux/devices/startracker/StarTrackerJsonCommands.h +++ b/linux/devices/startracker/StarTrackerJsonCommands.h @@ -66,7 +66,7 @@ class Mounting : public ArcsecJsonParamBase { */ class ImageProcessor : public ArcsecJsonParamBase { public: - ImageProcessor(); + ImageProcessor(); size_t getSize(); diff --git a/linux/devices/startracker/StrHelper.cpp b/linux/devices/startracker/StrHelper.cpp index 0c6e714a..fc58bfd0 100644 --- a/linux/devices/startracker/StrHelper.cpp +++ b/linux/devices/startracker/StrHelper.cpp @@ -1,9 +1,9 @@ #include "StrHelper.h" -#include "OBSWConfig.h" #include #include +#include "OBSWConfig.h" #include "mission/utility/Timestamp.h" StrHelper::StrHelper(object_id_t objectId) : SystemObject(objectId) {} @@ -321,7 +321,7 @@ ReturnValue_t StrHelper::performImageUpload() { return result; } #if OBSW_DEBUG_STARTRACKER == 1 - printProgress((uploadReq.position + 1) * SIZE_IMAGE_PART, imageSize); + printProgress((uploadReq.position + 1) * SIZE_IMAGE_PART, imageSize); #endif /* OBSW_DEBUG_STARTRACKER == 1 */ return RETURN_OK; } @@ -694,13 +694,13 @@ ReturnValue_t StrHelper::checkPath(std::string name) { #endif void StrHelper::printProgress(uint32_t itemsTransferred, uint32_t fullNumItems) { - float progressInPercent = - static_cast(itemsTransferred) / static_cast(fullNumItems) * 100; - if (static_cast(progressInPercent) == nextProgressPrint) { - sif::info << "Str Helper Progress: " << progressInPercent << " %" << std::endl; - nextProgressPrint += FIVE_PERCENT; - } - if (nextProgressPrint > 100) { - nextProgressPrint = 0; - } + float progressInPercent = + static_cast(itemsTransferred) / static_cast(fullNumItems) * 100; + if (static_cast(progressInPercent) == nextProgressPrint) { + sif::info << "Str Helper Progress: " << progressInPercent << " %" << std::endl; + nextProgressPrint += FIVE_PERCENT; + } + if (nextProgressPrint > 100) { + nextProgressPrint = 0; + } } diff --git a/linux/devices/startracker/StrHelper.h b/linux/devices/startracker/StrHelper.h index 0c77814c..c0e8e5c0 100644 --- a/linux/devices/startracker/StrHelper.h +++ b/linux/devices/startracker/StrHelper.h @@ -3,8 +3,8 @@ #include -#include "OBSWConfig.h" #include "ArcsecDatalinkLayer.h" +#include "OBSWConfig.h" #ifdef XIPHOS_Q7S #include "bsp_q7s/memory/SdCardManager.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 9e6a5f61..922892c8 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -146,290 +146,290 @@ const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS"; const char *STR_HELPER_SENDING_PACKET_FAILED_STRING = "STR_HELPER_SENDING_PACKET_FAILED"; const char *STR_HELPER_REQUESTING_MSG_FAILED_STRING = "STR_HELPER_REQUESTING_MSG_FAILED"; -const char * translateEvents(Event event) { - switch( (event & 0xffff) ) { - case(2200): - return STORE_SEND_WRITE_FAILED_STRING; - case(2201): - return STORE_WRITE_FAILED_STRING; - case(2202): - return STORE_SEND_READ_FAILED_STRING; - case(2203): - return STORE_READ_FAILED_STRING; - case(2204): - return UNEXPECTED_MSG_STRING; - case(2205): - return STORING_FAILED_STRING; - case(2206): - return TM_DUMP_FAILED_STRING; - case(2207): - return STORE_INIT_FAILED_STRING; - case(2208): - return STORE_INIT_EMPTY_STRING; - case(2209): - return STORE_CONTENT_CORRUPTED_STRING; - case(2210): - return STORE_INITIALIZE_STRING; - case(2211): - return INIT_DONE_STRING; - case(2212): - return DUMP_FINISHED_STRING; - case(2213): - return DELETION_FINISHED_STRING; - case(2214): - return DELETION_FAILED_STRING; - case(2215): - return AUTO_CATALOGS_SENDING_FAILED_STRING; - case(2600): - return GET_DATA_FAILED_STRING; - case(2601): - return STORE_DATA_FAILED_STRING; - case(2800): - return DEVICE_BUILDING_COMMAND_FAILED_STRING; - case(2801): - return DEVICE_SENDING_COMMAND_FAILED_STRING; - case(2802): - return DEVICE_REQUESTING_REPLY_FAILED_STRING; - case(2803): - return DEVICE_READING_REPLY_FAILED_STRING; - case(2804): - return DEVICE_INTERPRETING_REPLY_FAILED_STRING; - case(2805): - return DEVICE_MISSED_REPLY_STRING; - case(2806): - return DEVICE_UNKNOWN_REPLY_STRING; - case(2807): - return DEVICE_UNREQUESTED_REPLY_STRING; - case(2808): - return INVALID_DEVICE_COMMAND_STRING; - case(2809): - return MONITORING_LIMIT_EXCEEDED_STRING; - case(2810): - return MONITORING_AMBIGUOUS_STRING; - case(2811): - return DEVICE_WANTS_HARD_REBOOT_STRING; - case(4201): - return FUSE_CURRENT_HIGH_STRING; - case(4202): - return FUSE_WENT_OFF_STRING; - case(4204): - return POWER_ABOVE_HIGH_LIMIT_STRING; - case(4205): - return POWER_BELOW_LOW_LIMIT_STRING; - case(4300): - return SWITCH_WENT_OFF_STRING; - case(5000): - return HEATER_ON_STRING; - case(5001): - return HEATER_OFF_STRING; - case(5002): - return HEATER_TIMEOUT_STRING; - case(5003): - return HEATER_STAYED_ON_STRING; - case(5004): - return HEATER_STAYED_OFF_STRING; - case(5200): - return TEMP_SENSOR_HIGH_STRING; - case(5201): - return TEMP_SENSOR_LOW_STRING; - case(5202): - return TEMP_SENSOR_GRADIENT_STRING; - case(5901): - return COMPONENT_TEMP_LOW_STRING; - case(5902): - return COMPONENT_TEMP_HIGH_STRING; - case(5903): - return COMPONENT_TEMP_OOL_LOW_STRING; - case(5904): - return COMPONENT_TEMP_OOL_HIGH_STRING; - case(5905): - return TEMP_NOT_IN_OP_RANGE_STRING; - case(7101): - return FDIR_CHANGED_STATE_STRING; - case(7102): - return FDIR_STARTS_RECOVERY_STRING; - case(7103): - return FDIR_TURNS_OFF_DEVICE_STRING; - case(7201): - return MONITOR_CHANGED_STATE_STRING; - case(7202): - return VALUE_BELOW_LOW_LIMIT_STRING; - case(7203): - return VALUE_ABOVE_HIGH_LIMIT_STRING; - case(7204): - return VALUE_OUT_OF_RANGE_STRING; - case(7400): - return CHANGING_MODE_STRING; - case(7401): - return MODE_INFO_STRING; - case(7402): - return FALLBACK_FAILED_STRING; - case(7403): - return MODE_TRANSITION_FAILED_STRING; - case(7404): - return CANT_KEEP_MODE_STRING; - case(7405): - return OBJECT_IN_INVALID_MODE_STRING; - case(7406): - return FORCING_MODE_STRING; - case(7407): - return MODE_CMD_REJECTED_STRING; - case(7506): - return HEALTH_INFO_STRING; - case(7507): - return CHILD_CHANGED_HEALTH_STRING; - case(7508): - return CHILD_PROBLEMS_STRING; - case(7509): - return OVERWRITING_HEALTH_STRING; - case(7510): - return TRYING_RECOVERY_STRING; - case(7511): - return RECOVERY_STEP_STRING; - case(7512): - return RECOVERY_DONE_STRING; - case(7900): - return RF_AVAILABLE_STRING; - case(7901): - return RF_LOST_STRING; - case(7902): - return BIT_LOCK_STRING; - case(7903): - return BIT_LOCK_LOST_STRING; - case(7905): - return FRAME_PROCESSING_FAILED_STRING; - case(8900): - return CLOCK_SET_STRING; - case(8901): - return CLOCK_SET_FAILURE_STRING; - case(9700): - return TEST_STRING; - case(10600): - return CHANGE_OF_SETUP_PARAMETER_STRING; - case(10900): - return GPIO_PULL_HIGH_FAILED_STRING; - case(10901): - return GPIO_PULL_LOW_FAILED_STRING; - case(10902): - return SWITCH_ALREADY_ON_STRING; - case(10903): - return SWITCH_ALREADY_OFF_STRING; - case(10904): - return MAIN_SWITCH_TIMEOUT_STRING; - case(11000): - return MAIN_SWITCH_ON_TIMEOUT_STRING; - case(11001): - return MAIN_SWITCH_OFF_TIMEOUT_STRING; - case(11002): - return DEPLOYMENT_FAILED_STRING; - case(11003): - return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; - case(11004): - return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; - case(11101): - return MEMORY_READ_RPT_CRC_FAILURE_STRING; - case(11102): - return ACK_FAILURE_STRING; - case(11103): - return EXE_FAILURE_STRING; - case(11104): - return CRC_FAILURE_EVENT_STRING; - case(11201): - return SELF_TEST_I2C_FAILURE_STRING; - case(11202): - return SELF_TEST_SPI_FAILURE_STRING; - case(11203): - return SELF_TEST_ADC_FAILURE_STRING; - case(11204): - return SELF_TEST_PWM_FAILURE_STRING; - case(11205): - return SELF_TEST_TC_FAILURE_STRING; - case(11206): - return SELF_TEST_MTM_RANGE_FAILURE_STRING; - case(11207): - return SELF_TEST_COIL_CURRENT_FAILURE_STRING; - case(11208): - return INVALID_ERROR_BYTE_STRING; - case(11301): - return ERROR_STATE_STRING; - case(11501): - return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; - case(11502): - return SUPV_ACK_FAILURE_STRING; - case(11503): - return SUPV_EXE_FAILURE_STRING; - case(11504): - return SUPV_CRC_FAILURE_EVENT_STRING; - case(11600): - return SANITIZATION_FAILED_STRING; - case(11700): - return UPDATE_FILE_NOT_EXISTS_STRING; - case(11701): - return ACTION_COMMANDING_FAILED_STRING; - case(11702): - return UPDATE_AVAILABLE_FAILED_STRING; - case(11703): - return UPDATE_TRANSFER_FAILED_STRING; - case(11704): - return UPDATE_VERIFY_FAILED_STRING; - case(11705): - return UPDATE_FINISHED_STRING; - case(11800): - return SEND_MRAM_DUMP_FAILED_STRING; - case(11801): - return MRAM_DUMP_FAILED_STRING; - case(11802): - return MRAM_DUMP_FINISHED_STRING; - case(11901): - return INVALID_TC_FRAME_STRING; - case(11902): - return INVALID_FAR_STRING; - case(11903): - return CARRIER_LOCK_STRING; - case(11904): - return BIT_LOCK_PDEC_STRING; - case(12000): - return IMAGE_UPLOAD_FAILED_STRING; - case(12001): - return IMAGE_DOWNLOAD_FAILED_STRING; - case(12002): - return IMAGE_UPLOAD_SUCCESSFUL_STRING; - case(12003): - return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; - case(12004): - return FLASH_WRITE_SUCCESSFUL_STRING; - case(12005): - return FLASH_READ_SUCCESSFUL_STRING; - case(12006): - return FLASH_WRITE_FAILED_STRING; - case(12007): - return FLASH_READ_FAILED_STRING; - case(12008): - return FPGA_DOWNLOAD_SUCCESSFUL_STRING; - case(12009): - return FPGA_DOWNLOAD_FAILED_STRING; - case(12010): - return FPGA_UPLOAD_SUCCESSFUL_STRING; - case(12011): - return FPGA_UPLOAD_FAILED_STRING; - case(12012): - return STR_HELPER_READING_REPLY_FAILED_STRING; - case(12013): - return STR_HELPER_COM_ERROR_STRING; - case(12014): - return STR_HELPER_NO_REPLY_STRING; - case(12015): - return STR_HELPER_DEC_ERROR_STRING; - case(12016): - return POSITION_MISMATCH_STRING; - case(12017): - return STR_HELPER_FILE_NOT_EXISTS_STRING; - case(12018): - return STR_HELPER_SENDING_PACKET_FAILED_STRING; - case(12019): - return STR_HELPER_REQUESTING_MSG_FAILED_STRING; - default: - return "UNKNOWN_EVENT"; +const char *translateEvents(Event event) { + switch ((event & 0xffff)) { + case (2200): + return STORE_SEND_WRITE_FAILED_STRING; + case (2201): + return STORE_WRITE_FAILED_STRING; + case (2202): + return STORE_SEND_READ_FAILED_STRING; + case (2203): + return STORE_READ_FAILED_STRING; + case (2204): + return UNEXPECTED_MSG_STRING; + case (2205): + return STORING_FAILED_STRING; + case (2206): + return TM_DUMP_FAILED_STRING; + case (2207): + return STORE_INIT_FAILED_STRING; + case (2208): + return STORE_INIT_EMPTY_STRING; + case (2209): + return STORE_CONTENT_CORRUPTED_STRING; + case (2210): + return STORE_INITIALIZE_STRING; + case (2211): + return INIT_DONE_STRING; + case (2212): + return DUMP_FINISHED_STRING; + case (2213): + return DELETION_FINISHED_STRING; + case (2214): + return DELETION_FAILED_STRING; + case (2215): + return AUTO_CATALOGS_SENDING_FAILED_STRING; + case (2600): + return GET_DATA_FAILED_STRING; + case (2601): + return STORE_DATA_FAILED_STRING; + case (2800): + return DEVICE_BUILDING_COMMAND_FAILED_STRING; + case (2801): + return DEVICE_SENDING_COMMAND_FAILED_STRING; + case (2802): + return DEVICE_REQUESTING_REPLY_FAILED_STRING; + case (2803): + return DEVICE_READING_REPLY_FAILED_STRING; + case (2804): + return DEVICE_INTERPRETING_REPLY_FAILED_STRING; + case (2805): + return DEVICE_MISSED_REPLY_STRING; + case (2806): + return DEVICE_UNKNOWN_REPLY_STRING; + case (2807): + return DEVICE_UNREQUESTED_REPLY_STRING; + case (2808): + return INVALID_DEVICE_COMMAND_STRING; + case (2809): + return MONITORING_LIMIT_EXCEEDED_STRING; + case (2810): + return MONITORING_AMBIGUOUS_STRING; + case (2811): + return DEVICE_WANTS_HARD_REBOOT_STRING; + case (4201): + return FUSE_CURRENT_HIGH_STRING; + case (4202): + return FUSE_WENT_OFF_STRING; + case (4204): + return POWER_ABOVE_HIGH_LIMIT_STRING; + case (4205): + return POWER_BELOW_LOW_LIMIT_STRING; + case (4300): + return SWITCH_WENT_OFF_STRING; + case (5000): + return HEATER_ON_STRING; + case (5001): + return HEATER_OFF_STRING; + case (5002): + return HEATER_TIMEOUT_STRING; + case (5003): + return HEATER_STAYED_ON_STRING; + case (5004): + return HEATER_STAYED_OFF_STRING; + case (5200): + return TEMP_SENSOR_HIGH_STRING; + case (5201): + return TEMP_SENSOR_LOW_STRING; + case (5202): + return TEMP_SENSOR_GRADIENT_STRING; + case (5901): + return COMPONENT_TEMP_LOW_STRING; + case (5902): + return COMPONENT_TEMP_HIGH_STRING; + case (5903): + return COMPONENT_TEMP_OOL_LOW_STRING; + case (5904): + return COMPONENT_TEMP_OOL_HIGH_STRING; + case (5905): + return TEMP_NOT_IN_OP_RANGE_STRING; + case (7101): + return FDIR_CHANGED_STATE_STRING; + case (7102): + return FDIR_STARTS_RECOVERY_STRING; + case (7103): + return FDIR_TURNS_OFF_DEVICE_STRING; + case (7201): + return MONITOR_CHANGED_STATE_STRING; + case (7202): + return VALUE_BELOW_LOW_LIMIT_STRING; + case (7203): + return VALUE_ABOVE_HIGH_LIMIT_STRING; + case (7204): + return VALUE_OUT_OF_RANGE_STRING; + case (7400): + return CHANGING_MODE_STRING; + case (7401): + return MODE_INFO_STRING; + case (7402): + return FALLBACK_FAILED_STRING; + case (7403): + return MODE_TRANSITION_FAILED_STRING; + case (7404): + return CANT_KEEP_MODE_STRING; + case (7405): + return OBJECT_IN_INVALID_MODE_STRING; + case (7406): + return FORCING_MODE_STRING; + case (7407): + return MODE_CMD_REJECTED_STRING; + case (7506): + return HEALTH_INFO_STRING; + case (7507): + return CHILD_CHANGED_HEALTH_STRING; + case (7508): + return CHILD_PROBLEMS_STRING; + case (7509): + return OVERWRITING_HEALTH_STRING; + case (7510): + return TRYING_RECOVERY_STRING; + case (7511): + return RECOVERY_STEP_STRING; + case (7512): + return RECOVERY_DONE_STRING; + case (7900): + return RF_AVAILABLE_STRING; + case (7901): + return RF_LOST_STRING; + case (7902): + return BIT_LOCK_STRING; + case (7903): + return BIT_LOCK_LOST_STRING; + case (7905): + return FRAME_PROCESSING_FAILED_STRING; + case (8900): + return CLOCK_SET_STRING; + case (8901): + return CLOCK_SET_FAILURE_STRING; + case (9700): + return TEST_STRING; + case (10600): + return CHANGE_OF_SETUP_PARAMETER_STRING; + case (10900): + return GPIO_PULL_HIGH_FAILED_STRING; + case (10901): + return GPIO_PULL_LOW_FAILED_STRING; + case (10902): + return SWITCH_ALREADY_ON_STRING; + case (10903): + return SWITCH_ALREADY_OFF_STRING; + case (10904): + return MAIN_SWITCH_TIMEOUT_STRING; + case (11000): + return MAIN_SWITCH_ON_TIMEOUT_STRING; + case (11001): + return MAIN_SWITCH_OFF_TIMEOUT_STRING; + case (11002): + return DEPLOYMENT_FAILED_STRING; + case (11003): + return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; + case (11004): + return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; + case (11101): + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case (11102): + return ACK_FAILURE_STRING; + case (11103): + return EXE_FAILURE_STRING; + case (11104): + return CRC_FAILURE_EVENT_STRING; + case (11201): + return SELF_TEST_I2C_FAILURE_STRING; + case (11202): + return SELF_TEST_SPI_FAILURE_STRING; + case (11203): + return SELF_TEST_ADC_FAILURE_STRING; + case (11204): + return SELF_TEST_PWM_FAILURE_STRING; + case (11205): + return SELF_TEST_TC_FAILURE_STRING; + case (11206): + return SELF_TEST_MTM_RANGE_FAILURE_STRING; + case (11207): + return SELF_TEST_COIL_CURRENT_FAILURE_STRING; + case (11208): + return INVALID_ERROR_BYTE_STRING; + case (11301): + return ERROR_STATE_STRING; + case (11501): + return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; + case (11502): + return SUPV_ACK_FAILURE_STRING; + case (11503): + return SUPV_EXE_FAILURE_STRING; + case (11504): + return SUPV_CRC_FAILURE_EVENT_STRING; + case (11600): + return SANITIZATION_FAILED_STRING; + case (11700): + return UPDATE_FILE_NOT_EXISTS_STRING; + case (11701): + return ACTION_COMMANDING_FAILED_STRING; + case (11702): + return UPDATE_AVAILABLE_FAILED_STRING; + case (11703): + return UPDATE_TRANSFER_FAILED_STRING; + case (11704): + return UPDATE_VERIFY_FAILED_STRING; + case (11705): + return UPDATE_FINISHED_STRING; + case (11800): + return SEND_MRAM_DUMP_FAILED_STRING; + case (11801): + return MRAM_DUMP_FAILED_STRING; + case (11802): + return MRAM_DUMP_FINISHED_STRING; + case (11901): + return INVALID_TC_FRAME_STRING; + case (11902): + return INVALID_FAR_STRING; + case (11903): + return CARRIER_LOCK_STRING; + case (11904): + return BIT_LOCK_PDEC_STRING; + case (12000): + return IMAGE_UPLOAD_FAILED_STRING; + case (12001): + return IMAGE_DOWNLOAD_FAILED_STRING; + case (12002): + return IMAGE_UPLOAD_SUCCESSFUL_STRING; + case (12003): + return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; + case (12004): + return FLASH_WRITE_SUCCESSFUL_STRING; + case (12005): + return FLASH_READ_SUCCESSFUL_STRING; + case (12006): + return FLASH_WRITE_FAILED_STRING; + case (12007): + return FLASH_READ_FAILED_STRING; + case (12008): + return FPGA_DOWNLOAD_SUCCESSFUL_STRING; + case (12009): + return FPGA_DOWNLOAD_FAILED_STRING; + case (12010): + return FPGA_UPLOAD_SUCCESSFUL_STRING; + case (12011): + return FPGA_UPLOAD_FAILED_STRING; + case (12012): + return STR_HELPER_READING_REPLY_FAILED_STRING; + case (12013): + return STR_HELPER_COM_ERROR_STRING; + case (12014): + return STR_HELPER_NO_REPLY_STRING; + case (12015): + return STR_HELPER_DEC_ERROR_STRING; + case (12016): + return POSITION_MISMATCH_STRING; + case (12017): + return STR_HELPER_FILE_NOT_EXISTS_STRING; + case (12018): + return STR_HELPER_SENDING_PACKET_FAILED_STRING; + case (12019): + return STR_HELPER_REQUESTING_MSG_FAILED_STRING; + default: + return "UNKNOWN_EVENT"; } return 0; } diff --git a/linux/fsfwconfig/events/translateEvents.h b/linux/fsfwconfig/events/translateEvents.h index bdabb21b..1b8a8831 100644 --- a/linux/fsfwconfig/events/translateEvents.h +++ b/linux/fsfwconfig/events/translateEvents.h @@ -3,6 +3,6 @@ #include "fsfw/events/Event.h" -const char * translateEvents(Event event); +const char* translateEvents(Event event); #endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */ From e222be0534901be1e1eab5b5eaea9ce93ab35e3d Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 5 Feb 2022 18:09:55 +0100 Subject: [PATCH 15/61] added bsp_egse to clang format script --- bsp_egse/ObjectFactory.cpp | 14 ++++++-------- bsp_egse/boardconfig/busConf.h | 2 +- bsp_egse/main.cpp | 3 ++- scripts/apply-clang-format.sh | 1 + 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bsp_egse/ObjectFactory.cpp b/bsp_egse/ObjectFactory.cpp index 2e2ccd68..7ccec79c 100644 --- a/bsp_egse/ObjectFactory.cpp +++ b/bsp_egse/ObjectFactory.cpp @@ -1,6 +1,10 @@ #include "ObjectFactory.h" #include +#include +#include +#include +#include #include #include "OBSWConfig.h" @@ -9,19 +13,13 @@ #include "fsfw/tmtcpacket/pus/tm.h" #include "fsfw/tmtcservices/CommandingServiceBase.h" #include "fsfw/tmtcservices/PusServiceBase.h" +#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" +#include "linux/devices/startracker/StarTrackerHandler.h" #include "mission/core/GenericFactory.h" #include "mission/utility/TmFunnel.h" #include "objects/systemObjectList.h" #include "tmtc/apid.h" #include "tmtc/pusIds.h" -#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" -#include "linux/devices/startracker/StarTrackerHandler.h" - -#include -#include - -#include -#include void Factory::setStaticFrameworkObjectIds() { PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR; diff --git a/bsp_egse/boardconfig/busConf.h b/bsp_egse/boardconfig/busConf.h index 38822dc6..4df55edc 100644 --- a/bsp_egse/boardconfig/busConf.h +++ b/bsp_egse/boardconfig/busConf.h @@ -2,7 +2,7 @@ #define BSP_EGSE_BOARDCONFIG_BUSCONF_H_ namespace egse { - static constexpr char STAR_TRACKER_UART[] = "/dev/serial0"; +static constexpr char STAR_TRACKER_UART[] = "/dev/serial0"; } #endif /* BSP_EGSE_BOARDCONFIG_BUSCONF_H_ */ diff --git a/bsp_egse/main.cpp b/bsp_egse/main.cpp index fc2d9a0f..4c77bbce 100644 --- a/bsp_egse/main.cpp +++ b/bsp_egse/main.cpp @@ -12,7 +12,8 @@ */ int main(void) { std::cout << "-- EIVE OBSW --" << std::endl; - std::cout << "-- Compiled for EGSE from Arcsec" << " --" << std::endl; + std::cout << "-- Compiled for EGSE from Arcsec" + << " --" << std::endl; std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "." << SW_REVISION << ", FSFW v" << FSFW_VERSION << "." << FSFW_SUBVERSION << FSFW_REVISION << "--" << std::endl; diff --git a/scripts/apply-clang-format.sh b/scripts/apply-clang-format.sh index 55a31487..724b44a0 100755 --- a/scripts/apply-clang-format.sh +++ b/scripts/apply-clang-format.sh @@ -8,4 +8,5 @@ find ./linux -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --sty find ./bsp_q7s -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i find ./bsp_linux_board -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i find ./bsp_hosted -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i +find ./bsp_egse -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i find ./test -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i From 21593a46969d696a595363453753e25a993ee216 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 5 Feb 2022 18:12:01 +0100 Subject: [PATCH 16/61] fsfw update --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 018d814f..3c06d2db 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 018d814f29972929577a020a00de33c34fa2034b +Subproject commit 3c06d2dbbb0d79608e003a8a3c89ae90cc71f409 From 191f3c3deb1bb5250ff0d893a66483de99f1bd6e Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Mon, 7 Feb 2022 09:47:12 +0100 Subject: [PATCH 17/61] moved toolchain path print out --- cmake/scripts/egse/egse_path_helper_win.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/scripts/egse/egse_path_helper_win.sh b/cmake/scripts/egse/egse_path_helper_win.sh index 006d20e7..4bda17b0 100644 --- a/cmake/scripts/egse/egse_path_helper_win.sh +++ b/cmake/scripts/egse/egse_path_helper_win.sh @@ -5,9 +5,9 @@ TOOLCHAIN_PATH="/c/SysGCC/raspberry/bin" if [ $# -eq 1 ];then export PATH=$PATH:"$1" else - echo "Path of toolchain set to $TOOLCHAIN_PATH" export PATH=$PATH:$TOOLCHAIN_PATH fi +echo "Path of toolchain set to $TOOLCHAIN_PATH" export CROSS_COMPILE="arm-linux-gnueabihf" export RASPBERRY_VERSION="4" \ No newline at end of file From c3e20d6a117135aeae6eb566d36bc2f89ddddd9d Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 8 Feb 2022 11:59:22 +0100 Subject: [PATCH 18/61] debugging --- linux/devices/startracker/StarTrackerHandler.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 475c1441..172094fe 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -1,6 +1,7 @@ #ifndef MISSION_DEVICES_STARTRACKERHANDLER_H_ #define MISSION_DEVICES_STARTRACKERHANDLER_H_ +#include "OBSWConfig.h" #include #include "ArcsecDatalinkLayer.h" @@ -268,10 +269,10 @@ class StarTrackerHandler : public DeviceHandlerBase { // Countdown to insert delay for star tracker to switch from bootloader to firmware program Countdown bootCountdown; -#ifdef EGSE +#ifndef EGSE std::string paramJsonFile = "/mnt/sd0/startracker/full.json"; #else - std::string paramJsonFile = "/home/pi/arcsec/flight-config.json"; + std::string paramJsonFile = "/home/pi/arcsec/ground-config.json"; #endif enum class InternalState { TEMPERATURE_REQUEST }; From 92eb403e35cca5e60ab2cc31a633866e7d268c0d Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 8 Feb 2022 13:09:50 +0100 Subject: [PATCH 19/61] egse define fiX --- linux/fsfwconfig/OBSWConfig.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 8da487cf..043ce97b 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -106,7 +106,7 @@ debugging. */ #define OBSW_DEBUG_PLOC_SUPERVISOR 0 #define OBSW_DEBUG_PDEC_HANDLER 0 -#if defined EGSE +#ifdef EGSE #define OBSW_DEBUG_STARTRACKER 1 #else #define OBSW_DEBUG_STARTRACKER 0 From 328a3b2d0285a8e15d1b82ed902fc59702d16517 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 8 Feb 2022 13:11:54 +0100 Subject: [PATCH 20/61] define fix --- linux/fsfwconfig/OBSWConfig.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 043ce97b..4643543f 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -59,7 +59,7 @@ debugging. */ #endif -#if defined EGSE +#ifdef EGSE #define OBSW_ADD_STAR_TRACKER 1 #endif From cfce44ca3ab639ef5b5ea8613b9a482816ff85e7 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 8 Feb 2022 16:01:06 +0100 Subject: [PATCH 21/61] change default name of json file --- linux/devices/startracker/StarTrackerHandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 172094fe..3d7ed28a 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -270,7 +270,7 @@ class StarTrackerHandler : public DeviceHandlerBase { // Countdown to insert delay for star tracker to switch from bootloader to firmware program Countdown bootCountdown; #ifndef EGSE - std::string paramJsonFile = "/mnt/sd0/startracker/full.json"; + std::string paramJsonFile = "/mnt/sd0/startracker/flight-config.json"; #else std::string paramJsonFile = "/home/pi/arcsec/ground-config.json"; #endif From a3092e57e43b05bf62e06cda9604296a0069f7a9 Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" Date: Tue, 8 Feb 2022 16:36:33 +0100 Subject: [PATCH 22/61] readme running obsw on egse --- README.md | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 34f31da7..78656e51 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,10 @@ 12. [Static Code Analysis](#static-code-analysis) 13. [Eclipse](#eclipse) 14. [Running the OBSW on a Raspberry Pi](#rpi) -15. [Manually preparing sysroots to compile gpsd](#gpsd) -16. [FSFW](#fsfw) -17. [Coding Style](#coding-style) +15. [Running OBSW on EGSE](#egse) +16. [Manually preparing sysroots to compile gpsd](#gpsd) +17. [FSFW](#fsfw) +18. [Coding Style](#coding-style) # General information @@ -1134,6 +1135,32 @@ sudo apt-get install gpiod libgpiod-dev to install the required GPIO libraries before cloning the system root folder. +# Running OBSW on EGSE +The EGSE is a test system from arcsec build arround a raspberry pi 4 to test the star tracker. The IP address of the EGSE (raspberry pi) is 192.168.18.31. An ssh session can be opened with +```` +ssh pi@192.168.18.31 +```` +Password: raspberry + +To run the obsw perform the following steps: +1. Build the cmake EGSE configuration +2. Disable the ser2net systemd service on the EGSE +````sh +$ sudo systemctl stop ser2net.service +```` +3. Power on the star tracker by running +````sh +$ ~/powerctrl/enable0.sh` +```` +4. Run portforwarding script for tmtc tcp connection and tcf agent on host PC +````sh +$ ./scripts/egse-port.sh +```` +5. The star tracker can be powered off by running +````sh +$ ~/powerctrl/disable0.sh +```` + # Manually preparing sysroots to compile gpsd Copy all header files from [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/gpsd&fileid=1189985) to the /usr/include directory and all static libraries to /usr/lib. From 60d43246d422dcffb5255a6412c5880050e3fbda Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" Date: Wed, 9 Feb 2022 13:34:24 +0100 Subject: [PATCH 23/61] link to egse sysroots --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 78656e51..7acc6342 100644 --- a/README.md +++ b/README.md @@ -1143,7 +1143,8 @@ ssh pi@192.168.18.31 Password: raspberry To run the obsw perform the following steps: -1. Build the cmake EGSE configuration +1. Build the cmake EGSE Configuration + * the sysroots for the EGSE can be found [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/egse&fileid=1190471) 2. Disable the ser2net systemd service on the EGSE ````sh $ sudo systemctl stop ser2net.service From 3035aea88585d854973c25a2ee9b6bbea6468db8 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 9 Feb 2022 19:20:19 +0100 Subject: [PATCH 24/61] wip parameter requests --- .../StarTrackerDefinitions.h | 677 +++++++++++++++++- .../startracker/StarTrackerHandler.cpp | 209 +++++- .../devices/startracker/StarTrackerHandler.h | 19 +- tmtc | 2 +- 4 files changed, 885 insertions(+), 22 deletions(-) diff --git a/linux/devices/devicedefinitions/StarTrackerDefinitions.h b/linux/devices/devicedefinitions/StarTrackerDefinitions.h index adfcf9b6..5f669fc9 100644 --- a/linux/devices/devicedefinitions/StarTrackerDefinitions.h +++ b/linux/devices/devicedefinitions/StarTrackerDefinitions.h @@ -214,6 +214,15 @@ enum PoolIds : lp_id_t { CAM_VAL3, CAM_REG4, CAM_VAL4, + CAM_REG5, + CAM_VAL5, + CAM_REG6, + CAM_VAL6, + CAM_REG7, + CAM_VAL7, + CAM_REG8, + CAM_VAL8, + CAM_FREQ_1, LIMITS_ACTION, LIMITS_FPGA18CURRENT, LIMITS_FPGA25CURRENT, @@ -239,7 +248,96 @@ enum PoolIds : lp_id_t { BLOB_DARK_THRESHOLD, BLOB_ENABLE_HISTOGRAM, BLOB_ENABLE_CONTRAST, - BLOB_BIN_MODE + BLOB_BIN_MODE, + LOGLEVEL1, + LOGLEVEL2, + LOGLEVEL3, + LOGLEVEL4, + LOGLEVEL5, + LOGLEVEL6, + LOGLEVEL7, + LOGLEVEL8, + LOGLEVEL9, + LOGLEVEL10, + LOGLEVEL11, + LOGLEVEL12, + LOGLEVEL13, + LOGLEVEL14, + LOGLEVEL15, + LOGLEVEL16, + MOUNTING_QW, + MOUNTING_QX, + MOUNTING_QY, + MOUNTING_QZ, + IMAGE_PROCESSOR_MODE, + IMAGE_PROCESSOR_STORE, + IMAGE_PROCESSOR_SIGNALTHRESHOLD, + IMAGE_PROCESSOR_DARKTHRESHOLD, + IMAGE_PROCESSOR_BACKGROUNDCOMPENSATION, + CENTROIDING_ENABLE_FILTER, + CENTROIDING_MAX_QUALITY, + CENTROIDING_DARK_THRESHOLD, + CENTROIDING_MIN_QUALITY, + CENTROIDING_MAX_INTENSITY, + CENTROIDING_MIN_INTENSITY, + CENTROIDING_MAX_MAGNITUDE, + CENTROIDING_GAUSSIAN_CMAX, + CENTROIDING_GAUSSIAN_CMIN, + CENTROIDING_TRANSMATRIX00, + CENTROIDING_TRANSMATRIX01, + CENTROIDING_TRANSMATRIX10, + CENTROIDING_TRANSMATRIX11, + LISA_MODE, + LISA_PREFILTER_DIST_THRESHOLD, + LISA_PREFILTER_ANGLE_THRESHOLD, + LISA_FOV_WIDTH, + LISA_FOV_HEIGHT, + LISA_FLOAT_STAR_LIMIT, + LISA_CLOSE_STAR_LIMIT, + LISA_RATING_WEIGHT_CLOSE_STAR_COUNT, + LISA_RATING_WEIGHT_FRACTION_CLOSE, + LISA_RATING_WEIGHT_MEAN_SUM, + LISA_RATING_WEIGHT_DB_STAR_COUNT, + LISA_MAX_COMBINATIONS, + LISA_NR_STARS_STOP, + LISA_FRACTION_CLOSE_STOP, + MATCHING_SQUARED_DISTANCE_LIMIT, + MATCHING_SQUARED_SHIFT_LIMIT, + TRACKING_THIN_LIMIT, + TRACKING_OUTLIER_THRESHOLD, + TRACKING_OUTLIER_THRESHOLD_QUEST, + TRACKING_TRACKER_CHOICE, + VALIDATION_STABLE_COUNT, + VALIDATION_MAX_DIFFERENCE, + VALIDATION_MIN_TRACKER_CONFIDENCE, + VALIDATION_MIN_MATCHED_STARS, + ALGO_MODE, + ALGO_I2T_MIN_CONFIDENCE, + ALGO_I2T_MIN_MATCHED, + ALGO_I2L_MIN_CONFIDENCE, + ALGO_I2L_MIN_MATCHED, + SUBSCRIPTION_TM1, + SUBSCRIPTION_TM2, + SUBSCRIPTION_TM3, + SUBSCRIPTION_TM4, + SUBSCRIPTION_TM5, + SUBSCRIPTION_TM6, + SUBSCRIPTION_TM7, + SUBSCRIPTION_TM8, + SUBSCRIPTION_TM9, + SUBSCRIPTION_TM10, + SUBSCRIPTION_TM11, + SUBSCRIPTION_TM12, + SUBSCRIPTION_TM13, + SUBSCRIPTION_TM14, + SUBSCRIPTION_TM15, + SUBSCRIPTION_TM16, + LOG_SUBSCRIPTION_LEVEL1, + LOG_SUBSCRIPTION_MODULE1, + LOG_SUBSCRIPTION_LEVEL2, + LOG_SUBSCRIPTION_MODULE2, + DEBUG_CAMERA_TIMING, + DEBUG_CAMERA_TEST }; static const DeviceCommandId_t PING_REQUEST = 0; @@ -290,6 +388,18 @@ static const DeviceCommandId_t UPLOAD_FPGA_IMAGE = 65; static const DeviceCommandId_t FPGA_ACTION = 66; static const DeviceCommandId_t REQ_CAMERA = 67; static const DeviceCommandId_t REQ_LIMITS = 68; +static const DeviceCommandId_t REQ_LOG_LEVEL = 69; +static const DeviceCommandId_t REQ_MOUNTING = 70; +static const DeviceCommandId_t REQ_IMAGE_PROCESSOR = 71; +static const DeviceCommandId_t REQ_CENTROIDING = 72; +static const DeviceCommandId_t REQ_LISA = 73; +static const DeviceCommandId_t REQ_MATCHING = 74; +static const DeviceCommandId_t REQ_TRACKING = 75; +static const DeviceCommandId_t REQ_VALIDATION = 76; +static const DeviceCommandId_t REQ_ALGO = 77; +static const DeviceCommandId_t REQ_SUBSCRIPTION = 78; +static const DeviceCommandId_t REQ_LOG_SUBSCRIPTION = 79; +static const DeviceCommandId_t REQ_DEBUG_CAMERA = 80; static const DeviceCommandId_t NONE = 0xFFFFFFFF; static const uint32_t VERSION_SET_ID = REQ_VERSION; @@ -307,6 +417,17 @@ static const uint32_t DOWNLOAD_DBIMAGE_SET_ID = DOWNLOAD_DBIMAGE; static const uint32_t DOWNLOAD_BLOBPIXEL_SET_ID = DOWNLOAD_BLOBPIXEL; static const uint32_t CAMERA_SET_ID = REQ_CAMERA; static const uint32_t LIMITS_SET_ID = REQ_LIMITS; +static const uint32_t LOG_LEVEL_SET_ID = REQ_LOG_LEVEL; +static const uint32_t MOUNTING_SET_ID = REQ_MOUNTING; +static const uint32_t IMAGE_PROCESSOR_SET_ID = REQ_IMAGE_PROCESSOR; +static const uint32_t CENTROIDING_SET_ID = REQ_CENTROIDING; +static const uint32_t LISA_SET_ID = REQ_LISA; +static const uint32_t MATCHING_SET_ID = REQ_MATCHING; +static const uint32_t TRACKING_SET_ID = REQ_TRACKING; +static const uint32_t VALIDATION_SET_ID = REQ_VALIDATION; +static const uint32_t ALGO_SET_ID = REQ_ALGO; +static const uint32_t SUBSCRIPTION_SET_ID = REQ_SUBSCRIPTION; +static const uint32_t LOG_SUBSCRIPTION_SET_ID = REQ_LOG_SUBSCRIPTION; /** Max size of unencoded frame */ static const size_t MAX_FRAME_SIZE = 1200; @@ -324,8 +445,20 @@ static const uint8_t DOWNLOAD_CENTROID_SET_ENTRIES = 11; static const uint8_t DOWNLOAD_MATCHED_STAR_SET_ENTRIES = 14; static const uint8_t DOWNLOAD_DBIMAGE_SET_ENTRIES = 6; static const uint8_t DOWNLOAD_BLOBPIXEL_SET_ENTRIES = 7; -static const uint8_t CAMERA_SET_ENTRIES = 15; +static const uint8_t CAMERA_SET_ENTRIES = 24; static const uint8_t LIMITS_SET_ENTRIES = 11; +static const uint8_t LOG_LEVEL_SET_ENTRIES = 16; +static const uint8_t MOUNTING_SET_ENTRIES = 4; +static const uint8_t IMAGE_PROCESSOR_SET_ENTRIES = 5; +static const uint8_t CENTROIDING_PARAMS_SET_ENTRIES = 13; +static const uint8_t LISA_SET_ENTRIES = 14; +static const uint8_t MATCHING_SET_ENTRIES = 2; +static const uint8_t TRACKING_SET_ENTRIES = 4; +static const uint8_t VALIDATION_SET_ENTRIES = 4; +static const uint8_t ALGO_SET_ENTRIES = 5; +static const uint8_t SUBSCRIPTION_SET_ENTRIES = 16; +static const uint8_t LOG_SUBSCRIPTION_SET_ENTRIES = 4; +static const uint8_t DEBUG_CAMERA_SET_ENTRIES = 2; // Action, parameter and telemetry IDs namespace ID { @@ -347,7 +480,7 @@ static const uint8_t REBOOT = 7; static const uint8_t UPLOAD_IMAGE = 10; static const uint8_t POWER = 11; static const uint8_t SET_TIME = 14; -static const uint8_t SUBSCRIBE = 18; +static const uint8_t SUBSCRIPTION = 18; static const uint8_t SOLUTION = 24; static const uint8_t TEMPERATURE = 27; static const uint8_t HISTOGRAM = 28; @@ -366,6 +499,9 @@ static const uint8_t DOWNLOAD_MATCHED_STAR = 18; static const uint8_t DOWNLOAD_DBIMAGE = 19; static const uint8_t DOWNLOAD_BLOBPIXEL = 24; static const uint8_t FPGA_ACTION = 22; +static const uint8_t LOG_LEVEL = 3; +static const uint8_t LOG_SUBSCRIPTION = 19; +static const uint8_t DEBUG_CAMERA = 20; } // namespace ID namespace Program { @@ -1103,7 +1239,7 @@ class DownloadBlobPixel : public StaticLocalDataSet { public: // Size of dataset - static const size_t SIZE = 25; + static const size_t SIZE = 34; CameraSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CAMERA_SET_ID) {} @@ -1124,6 +1260,15 @@ class CameraSet : public StaticLocalDataSet { lp_var_t val3 = lp_var_t(sid.objectId, PoolIds::CAM_VAL3, this); lp_var_t reg4 = lp_var_t(sid.objectId, PoolIds::CAM_REG4, this); lp_var_t val4 = lp_var_t(sid.objectId, PoolIds::CAM_VAL4, this); + lp_var_t reg5 = lp_var_t(sid.objectId, PoolIds::CAM_REG5, this); + lp_var_t val5 = lp_var_t(sid.objectId, PoolIds::CAM_VAL5, this); + lp_var_t reg6 = lp_var_t(sid.objectId, PoolIds::CAM_REG6, this); + lp_var_t val6 = lp_var_t(sid.objectId, PoolIds::CAM_VAL6, this); + lp_var_t reg7 = lp_var_t(sid.objectId, PoolIds::CAM_REG7, this); + lp_var_t val7 = lp_var_t(sid.objectId, PoolIds::CAM_VAL7, this); + lp_var_t reg8 = lp_var_t(sid.objectId, PoolIds::CAM_REG8, this); + lp_var_t val8 = lp_var_t(sid.objectId, PoolIds::CAM_VAL8, this); + lp_var_t freq1 = lp_var_t(sid.objectId, PoolIds::CAM_FREQ_1, this); void printSet() { PoolReadGuard rg(this); @@ -1153,6 +1298,24 @@ class CameraSet : public StaticLocalDataSet { << std::endl; sif::info << "CameraSet::printSet: Val 4: " << static_cast(this->val4.value) << std::endl; + sif::info << "CameraSet::printSet: Reg 5: " << static_cast(this->reg5.value) + << std::endl; + sif::info << "CameraSet::printSet: Val 5: " << static_cast(this->val5.value) + << std::endl; + sif::info << "CameraSet::printSet: Reg 6: " << static_cast(this->reg6.value) + << std::endl; + sif::info << "CameraSet::printSet: Val 6: " << static_cast(this->val6.value) + << std::endl; + sif::info << "CameraSet::printSet: Reg 7: " << static_cast(this->reg7.value) + << std::endl; + sif::info << "CameraSet::printSet: Val 7: " << static_cast(this->val7.value) + << std::endl; + sif::info << "CameraSet::printSet: Reg 8: " << static_cast(this->reg8.value) + << std::endl; + sif::info << "CameraSet::printSet: Val 8: " << static_cast(this->val8.value) + << std::endl; + sif::info << "CameraSet::printSet: Freq 1: " << static_cast(this->freq1.value) + << std::endl; } }; @@ -1189,17 +1352,503 @@ class LimitsSet : public StaticLocalDataSet { void printSet() { PoolReadGuard rg(this); - sif::info << "CameraSet::printSet: action: " << static_cast(this->action.value) + sif::info << "LimitsSet::printSet: action: " << static_cast(this->action.value) << std::endl; - sif::info << "CameraSet::printSet: FPGA18Current: " << this->fpga18current << std::endl; - sif::info << "CameraSet::printSet: FPGA25Current: " << this->fpga25current << std::endl; - sif::info << "CameraSet::printSet: FPGA10Current: " << this->fpga10current << std::endl; - sif::info << "CameraSet::printSet: MCUCurrent: " << this->mcuCurrent << std::endl; - sif::info << "CameraSet::printSet: CMOS21Current: " << this->cmos21current << std::endl; - sif::info << "CameraSet::printSet: CMOSPixCurrent: " << this->cmosPixCurrent << std::endl; - sif::info << "CameraSet::printSet: CMOS33Current: " << this->cmos33current << std::endl; - sif::info << "CameraSet::printSet: CMOSVResCurrent: " << this->cmosVresCurrent << std::endl; - sif::info << "CameraSet::printSet: CMOSTemperature: " << this->cmosTemperature << std::endl; + sif::info << "LimitsSet::printSet: FPGA18Current: " << this->fpga18current << std::endl; + sif::info << "LimitsSet::printSet: FPGA25Current: " << this->fpga25current << std::endl; + sif::info << "LimitsSet::printSet: FPGA10Current: " << this->fpga10current << std::endl; + sif::info << "LimitsSet::printSet: MCUCurrent: " << this->mcuCurrent << std::endl; + sif::info << "LimitsSet::printSet: CMOS21Current: " << this->cmos21current << std::endl; + sif::info << "LimitsSet::printSet: CMOSPixCurrent: " << this->cmosPixCurrent << std::endl; + sif::info << "LimitsSet::printSet: CMOS33Current: " << this->cmos33current << std::endl; + sif::info << "LimitsSet::printSet: CMOSVResCurrent: " << this->cmosVresCurrent << std::endl; + sif::info << "LimitsSet::printSet: CMOSTemperature: " << this->cmosTemperature << std::endl; + } +}; + +/** + * @brief Will store the requested log level parameters + */ +class LogLevelSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 16; + + LogLevelSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, LOG_LEVEL_SET_ENTRIES) {} + + LogLevelSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, LOG_LEVEL_SET_ENTRIES)) {} + + lp_var_t loglevel1 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL1, this); + lp_var_t loglevel2 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL2, this); + lp_var_t loglevel3 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL3, this); + lp_var_t loglevel4 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL4, this); + lp_var_t loglevel5 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL5, this); + lp_var_t loglevel6 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL6, this); + lp_var_t loglevel7 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL7, this); + lp_var_t loglevel8 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL8, this); + lp_var_t loglevel9 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL9, this); + lp_var_t loglevel10 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL10, this); + lp_var_t loglevel11 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL11, this); + lp_var_t loglevel12 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL12, this); + lp_var_t loglevel13 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL13, this); + lp_var_t loglevel14 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL14, this); + lp_var_t loglevel15 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL15, this); + lp_var_t loglevel16 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL16, this); + + void printSet() { + PoolReadGuard rg(this); + sif::info << "LogLevelSet::printSet: loglevel1: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel2: " + << static_cast(this->loglevel2.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel3: " + << static_cast(this->loglevel3.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel4: " + << static_cast(this->loglevel4.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel5: " + << static_cast(this->loglevel5.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel6: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel7: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel8: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel9: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel10: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel11: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel12: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel13: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel14: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel15: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel16: " + << static_cast(this->loglevel1.value) << std::endl; + } +}; + +/** + * @brief Will store the requested mounting parameters + */ +class MountingSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 16; + + MountingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, MOUNTING_SET_ID) {} + + MountingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, MOUNTING_SET_ID)) {} + + lp_var_t qw = lp_var_t(sid.objectId, PoolIds::MOUNTING_QW, this); + lp_var_t qx = lp_var_t(sid.objectId, PoolIds::MOUNTING_QX, this); + lp_var_t qy = lp_var_t(sid.objectId, PoolIds::MOUNTING_QY, this); + lp_var_t qz = lp_var_t(sid.objectId, PoolIds::MOUNTING_QZ, this); + + void printSet() { + sif::info << "MountingSet::printSet: qw: " << this->qw << std::endl; + sif::info << "MountingSet::printSet: qx: " << this->qx << std::endl; + sif::info << "MountingSet::printSet: qy: " << this->qy << std::endl; + sif::info << "MountingSet::printSet: qz: " << this->qz << std::endl; + } +}; + +/** + * @brief Will store the requested image processor parameters + */ +class ImageProcessorSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 7; + + ImageProcessorSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, IMAGE_PROCESSOR_SET_ID) {} + + ImageProcessorSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, IMAGE_PROCESSOR_SET_ID)) {} + + lp_var_t mode = lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_MODE, this); + lp_var_t store = lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_STORE, this); + lp_var_t signalThreshold = + lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_SIGNALTHRESHOLD, this); + lp_var_t darkThreshold = + lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_DARKTHRESHOLD, this); + lp_var_t backgroundCompensation = + lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_BACKGROUNDCOMPENSATION, this); + + void printSet() { + sif::info << "ImageProcessorSet::printSet: mode: " << this->mode << std::endl; + sif::info << "ImageProcessorSet::printSet: store: " << this->store << std::endl; + sif::info << "ImageProcessorSet::printSet: signal threshold: " << this->signalThreshold + << std::endl; + sif::info << "ImageProcessorSet::printSet: dark threshold: " << this->darkThreshold + << std::endl; + sif::info << "ImageProcessorSet::printSet: background compensation: " + << this->backgroundCompensation << std::endl; + } +}; + +/** + * @brief Will store the requested centroiding parameters + */ +class CentroidingSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 49; + + CentroidingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CENTROIDING_SET_ID) {} + + CentroidingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, CENTROIDING_SET_ID)) {} + + lp_var_t enableFilter = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_ENABLE_FILTER, this); + lp_var_t maxQuality = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MAX_QUALITY, this); + lp_var_t darkThreshold = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_DARK_THRESHOLD, this); + lp_var_t minQuality = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MIN_QUALITY, this); + lp_var_t maxIntensity = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MAX_INTENSITY, this); + lp_var_t minIntensity = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MIN_INTENSITY, this); + lp_var_t maxMagnitude = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MAX_MAGNITUDE, this); + lp_var_t gaussianCmax = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_GAUSSIAN_CMAX, this); + lp_var_t gaussianCmin = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_GAUSSIAN_CMIN, this); + lp_var_t transmatrix00 = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX00, this); + lp_var_t transmatrix01 = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX01, this); + lp_var_t transmatrix10 = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX10, this); + lp_var_t transmatrix11 = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX11, this); + + void printSet() { + sif::info << "CentroidingSet::printSet: enable filter: " << this->enableFilter << std::endl; + sif::info << "CentroidingSet::printSet: max quality: " << this->maxQuality << std::endl; + sif::info << "CentroidingSet::printSet: dark threshold: " << this->darkThreshold << std::endl; + sif::info << "CentroidingSet::printSet: min quality: " << this->minQuality << std::endl; + sif::info << "CentroidingSet::printSet: max intensity: " << this->maxIntensity << std::endl; + sif::info << "CentroidingSet::printSet: min intensity: " << this->minIntensity << std::endl; + sif::info << "CentroidingSet::printSet: max magnitude: " << this->maxMagnitude << std::endl; + sif::info << "CentroidingSet::printSet: gaussian cmax: " << this->gaussianCmax << std::endl; + sif::info << "CentroidingSet::printSet: gaussian cmin: " << this->gaussianCmin << std::endl; + sif::info << "CentroidingSet::printSet: transmatrix 00 : " << this->transmatrix00 << std::endl; + sif::info << "CentroidingSet::printSet: transmatrix 01 : " << this->transmatrix01 << std::endl; + sif::info << "CentroidingSet::printSet: transmatrix 10 : " << this->transmatrix10 << std::endl; + sif::info << "CentroidingSet::printSet: transmatrix 11 : " << this->transmatrix11 << std::endl; + } +}; + +/** + * @brief Will store the requested centroiding parameters + */ +class LisaSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 50; + + LisaSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, LISA_SET_ID) {} + + LisaSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, LISA_SET_ID)) {} + + lp_var_t mode = lp_var_t(sid.objectId, PoolIds::LISA_MODE, this); + lp_var_t prefilterDistThreshold = + lp_var_t(sid.objectId, PoolIds::LISA_PREFILTER_DIST_THRESHOLD, this); + lp_var_t prefilterAngleThreshold = + lp_var_t(sid.objectId, PoolIds::LISA_PREFILTER_ANGLE_THRESHOLD, this); + lp_var_t fovWidth = lp_var_t(sid.objectId, PoolIds::LISA_FOV_WIDTH, this); + lp_var_t fovHeight = lp_var_t(sid.objectId, PoolIds::LISA_FOV_HEIGHT, this); + lp_var_t floatStarLimit = + lp_var_t(sid.objectId, PoolIds::LISA_FLOAT_STAR_LIMIT, this); + lp_var_t closeStarLimit = + lp_var_t(sid.objectId, PoolIds::LISA_CLOSE_STAR_LIMIT, this); + lp_var_t ratingWeightCloseStarCount = + lp_var_t(sid.objectId, PoolIds::LISA_RATING_WEIGHT_CLOSE_STAR_COUNT, this); + lp_var_t ratingWeightFractionClose = + lp_var_t(sid.objectId, PoolIds::LISA_RATING_WEIGHT_FRACTION_CLOSE, this); + lp_var_t ratingWeightMeanSum = + lp_var_t(sid.objectId, PoolIds::LISA_RATING_WEIGHT_MEAN_SUM, this); + lp_var_t ratingWeightDbStarCount = + lp_var_t(sid.objectId, PoolIds::LISA_RATING_WEIGHT_DB_STAR_COUNT, this); + lp_var_t maxCombinations = + lp_var_t(sid.objectId, PoolIds::LISA_MAX_COMBINATIONS, this); + lp_var_t nrStarsStop = + lp_var_t(sid.objectId, PoolIds::LISA_NR_STARS_STOP, this); + lp_var_t fractionCloseStop = + lp_var_t(sid.objectId, PoolIds::LISA_FRACTION_CLOSE_STOP, this); + + void printSet() { + sif::info << "LisaSet::printSet: mode: " << this->mode << std::endl; + sif::info << "LisaSet::printSet: prefilter dist threshold: " << this->prefilterDistThreshold + << std::endl; + sif::info << "LisaSet::printSet: prefilter angle threshold: " << this->prefilterAngleThreshold + << std::endl; + sif::info << "LisaSet::printSet: fov width: " << this->fovWidth << std::endl; + sif::info << "LisaSet::printSet: fov height: " << this->fovHeight << std::endl; + sif::info << "LisaSet::printSet: float star limit: " << this->floatStarLimit << std::endl; + sif::info << "LisaSet::printSet: close star limit: " << this->closeStarLimit << std::endl; + sif::info << "LisaSet::printSet: rating weight close star count: " + << this->ratingWeightCloseStarCount << std::endl; + sif::info << "LisaSet::printSet: rating weight fraction close: " + << this->ratingWeightFractionClose << std::endl; + sif::info << "LisaSet::printSet: rating weight mean sum: " << this->ratingWeightMeanSum + << std::endl; + sif::info << "LisaSet::printSet: rating weight db star count: " << this->ratingWeightDbStarCount + << std::endl; + sif::info << "LisaSet::printSet: max combinations: " << this->maxCombinations << std::endl; + sif::info << "LisaSet::printSet: nr stars stop: " << this->nrStarsStop << std::endl; + sif::info << "LisaSet::printSet: fraction close stop: " << this->fractionCloseStop << std::endl; + } +}; + +/** + * @brief Will store the requested matching parameters + */ +class MatchingSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 8; + + MatchingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, MATCHING_SET_ID) {} + + MatchingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, MATCHING_SET_ID)) {} + + lp_var_t squaredDistanceLimit = lp_var_t(sid.objectId, PoolIds::MATCHING_SQUARED_DISTANCE_LIMIT, this); + lp_var_t squaredShiftLimit = lp_var_t(sid.objectId, PoolIds::MATCHING_SQUARED_SHIFT_LIMIT, this); + + void printSet() { + sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredDistanceLimit + << std::endl; + sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredShiftLimit + << std::endl; + } +}; + +/** + * @brief Will store the requested tracking parameters + */ +class TrackingSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 16; + + TrackingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, TRACKING_SET_ID) {} + + TrackingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, TRACKING_SET_ID)) {} + + lp_var_t thinLimit = lp_var_t(sid.objectId, PoolIds::TRACKING_THIN_LIMIT, this); + lp_var_t outlierThreshold = lp_var_t(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD, this); + lp_var_t outlierThresholdQuest = lp_var_t(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD_QUEST, this); + lp_var_t trackerChoice = lp_var_t(sid.objectId, PoolIds::TRACKING_TRACKER_CHOICE, this); + + void printSet() { + sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredDistanceLimit + << std::endl; + sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredShiftLimit + << std::endl; + } +}; + +/** + * @brief Will store the requested validation parameters + */ +class ValidationSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 10; + + ValidationSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, VALIDATION_SET_ID) {} + + ValidationSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, VALIDATION_SET_ID)) {} + + lp_var_t stableCount = + lp_var_t(sid.objectId, PoolIds::VALIDATION_STABLE_COUNT, this); + lp_var_t maxDifference = + lp_var_t(sid.objectId, PoolIds::VALIDATION_MAX_DIFFERENCE, this); + lp_var_t minTrackerConfidence = + lp_var_t(sid.objectId, PoolIds::VALIDATION_MIN_TRACKER_CONFIDENCE, this); + lp_var_t minMatchedStars = + lp_var_t(sid.objectId, PoolIds::VALIDATION_MIN_MATCHED_STARS, this); + + void printSet() { + sif::info << "ValidationSet::printSet: stable count: " + << static_cast(this->stableCount) << std::endl; + sif::info << "ValidationSet::printSet: max difference: " << this->maxDifference << std::endl; + sif::info << "ValidationSet::printSet: min tracker confidence: " << this->minTrackerConfidence + << std::endl; + sif::info << "ValidationSet::printSet: min matched stars: " << this->minMatchedStars + << std::endl; + } +}; + +/** + * @brief Will store the requested algo parameters + */ +class AlgoSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 11; + + AlgoSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, ALGO_SET_ID) {} + + AlgoSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, ALGO_SET_ID)) {} + + lp_var_t mode = + lp_var_t(sid.objectId, PoolIds::ALGO_MODE, this); + lp_var_t i2tMinConfidence = + lp_var_t(sid.objectId, PoolIds::ALGO_I2T_MIN_CONFIDENCE, this); + lp_var_t i2tMinMatched = + lp_var_t(sid.objectId, PoolIds::ALGO_I2T_MIN_MATCHED, this); + lp_var_t i2lMinConfidence = + lp_var_t(sid.objectId, PoolIds::ALGO_I2L_MIN_CONFIDENCE, this); + lp_var_t i2lMinMatched = + lp_var_t(sid.objectId, PoolIds::ALGO_I2L_MIN_MATCHED, this); + + void printSet() { + sif::info << "AlgoSet::printSet: mode: " << static_cast(this->mode) << std::endl; + sif::info << "AlgoSet::printSet: i2t min confidence: " << this->i2tMinConfidence << std::endl; + sif::info << "AlgoSet::printSet: i2t min matched: " + << static_cast(this->i2tMinMatched) << std::endl; + sif::info << "AlgoSet::printSet: i2l min confidence: " << this->i2lMinConfidence << std::endl; + sif::info << "AlgoSet::printSet: i2l min matched: " + << static_cast(this->i2lMinMatched) << std::endl; + } +}; + +/** + * @brief Will store the requested subscription parameters + */ +class SubscriptionSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 16; + + SubscriptionSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, SUBSCRIPTION_SET_ID) {} + + SubscriptionSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, SUBSCRIPTION_SET_ID)) {} + + lp_var_t tm1 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM1, this); + lp_var_t tm2 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM2, this); + lp_var_t tm3 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM3, this); + lp_var_t tm4 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM4, this); + lp_var_t tm5 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM5, this); + lp_var_t tm6 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM6, this); + lp_var_t tm7 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM7, this); + lp_var_t tm8 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM8, this); + lp_var_t tm9 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM9, this); + lp_var_t tm10 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM10, this); + lp_var_t tm11 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM11, this); + lp_var_t tm12 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM12, this); + lp_var_t tm13 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM13, this); + lp_var_t tm14 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM14, this); + lp_var_t tm15 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM15, this); + lp_var_t tm16 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM16, this); + + void printSet() { + sif::info << "SubscriptionSet::printSet: telemetry 1: " << static_cast(this->tm1) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 2: " << static_cast(this->tm2) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 3: " << static_cast(this->tm3) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 4: " << static_cast(this->tm4) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 5: " << static_cast(this->tm5) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 6: " << static_cast(this->tm6) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 7: " << static_cast(this->tm7) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 8: " << static_cast(this->tm8) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 9: " << static_cast(this->tm9) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 10: " + << static_cast(this->tm10) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 11: " + << static_cast(this->tm11) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 12: " + << static_cast(this->tm12) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 13: " + << static_cast(this->tm13) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 14: " + << static_cast(this->tm14) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 15: " + << static_cast(this->tm15) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 16: " + << static_cast(this->tm16) << std::endl; + } +}; + +/** + * @brief Will store the requested log subscription parameters + */ +class LogSubscriptionSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 4; + + LogSubscriptionSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, LOG_SUBSCRIPTION_SET_ID) {} + + LogSubscriptionSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, LOG_SUBSCRIPTION_SET_ID)) {} + + lp_var_t level1 = + lp_var_t(sid.objectId, PoolIds::LOG_SUBSCRIPTION_LEVEL1, this); + lp_var_t module1 = + lp_var_t(sid.objectId, PoolIds::LOG_SUBSCRIPTION_MODULE1, this); + lp_var_t level2 = + lp_var_t(sid.objectId, PoolIds::LOG_SUBSCRIPTION_LEVEL2, this); + lp_var_t module2 = + lp_var_t(sid.objectId, PoolIds::LOG_SUBSCRIPTION_MODULE2, this); + + void printSet() { + sif::info << "LogSubscriptionSet::printSet: level 1: " + << static_cast(this->level1) << std::endl; + sif::info << "LogSubscriptionSet::printSet: module 1: " + << static_cast(this->module1) << std::endl; + sif::info << "LogSubscriptionSet::printSet: level 2: " + << static_cast(this->level2) << std::endl; + sif::info << "LogSubscriptionSet::printSet: module 2: " + << static_cast(this->module2) << std::endl; + } +}; + +/** + * @brief Will store the requested debug camera parameters + */ +class DebugCameraSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 8; + + DebugCameraSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, DEBUG_CAMERA_SET_ID) {} + + lp_var_t timing = + lp_var_t(sid.objectId, PoolIds::DEBUG_CAMERA_TIMING, this); + lp_var_t test = + lp_var_t(sid.objectId, PoolIds::DEBUG_CAMERA_TEST, this); + + DebugCameraSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, DEBUG_CAMERA_SET_ID)) {} + + void printSet() { + sif::info << "DebugCameraSet::printSet: level 1: " + << static_cast(this->level1) << std::endl; + sif::info << "DebugCameraSet::printSet: module 1: " + << static_cast(this->module1) << std::endl; } }; } // namespace StarTracker diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index e2857f79..044dd0d7 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -515,6 +515,50 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi result = prepareRequestLimitsParams(); return result; } + case (StarTracker::REQ_LOG_LEVEL): { + result = prepareRequestLogLevelParams(); + return result; + } + case (StarTracker::REQ_MOUNTING): { + result = prepareRequestMountingParams(); + return result; + } + case (StarTracker::REQ_IMAGE_PROCESSOR): { + result = prepareRequestMountignParams(); + return result; + } + case (StarTracker::REQ_CENTROIDING): { + result = prepareRequestCentroidingParams(); + return result; + } + case (StarTracker::REQ_LISA): { + result = prepareRequestLisaParams(); + return result; + } + case (StarTracker::REQ_MATCHING): { + result = prepareRequetMatchingParams(); + return result; + } + case (StarTracker::REQ_TRACKING): { + result = prepareRequestTrackingParams(); + return result; + } + case (StarTracker::REQ_VALIDATION): { + result = prepareRequestValidationParams(); + return result; + } + case (StarTracker::REQ_ALGO): { + result = prepareRequestAlgoParams(); + return result; + } + case (StarTracker::REQ_SUBSCRIPTION): { + result = prepareRequestSubscriptionParams(); + return result; + } + case (StarTracker::REQ_LOG_SUBSCRIPTION): { + result = prepareRequestLogSubscriptionParams(); + return result; + } default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -599,6 +643,30 @@ void StarTrackerHandler::fillCommandAndReplyMap() { StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::REQ_LIMITS, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_LOG_LEVEL, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_MOUNTING, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_IMAGE_PROCESSOR, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_CENTROIDING, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_LISA, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_MATCHING, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_TRACKING, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_VALIDATION, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_ALGO, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_SUBSCRIPTION, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_LOG_SUBSCRIPTION, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_DEBUG_CAMERA, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); } ReturnValue_t StarTrackerHandler::scanForReply(const uint8_t* start, size_t remainingSize, @@ -983,6 +1051,15 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(StarTracker::CAM_VAL3, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::CAM_REG4, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::CAM_VAL4, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_REG5, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_VAL5, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_REG6, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_VAL6, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_REG7, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_VAL7, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_REG8, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_VAL8, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_FREQ_1, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::LIMITS_ACTION, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::LIMITS_FPGA18CURRENT, new PoolEntry({0})); @@ -994,6 +1071,77 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(StarTracker::LIMITS_CMOS33CURRENT, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::LIMITS_CMOSVRESCURRENT, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::LIMITS_CMOSTEMPERATURE, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::LOGLEVEL1, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL2, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL3, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL4, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL5, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL6, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL7, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL8, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL9, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL10, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL11, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL12, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL13, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL14, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL15, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL16, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::MOUNTING_QW, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::MOUNTING_QX, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::MOUNTING_QY, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::MOUNTING_QZ, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::IMAGE_PROCESSOR_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::IMAGE_PROCESSOR_STORE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::IMAGE_PROCESSOR_SIGNALTHRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::IMAGE_PROCESSOR_DARKTHRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::IMAGE_PROCESSOR_BACKGROUNDCOMPENSATION, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::CENTROIDING_ENABLE_FILTER, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_MAX_QUALITY, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_DARK_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_MIN_QUALITY, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_MAX_INTENSITY, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_MIN_INTENSITY, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_MAX_MAGNITUDE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_GAUSSIAN_CMAX, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_GAUSSIAN_CMIN, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_TRANSMATRIX00, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_TRANSMATRIX01, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_TRANSMATRIX10, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_TRANSMATRIX11, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::LISA_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_PREFILTER_DIST_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_PREFILTER_ANGLE_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_FOV_WIDTH, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_FOV_HEIGHT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_FLOAT_STAR_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_CLOSE_STAR_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_RATING_WEIGHT_CLOSE_STAR_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_RATING_WEIGHT_FRACTION_CLOSE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_RATING_WEIGHT_MEAN_SUM, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_RATING_WEIGHT_DB_STAR_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_MAX_COMBINATIONS, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_NR_STARS_STOP, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_FRACTION_CLOSE_STOP, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::MATCHING_SQUARED_DISTANCE_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::MATCHING_SQUARED_SHIFT_LIMIT, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::TRACKING_THIN_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::TRACKING_OUTLIER_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::TRACKING_OUTLIER_THRESHOLD_QUEST, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::TRACKING_TRACKER_CHOICE, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::VALIDATION_STABLE_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::VALIDATION_MAX_DIFFERENCE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::VALIDATION_MIN_TRACKER_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::VALIDATION_MIN_MATCHED_STARS, new PoolEntry({0})); + return RETURN_OK; } @@ -1099,7 +1247,7 @@ ReturnValue_t StarTrackerHandler::scanForActionReply(DeviceCommandId_t* foundId) ReturnValue_t StarTrackerHandler::scanForSetParameterReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (StarTracker::ID::SUBSCRIBE): { + case (StarTracker::ID::SUBSCRIPTION): { *foundId = StarTracker::SUBSCRIBE_TO_TM; break; } @@ -1162,6 +1310,54 @@ ReturnValue_t StarTrackerHandler::scanForGetParameterReply(DeviceCommandId_t* fo *foundId = StarTracker::REQ_LIMITS; break; } + case (StarTracker::ID::LOG_LEVEL): { + *foundId = StarTracker::REQ_LOG_LEVEL; + break; + } + case (StarTracker::ID::MOUNTING): { + *foundId = StarTracker::REQ_MOUNTING; + break; + } + case (StarTracker::ID::IMAGE_PROCESSOR): { + *foundId = StarTracker::REQ_IMAGE_PROCESSOR; + break; + } + case (StarTracker::ID::CENTROIDING): { + *foundId = StarTracker::REQ_CENTROIDING; + break; + } + case (StarTracker::ID::LISA): { + *foundId = StarTracker::REQ_LISA; + break; + } + case (StarTracker::ID::MATCHING): { + *foundId = StarTracker::REQ_MATCHING; + break; + } + case (StarTracker::ID::TRACKING): { + *foundId = StarTracker::REQ_TRACKING; + break; + } + case (StarTracker::ID::VALIDATION): { + *foundId = StarTracker::REQ_VALIDATION; + break; + } + case (StarTracker::ID::ALGO): { + *foundId = StarTracker::REQ_ALGO; + break; + } + case (StarTracker::ID::SUBSCRIPTION): { + *foundId = StarTracker::SUBSCRIPTION; + break; + } + case (StarTracker::ID::LOG_SUBSCRIPTION): { + *foundId = StarTracker::REQ_LOG_SUBSCRIPTION; + break; + } + case (StarTracker::ID::DEBUG_CAMERA): { + *foundId = StarTracker::REQ_DEBUG_CAMERA; + break; + } default: { sif::warning << "tarTrackerHandler::scanForGetParameterReply: UnkNown ID" << std::endl; return RETURN_FAILED; @@ -1626,7 +1822,7 @@ void StarTrackerHandler::prepareTakeImageCommand(const uint8_t* commandData) { void StarTrackerHandler::prepareSubscriptionCommand(const uint8_t* tmId) { uint32_t length = 18; commandBuffer[0] = TMTC_SETPARAMREQ; - commandBuffer[1] = StarTracker::ID::SUBSCRIBE; + commandBuffer[1] = StarTracker::ID::SUBSCRIPTION; // Fill all other fields with invalid tm id commandBuffer[2] = *tmId; commandBuffer[3] = 0; @@ -1794,6 +1990,15 @@ ReturnValue_t StarTrackerHandler::prepareRequestLimitsParams() { return RETURN_OK; } +ReturnValue_t StarTrackerHandler::prepareRequestPropertyParams() { + uint32_t length = 0; + arc_pack_loglevel_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + ReturnValue_t StarTrackerHandler::handleSetParamReply() { const uint8_t* reply = dataLinkLayer.getReply(); uint8_t status = *(reply + STATUS_OFFSET); diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 3d7ed28a..a6ead8e8 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -495,14 +495,23 @@ class StarTrackerHandler : public DeviceHandlerBase { ReturnValue_t prepareFpgaActionCommand(const uint8_t* commandData, size_t commandDataLen); /** - * @brief Will fill the command buffer with the command to request the set camera parameters. + * @brief The following function will fill the command buffer with the command to request + * a parameter set. */ ReturnValue_t prepareRequestCameraParams(); - - /** - * @brief Will fill the command buffer with the command to request the set limits. - */ ReturnValue_t prepareRequestLimitsParams(); + ReturnValue_t prepareRequestLogLevelParams(); + ReturnValue_t prepareRequestMountingParams(); + ReturnValue_t prepareRequestImageProcessorParams(); + ReturnValue_t prepareRequestCentroidingParams(); + ReturnValue_t prepareRequestLisaParams(); + ReturnValue_t prepareRequestMatchingParams(); + ReturnValue_t prepareRequestTrackingParams(); + ReturnValue_t prepareRequestValidationParams(); + ReturnValue_t prepareRequestAlgoParams(); + ReturnValue_t prepareRequestSubscriptionParams(); + ReturnValue_t prepareRequestLogSubscriptionParams(); + ReturnValue_t prepareRequestDebugCameraParams(); /** * @brief Handles action replies with datasets. diff --git a/tmtc b/tmtc index 199ffe1a..cf7d25c2 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 199ffe1a321c09ba9726c87413045f8b32f40e90 +Subproject commit cf7d25c206e8ae8480367e1fc2b1151a0ded2683 From a65072b743637d502af096638ab2c47b4656ab4c Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 9 Feb 2022 19:27:08 +0100 Subject: [PATCH 25/61] changed egse default config to ground --- linux/devices/startracker/StarTrackerHandler.h | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 3d7ed28a..65aefa93 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -272,7 +272,7 @@ class StarTrackerHandler : public DeviceHandlerBase { #ifndef EGSE std::string paramJsonFile = "/mnt/sd0/startracker/flight-config.json"; #else - std::string paramJsonFile = "/home/pi/arcsec/ground-config.json"; + std::string paramJsonFile = "/home/pi/arcsec/flight-config.json"; #endif enum class InternalState { TEMPERATURE_REQUEST }; diff --git a/tmtc b/tmtc index 199ffe1a..cf7d25c2 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 199ffe1a321c09ba9726c87413045f8b32f40e90 +Subproject commit cf7d25c206e8ae8480367e1fc2b1151a0ded2683 From 07e68bd05b444261860d8fe651bc1deef0e5f16b Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 9 Feb 2022 19:46:12 +0100 Subject: [PATCH 26/61] param request wip --- .../StarTrackerDefinitions.h | 6 +- .../startracker/StarTrackerHandler.cpp | 71 +++++++++++++++---- .../devices/startracker/StarTrackerHandler.h | 12 ++++ 3 files changed, 71 insertions(+), 18 deletions(-) diff --git a/linux/devices/devicedefinitions/StarTrackerDefinitions.h b/linux/devices/devicedefinitions/StarTrackerDefinitions.h index 5f669fc9..4e80bf42 100644 --- a/linux/devices/devicedefinitions/StarTrackerDefinitions.h +++ b/linux/devices/devicedefinitions/StarTrackerDefinitions.h @@ -1845,10 +1845,8 @@ class DebugCameraSet : public StaticLocalDataSet { : StaticLocalDataSet(sid_t(objectId, DEBUG_CAMERA_SET_ID)) {} void printSet() { - sif::info << "DebugCameraSet::printSet: level 1: " - << static_cast(this->level1) << std::endl; - sif::info << "DebugCameraSet::printSet: module 1: " - << static_cast(this->module1) << std::endl; + sif::info << "DebugCameraSet::printSet: level 1: " << this->timing << std::endl; + sif::info << "DebugCameraSet::printSet: module 1: " << this->test << std::endl; } }; } // namespace StarTracker diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index 044dd0d7..a24284bf 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -36,6 +36,18 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, downloadBlobPixel(this), cameraSet(this), limitsSet(this), + loglevelSet(this), + mountingSet(this), + imageProcessorSet(this), + centroidingSet(this), + lisaSet(this), + matchingSet(this), + trackingSet(this), + validationSet(this), + algoSet(this), + subscriptionSet(this), + logSubscriptionSet(this), + debugCameraSet(this), strHelper(strHelper) { if (comCookie == nullptr) { sif::error << "StarTrackerHandler: Invalid com cookie" << std::endl; @@ -639,33 +651,33 @@ void StarTrackerHandler::fillCommandAndReplyMap() { StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::FPGA_ACTION, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_CAMERA, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_CAMERA, 3, &cameraSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_LIMITS, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_LIMITS, 3, &limitsSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_LOG_LEVEL, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_LOG_LEVEL, 3, &loglevelSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_MOUNTING, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_MOUNTING, 3, &mountingSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_IMAGE_PROCESSOR, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_IMAGE_PROCESSOR, 3, &imageProcessorSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_CENTROIDING, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_CENTROIDING, 3, ¢roidingSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_LISA, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_LISA, 3, &lisaSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_MATCHING, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_MATCHING, 3, &matchingSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_TRACKING, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_TRACKING, 3, &trackingSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_VALIDATION, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_VALIDATION, 3, &validationSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_ALGO, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_ALGO, 3, &algoSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_SUBSCRIPTION, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_SUBSCRIPTION, 3, &subscriptionSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_LOG_SUBSCRIPTION, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_LOG_SUBSCRIPTION, 3, &logSubscriptionSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_DEBUG_CAMERA, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_DEBUG_CAMERA, 3, &debugCameraSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); } @@ -1142,6 +1154,37 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(StarTracker::VALIDATION_MIN_TRACKER_CONFIDENCE, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::VALIDATION_MIN_MATCHED_STARS, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::ALGO_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::ALGO_I2T_MIN_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::ALGO_I2T_MIN_MATCHED, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::ALGO_I2L_MIN_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::ALGO_I2L_MIN_MATCHED, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM1, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM2, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM3, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM4, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM5, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM6, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM7, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM8, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM9, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM10, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM11, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM12, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM13, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM14, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM15, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM16, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::LOG_SUBSCRIPTION_LEVEL1, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOG_SUBSCRIPTION_MODULE1, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOG_SUBSCRIPTION_LEVEL2, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOG_SUBSCRIPTION_MODULE2, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::DEBUG_CAMERA_TIMING, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::DEBUG_CAMERA_TEST, new PoolEntry({0})); + return RETURN_OK; } diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index a6ead8e8..aa600ff6 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -261,6 +261,18 @@ class StarTrackerHandler : public DeviceHandlerBase { StarTracker::DownloadBlobPixel downloadBlobPixel; StarTracker::CameraSet cameraSet; StarTracker::LimitsSet limitsSet; + StarTracker::LogLevelSet loglevelSet; + StarTracker::MountingSet mountingSet; + StarTracker::ImageProcessorSet imageProcessorSet; + StarTracker::CentroidingSet centroidingSet; + StarTracker::LisaSet lisaSet; + StarTracker::MatchingSet matchingSet; + StarTracker::TrackingSet trackingSet; + StarTracker::ValidationSet validationSet; + StarTracker::AlgoSet algoSet; + StarTracker::SubscriptionSet subscriptionSet; + StarTracker::LogSubscriptionSet logSubscriptionSet; + StarTracker::DebugCameraSet debugCameraSet; // Pointer to object responsible for uploading and downloading images to/from the star tracker StrHelper* strHelper = nullptr; From c9e5fbc36130c808b0ae78715c66ef929c8c3842 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 10 Feb 2022 18:39:37 +0100 Subject: [PATCH 27/61] all parameter requests implemented --- bsp_egse/InitMission.cpp | 4 + .../StarTrackerDefinitions.h | 114 +++---- linux/devices/startracker/ArcsecJsonKeys.h | 49 ++- .../startracker/StarTrackerHandler.cpp | 245 ++++++++++++--- .../startracker/StarTrackerJsonCommands.cpp | 283 ++++++++++++++++++ .../startracker/StarTrackerJsonCommands.h | 64 ++++ 6 files changed, 664 insertions(+), 95 deletions(-) diff --git a/bsp_egse/InitMission.cpp b/bsp_egse/InitMission.cpp index 920c066d..222c8ec8 100644 --- a/bsp_egse/InitMission.cpp +++ b/bsp_egse/InitMission.cpp @@ -24,6 +24,10 @@ ServiceInterfaceStream sif::error("ERROR"); ObjectManagerIF* objectManager = nullptr; void initmission::initMission() { + sif::info << "Make sure the systemd service ser2net on the egse has been stopped " + << "(alias stop-ser2net)" << std::endl; + sif::info << "Make sure the power lines of the star tracker have been enabled " + << "(alias enable-startracker)" << std::endl; sif::info << "Building global objects.." << std::endl; /* Instantiate global object manager and also create all objects */ ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); diff --git a/linux/devices/devicedefinitions/StarTrackerDefinitions.h b/linux/devices/devicedefinitions/StarTrackerDefinitions.h index 4e80bf42..215ef472 100644 --- a/linux/devices/devicedefinitions/StarTrackerDefinitions.h +++ b/linux/devices/devicedefinitions/StarTrackerDefinitions.h @@ -355,7 +355,7 @@ static const DeviceCommandId_t REQ_POWER = 11; static const DeviceCommandId_t TAKE_IMAGE = 15; static const DeviceCommandId_t DOWNLOAD_CENTROID = 16; static const DeviceCommandId_t UPLOAD_CENTROID = 17; -static const DeviceCommandId_t SUBSCRIBE_TO_TM = 18; +static const DeviceCommandId_t SUBSCRIPTION = 18; static const DeviceCommandId_t IMAGE_PROCESSOR = 19; static const DeviceCommandId_t REQ_SOLUTION = 24; static const DeviceCommandId_t REQ_TEMPERATURE = 25; @@ -400,6 +400,9 @@ static const DeviceCommandId_t REQ_ALGO = 77; static const DeviceCommandId_t REQ_SUBSCRIPTION = 78; static const DeviceCommandId_t REQ_LOG_SUBSCRIPTION = 79; static const DeviceCommandId_t REQ_DEBUG_CAMERA = 80; +static const DeviceCommandId_t LOGLEVEL = 81; +static const DeviceCommandId_t LOGSUBSCRIPTION = 82; +static const DeviceCommandId_t DEBUG_CAMERA = 83; static const DeviceCommandId_t NONE = 0xFFFFFFFF; static const uint32_t VERSION_SET_ID = REQ_VERSION; @@ -428,6 +431,7 @@ static const uint32_t VALIDATION_SET_ID = REQ_VALIDATION; static const uint32_t ALGO_SET_ID = REQ_ALGO; static const uint32_t SUBSCRIPTION_SET_ID = REQ_SUBSCRIPTION; static const uint32_t LOG_SUBSCRIPTION_SET_ID = REQ_LOG_SUBSCRIPTION; +static const uint32_t DEBUG_CAMERA_SET_ID = REQ_DEBUG_CAMERA; /** Max size of unencoded frame */ static const size_t MAX_FRAME_SIZE = 1200; @@ -1369,14 +1373,14 @@ class LimitsSet : public StaticLocalDataSet { /** * @brief Will store the requested log level parameters */ -class LogLevelSet : public StaticLocalDataSet { +class LogLevelSet : public StaticLocalDataSet { public: // Size of dataset static const size_t SIZE = 16; - LogLevelSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, LOG_LEVEL_SET_ENTRIES) {} + LogLevelSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, LOG_LEVEL_SET_ID) {} - LogLevelSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, LOG_LEVEL_SET_ENTRIES)) {} + LogLevelSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, LOG_LEVEL_SET_ID)) {} lp_var_t loglevel1 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL1, this); lp_var_t loglevel2 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL2, this); @@ -1481,14 +1485,16 @@ class ImageProcessorSet : public StaticLocalDataSet lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_BACKGROUNDCOMPENSATION, this); void printSet() { - sif::info << "ImageProcessorSet::printSet: mode: " << this->mode << std::endl; - sif::info << "ImageProcessorSet::printSet: store: " << this->store << std::endl; + sif::info << "ImageProcessorSet::printSet: mode: " + << static_cast(this->mode.value) << std::endl; + sif::info << "ImageProcessorSet::printSet: store: " + << static_cast(this->store.value) << std::endl; sif::info << "ImageProcessorSet::printSet: signal threshold: " << this->signalThreshold << std::endl; sif::info << "ImageProcessorSet::printSet: dark threshold: " << this->darkThreshold << std::endl; sif::info << "ImageProcessorSet::printSet: background compensation: " - << this->backgroundCompensation << std::endl; + << static_cast(this->backgroundCompensation.value) << std::endl; } }; @@ -1532,7 +1538,8 @@ class CentroidingSet : public StaticLocalDataSet lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX11, this); void printSet() { - sif::info << "CentroidingSet::printSet: enable filter: " << this->enableFilter << std::endl; + sif::info << "CentroidingSet::printSet: enable filter: " + << static_cast(this->enableFilter.value) << std::endl; sif::info << "CentroidingSet::printSet: max quality: " << this->maxQuality << std::endl; sif::info << "CentroidingSet::printSet: dark threshold: " << this->darkThreshold << std::endl; sif::info << "CentroidingSet::printSet: min quality: " << this->minQuality << std::endl; @@ -1604,8 +1611,10 @@ class LisaSet : public StaticLocalDataSet { << std::endl; sif::info << "LisaSet::printSet: rating weight db star count: " << this->ratingWeightDbStarCount << std::endl; - sif::info << "LisaSet::printSet: max combinations: " << this->maxCombinations << std::endl; - sif::info << "LisaSet::printSet: nr stars stop: " << this->nrStarsStop << std::endl; + sif::info << "LisaSet::printSet: max combinations: " + << static_cast(this->maxCombinations.value) << std::endl; + sif::info << "LisaSet::printSet: nr stars stop: " + << static_cast(this->nrStarsStop.value) << std::endl; sif::info << "LisaSet::printSet: fraction close stop: " << this->fractionCloseStop << std::endl; } }; @@ -1639,7 +1648,7 @@ class MatchingSet : public StaticLocalDataSet { class TrackingSet : public StaticLocalDataSet { public: // Size of dataset - static const size_t SIZE = 16; + static const size_t SIZE = 13; TrackingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, TRACKING_SET_ID) {} @@ -1648,13 +1657,16 @@ class TrackingSet : public StaticLocalDataSet { lp_var_t thinLimit = lp_var_t(sid.objectId, PoolIds::TRACKING_THIN_LIMIT, this); lp_var_t outlierThreshold = lp_var_t(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD, this); lp_var_t outlierThresholdQuest = lp_var_t(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD_QUEST, this); - lp_var_t trackerChoice = lp_var_t(sid.objectId, PoolIds::TRACKING_TRACKER_CHOICE, this); + lp_var_t trackerChoice = lp_var_t(sid.objectId, PoolIds::TRACKING_TRACKER_CHOICE, this); void printSet() { - sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredDistanceLimit + sif::info << "TrackingSet::printSet: thin limit: " << this->thinLimit << std::endl; + sif::info << "TrackingSet::printSet: outlier threshold: " << this->outlierThreshold << std::endl; - sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredShiftLimit + sif::info << "TrackingSet::printSet: outlier threshold quest: " << this->outlierThresholdQuest << std::endl; + sif::info << "TrackingSet::printSet: tracker choice: " + << static_cast(this->trackerChoice.value) << std::endl; } }; @@ -1681,12 +1693,12 @@ class ValidationSet : public StaticLocalDataSet { void printSet() { sif::info << "ValidationSet::printSet: stable count: " - << static_cast(this->stableCount) << std::endl; + << static_cast(this->stableCount.value) << std::endl; sif::info << "ValidationSet::printSet: max difference: " << this->maxDifference << std::endl; sif::info << "ValidationSet::printSet: min tracker confidence: " << this->minTrackerConfidence << std::endl; - sif::info << "ValidationSet::printSet: min matched stars: " << this->minMatchedStars - << std::endl; + sif::info << "ValidationSet::printSet: min matched stars: " + << static_cast(this->minMatchedStars.value) << std::endl; } }; @@ -1714,13 +1726,13 @@ class AlgoSet : public StaticLocalDataSet { lp_var_t(sid.objectId, PoolIds::ALGO_I2L_MIN_MATCHED, this); void printSet() { - sif::info << "AlgoSet::printSet: mode: " << static_cast(this->mode) << std::endl; + sif::info << "AlgoSet::printSet: mode: " << static_cast(this->mode.value) << std::endl; sif::info << "AlgoSet::printSet: i2t min confidence: " << this->i2tMinConfidence << std::endl; sif::info << "AlgoSet::printSet: i2t min matched: " - << static_cast(this->i2tMinMatched) << std::endl; + << static_cast(this->i2tMinMatched.value) << std::endl; sif::info << "AlgoSet::printSet: i2l min confidence: " << this->i2lMinConfidence << std::endl; sif::info << "AlgoSet::printSet: i2l min matched: " - << static_cast(this->i2lMinMatched) << std::endl; + << static_cast(this->i2lMinMatched.value) << std::endl; } }; @@ -1755,38 +1767,38 @@ class SubscriptionSet : public StaticLocalDataSet { lp_var_t tm16 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM16, this); void printSet() { - sif::info << "SubscriptionSet::printSet: telemetry 1: " << static_cast(this->tm1) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 2: " << static_cast(this->tm2) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 3: " << static_cast(this->tm3) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 4: " << static_cast(this->tm4) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 5: " << static_cast(this->tm5) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 6: " << static_cast(this->tm6) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 7: " << static_cast(this->tm7) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 8: " << static_cast(this->tm8) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 9: " << static_cast(this->tm9) - << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 1: " + << static_cast(this->tm1.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 2: " + << static_cast(this->tm2.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 3: " + << static_cast(this->tm3.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 4: " + << static_cast(this->tm4.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 5: " + << static_cast(this->tm5.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 6: " + << static_cast(this->tm6.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 7: " + << static_cast(this->tm7.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 8: " + << static_cast(this->tm8.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 9: " + << static_cast(this->tm9.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 10: " - << static_cast(this->tm10) << std::endl; + << static_cast(this->tm10.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 11: " - << static_cast(this->tm11) << std::endl; + << static_cast(this->tm11.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 12: " - << static_cast(this->tm12) << std::endl; + << static_cast(this->tm12.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 13: " - << static_cast(this->tm13) << std::endl; + << static_cast(this->tm13.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 14: " - << static_cast(this->tm14) << std::endl; + << static_cast(this->tm14.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 15: " - << static_cast(this->tm15) << std::endl; + << static_cast(this->tm15.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 16: " - << static_cast(this->tm16) << std::endl; + << static_cast(this->tm16.value) << std::endl; } }; @@ -1815,13 +1827,13 @@ class LogSubscriptionSet : public StaticLocalDataSet(this->level1) << std::endl; + << static_cast(this->level1.value) << std::endl; sif::info << "LogSubscriptionSet::printSet: module 1: " - << static_cast(this->module1) << std::endl; + << static_cast(this->module1.value) << std::endl; sif::info << "LogSubscriptionSet::printSet: level 2: " - << static_cast(this->level2) << std::endl; + << static_cast(this->level2.value) << std::endl; sif::info << "LogSubscriptionSet::printSet: module 2: " - << static_cast(this->module2) << std::endl; + << static_cast(this->module2.value) << std::endl; } }; @@ -1845,8 +1857,8 @@ class DebugCameraSet : public StaticLocalDataSet { : StaticLocalDataSet(sid_t(objectId, DEBUG_CAMERA_SET_ID)) {} void printSet() { - sif::info << "DebugCameraSet::printSet: level 1: " << this->timing << std::endl; - sif::info << "DebugCameraSet::printSet: module 1: " << this->test << std::endl; + sif::info << "DebugCameraSet::printSet: timing: " << this->timing << std::endl; + sif::info << "DebugCameraSet::printSet: test: " << this->test << std::endl; } }; } // namespace StarTracker diff --git a/linux/devices/startracker/ArcsecJsonKeys.h b/linux/devices/startracker/ArcsecJsonKeys.h index 28d4ad3f..34989b1f 100644 --- a/linux/devices/startracker/ArcsecJsonKeys.h +++ b/linux/devices/startracker/ArcsecJsonKeys.h @@ -126,9 +126,56 @@ static const char TRACKER_CHOICE[] = "trackerChoice"; static const char ALGO[] = "algo"; static const char L2T_MIN_CONFIDENCE[] = "l2t_minConfidence"; -static const char L2T_MIN_MATCHED[] = "l2t_minConfidence"; +static const char L2T_MIN_MATCHED[] = "l2t_minMatched"; static const char T2L_MIN_CONFIDENCE[] = "t2l_minConfidence"; static const char T2L_MIN_MATCHED[] = "t2l_minMatched"; + +static const char LOGLEVEL[] = "loglevel"; +static const char LOGLEVEL1[] = "loglevel1"; +static const char LOGLEVEL2[] = "loglevel2"; +static const char LOGLEVEL3[] = "loglevel3"; +static const char LOGLEVEL4[] = "loglevel4"; +static const char LOGLEVEL5[] = "loglevel5"; +static const char LOGLEVEL6[] = "loglevel6"; +static const char LOGLEVEL7[] = "loglevel7"; +static const char LOGLEVEL8[] = "loglevel8"; +static const char LOGLEVEL9[] = "loglevel9"; +static const char LOGLEVEL10[] = "loglevel10"; +static const char LOGLEVEL11[] = "loglevel11"; +static const char LOGLEVEL12[] = "loglevel12"; +static const char LOGLEVEL13[] = "loglevel13"; +static const char LOGLEVEL14[] = "loglevel14"; +static const char LOGLEVEL15[] = "loglevel15"; +static const char LOGLEVEL16[] = "loglevel16"; + +static const char SUBSCRIPTION[] = "subscription"; +static const char TELEMETRY_1[] = "telemetry1"; +static const char TELEMETRY_2[] = "telemetry2"; +static const char TELEMETRY_3[] = "telemetry3"; +static const char TELEMETRY_4[] = "telemetry4"; +static const char TELEMETRY_5[] = "telemetry5"; +static const char TELEMETRY_6[] = "telemetry6"; +static const char TELEMETRY_7[] = "telemetry7"; +static const char TELEMETRY_8[] = "telemetry8"; +static const char TELEMETRY_9[] = "telemetry9"; +static const char TELEMETRY_10[] = "telemetry10"; +static const char TELEMETRY_11[] = "telemetry11"; +static const char TELEMETRY_12[] = "telemetry12"; +static const char TELEMETRY_13[] = "telemetry13"; +static const char TELEMETRY_14[] = "telemetry14"; +static const char TELEMETRY_15[] = "telemetry15"; +static const char TELEMETRY_16[] = "telemetry16"; + +static const char LOG_SUBSCRIPTION[] = "logsubscription"; +static const char LEVEL1[] = "level1"; +static const char MODULE1[] = "module1"; +static const char LEVEL2[] = "level2"; +static const char MODULE2[] = "module2"; + +static const char DEBUG_CAMERA[] = "debugcamera"; +static const char TIMING[] = "timing"; +static const char TEST[] = "test"; + } // namespace arcseckeys #endif /* BSP_Q7S_DEVICES_DEVICEDEFINITIONS_ARCSECJSONKEYS_H_ */ diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index a24284bf..9324458c 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -270,6 +270,7 @@ void StarTrackerHandler::doStartUp() { } return; case StartupState::DONE: + startupState = StartupState::IDLE; break; default: return; @@ -405,8 +406,9 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi prepareTakeImageCommand(commandData); return RETURN_OK; } - case (StarTracker::SUBSCRIBE_TO_TM): { - prepareSubscriptionCommand(commandData); + case (StarTracker::SUBSCRIPTION): { + Subscription subscription; + result = prepareParamCommand(commandData, commandDataLen, subscription); return RETURN_OK; } case (StarTracker::REQ_SOLUTION): { @@ -479,6 +481,21 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi result = prepareParamCommand(commandData, commandDataLen, tracking); return result; } + case (StarTracker::LOGLEVEL): { + LogLevel logLevel; + result = prepareParamCommand(commandData, commandDataLen, logLevel); + return result; + } + case (StarTracker::LOGSUBSCRIPTION): { + LogSubscription logSubscription; + result = prepareParamCommand(commandData, commandDataLen, logSubscription); + return result; + } + case (StarTracker::DEBUG_CAMERA): { + DebugCamera debugCamera; + result = prepareParamCommand(commandData, commandDataLen, debugCamera); + return result; + } case (StarTracker::ERASE): { result = prepareEraseCommand(commandData, commandDataLen); return result; @@ -536,7 +553,7 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi return result; } case (StarTracker::REQ_IMAGE_PROCESSOR): { - result = prepareRequestMountignParams(); + result = prepareRequestImageProcessorParams(); return result; } case (StarTracker::REQ_CENTROIDING): { @@ -548,7 +565,7 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi return result; } case (StarTracker::REQ_MATCHING): { - result = prepareRequetMatchingParams(); + result = prepareRequestMatchingParams(); return result; } case (StarTracker::REQ_TRACKING): { @@ -571,6 +588,10 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi result = prepareRequestLogSubscriptionParams(); return result; } + case (StarTracker::REQ_DEBUG_CAMERA): { + result = prepareRequestDebugCameraParams(); + return result; + } default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -595,7 +616,7 @@ void StarTrackerHandler::fillCommandAndReplyMap() { StarTracker::MAX_FRAME_SIZE * 2 + 2); // Reboot has no reply. Star tracker reboots immediately this->insertInCommandMap(StarTracker::SWITCH_TO_BOOTLOADER_PROGRAM); - this->insertInCommandAndReplyMap(StarTracker::SUBSCRIBE_TO_TM, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::SUBSCRIPTION, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::REQ_SOLUTION, 3, &solutionSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); @@ -605,6 +626,12 @@ void StarTrackerHandler::fillCommandAndReplyMap() { StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::REQ_CONTRAST, 3, &contrastSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::LOGLEVEL, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::LOGSUBSCRIPTION, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::DEBUG_CAMERA, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::LIMITS, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::MOUNTING, 3, nullptr, @@ -739,10 +766,6 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, ReturnValue_t result = RETURN_OK; switch (id) { - case (StarTracker::SUBSCRIBE_TO_TM): { - result = handleSetParamReply(); - break; - } case (StarTracker::REQ_TIME): { result = handleTm(timeSet, StarTracker::TimeSet::SIZE); break; @@ -823,6 +846,10 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, result = handleTm(contrastSet, StarTracker::ContrastSet::SIZE); break; } + case (StarTracker::SUBSCRIPTION): + case (StarTracker::LOGLEVEL): + case (StarTracker::LOGSUBSCRIPTION): + case (StarTracker::DEBUG_CAMERA): case (StarTracker::LIMITS): case (StarTracker::MOUNTING): case (StarTracker::CAMERA): @@ -844,13 +871,60 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, handleParamRequest(limitsSet, StarTracker::LimitsSet::SIZE); break; } + case (StarTracker::REQ_LOG_LEVEL): { + handleParamRequest(loglevelSet, StarTracker::LogLevelSet::SIZE); + break; + } + case (StarTracker::REQ_MOUNTING): { + handleParamRequest(mountingSet, StarTracker::MountingSet::SIZE); + break; + } + case (StarTracker::REQ_IMAGE_PROCESSOR): { + handleParamRequest(imageProcessorSet, StarTracker::ImageProcessorSet::SIZE); + break; + } + case (StarTracker::REQ_CENTROIDING): { + handleParamRequest(centroidingSet, StarTracker::CentroidingSet::SIZE); + break; + } + case (StarTracker::REQ_LISA): { + handleParamRequest(lisaSet, StarTracker::LisaSet::SIZE); + break; + } + case (StarTracker::REQ_MATCHING): { + handleParamRequest(matchingSet, StarTracker::MatchingSet::SIZE); + break; + } + case (StarTracker::REQ_TRACKING): { + handleParamRequest(trackingSet, StarTracker::TrackingSet::SIZE); + break; + } + case (StarTracker::REQ_VALIDATION): { + handleParamRequest(validationSet, StarTracker::ValidationSet::SIZE); + break; + } + case (StarTracker::REQ_ALGO): { + handleParamRequest(algoSet, StarTracker::AlgoSet::SIZE); + break; + } + case (StarTracker::REQ_SUBSCRIPTION): { + handleParamRequest(subscriptionSet, StarTracker::SubscriptionSet::SIZE); + break; + } + case (StarTracker::REQ_LOG_SUBSCRIPTION): { + handleParamRequest(logSubscriptionSet, StarTracker::LogSubscriptionSet::SIZE); + break; + } + case (StarTracker::REQ_DEBUG_CAMERA): { + handleParamRequest(debugCameraSet, StarTracker::DebugCameraSet::SIZE); + break; + } default: { sif::debug << "StarTrackerHandler::interpretDeviceReply: Unknown device reply id:" << id << std::endl; result = DeviceHandlerIF::UNKNOWN_DEVICE_REPLY; } } - return result; } @@ -1147,7 +1221,7 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(StarTracker::TRACKING_THIN_LIMIT, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::TRACKING_OUTLIER_THRESHOLD, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::TRACKING_OUTLIER_THRESHOLD_QUEST, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TRACKING_TRACKER_CHOICE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::TRACKING_TRACKER_CHOICE, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::VALIDATION_STABLE_COUNT, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::VALIDATION_MAX_DIFFERENCE, new PoolEntry({0})); @@ -1182,8 +1256,8 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(StarTracker::LOG_SUBSCRIPTION_LEVEL2, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::LOG_SUBSCRIPTION_MODULE2, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DEBUG_CAMERA_TIMING, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DEBUG_CAMERA_TEST, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::DEBUG_CAMERA_TIMING, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::DEBUG_CAMERA_TEST, new PoolEntry({0})); return RETURN_OK; } @@ -1280,7 +1354,7 @@ ReturnValue_t StarTrackerHandler::scanForActionReply(DeviceCommandId_t* foundId) break; } default: - sif::warning << "StarTrackerHandler::scanForParameterReply: Unknown parameter reply id" + sif::warning << "StarTrackerHandler::scanForActionReply: Unknown parameter reply id" << std::endl; return RETURN_FAILED; } @@ -1291,7 +1365,7 @@ ReturnValue_t StarTrackerHandler::scanForSetParameterReply(DeviceCommandId_t* fo const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { case (StarTracker::ID::SUBSCRIPTION): { - *foundId = StarTracker::SUBSCRIBE_TO_TM; + *foundId = StarTracker::SUBSCRIPTION; break; } case (StarTracker::ID::LIMITS): { @@ -1334,6 +1408,18 @@ ReturnValue_t StarTrackerHandler::scanForSetParameterReply(DeviceCommandId_t* fo *foundId = StarTracker::ALGO; break; } + case (StarTracker::ID::LOG_LEVEL): { + *foundId = StarTracker::LOGLEVEL; + break; + } + case (StarTracker::ID::DEBUG_CAMERA): { + *foundId = StarTracker::DEBUG_CAMERA; + break; + } + case (StarTracker::ID::LOG_SUBSCRIPTION): { + *foundId = StarTracker::LOGSUBSCRIPTION; + break; + } default: sif::debug << "StarTrackerHandler::scanForParameterReply: Unknown parameter reply id" << std::endl; @@ -1390,7 +1476,7 @@ ReturnValue_t StarTrackerHandler::scanForGetParameterReply(DeviceCommandId_t* fo break; } case (StarTracker::ID::SUBSCRIPTION): { - *foundId = StarTracker::SUBSCRIPTION; + *foundId = StarTracker::REQ_SUBSCRIPTION; break; } case (StarTracker::ID::LOG_SUBSCRIPTION): { @@ -1862,32 +1948,6 @@ void StarTrackerHandler::prepareTakeImageCommand(const uint8_t* commandData) { rawPacketLen = dataLinkLayer.getEncodedLength(); } -void StarTrackerHandler::prepareSubscriptionCommand(const uint8_t* tmId) { - uint32_t length = 18; - commandBuffer[0] = TMTC_SETPARAMREQ; - commandBuffer[1] = StarTracker::ID::SUBSCRIPTION; - // Fill all other fields with invalid tm id - commandBuffer[2] = *tmId; - commandBuffer[3] = 0; - commandBuffer[4] = 0; - commandBuffer[5] = 0; - commandBuffer[6] = 0; - commandBuffer[7] = 0; - commandBuffer[8] = 0; - commandBuffer[9] = 0; - commandBuffer[10] = 0; - commandBuffer[11] = 0; - commandBuffer[12] = 0; - commandBuffer[13] = 0; - commandBuffer[14] = 0; - commandBuffer[15] = 0; - commandBuffer[16] = 0; - commandBuffer[17] = 0; - dataLinkLayer.encodeFrame(commandBuffer, length); - rawPacket = dataLinkLayer.getEncodedFrame(); - rawPacketLen = dataLinkLayer.getEncodedLength(); -} - void StarTrackerHandler::prepareSolutionRequest() { uint32_t length = 0; arc_tm_pack_solution_req(commandBuffer, &length); @@ -2033,7 +2093,7 @@ ReturnValue_t StarTrackerHandler::prepareRequestLimitsParams() { return RETURN_OK; } -ReturnValue_t StarTrackerHandler::prepareRequestPropertyParams() { +ReturnValue_t StarTrackerHandler::prepareRequestLogLevelParams() { uint32_t length = 0; arc_pack_loglevel_parameter_req(commandBuffer, &length); dataLinkLayer.encodeFrame(commandBuffer, length); @@ -2042,6 +2102,105 @@ ReturnValue_t StarTrackerHandler::prepareRequestPropertyParams() { return RETURN_OK; } +ReturnValue_t StarTrackerHandler::prepareRequestMountingParams() { + uint32_t length = 0; + arc_pack_mounting_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestImageProcessorParams() { + uint32_t length = 0; + arc_pack_imageprocessor_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestCentroidingParams() { + uint32_t length = 0; + arc_pack_centroiding_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestLisaParams() { + uint32_t length = 0; + arc_pack_lisa_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestMatchingParams() { + uint32_t length = 0; + arc_pack_matching_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestTrackingParams() { + uint32_t length = 0; + arc_pack_tracking_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestValidationParams() { + uint32_t length = 0; + arc_pack_validation_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestAlgoParams() { + uint32_t length = 0; + arc_pack_algo_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestSubscriptionParams() { + uint32_t length = 0; + arc_pack_subscription_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestLogSubscriptionParams() { + uint32_t length = 0; + arc_pack_logsubscription_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestDebugCameraParams() { + uint32_t length = 0; + arc_pack_debugcamera_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + ReturnValue_t StarTrackerHandler::handleSetParamReply() { const uint8_t* reply = dataLinkLayer.getReply(); uint8_t status = *(reply + STATUS_OFFSET); diff --git a/linux/devices/startracker/StarTrackerJsonCommands.cpp b/linux/devices/startracker/StarTrackerJsonCommands.cpp index c9d09a96..d8ddb7ca 100644 --- a/linux/devices/startracker/StarTrackerJsonCommands.cpp +++ b/linux/devices/startracker/StarTrackerJsonCommands.cpp @@ -504,6 +504,12 @@ ReturnValue_t Lisa::createCommand(uint8_t* buffer) { } addfloat(param, buffer + offset); offset += sizeof(float); + result = getParam(arcseckeys::RATING_WEIGHT_MEAN_SUM, param); + if (result != RETURN_OK) { + return result; + } + addfloat(param, buffer + offset); + offset += sizeof(float); result = getParam(arcseckeys::RATING_WEIGHT_DB_STAR_COUNT, param); if (result != RETURN_OK) { return result; @@ -632,3 +638,280 @@ ReturnValue_t Algo::createCommand(uint8_t* buffer) { adduint8(param, buffer + offset); return RETURN_OK; } + +LogLevel::LogLevel() : ArcsecJsonParamBase(arcseckeys::LOGLEVEL) {} + +size_t LogLevel::getSize() { return COMMAND_SIZE; } + +ReturnValue_t LogLevel::createCommand(uint8_t* buffer) { + ReturnValue_t result = RETURN_OK; + uint8_t offset = 0; + std::string param; + addSetParamHeader(buffer, StarTracker::ID::LOG_LEVEL); + offset = 2; + result = getParam(arcseckeys::LOGLEVEL1, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL2, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL3, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL4, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL5, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL6, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL7, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL8, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL9, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL10, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL11, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL12, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL13, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL14, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL15, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL16, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + + return RETURN_OK; +} + +Subscription::Subscription() : ArcsecJsonParamBase(arcseckeys::SUBSCRIPTION) {} + +size_t Subscription::getSize() { return COMMAND_SIZE; } + +ReturnValue_t Subscription::createCommand(uint8_t* buffer) { + ReturnValue_t result = RETURN_OK; + uint8_t offset = 0; + std::string param; + addSetParamHeader(buffer, StarTracker::ID::SUBSCRIPTION); + offset = 2; + result = getParam(arcseckeys::TELEMETRY_1, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_2, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_3, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_4, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_5, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_6, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_7, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_8, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_9, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_10, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_11, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_12, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_13, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_14, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_15, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_16, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + return RETURN_OK; +} + +LogSubscription::LogSubscription() : ArcsecJsonParamBase(arcseckeys::LOG_SUBSCRIPTION) {} + +size_t LogSubscription::getSize() { return COMMAND_SIZE; } + +ReturnValue_t LogSubscription::createCommand(uint8_t* buffer) { + ReturnValue_t result = RETURN_OK; + uint8_t offset = 0; + std::string param; + addSetParamHeader(buffer, StarTracker::ID::LOG_SUBSCRIPTION); + offset = 2; + result = getParam(arcseckeys::LEVEL1, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::MODULE1, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LEVEL2, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::MODULE2, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + return RETURN_OK; +} + +DebugCamera::DebugCamera() : ArcsecJsonParamBase(arcseckeys::DEBUG_CAMERA) {} + +size_t DebugCamera::getSize() { return COMMAND_SIZE; } + +ReturnValue_t DebugCamera::createCommand(uint8_t* buffer) { + ReturnValue_t result = RETURN_OK; + uint8_t offset = 0; + std::string param; + addSetParamHeader(buffer, StarTracker::ID::DEBUG_CAMERA); + offset = 2; + result = getParam(arcseckeys::TIMING, param); + if (result != RETURN_OK) { + return result; + } + adduint32(param, buffer + offset); + offset += sizeof(uint32_t); + result = getParam(arcseckeys::TEST, param); + if (result != RETURN_OK) { + return result; + } + adduint32(param, buffer + offset); + return RETURN_OK; +} diff --git a/linux/devices/startracker/StarTrackerJsonCommands.h b/linux/devices/startracker/StarTrackerJsonCommands.h index 2c816056..a827d829 100644 --- a/linux/devices/startracker/StarTrackerJsonCommands.h +++ b/linux/devices/startracker/StarTrackerJsonCommands.h @@ -173,4 +173,68 @@ class Algo : public ArcsecJsonParamBase { ReturnValue_t createCommand(uint8_t* buffer) override; }; +/** + * @brief Generates command to configure the log level parameters. + * + */ +class LogLevel : public ArcsecJsonParamBase { + public: + LogLevel(); + + size_t getSize(); + + private: + static const size_t COMMAND_SIZE = 18; + + ReturnValue_t createCommand(uint8_t* buffer) override; +}; + +/** + * @brief Generates command to set subscription parameters. + * + */ +class Subscription : public ArcsecJsonParamBase { + public: + Subscription(); + + size_t getSize(); + + private: + static const size_t COMMAND_SIZE = 18; + + ReturnValue_t createCommand(uint8_t* buffer) override; +}; + +/** + * @brief Generates command to set log subscription parameters. + * + */ +class LogSubscription : public ArcsecJsonParamBase { + public: + LogSubscription(); + + size_t getSize(); + + private: + static const size_t COMMAND_SIZE = 6; + + ReturnValue_t createCommand(uint8_t* buffer) override; +}; + +/** + * @brief Generates command to set debug camera parameters + * + */ +class DebugCamera : public ArcsecJsonParamBase { + public: + DebugCamera(); + + size_t getSize(); + + private: + static const size_t COMMAND_SIZE = 10; + + ReturnValue_t createCommand(uint8_t* buffer) override; +}; + #endif /* BSP_Q7S_DEVICES_DEVICEDEFINITIONS_STARTRACKERJSONCOMMANDS_H_ */ From 1e4001321006de0eb137dcc1a166c27d340840f3 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 11 Feb 2022 07:34:55 +0100 Subject: [PATCH 28/61] arcsec lib update --- thirdparty/arcsec_star_tracker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/arcsec_star_tracker b/thirdparty/arcsec_star_tracker index aa1ebfc1..7cb426a6 160000 --- a/thirdparty/arcsec_star_tracker +++ b/thirdparty/arcsec_star_tracker @@ -1 +1 @@ -Subproject commit aa1ebfc154558dad746a175d2efee52470fddefe +Subproject commit 7cb426a6a1f1b25ac02d7bfd0792c412451c70af From b1973f77f7f10fefe52fc4bf11bdbd048c4320bf Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 11 Feb 2022 08:24:35 +0100 Subject: [PATCH 29/61] integrated log level, log suscription and debug camera parameter setting in startup routine --- .../startracker/StarTrackerHandler.cpp | 29 ++++++++++++++++++- .../devices/startracker/StarTrackerHandler.h | 3 ++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index 9324458c..83776d2d 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -266,7 +266,7 @@ void StarTrackerHandler::doStartUp() { return; case StartupState::BOOT_DELAY: if (bootCountdown.hasTimedOut()) { - startupState = StartupState::LIMITS; + startupState = StartupState::LOGLEVEL; } return; case StartupState::DONE: @@ -313,6 +313,11 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t bootCountdown.setTimeout(BOOT_TIMEOUT); startupState = StartupState::BOOT_DELAY; return buildCommandFromCommand(*id, nullptr, 0); + case StartupState::LOGLEVEL: + startupState = StartupState::WAIT_FOR_EXECUTION; + *id = StarTracker::LOGLEVEL; + return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), + paramJsonFile.size()); case StartupState::LIMITS: startupState = StartupState::WAIT_FOR_EXECUTION; *id = StarTracker::LIMITS; @@ -363,6 +368,16 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t *id = StarTracker::ALGO; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); + case StartupState::LOG_SUBSCRIPTION: + startupState = StartupState::WAIT_FOR_EXECUTION; + *id = StarTracker::LOGSUBSCRIPTION; + return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), + paramJsonFile.size()); + case StartupState::DEBUG_CAMERA: + startupState = StartupState::WAIT_FOR_EXECUTION; + *id = StarTracker::DEBUG_CAMERA; + return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), + paramJsonFile.size()); default: break; } @@ -2422,6 +2437,10 @@ ReturnValue_t StarTrackerHandler::handleActionReplySet(LocalPoolDataSetBase& dat void StarTrackerHandler::handleStartup(const uint8_t* parameterId) { switch (*parameterId) { + case (StarTracker::ID::LOG_LEVEL): { + startupState = StartupState::LIMITS; + break; + } case (StarTracker::ID::LIMITS): { startupState = StartupState::TRACKING; break; @@ -2459,6 +2478,14 @@ void StarTrackerHandler::handleStartup(const uint8_t* parameterId) { break; } case (StarTracker::ID::ALGO): { + startupState = StartupState::LOG_SUBSCRIPTION; + break; + } + case (StarTracker::ID::LOG_SUBSCRIPTION): { + startupState = StartupState::DEBUG_CAMERA; + break; + } + case (StarTracker::ID::DEBUG_CAMERA): { startupState = StartupState::DONE; break; } diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 736ae7e0..8fb49b63 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -296,6 +296,7 @@ class StarTrackerHandler : public DeviceHandlerBase { CHECK_BOOT_STATE, BOOT, BOOT_DELAY, + LOGLEVEL, LIMITS, TRACKING, MOUNTING, @@ -307,6 +308,8 @@ class StarTrackerHandler : public DeviceHandlerBase { MATCHING, VALIDATION, ALGO, + LOG_SUBSCRIPTION, + DEBUG_CAMERA, WAIT_FOR_EXECUTION, DONE }; From e3f36ddcfb9bb7d6abd4152276e6f42836e17e53 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 11 Feb 2022 08:47:06 +0100 Subject: [PATCH 30/61] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index cf7d25c2..5d8b9aac 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit cf7d25c206e8ae8480367e1fc2b1151a0ded2683 +Subproject commit 5d8b9aac1fea707015bd991b865da7f3405859e8 From 7adff2c9a85030cc382c2e4e9ad38827b42f18eb Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Mon, 14 Feb 2022 11:28:15 +0100 Subject: [PATCH 31/61] firmware update wip --- bsp_egse/ObjectFactory.cpp | 2 +- fsfw | 2 +- generators/bsp_q7s_events.csv | 277 ++- generators/bsp_q7s_objects.csv | 1 + generators/events/translateEvents.cpp | 575 +++--- generators/objects/translateObjects.cpp | 7 +- .../StarTrackerDefinitions.h | 22 +- .../startracker/ArcsecDatalinkLayer.cpp | 2 +- .../devices/startracker/ArcsecDatalinkLayer.h | 6 +- .../startracker/StarTrackerHandler.cpp | 1638 ++++++++--------- .../devices/startracker/StarTrackerHandler.h | 108 +- .../startracker/StarTrackerJsonCommands.cpp | 28 +- linux/devices/startracker/StrHelper.cpp | 223 +-- linux/devices/startracker/StrHelper.h | 125 +- linux/fsfwconfig/events/translateEvents.cpp | 577 +++--- linux/fsfwconfig/events/translateEvents.h | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 459 ++--- tmtc | 2 +- 18 files changed, 1906 insertions(+), 2150 deletions(-) diff --git a/bsp_egse/ObjectFactory.cpp b/bsp_egse/ObjectFactory.cpp index 7ccec79c..09d305ec 100644 --- a/bsp_egse/ObjectFactory.cpp +++ b/bsp_egse/ObjectFactory.cpp @@ -41,7 +41,7 @@ void ObjectFactory::produce(void* args) { UartCookie* starTrackerCookie = new UartCookie(objects::STAR_TRACKER, egse::STAR_TRACKER_UART, UartModes::NON_CANONICAL, - uart::STAR_TRACKER_BAUD, StarTracker::MAX_FRAME_SIZE * 2 + 2); + uart::STAR_TRACKER_BAUD, startracker::MAX_FRAME_SIZE * 2 + 2); new UartComIF(objects::UART_COM_IF); starTrackerCookie->setNoFixedSizeReply(); StrHelper* strHelper = new StrHelper(objects::STR_HELPER); diff --git a/fsfw b/fsfw index 3c06d2db..c20bf31d 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 3c06d2dbbb0d79608e003a8a3c89ae90cc71f409 +Subproject commit c20bf31d5d9f7ed18d15f2a3211a14f28242eeb6 diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index b3d874ab..ad90e3d5 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -1,140 +1,137 @@ -2200;STORE_SEND_WRITE_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2201;STORE_WRITE_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2202;STORE_SEND_READ_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2203;STORE_READ_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2204;UNEXPECTED_MSG;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2205;STORING_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2206;TM_DUMP_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2207;STORE_INIT_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2208;STORE_INIT_EMPTY;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2209;STORE_CONTENT_CORRUPTED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2210;STORE_INITIALIZE;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2211;INIT_DONE;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2212;DUMP_FINISHED;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2213;DELETION_FINISHED;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2214;DELETION_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2215;AUTO_CATALOGS_SENDING_FAILED;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -2600;GET_DATA_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/storagemanager/StorageManagerIF.h -2601;STORE_DATA_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/storagemanager/StorageManagerIF.h -2800;DEVICE_BUILDING_COMMAND_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -2801;DEVICE_SENDING_COMMAND_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -2802;DEVICE_REQUESTING_REPLY_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -2803;DEVICE_READING_REPLY_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -2804;DEVICE_INTERPRETING_REPLY_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -2805;DEVICE_MISSED_REPLY;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -2806;DEVICE_UNKNOWN_REPLY;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -2807;DEVICE_UNREQUESTED_REPLY;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -2808;INVALID_DEVICE_COMMAND;LOW;Indicates a SW bug in child class.;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -2809;MONITORING_LIMIT_EXCEEDED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -2810;MONITORING_AMBIGUOUS;HIGH;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -2811;DEVICE_WANTS_HARD_REBOOT;HIGH;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -4201;FUSE_CURRENT_HIGH;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/power/Fuse.h -4202;FUSE_WENT_OFF;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/power/Fuse.h -4204;POWER_ABOVE_HIGH_LIMIT;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/power/Fuse.h -4205;POWER_BELOW_LOW_LIMIT;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/power/Fuse.h -4300;SWITCH_WENT_OFF;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/power/PowerSwitchIF.h -5000;HEATER_ON;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/Heater.h -5001;HEATER_OFF;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/Heater.h -5002;HEATER_TIMEOUT;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/Heater.h -5003;HEATER_STAYED_ON;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/Heater.h -5004;HEATER_STAYED_OFF;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/Heater.h -5200;TEMP_SENSOR_HIGH;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h -5201;TEMP_SENSOR_LOW;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h -5202;TEMP_SENSOR_GRADIENT;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h -5901;COMPONENT_TEMP_LOW;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h -5902;COMPONENT_TEMP_HIGH;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h -5903;COMPONENT_TEMP_OOL_LOW;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h -5904;COMPONENT_TEMP_OOL_HIGH;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h -5905;TEMP_NOT_IN_OP_RANGE;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h -7101;FDIR_CHANGED_STATE;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/fdir/FailureIsolationBase.h -7102;FDIR_STARTS_RECOVERY;MEDIUM;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/fdir/FailureIsolationBase.h -7103;FDIR_TURNS_OFF_DEVICE;MEDIUM;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/fdir/FailureIsolationBase.h -7201;MONITOR_CHANGED_STATE;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h -7202;VALUE_BELOW_LOW_LIMIT;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h -7203;VALUE_ABOVE_HIGH_LIMIT;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h -7204;VALUE_OUT_OF_RANGE;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h -7400;CHANGING_MODE;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h -7401;MODE_INFO;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h -7402;FALLBACK_FAILED;HIGH;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h -7403;MODE_TRANSITION_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h -7404;CANT_KEEP_MODE;HIGH;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h -7405;OBJECT_IN_INVALID_MODE;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h -7406;FORCING_MODE;MEDIUM;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h -7407;MODE_CMD_REJECTED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h -7506;HEALTH_INFO;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h -7507;CHILD_CHANGED_HEALTH;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h -7508;CHILD_PROBLEMS;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h -7509;OVERWRITING_HEALTH;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h -7510;TRYING_RECOVERY;MEDIUM;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h -7511;RECOVERY_STEP;MEDIUM;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h -7512;RECOVERY_DONE;MEDIUM;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h -7900;RF_AVAILABLE;INFO;A RF available signal was detected. P1: raw RFA state, P2: 0;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h -7901;RF_LOST;INFO;A previously found RF available signal was lost. P1: raw RFA state, P2: 0;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h -7902;BIT_LOCK;INFO;A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h -7903;BIT_LOCK_LOST;INFO;A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h -7905;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h -8900;CLOCK_SET;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/pus/Service9TimeManagement.h -8901;CLOCK_SET_FAILURE;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/pus/Service9TimeManagement.h -9700;TEST;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/pus/Service17Test.h -10600;CHANGE_OF_SETUP_PARAMETER;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h -10900;GPIO_PULL_HIGH_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/HeaterHandler.h -10901;GPIO_PULL_LOW_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/HeaterHandler.h -10902;SWITCH_ALREADY_ON;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/HeaterHandler.h -10903;SWITCH_ALREADY_OFF;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/HeaterHandler.h -10904;MAIN_SWITCH_TIMEOUT;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/HeaterHandler.h -11000;MAIN_SWITCH_ON_TIMEOUT;LOW;;/home/rmueller/EIVE/eive-obsw/linux/devices/SolarArrayDeploymentHandler.h -11001;MAIN_SWITCH_OFF_TIMEOUT;LOW;;/home/rmueller/EIVE/eive-obsw/linux/devices/SolarArrayDeploymentHandler.h -11002;DEPLOYMENT_FAILED;HIGH;;/home/rmueller/EIVE/eive-obsw/linux/devices/SolarArrayDeploymentHandler.h -11003;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;/home/rmueller/EIVE/eive-obsw/linux/devices/SolarArrayDeploymentHandler.h -11004;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;/home/rmueller/EIVE/eive-obsw/linux/devices/SolarArrayDeploymentHandler.h -11101;MEMORY_READ_RPT_CRC_FAILURE;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/PlocMPSoCHandler.h -11102;ACK_FAILURE;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/PlocMPSoCHandler.h -11103;EXE_FAILURE;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/PlocMPSoCHandler.h -11104;CRC_FAILURE_EVENT;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/PlocMPSoCHandler.h -11201;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h -11202;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h -11203;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h -11204;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h -11205;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system failure) P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h -11206;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h -11207;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h -11208;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h -11301;ERROR_STATE;HIGH;Reaction wheel signals an error state;/home/rmueller/EIVE/eive-obsw/mission/devices/RwHandler.h -11501;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocSupervisorHandler.h -11502;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocSupervisorHandler.h -11503;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocSupervisorHandler.h -11504;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocSupervisorHandler.h -11600;SANITIZATION_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/bsp_q7s/memory/SdCardManager.h -11700;UPDATE_FILE_NOT_EXISTS;LOW;;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocUpdater.h -11701;ACTION_COMMANDING_FAILED;LOW;Failed to send command to supervisor handler P1: Return value of CommandActionHelper::commandAction P2: Action ID of command to send;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocUpdater.h -11702;UPDATE_AVAILABLE_FAILED;LOW;Supervisor handler replied action message indicating a command execution failure of the update available command;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocUpdater.h -11703;UPDATE_TRANSFER_FAILED;LOW;Supervisor handler failed to transfer an update space packet. P1: Parameter holds the number of update packets already sent (inclusive the failed packet);/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocUpdater.h -11704;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocUpdater.h -11705;UPDATE_FINISHED;INFO;MPSoC update successful completed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocUpdater.h -11800;SEND_MRAM_DUMP_FAILED;LOW;Failed to send mram dump command to supervisor handler P1: Return value of commandAction function P2: Start address of MRAM to dump with this command;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocMemoryDumper.h -11801;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocMemoryDumper.h -11802;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocMemoryDumper.h -11901;INVALID_TC_FRAME;HIGH;;/home/rmueller/EIVE/eive-obsw/linux/obc/PdecHandler.h -11902;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;/home/rmueller/EIVE/eive-obsw/linux/obc/PdecHandler.h -11903;CARRIER_LOCK;INFO;Carrier lock detected;/home/rmueller/EIVE/eive-obsw/linux/obc/PdecHandler.h -11904;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);/home/rmueller/EIVE/eive-obsw/linux/obc/PdecHandler.h -12000;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12001;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12002;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12003;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12004;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12005;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12006;FLASH_WRITE_FAILED;LOW;Flash write procedure failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12007;FLASH_READ_FAILED;LOW;Flash read procedure failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12008;FPGA_DOWNLOAD_SUCCESSFUL;LOW;Download of FPGA image successful;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12009;FPGA_DOWNLOAD_FAILED;LOW;Download of FPGA image failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12010;FPGA_UPLOAD_SUCCESSFUL;LOW;Upload of FPGA image successful;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12011;FPGA_UPLOAD_FAILED;LOW;Upload of FPGA image failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12012;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12013;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12014;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12015;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12016;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12017;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12018;STR_HELPER_SENDING_PACKET_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h -12019;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h +2200;STORE_SEND_WRITE_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2201;STORE_WRITE_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2202;STORE_SEND_READ_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2203;STORE_READ_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2204;UNEXPECTED_MSG;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2205;STORING_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2206;TM_DUMP_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2207;STORE_INIT_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2208;STORE_INIT_EMPTY;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2209;STORE_CONTENT_CORRUPTED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2210;STORE_INITIALIZE;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2211;INIT_DONE;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2212;DUMP_FINISHED;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2213;DELETION_FINISHED;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2214;DELETION_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2215;AUTO_CATALOGS_SENDING_FAILED;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2600;GET_DATA_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/storagemanager/StorageManagerIF.h +2601;STORE_DATA_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/storagemanager/StorageManagerIF.h +2800;DEVICE_BUILDING_COMMAND_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2801;DEVICE_SENDING_COMMAND_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2802;DEVICE_REQUESTING_REPLY_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2803;DEVICE_READING_REPLY_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2804;DEVICE_INTERPRETING_REPLY_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2805;DEVICE_MISSED_REPLY;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2806;DEVICE_UNKNOWN_REPLY;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2807;DEVICE_UNREQUESTED_REPLY;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2808;INVALID_DEVICE_COMMAND;LOW;Indicates a SW bug in child class.;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2809;MONITORING_LIMIT_EXCEEDED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2810;MONITORING_AMBIGUOUS;HIGH;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2811;DEVICE_WANTS_HARD_REBOOT;HIGH;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +4201;FUSE_CURRENT_HIGH;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/power/Fuse.h +4202;FUSE_WENT_OFF;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/power/Fuse.h +4204;POWER_ABOVE_HIGH_LIMIT;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/power/Fuse.h +4205;POWER_BELOW_LOW_LIMIT;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/power/Fuse.h +4300;SWITCH_WENT_OFF;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/power/PowerSwitchIF.h +5000;HEATER_ON;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/Heater.h +5001;HEATER_OFF;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/Heater.h +5002;HEATER_TIMEOUT;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/Heater.h +5003;HEATER_STAYED_ON;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/Heater.h +5004;HEATER_STAYED_OFF;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/Heater.h +5200;TEMP_SENSOR_HIGH;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h +5201;TEMP_SENSOR_LOW;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h +5202;TEMP_SENSOR_GRADIENT;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h +5901;COMPONENT_TEMP_LOW;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h +5902;COMPONENT_TEMP_HIGH;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h +5903;COMPONENT_TEMP_OOL_LOW;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h +5904;COMPONENT_TEMP_OOL_HIGH;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h +5905;TEMP_NOT_IN_OP_RANGE;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h +7101;FDIR_CHANGED_STATE;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/fdir/FailureIsolationBase.h +7102;FDIR_STARTS_RECOVERY;MEDIUM;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/fdir/FailureIsolationBase.h +7103;FDIR_TURNS_OFF_DEVICE;MEDIUM;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/fdir/FailureIsolationBase.h +7201;MONITOR_CHANGED_STATE;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h +7202;VALUE_BELOW_LOW_LIMIT;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h +7203;VALUE_ABOVE_HIGH_LIMIT;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h +7204;VALUE_OUT_OF_RANGE;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h +7400;CHANGING_MODE;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h +7401;MODE_INFO;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h +7402;FALLBACK_FAILED;HIGH;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h +7403;MODE_TRANSITION_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h +7404;CANT_KEEP_MODE;HIGH;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h +7405;OBJECT_IN_INVALID_MODE;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h +7406;FORCING_MODE;MEDIUM;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h +7407;MODE_CMD_REJECTED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h +7506;HEALTH_INFO;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h +7507;CHILD_CHANGED_HEALTH;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h +7508;CHILD_PROBLEMS;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h +7509;OVERWRITING_HEALTH;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h +7510;TRYING_RECOVERY;MEDIUM;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h +7511;RECOVERY_STEP;MEDIUM;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h +7512;RECOVERY_DONE;MEDIUM;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h +7900;RF_AVAILABLE;INFO;A RF available signal was detected. P1: raw RFA state, P2: 0;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h +7901;RF_LOST;INFO;A previously found RF available signal was lost. P1: raw RFA state, P2: 0;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h +7902;BIT_LOCK;INFO;A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h +7903;BIT_LOCK_LOST;INFO;A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h +7905;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h +8900;CLOCK_SET;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/pus/Service9TimeManagement.h +8901;CLOCK_SET_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/pus/Service9TimeManagement.h +9700;TEST;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/pus/Service17Test.h +10600;CHANGE_OF_SETUP_PARAMETER;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h +10900;GPIO_PULL_HIGH_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/HeaterHandler.h +10901;GPIO_PULL_LOW_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/HeaterHandler.h +10902;SWITCH_ALREADY_ON;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/HeaterHandler.h +10903;SWITCH_ALREADY_OFF;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/HeaterHandler.h +10904;MAIN_SWITCH_TIMEOUT;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/HeaterHandler.h +11000;MAIN_SWITCH_ON_TIMEOUT;LOW;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/SolarArrayDeploymentHandler.h +11001;MAIN_SWITCH_OFF_TIMEOUT;LOW;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/SolarArrayDeploymentHandler.h +11002;DEPLOYMENT_FAILED;HIGH;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/SolarArrayDeploymentHandler.h +11003;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/SolarArrayDeploymentHandler.h +11004;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/SolarArrayDeploymentHandler.h +11101;MEMORY_READ_RPT_CRC_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/PlocMPSoCHandler.h +11102;ACK_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/PlocMPSoCHandler.h +11103;EXE_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/PlocMPSoCHandler.h +11104;CRC_FAILURE_EVENT;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/PlocMPSoCHandler.h +11201;SELF_TEST_I2C_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h +11202;SELF_TEST_SPI_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h +11203;SELF_TEST_ADC_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h +11204;SELF_TEST_PWM_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h +11205;SELF_TEST_TC_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h +11206;SELF_TEST_MTM_RANGE_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h +11207;SELF_TEST_COIL_CURRENT_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h +11208;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h +11301;ERROR_STATE;HIGH;Reaction wheel signals an error state;C:\Users\jakob\eive-software\eive_obsw/mission/devices/RwHandler.h +11501;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocSupervisorHandler.h +11502;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocSupervisorHandler.h +11503;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocSupervisorHandler.h +11504;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocSupervisorHandler.h +11600;SANITIZATION_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/memory/SdCardManager.h +11700;UPDATE_FILE_NOT_EXISTS;LOW;;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocUpdater.h +11701;ACTION_COMMANDING_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocUpdater.h +11702;UPDATE_AVAILABLE_FAILED;LOW;Supervisor handler replied action message indicating a command execution failure of the update available command;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocUpdater.h +11703;UPDATE_TRANSFER_FAILED;LOW;Supervisor handler failed to transfer an update space packet. P1: Parameter holds the number of update packets already sent (inclusive the failed packet);C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocUpdater.h +11704;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocUpdater.h +11705;UPDATE_FINISHED;INFO;MPSoC update successful completed;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocUpdater.h +11800;SEND_MRAM_DUMP_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocMemoryDumper.h +11801;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocMemoryDumper.h +11802;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocMemoryDumper.h +11901;INVALID_TC_FRAME;HIGH;;C:\Users\jakob\eive-software\eive_obsw/linux/obc/PdecHandler.h +11902;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;C:\Users\jakob\eive-software\eive_obsw/linux/obc/PdecHandler.h +11903;CARRIER_LOCK;INFO;Carrier lock detected;C:\Users\jakob\eive-software\eive_obsw/linux/obc/PdecHandler.h +11904;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);C:\Users\jakob\eive-software\eive_obsw/linux/obc/PdecHandler.h +12000;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12001;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12002;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12003;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12004;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12005;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12006;FLASH_READ_FAILED;LOW;Flash read procedure failed;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12007;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12008;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12009;STR_HELPER_READING_REPLY_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12010;STR_HELPER_COM_ERROR;LOW;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12011;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12012;STR_HELPER_DEC_ERROR;LOW;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12013;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12014;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12015;STR_HELPER_SENDING_PACKET_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h +12016;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index c686ec40..2700c222 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -101,6 +101,7 @@ 0x53ffffff;FSFW_OBJECTS_END 0x54000010;SPI_TEST 0x54000020;UART_TEST +0x54000030;I2C_TEST 0x5400AFFE;DUMMY_HANDLER 0x5400CAFE;DUMMY_INTERFACE 0x54123456;LIBGPIOD_TEST diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 9e6a5f61..117e264f 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 140 translations. + * @brief Auto-generated event translation file. Contains 137 translations. * @details - * Generated on: 2022-02-03 17:30:40 + * Generated on: 2022-02-13 15:31:27 */ #include "translateEvents.h" @@ -131,12 +131,9 @@ const char *IMAGE_UPLOAD_SUCCESSFUL_STRING = "IMAGE_UPLOAD_SUCCESSFUL"; const char *IMAGE_DOWNLOAD_SUCCESSFUL_STRING = "IMAGE_DOWNLOAD_SUCCESSFUL"; const char *FLASH_WRITE_SUCCESSFUL_STRING = "FLASH_WRITE_SUCCESSFUL"; const char *FLASH_READ_SUCCESSFUL_STRING = "FLASH_READ_SUCCESSFUL"; -const char *FLASH_WRITE_FAILED_STRING = "FLASH_WRITE_FAILED"; const char *FLASH_READ_FAILED_STRING = "FLASH_READ_FAILED"; -const char *FPGA_DOWNLOAD_SUCCESSFUL_STRING = "FPGA_DOWNLOAD_SUCCESSFUL"; -const char *FPGA_DOWNLOAD_FAILED_STRING = "FPGA_DOWNLOAD_FAILED"; -const char *FPGA_UPLOAD_SUCCESSFUL_STRING = "FPGA_UPLOAD_SUCCESSFUL"; -const char *FPGA_UPLOAD_FAILED_STRING = "FPGA_UPLOAD_FAILED"; +const char *FIRMWARE_UPDATE_SUCCESSFUL_STRING = "FIRMWARE_UPDATE_SUCCESSFUL"; +const char *FIRMWARE_UPDATE_FAILED_STRING = "FIRMWARE_UPDATE_FAILED"; const char *STR_HELPER_READING_REPLY_FAILED_STRING = "STR_HELPER_READING_REPLY_FAILED"; const char *STR_HELPER_COM_ERROR_STRING = "STR_HELPER_COM_ERROR"; const char *STR_HELPER_NO_REPLY_STRING = "STR_HELPER_NO_REPLY"; @@ -147,289 +144,283 @@ const char *STR_HELPER_SENDING_PACKET_FAILED_STRING = "STR_HELPER_SENDING_PACKET const char *STR_HELPER_REQUESTING_MSG_FAILED_STRING = "STR_HELPER_REQUESTING_MSG_FAILED"; const char * translateEvents(Event event) { - switch( (event & 0xffff) ) { - case(2200): - return STORE_SEND_WRITE_FAILED_STRING; - case(2201): - return STORE_WRITE_FAILED_STRING; - case(2202): - return STORE_SEND_READ_FAILED_STRING; - case(2203): - return STORE_READ_FAILED_STRING; - case(2204): - return UNEXPECTED_MSG_STRING; - case(2205): - return STORING_FAILED_STRING; - case(2206): - return TM_DUMP_FAILED_STRING; - case(2207): - return STORE_INIT_FAILED_STRING; - case(2208): - return STORE_INIT_EMPTY_STRING; - case(2209): - return STORE_CONTENT_CORRUPTED_STRING; - case(2210): - return STORE_INITIALIZE_STRING; - case(2211): - return INIT_DONE_STRING; - case(2212): - return DUMP_FINISHED_STRING; - case(2213): - return DELETION_FINISHED_STRING; - case(2214): - return DELETION_FAILED_STRING; - case(2215): - return AUTO_CATALOGS_SENDING_FAILED_STRING; - case(2600): - return GET_DATA_FAILED_STRING; - case(2601): - return STORE_DATA_FAILED_STRING; - case(2800): - return DEVICE_BUILDING_COMMAND_FAILED_STRING; - case(2801): - return DEVICE_SENDING_COMMAND_FAILED_STRING; - case(2802): - return DEVICE_REQUESTING_REPLY_FAILED_STRING; - case(2803): - return DEVICE_READING_REPLY_FAILED_STRING; - case(2804): - return DEVICE_INTERPRETING_REPLY_FAILED_STRING; - case(2805): - return DEVICE_MISSED_REPLY_STRING; - case(2806): - return DEVICE_UNKNOWN_REPLY_STRING; - case(2807): - return DEVICE_UNREQUESTED_REPLY_STRING; - case(2808): - return INVALID_DEVICE_COMMAND_STRING; - case(2809): - return MONITORING_LIMIT_EXCEEDED_STRING; - case(2810): - return MONITORING_AMBIGUOUS_STRING; - case(2811): - return DEVICE_WANTS_HARD_REBOOT_STRING; - case(4201): - return FUSE_CURRENT_HIGH_STRING; - case(4202): - return FUSE_WENT_OFF_STRING; - case(4204): - return POWER_ABOVE_HIGH_LIMIT_STRING; - case(4205): - return POWER_BELOW_LOW_LIMIT_STRING; - case(4300): - return SWITCH_WENT_OFF_STRING; - case(5000): - return HEATER_ON_STRING; - case(5001): - return HEATER_OFF_STRING; - case(5002): - return HEATER_TIMEOUT_STRING; - case(5003): - return HEATER_STAYED_ON_STRING; - case(5004): - return HEATER_STAYED_OFF_STRING; - case(5200): - return TEMP_SENSOR_HIGH_STRING; - case(5201): - return TEMP_SENSOR_LOW_STRING; - case(5202): - return TEMP_SENSOR_GRADIENT_STRING; - case(5901): - return COMPONENT_TEMP_LOW_STRING; - case(5902): - return COMPONENT_TEMP_HIGH_STRING; - case(5903): - return COMPONENT_TEMP_OOL_LOW_STRING; - case(5904): - return COMPONENT_TEMP_OOL_HIGH_STRING; - case(5905): - return TEMP_NOT_IN_OP_RANGE_STRING; - case(7101): - return FDIR_CHANGED_STATE_STRING; - case(7102): - return FDIR_STARTS_RECOVERY_STRING; - case(7103): - return FDIR_TURNS_OFF_DEVICE_STRING; - case(7201): - return MONITOR_CHANGED_STATE_STRING; - case(7202): - return VALUE_BELOW_LOW_LIMIT_STRING; - case(7203): - return VALUE_ABOVE_HIGH_LIMIT_STRING; - case(7204): - return VALUE_OUT_OF_RANGE_STRING; - case(7400): - return CHANGING_MODE_STRING; - case(7401): - return MODE_INFO_STRING; - case(7402): - return FALLBACK_FAILED_STRING; - case(7403): - return MODE_TRANSITION_FAILED_STRING; - case(7404): - return CANT_KEEP_MODE_STRING; - case(7405): - return OBJECT_IN_INVALID_MODE_STRING; - case(7406): - return FORCING_MODE_STRING; - case(7407): - return MODE_CMD_REJECTED_STRING; - case(7506): - return HEALTH_INFO_STRING; - case(7507): - return CHILD_CHANGED_HEALTH_STRING; - case(7508): - return CHILD_PROBLEMS_STRING; - case(7509): - return OVERWRITING_HEALTH_STRING; - case(7510): - return TRYING_RECOVERY_STRING; - case(7511): - return RECOVERY_STEP_STRING; - case(7512): - return RECOVERY_DONE_STRING; - case(7900): - return RF_AVAILABLE_STRING; - case(7901): - return RF_LOST_STRING; - case(7902): - return BIT_LOCK_STRING; - case(7903): - return BIT_LOCK_LOST_STRING; - case(7905): - return FRAME_PROCESSING_FAILED_STRING; - case(8900): - return CLOCK_SET_STRING; - case(8901): - return CLOCK_SET_FAILURE_STRING; - case(9700): - return TEST_STRING; - case(10600): - return CHANGE_OF_SETUP_PARAMETER_STRING; - case(10900): - return GPIO_PULL_HIGH_FAILED_STRING; - case(10901): - return GPIO_PULL_LOW_FAILED_STRING; - case(10902): - return SWITCH_ALREADY_ON_STRING; - case(10903): - return SWITCH_ALREADY_OFF_STRING; - case(10904): - return MAIN_SWITCH_TIMEOUT_STRING; - case(11000): - return MAIN_SWITCH_ON_TIMEOUT_STRING; - case(11001): - return MAIN_SWITCH_OFF_TIMEOUT_STRING; - case(11002): - return DEPLOYMENT_FAILED_STRING; - case(11003): - return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; - case(11004): - return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; - case(11101): - return MEMORY_READ_RPT_CRC_FAILURE_STRING; - case(11102): - return ACK_FAILURE_STRING; - case(11103): - return EXE_FAILURE_STRING; - case(11104): - return CRC_FAILURE_EVENT_STRING; - case(11201): - return SELF_TEST_I2C_FAILURE_STRING; - case(11202): - return SELF_TEST_SPI_FAILURE_STRING; - case(11203): - return SELF_TEST_ADC_FAILURE_STRING; - case(11204): - return SELF_TEST_PWM_FAILURE_STRING; - case(11205): - return SELF_TEST_TC_FAILURE_STRING; - case(11206): - return SELF_TEST_MTM_RANGE_FAILURE_STRING; - case(11207): - return SELF_TEST_COIL_CURRENT_FAILURE_STRING; - case(11208): - return INVALID_ERROR_BYTE_STRING; - case(11301): - return ERROR_STATE_STRING; - case(11501): - return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; - case(11502): - return SUPV_ACK_FAILURE_STRING; - case(11503): - return SUPV_EXE_FAILURE_STRING; - case(11504): - return SUPV_CRC_FAILURE_EVENT_STRING; - case(11600): - return SANITIZATION_FAILED_STRING; - case(11700): - return UPDATE_FILE_NOT_EXISTS_STRING; - case(11701): - return ACTION_COMMANDING_FAILED_STRING; - case(11702): - return UPDATE_AVAILABLE_FAILED_STRING; - case(11703): - return UPDATE_TRANSFER_FAILED_STRING; - case(11704): - return UPDATE_VERIFY_FAILED_STRING; - case(11705): - return UPDATE_FINISHED_STRING; - case(11800): - return SEND_MRAM_DUMP_FAILED_STRING; - case(11801): - return MRAM_DUMP_FAILED_STRING; - case(11802): - return MRAM_DUMP_FINISHED_STRING; - case(11901): - return INVALID_TC_FRAME_STRING; - case(11902): - return INVALID_FAR_STRING; - case(11903): - return CARRIER_LOCK_STRING; - case(11904): - return BIT_LOCK_PDEC_STRING; - case(12000): - return IMAGE_UPLOAD_FAILED_STRING; - case(12001): - return IMAGE_DOWNLOAD_FAILED_STRING; - case(12002): - return IMAGE_UPLOAD_SUCCESSFUL_STRING; - case(12003): - return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; - case(12004): - return FLASH_WRITE_SUCCESSFUL_STRING; - case(12005): - return FLASH_READ_SUCCESSFUL_STRING; - case(12006): - return FLASH_WRITE_FAILED_STRING; - case(12007): - return FLASH_READ_FAILED_STRING; - case(12008): - return FPGA_DOWNLOAD_SUCCESSFUL_STRING; - case(12009): - return FPGA_DOWNLOAD_FAILED_STRING; - case(12010): - return FPGA_UPLOAD_SUCCESSFUL_STRING; - case(12011): - return FPGA_UPLOAD_FAILED_STRING; - case(12012): - return STR_HELPER_READING_REPLY_FAILED_STRING; - case(12013): - return STR_HELPER_COM_ERROR_STRING; - case(12014): - return STR_HELPER_NO_REPLY_STRING; - case(12015): - return STR_HELPER_DEC_ERROR_STRING; - case(12016): - return POSITION_MISMATCH_STRING; - case(12017): - return STR_HELPER_FILE_NOT_EXISTS_STRING; - case(12018): - return STR_HELPER_SENDING_PACKET_FAILED_STRING; - case(12019): - return STR_HELPER_REQUESTING_MSG_FAILED_STRING; - default: - return "UNKNOWN_EVENT"; - } - return 0; + switch( (event & 0xffff) ) { + case(2200): + return STORE_SEND_WRITE_FAILED_STRING; + case(2201): + return STORE_WRITE_FAILED_STRING; + case(2202): + return STORE_SEND_READ_FAILED_STRING; + case(2203): + return STORE_READ_FAILED_STRING; + case(2204): + return UNEXPECTED_MSG_STRING; + case(2205): + return STORING_FAILED_STRING; + case(2206): + return TM_DUMP_FAILED_STRING; + case(2207): + return STORE_INIT_FAILED_STRING; + case(2208): + return STORE_INIT_EMPTY_STRING; + case(2209): + return STORE_CONTENT_CORRUPTED_STRING; + case(2210): + return STORE_INITIALIZE_STRING; + case(2211): + return INIT_DONE_STRING; + case(2212): + return DUMP_FINISHED_STRING; + case(2213): + return DELETION_FINISHED_STRING; + case(2214): + return DELETION_FAILED_STRING; + case(2215): + return AUTO_CATALOGS_SENDING_FAILED_STRING; + case(2600): + return GET_DATA_FAILED_STRING; + case(2601): + return STORE_DATA_FAILED_STRING; + case(2800): + return DEVICE_BUILDING_COMMAND_FAILED_STRING; + case(2801): + return DEVICE_SENDING_COMMAND_FAILED_STRING; + case(2802): + return DEVICE_REQUESTING_REPLY_FAILED_STRING; + case(2803): + return DEVICE_READING_REPLY_FAILED_STRING; + case(2804): + return DEVICE_INTERPRETING_REPLY_FAILED_STRING; + case(2805): + return DEVICE_MISSED_REPLY_STRING; + case(2806): + return DEVICE_UNKNOWN_REPLY_STRING; + case(2807): + return DEVICE_UNREQUESTED_REPLY_STRING; + case(2808): + return INVALID_DEVICE_COMMAND_STRING; + case(2809): + return MONITORING_LIMIT_EXCEEDED_STRING; + case(2810): + return MONITORING_AMBIGUOUS_STRING; + case(2811): + return DEVICE_WANTS_HARD_REBOOT_STRING; + case(4201): + return FUSE_CURRENT_HIGH_STRING; + case(4202): + return FUSE_WENT_OFF_STRING; + case(4204): + return POWER_ABOVE_HIGH_LIMIT_STRING; + case(4205): + return POWER_BELOW_LOW_LIMIT_STRING; + case(4300): + return SWITCH_WENT_OFF_STRING; + case(5000): + return HEATER_ON_STRING; + case(5001): + return HEATER_OFF_STRING; + case(5002): + return HEATER_TIMEOUT_STRING; + case(5003): + return HEATER_STAYED_ON_STRING; + case(5004): + return HEATER_STAYED_OFF_STRING; + case(5200): + return TEMP_SENSOR_HIGH_STRING; + case(5201): + return TEMP_SENSOR_LOW_STRING; + case(5202): + return TEMP_SENSOR_GRADIENT_STRING; + case(5901): + return COMPONENT_TEMP_LOW_STRING; + case(5902): + return COMPONENT_TEMP_HIGH_STRING; + case(5903): + return COMPONENT_TEMP_OOL_LOW_STRING; + case(5904): + return COMPONENT_TEMP_OOL_HIGH_STRING; + case(5905): + return TEMP_NOT_IN_OP_RANGE_STRING; + case(7101): + return FDIR_CHANGED_STATE_STRING; + case(7102): + return FDIR_STARTS_RECOVERY_STRING; + case(7103): + return FDIR_TURNS_OFF_DEVICE_STRING; + case(7201): + return MONITOR_CHANGED_STATE_STRING; + case(7202): + return VALUE_BELOW_LOW_LIMIT_STRING; + case(7203): + return VALUE_ABOVE_HIGH_LIMIT_STRING; + case(7204): + return VALUE_OUT_OF_RANGE_STRING; + case(7400): + return CHANGING_MODE_STRING; + case(7401): + return MODE_INFO_STRING; + case(7402): + return FALLBACK_FAILED_STRING; + case(7403): + return MODE_TRANSITION_FAILED_STRING; + case(7404): + return CANT_KEEP_MODE_STRING; + case(7405): + return OBJECT_IN_INVALID_MODE_STRING; + case(7406): + return FORCING_MODE_STRING; + case(7407): + return MODE_CMD_REJECTED_STRING; + case(7506): + return HEALTH_INFO_STRING; + case(7507): + return CHILD_CHANGED_HEALTH_STRING; + case(7508): + return CHILD_PROBLEMS_STRING; + case(7509): + return OVERWRITING_HEALTH_STRING; + case(7510): + return TRYING_RECOVERY_STRING; + case(7511): + return RECOVERY_STEP_STRING; + case(7512): + return RECOVERY_DONE_STRING; + case(7900): + return RF_AVAILABLE_STRING; + case(7901): + return RF_LOST_STRING; + case(7902): + return BIT_LOCK_STRING; + case(7903): + return BIT_LOCK_LOST_STRING; + case(7905): + return FRAME_PROCESSING_FAILED_STRING; + case(8900): + return CLOCK_SET_STRING; + case(8901): + return CLOCK_SET_FAILURE_STRING; + case(9700): + return TEST_STRING; + case(10600): + return CHANGE_OF_SETUP_PARAMETER_STRING; + case(10900): + return GPIO_PULL_HIGH_FAILED_STRING; + case(10901): + return GPIO_PULL_LOW_FAILED_STRING; + case(10902): + return SWITCH_ALREADY_ON_STRING; + case(10903): + return SWITCH_ALREADY_OFF_STRING; + case(10904): + return MAIN_SWITCH_TIMEOUT_STRING; + case(11000): + return MAIN_SWITCH_ON_TIMEOUT_STRING; + case(11001): + return MAIN_SWITCH_OFF_TIMEOUT_STRING; + case(11002): + return DEPLOYMENT_FAILED_STRING; + case(11003): + return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; + case(11004): + return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; + case(11101): + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case(11102): + return ACK_FAILURE_STRING; + case(11103): + return EXE_FAILURE_STRING; + case(11104): + return CRC_FAILURE_EVENT_STRING; + case(11201): + return SELF_TEST_I2C_FAILURE_STRING; + case(11202): + return SELF_TEST_SPI_FAILURE_STRING; + case(11203): + return SELF_TEST_ADC_FAILURE_STRING; + case(11204): + return SELF_TEST_PWM_FAILURE_STRING; + case(11205): + return SELF_TEST_TC_FAILURE_STRING; + case(11206): + return SELF_TEST_MTM_RANGE_FAILURE_STRING; + case(11207): + return SELF_TEST_COIL_CURRENT_FAILURE_STRING; + case(11208): + return INVALID_ERROR_BYTE_STRING; + case(11301): + return ERROR_STATE_STRING; + case(11501): + return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; + case(11502): + return SUPV_ACK_FAILURE_STRING; + case(11503): + return SUPV_EXE_FAILURE_STRING; + case(11504): + return SUPV_CRC_FAILURE_EVENT_STRING; + case(11600): + return SANITIZATION_FAILED_STRING; + case(11700): + return UPDATE_FILE_NOT_EXISTS_STRING; + case(11701): + return ACTION_COMMANDING_FAILED_STRING; + case(11702): + return UPDATE_AVAILABLE_FAILED_STRING; + case(11703): + return UPDATE_TRANSFER_FAILED_STRING; + case(11704): + return UPDATE_VERIFY_FAILED_STRING; + case(11705): + return UPDATE_FINISHED_STRING; + case(11800): + return SEND_MRAM_DUMP_FAILED_STRING; + case(11801): + return MRAM_DUMP_FAILED_STRING; + case(11802): + return MRAM_DUMP_FINISHED_STRING; + case(11901): + return INVALID_TC_FRAME_STRING; + case(11902): + return INVALID_FAR_STRING; + case(11903): + return CARRIER_LOCK_STRING; + case(11904): + return BIT_LOCK_PDEC_STRING; + case(12000): + return IMAGE_UPLOAD_FAILED_STRING; + case(12001): + return IMAGE_DOWNLOAD_FAILED_STRING; + case(12002): + return IMAGE_UPLOAD_SUCCESSFUL_STRING; + case(12003): + return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; + case(12004): + return FLASH_WRITE_SUCCESSFUL_STRING; + case(12005): + return FLASH_READ_SUCCESSFUL_STRING; + case(12006): + return FLASH_READ_FAILED_STRING; + case(12007): + return FIRMWARE_UPDATE_SUCCESSFUL_STRING; + case(12008): + return FIRMWARE_UPDATE_FAILED_STRING; + case(12009): + return STR_HELPER_READING_REPLY_FAILED_STRING; + case(12010): + return STR_HELPER_COM_ERROR_STRING; + case(12011): + return STR_HELPER_NO_REPLY_STRING; + case(12012): + return STR_HELPER_DEC_ERROR_STRING; + case(12013): + return POSITION_MISMATCH_STRING; + case(12014): + return STR_HELPER_FILE_NOT_EXISTS_STRING; + case(12015): + return STR_HELPER_SENDING_PACKET_FAILED_STRING; + case(12016): + return STR_HELPER_REQUESTING_MSG_FAILED_STRING; + default: + return "UNKNOWN_EVENT"; + } + return 0; } diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 44b74490..2400e1d8 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 110 translations. - * Generated on: 2022-02-03 12:01:36 + * Contains 111 translations. + * Generated on: 2022-02-13 15:31:32 */ #include "translateObjects.h" @@ -109,6 +109,7 @@ const char *TIME_STAMPER_STRING = "TIME_STAMPER"; const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; const char *SPI_TEST_STRING = "SPI_TEST"; const char *UART_TEST_STRING = "UART_TEST"; +const char *I2C_TEST_STRING = "I2C_TEST"; const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST"; @@ -325,6 +326,8 @@ const char* translateObject(object_id_t object) { return SPI_TEST_STRING; case 0x54000020: return UART_TEST_STRING; + case 0x54000030: + return I2C_TEST_STRING; case 0x5400AFFE: return DUMMY_HANDLER_STRING; case 0x5400CAFE: diff --git a/linux/devices/devicedefinitions/StarTrackerDefinitions.h b/linux/devices/devicedefinitions/StarTrackerDefinitions.h index ba077e5f..f501f096 100644 --- a/linux/devices/devicedefinitions/StarTrackerDefinitions.h +++ b/linux/devices/devicedefinitions/StarTrackerDefinitions.h @@ -1,5 +1,5 @@ -#ifndef LINUX_DEVICES_DEVICEDEFINITIONS_DEFINITIONS_H_ -#define LINUX_DEVICES_DEVICEDEFINITIONS_DEFINITIONS_H_ +#ifndef LINUX_DEVICES_DEVICEDEFINITIONS_STARTRACKER_DEFINITIONS_H_ +#define LINUX_DEVICES_DEVICEDEFINITIONS_STARTRACKER_DEFINITIONS_H_ #include #include @@ -372,7 +372,6 @@ static const DeviceCommandId_t VALIDATION = 48; static const DeviceCommandId_t ALGO = 49; static const DeviceCommandId_t CHECKSUM = 50; static const DeviceCommandId_t READ = 51; -static const DeviceCommandId_t WRITE = 52; static const DeviceCommandId_t DOWNLOAD_MATCHED_STAR = 53; static const DeviceCommandId_t STOP_IMAGE_LOADER = 55; static const DeviceCommandId_t RESET_ERROR = 56; @@ -382,10 +381,6 @@ static const DeviceCommandId_t SET_READ_FILENAME = 59; static const DeviceCommandId_t SET_TIME = 60; static const DeviceCommandId_t DOWNLOAD_DBIMAGE = 61; static const DeviceCommandId_t DOWNLOAD_BLOBPIXEL = 62; -static const DeviceCommandId_t DOWNLOAD_FPGA_IMAGE = 63; -static const DeviceCommandId_t CHANGE_FPGA_DOWNLOAD_FILE = 64; -static const DeviceCommandId_t UPLOAD_FPGA_IMAGE = 65; -static const DeviceCommandId_t FPGA_ACTION = 66; static const DeviceCommandId_t REQ_CAMERA = 67; static const DeviceCommandId_t REQ_LIMITS = 68; static const DeviceCommandId_t REQ_LOG_LEVEL = 69; @@ -403,6 +398,7 @@ static const DeviceCommandId_t REQ_DEBUG_CAMERA = 80; static const DeviceCommandId_t LOGLEVEL = 81; static const DeviceCommandId_t LOGSUBSCRIPTION = 82; static const DeviceCommandId_t DEBUG_CAMERA = 83; +static const DeviceCommandId_t FIRMWARE_UPDATE = 84; static const DeviceCommandId_t NONE = 0xFFFFFFFF; static const uint32_t VERSION_SET_ID = REQ_VERSION; @@ -502,7 +498,6 @@ static const uint8_t UPLOAD_CENTROID = 17; static const uint8_t DOWNLOAD_MATCHED_STAR = 18; static const uint8_t DOWNLOAD_DBIMAGE = 19; static const uint8_t DOWNLOAD_BLOBPIXEL = 24; -static const uint8_t FPGA_ACTION = 22; static const uint8_t LOG_LEVEL = 3; static const uint8_t LOG_SUBSCRIPTION = 19; static const uint8_t DEBUG_CAMERA = 20; @@ -530,7 +525,7 @@ namespace region_secrets { static const uint32_t REGION_13_SECRET = 0xe53cf10d; static const uint32_t REGION_14_SECRET = 0xe862b70b; static const uint32_t REGION_15_SECRET = 0x79b537ca; - uint32_t secret[16] { + static const uint32_t secret[16] { REGION_0_SECRET, REGION_1_SECRET, REGION_2_SECRET, @@ -556,9 +551,10 @@ enum class FlashSections: uint8_t { ARC_CONFIG_SECTION = 2 }; +// Flash region IDs of firmware partition enum class FirmwareRegions: uint32_t { - START = 1, - END = 8 + FIRST = 1, + LAST = 8 }; static const uint32_t FLASH_REGION_SIZE = 0x20000; @@ -1911,5 +1907,5 @@ class DebugCameraSet : public StaticLocalDataSet { sif::info << "DebugCameraSet::printSet: test: " << this->test << std::endl; } }; -} // namespace StarTracker -#endif /* LINUX_DEVICES_DEVICEDEFINITIONS_DEFINITIONS_H_ */ +} // namespace startracker +#endif /* LINUX_DEVICES_DEVICEDEFINITIONS_STARTRACKER_DEFINITIONS_H_ */ diff --git a/linux/devices/startracker/ArcsecDatalinkLayer.cpp b/linux/devices/startracker/ArcsecDatalinkLayer.cpp index 9d8d7bbf..24eab940 100644 --- a/linux/devices/startracker/ArcsecDatalinkLayer.cpp +++ b/linux/devices/startracker/ArcsecDatalinkLayer.cpp @@ -6,7 +6,7 @@ ArcsecDatalinkLayer::~ArcsecDatalinkLayer() {} void ArcsecDatalinkLayer::slipInit() { slipInfo.buffer = rxBuffer; - slipInfo.maxlength = StarTracker::MAX_FRAME_SIZE; + slipInfo.maxlength = startracker::MAX_FRAME_SIZE; slipInfo.length = 0; slipInfo.unescape_next = 0; slipInfo.prev_state = SLIP_COMPLETE; diff --git a/linux/devices/startracker/ArcsecDatalinkLayer.h b/linux/devices/startracker/ArcsecDatalinkLayer.h index d287a888..e3da9b6a 100644 --- a/linux/devices/startracker/ArcsecDatalinkLayer.h +++ b/linux/devices/startracker/ArcsecDatalinkLayer.h @@ -79,12 +79,12 @@ class ArcsecDatalinkLayer : public HasReturnvaluesIF { static const uint8_t STATUS_OFFSET = 2; // Used by arcsec slip decoding function process received data - uint8_t rxBuffer[StarTracker::MAX_FRAME_SIZE]; + uint8_t rxBuffer[startracker::MAX_FRAME_SIZE]; // Decoded frame will be copied to this buffer - uint8_t decodedFrame[StarTracker::MAX_FRAME_SIZE]; + uint8_t decodedFrame[startracker::MAX_FRAME_SIZE]; // Buffer where encoded frames will be stored. First byte of encoded frame represents type of // reply - uint8_t encBuffer[StarTracker::MAX_FRAME_SIZE * 2 + 2]; + uint8_t encBuffer[startracker::MAX_FRAME_SIZE * 2 + 2]; // Size of decoded frame uint32_t decFrameSize = 0; // Size of encoded frame diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index bddab7a1..5dde524b 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -81,7 +81,7 @@ ReturnValue_t StarTrackerHandler::initialize() { } result = manager->subscribeToEventRange(eventQueue->getId(), event::getEventId(StrHelper::IMAGE_UPLOAD_FAILED), - event::getEventId(StrHelper::FPGA_UPLOAD_FAILED)); + event::getEventId(StrHelper::FIRMWARE_UPDATE_FAILED)); if (result != RETURN_OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "StarTrackerHandler::initialize: Failed to subscribe to events from " @@ -104,11 +104,11 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu ReturnValue_t result = RETURN_OK; switch (actionId) { - case (startrackerSTOP_IMAGE_LOADER): { + case (startracker::STOP_IMAGE_LOADER): { strHelper->stopProcess(); return EXECUTION_FINISHED; } - case (startrackerSET_JSON_FILE_NAME): { + case (startracker::SET_JSON_FILE_NAME): { if (size > MAX_PATH_SIZE) { return FILE_PATH_TOO_LONG; } @@ -128,9 +128,14 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu return result; } + result = checkCommand(actionId); + if (result != RETURN_OK) { + return result; + } + // Intercept image loader commands which do not follow the common DHB communication flow switch (actionId) { - case (startrackerUPLOAD_IMAGE): { + case (startracker::UPLOAD_IMAGE): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -145,7 +150,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu strHelperExecuting = true; return EXECUTION_FINISHED; } - case (startrackerDOWNLOAD_IMAGE): { + case (startracker::DOWNLOAD_IMAGE): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -161,20 +166,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu strHelperExecuting = true; return EXECUTION_FINISHED; } - case (startrackerWRITE): { - result = DeviceHandlerBase::acceptExternalDeviceCommands(); - if (result != RETURN_OK) { - return result; - } - result = executeWriteCommand(data, size); - if (result != RETURN_OK) { - return result; - } - - strHelperExecuting = true; - return EXECUTION_FINISHED; - } - case (startrackerREAD): { + case (startracker::READ): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -186,43 +178,21 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu strHelperExecuting = true; return EXECUTION_FINISHED; } - case (startrackerCHANGE_DOWNLOAD_FILE): { + case (startracker::CHANGE_DOWNLOAD_FILE): { if (size > MAX_FILE_NAME) { return FILENAME_TOO_LONG; } strHelper->setDownloadImageName(std::string(reinterpret_cast(data), size)); return EXECUTION_FINISHED; } - case (startrackerCHANGE_FPGA_DOWNLOAD_FILE): { - if (size > MAX_FILE_NAME) { - return FILENAME_TOO_LONG; - } - strHelper->setDownloadFpgaImage(std::string(reinterpret_cast(data), size)); - return EXECUTION_FINISHED; - } - case (startrackerSET_READ_FILENAME): { + case (startracker::SET_READ_FILENAME): { if (size > MAX_FILE_NAME) { return FILENAME_TOO_LONG; } strHelper->setDownloadImageName(std::string(reinterpret_cast(data), size)); return EXECUTION_FINISHED; } - case (startrackerDOWNLOAD_FPGA_IMAGE): { - result = DeviceHandlerBase::acceptExternalDeviceCommands(); - if (result != RETURN_OK) { - return result; - } - if (size > MAX_PATH_SIZE) { - return FILE_PATH_TOO_LONG; - } - result = executeFpgaDownloadCommand(data, size); - if (result != RETURN_OK) { - return result; - } - strHelperExecuting = true; - return EXECUTION_FINISHED; - } - case (startrackerUPLOAD_FPGA_IMAGE): { + case (startracker::FIRMWARE_UPDATE): { result = DeviceHandlerBase::acceptExternalDeviceCommands(); if (result != RETURN_OK) { return result; @@ -230,7 +200,8 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu if (size > MAX_PATH_SIZE + MAX_FILE_NAME) { return FILE_PATH_TOO_LONG; } - result = strHelper->startFpgaUpload(std::string(reinterpret_cast(data), size)); + result = + strHelper->startFirmwareUpdate(std::string(reinterpret_cast(data), size)); if (result != RETURN_OK) { return result; } @@ -266,9 +237,15 @@ void StarTrackerHandler::doStartUp() { return; case StartupState::BOOT_DELAY: if (bootCountdown.hasTimedOut()) { - startupState = StartupState::LOGLEVEL; + startupState = StartupState::VERIFY_BOOT; } return; + case StartupState::FAILED_FIRMWARE_BOOT: + startupState = StartupState::IDLE; + // Though the star tracker failed to boot the firmware the device handler will go to + // mode on. In bootloader mode the star tracker is still on and can e.g. perform firmware + // updates. + break; case StartupState::DONE: startupState = StartupState::IDLE; break; @@ -279,17 +256,25 @@ void StarTrackerHandler::doStartUp() { } void StarTrackerHandler::doShutDown() { - // If star tracker is shutdown also stop all running processes in the image loader task + // If the star tracker is shutdown also stop all running processes in the image loader task strHelper->stopProcess(); + internalState = InternalState::IDLE; + startupState = StartupState::IDLE; setMode(_MODE_POWER_DOWN); } void StarTrackerHandler::doOffActivity() { startupState = StartupState::IDLE; } ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { + if (!bootCountdown.hasTimedOut()) { + return NOTHING_TO_SEND; + } switch (internalState) { + case InternalState::CHECK_PROGRAM: + *id = startracker::REQ_VERSION; + break; case InternalState::TEMPERATURE_REQUEST: - *id = startrackerREQ_TEMPERATURE; + *id = startracker::REQ_TEMPERATURE; break; default: sif::debug << "StarTrackerHandler::buildNormalDeviceCommand: Invalid internal step" @@ -300,82 +285,92 @@ ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id } ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { - if (mode != _MODE_START_UP) { + if (mode == _MODE_TO_NORMAL && currentProgram != startracker::Program::FIRMWARE) { + internalState = InternalState::CHECK_PROGRAM; + *id = startracker::BOOT; + bootCountdown.setTimeout(BOOT_TIMEOUT); + return buildCommandFromCommand(*id, nullptr, 0); + } else if (mode != _MODE_START_UP) { return NOTHING_TO_SEND; } switch (startupState) { case StartupState::CHECK_BOOT_STATE: - *id = startrackerREQ_VERSION; - startupState = StartupState::WAIT_FOR_EXECUTION; + *id = startracker::REQ_VERSION; + startupState = StartupState::STARTUP_CHECK; return buildCommandFromCommand(*id, nullptr, 0); case StartupState::BOOT: - *id = startrackerBOOT; + *id = startracker::BOOT; bootCountdown.setTimeout(BOOT_TIMEOUT); startupState = StartupState::BOOT_DELAY; return buildCommandFromCommand(*id, nullptr, 0); + case StartupState::VERIFY_BOOT: + // Again read program to check if firmware boot was successful + *id = startracker::REQ_VERSION; + startupState = StartupState::FIRMWARE_CHECK; + return buildCommandFromCommand(*id, nullptr, 0); case StartupState::LOGLEVEL: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startrackerLOGLEVEL; + *id = startracker::LOGLEVEL; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::LIMITS: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startrackerLIMITS; + *id = startracker::LIMITS; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::TRACKING: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startrackerTRACKING; + *id = startracker::TRACKING; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::MOUNTING: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startrackerMOUNTING; + *id = startracker::MOUNTING; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::IMAGE_PROCESSOR: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startrackerIMAGE_PROCESSOR; + *id = startracker::IMAGE_PROCESSOR; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::CAMERA: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startrackerCAMERA; + *id = startracker::CAMERA; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::CENTROIDING: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startrackerCENTROIDING; + *id = startracker::CENTROIDING; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::LISA: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startrackerLISA; + *id = startracker::LISA; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::MATCHING: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startrackerMATCHING; + *id = startracker::MATCHING; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::VALIDATION: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startrackerVALIDATION; + *id = startracker::VALIDATION; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::ALGO: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startrackerALGO; + *id = startracker::ALGO; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::LOG_SUBSCRIPTION: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startrackerLOGSUBSCRIPTION; + *id = startracker::LOGSUBSCRIPTION; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); case StartupState::DEBUG_CAMERA: startupState = StartupState::WAIT_FOR_EXECUTION; - *id = startrackerDEBUG_CAMERA; + *id = startracker::DEBUG_CAMERA; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); default: @@ -389,221 +384,218 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi size_t commandDataLen) { ReturnValue_t result = RETURN_OK; switch (deviceCommand) { - case (startrackerPING_REQUEST): { + case (startracker::PING_REQUEST): { preparePingRequest(); return RETURN_OK; } - case (startrackerREQ_TIME): { + case (startracker::REQ_TIME): { prepareTimeRequest(); return RETURN_OK; } - case (startrackerBOOT): { + case (startracker::BOOT): { prepareBootCommand(); return RETURN_OK; } - case (startrackerREQ_VERSION): { + case (startracker::REQ_VERSION): { prepareVersionRequest(); return RETURN_OK; } - case (startrackerREQ_INTERFACE): { + case (startracker::REQ_INTERFACE): { prepareInterfaceRequest(); return RETURN_OK; } - case (startrackerREQ_POWER): { + case (startracker::REQ_POWER): { preparePowerRequest(); return RETURN_OK; } - case (startrackerSWITCH_TO_BOOTLOADER_PROGRAM): { + case (startracker::SWITCH_TO_BOOTLOADER_PROGRAM): { + currentProgram = startracker::Program::BOOTLOADER; prepareRebootCommand(); return RETURN_OK; } - case (startrackerTAKE_IMAGE): { + case (startracker::TAKE_IMAGE): { prepareTakeImageCommand(commandData); return RETURN_OK; } - case (startrackerSUBSCRIPTION): { + case (startracker::SUBSCRIPTION): { Subscription subscription; result = prepareParamCommand(commandData, commandDataLen, subscription); return RETURN_OK; } - case (startrackerREQ_SOLUTION): { + case (startracker::REQ_SOLUTION): { prepareSolutionRequest(); return RETURN_OK; } - case (startrackerREQ_TEMPERATURE): { + case (startracker::REQ_TEMPERATURE): { prepareTemperatureRequest(); return RETURN_OK; } - case (startrackerREQ_HISTOGRAM): { + case (startracker::REQ_HISTOGRAM): { prepareHistogramRequest(); return RETURN_OK; } - case (startrackerREQ_CONTRAST): { + case (startracker::REQ_CONTRAST): { prepareContrastRequest(); return RETURN_OK; } - case (startrackerRESET_ERROR): { + case (startracker::RESET_ERROR): { prepareErrorResetRequest(); return RETURN_OK; } - case (startrackerLIMITS): { + case (startracker::LIMITS): { Limits limits; result = prepareParamCommand(commandData, commandDataLen, limits); return result; } - case (startrackerMOUNTING): { + case (startracker::MOUNTING): { Mounting mounting; result = prepareParamCommand(commandData, commandDataLen, mounting); return result; } - case (startrackerIMAGE_PROCESSOR): { + case (startracker::IMAGE_PROCESSOR): { ImageProcessor imageProcessor; result = prepareParamCommand(commandData, commandDataLen, imageProcessor); return result; } - case (startrackerCAMERA): { + case (startracker::CAMERA): { Camera camera; result = prepareParamCommand(commandData, commandDataLen, camera); return result; } - case (startrackerCENTROIDING): { + case (startracker::CENTROIDING): { Centroiding centroiding; result = prepareParamCommand(commandData, commandDataLen, centroiding); return result; } - case (startrackerLISA): { + case (startracker::LISA): { Lisa lisa; result = prepareParamCommand(commandData, commandDataLen, lisa); return result; } - case (startrackerMATCHING): { + case (startracker::MATCHING): { Matching matching; result = prepareParamCommand(commandData, commandDataLen, matching); return result; } - case (startrackerVALIDATION): { + case (startracker::VALIDATION): { Validation validation; result = prepareParamCommand(commandData, commandDataLen, validation); return result; } - case (startrackerALGO): { + case (startracker::ALGO): { Algo algo; result = prepareParamCommand(commandData, commandDataLen, algo); return result; } - case (startrackerTRACKING): { + case (startracker::TRACKING): { Tracking tracking; result = prepareParamCommand(commandData, commandDataLen, tracking); return result; } - case (startrackerLOGLEVEL): { + case (startracker::LOGLEVEL): { LogLevel logLevel; result = prepareParamCommand(commandData, commandDataLen, logLevel); return result; } - case (startrackerLOGSUBSCRIPTION): { + case (startracker::LOGSUBSCRIPTION): { LogSubscription logSubscription; result = prepareParamCommand(commandData, commandDataLen, logSubscription); return result; } - case (startrackerDEBUG_CAMERA): { + case (startracker::DEBUG_CAMERA): { DebugCamera debugCamera; result = prepareParamCommand(commandData, commandDataLen, debugCamera); return result; } - case (startrackerERASE): { + case (startracker::ERASE): { result = prepareEraseCommand(commandData, commandDataLen); return result; } - case (startrackerUNLOCK): { + case (startracker::UNLOCK): { result = prepareUnlockCommand(commandData, commandDataLen); return result; } - case (startrackerCHECKSUM): { + case (startracker::CHECKSUM): { result = prepareChecksumCommand(commandData, commandDataLen); return result; } - case (startrackerSET_TIME): { + case (startracker::SET_TIME): { result = prepareSetTimeCommand(commandData, commandDataLen); return result; } - case (startrackerDOWNLOAD_CENTROID): { + case (startracker::DOWNLOAD_CENTROID): { result = prepareDownloadCentroidCommand(commandData, commandDataLen); return result; } - case (startrackerUPLOAD_CENTROID): { + case (startracker::UPLOAD_CENTROID): { result = prepareUploadCentroidCommand(commandData, commandDataLen); return result; } - case (startrackerDOWNLOAD_MATCHED_STAR): { + case (startracker::DOWNLOAD_MATCHED_STAR): { result = prepareDownloadMatchedStarCommand(commandData, commandDataLen); return result; } - case (startrackerDOWNLOAD_DBIMAGE): { + case (startracker::DOWNLOAD_DBIMAGE): { result = prepareDownloadDbImageCommand(commandData, commandDataLen); return result; } - case (startrackerDOWNLOAD_BLOBPIXEL): { + case (startracker::DOWNLOAD_BLOBPIXEL): { result = prepareDownloadBlobPixelCommand(commandData, commandDataLen); return result; } - case (startrackerFPGA_ACTION): { - result = prepareFpgaActionCommand(commandData, commandDataLen); - return result; - } - case (startrackerREQ_CAMERA): { + case (startracker::REQ_CAMERA): { result = prepareRequestCameraParams(); return result; } - case (startrackerREQ_LIMITS): { + case (startracker::REQ_LIMITS): { result = prepareRequestLimitsParams(); return result; } - case (startrackerREQ_LOG_LEVEL): { + case (startracker::REQ_LOG_LEVEL): { result = prepareRequestLogLevelParams(); return result; } - case (startrackerREQ_MOUNTING): { + case (startracker::REQ_MOUNTING): { result = prepareRequestMountingParams(); return result; } - case (startrackerREQ_IMAGE_PROCESSOR): { + case (startracker::REQ_IMAGE_PROCESSOR): { result = prepareRequestImageProcessorParams(); return result; } - case (startrackerREQ_CENTROIDING): { + case (startracker::REQ_CENTROIDING): { result = prepareRequestCentroidingParams(); return result; } - case (startrackerREQ_LISA): { + case (startracker::REQ_LISA): { result = prepareRequestLisaParams(); return result; } - case (startrackerREQ_MATCHING): { + case (startracker::REQ_MATCHING): { result = prepareRequestMatchingParams(); return result; } - case (startrackerREQ_TRACKING): { + case (startracker::REQ_TRACKING): { result = prepareRequestTrackingParams(); return result; } - case (startrackerREQ_VALIDATION): { + case (startracker::REQ_VALIDATION): { result = prepareRequestValidationParams(); return result; } - case (startrackerREQ_ALGO): { + case (startracker::REQ_ALGO): { result = prepareRequestAlgoParams(); return result; } - case (startrackerREQ_SUBSCRIPTION): { + case (startracker::REQ_SUBSCRIPTION): { result = prepareRequestSubscriptionParams(); return result; } - case (startrackerREQ_LOG_SUBSCRIPTION): { + case (startracker::REQ_LOG_SUBSCRIPTION): { result = prepareRequestLogSubscriptionParams(); return result; } - case (startrackerREQ_DEBUG_CAMERA): { + case (startracker::REQ_DEBUG_CAMERA): { result = prepareRequestDebugCameraParams(); return result; } @@ -616,111 +608,109 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi void StarTrackerHandler::fillCommandAndReplyMap() { /** Reply lengths are unknown because of the slip encoding. Thus always maximum reply size * is specified */ - this->insertInCommandAndReplyMap(startrackerPING_REQUEST, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandMap(startrackerBOOT); - this->insertInCommandAndReplyMap(startrackerREQ_VERSION, 3, &versionSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_TIME, 3, &timeSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandMap(startrackerUPLOAD_IMAGE); - this->insertInCommandMap(startrackerDOWNLOAD_IMAGE); - this->insertInCommandAndReplyMap(startrackerREQ_POWER, 3, &powerSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_INTERFACE, 3, &interfaceSet, - startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::PING_REQUEST, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandMap(startracker::BOOT); + this->insertInCommandAndReplyMap(startracker::REQ_VERSION, 3, &versionSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_TIME, 3, &timeSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandMap(startracker::UPLOAD_IMAGE); + this->insertInCommandMap(startracker::DOWNLOAD_IMAGE); + this->insertInCommandAndReplyMap(startracker::REQ_POWER, 3, &powerSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_INTERFACE, 3, &interfaceSet, + startracker::MAX_FRAME_SIZE * 2 + 2); // Reboot has no reply. Star tracker reboots immediately - this->insertInCommandMap(startrackerSWITCH_TO_BOOTLOADER_PROGRAM); - this->insertInCommandAndReplyMap(startrackerSUBSCRIPTION, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_SOLUTION, 3, &solutionSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_TEMPERATURE, 3, &temperatureSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_HISTOGRAM, 3, &histogramSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_CONTRAST, 3, &contrastSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerLOGLEVEL, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerLOGSUBSCRIPTION, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerDEBUG_CAMERA, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerLIMITS, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerMOUNTING, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerIMAGE_PROCESSOR, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerCAMERA, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerCAMERA, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerCENTROIDING, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerLISA, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerMATCHING, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerTRACKING, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerVALIDATION, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerALGO, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerTAKE_IMAGE, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerRESET_ERROR, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerERASE, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerUNLOCK, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerCHECKSUM, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerSET_TIME, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerDOWNLOAD_CENTROID, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerUPLOAD_CENTROID, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerDOWNLOAD_MATCHED_STAR, 3, &downloadMatchedStar, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerDOWNLOAD_DBIMAGE, 3, &downloadDbImage, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerDOWNLOAD_BLOBPIXEL, 3, &downloadBlobPixel, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerFPGA_ACTION, 3, nullptr, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_CAMERA, 3, &cameraSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_LIMITS, 3, &limitsSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_LOG_LEVEL, 3, &loglevelSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_MOUNTING, 3, &mountingSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_IMAGE_PROCESSOR, 3, &imageProcessorSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_CENTROIDING, 3, ¢roidingSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_LISA, 3, &lisaSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_MATCHING, 3, &matchingSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_TRACKING, 3, &trackingSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_VALIDATION, 3, &validationSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_ALGO, 3, &algoSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_SUBSCRIPTION, 3, &subscriptionSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_LOG_SUBSCRIPTION, 3, &logSubscriptionSet, - startrackerMAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(startrackerREQ_DEBUG_CAMERA, 3, &debugCameraSet, - startrackerMAX_FRAME_SIZE * 2 + 2); + this->insertInCommandMap(startracker::SWITCH_TO_BOOTLOADER_PROGRAM); + this->insertInCommandAndReplyMap(startracker::SUBSCRIPTION, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_SOLUTION, 3, &solutionSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_TEMPERATURE, 3, &temperatureSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_HISTOGRAM, 3, &histogramSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_CONTRAST, 3, &contrastSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::LOGLEVEL, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::LOGSUBSCRIPTION, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::DEBUG_CAMERA, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::LIMITS, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::MOUNTING, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::IMAGE_PROCESSOR, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::CAMERA, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::CAMERA, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::CENTROIDING, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::LISA, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::MATCHING, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::TRACKING, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::VALIDATION, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::ALGO, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::TAKE_IMAGE, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::RESET_ERROR, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::ERASE, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::UNLOCK, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::CHECKSUM, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::SET_TIME, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::DOWNLOAD_CENTROID, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::UPLOAD_CENTROID, 3, nullptr, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::DOWNLOAD_MATCHED_STAR, 3, &downloadMatchedStar, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::DOWNLOAD_DBIMAGE, 3, &downloadDbImage, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::DOWNLOAD_BLOBPIXEL, 3, &downloadBlobPixel, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_CAMERA, 3, &cameraSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_LIMITS, 3, &limitsSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_LOG_LEVEL, 3, &loglevelSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_MOUNTING, 3, &mountingSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_IMAGE_PROCESSOR, 3, &imageProcessorSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_CENTROIDING, 3, ¢roidingSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_LISA, 3, &lisaSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_MATCHING, 3, &matchingSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_TRACKING, 3, &trackingSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_VALIDATION, 3, &validationSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_ALGO, 3, &algoSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_SUBSCRIPTION, 3, &subscriptionSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_LOG_SUBSCRIPTION, 3, &logSubscriptionSet, + startracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(startracker::REQ_DEBUG_CAMERA, 3, &debugCameraSet, + startracker::MAX_FRAME_SIZE * 2 + 2); } ReturnValue_t StarTrackerHandler::scanForReply(const uint8_t* start, size_t remainingSize, @@ -781,53 +771,49 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, ReturnValue_t result = RETURN_OK; switch (id) { - case (startrackerREQ_TIME): { - result = handleTm(timeSet, startrackerTimeSet::SIZE); + case (startracker::REQ_TIME): { + result = handleTm(timeSet, startracker::TimeSet::SIZE); break; } - case (startrackerPING_REQUEST): { + case (startracker::PING_REQUEST): { result = handlePingReply(); break; } - case (startrackerBOOT): - case (startrackerTAKE_IMAGE): - case (startrackerRESET_ERROR): - case (startrackerUNLOCK): - case (startrackerSET_TIME): - case (startrackerFPGA_ACTION): { - result = handleActionReply(); + case (startracker::BOOT): + case (startracker::TAKE_IMAGE): + case (startracker::RESET_ERROR): + case (startracker::UNLOCK): + case (startracker::SET_TIME): + case (startracker::DOWNLOAD_CENTROID): { + result = handleActionReplySet(downloadCentroidSet, startracker::DownloadCentroidSet::SIZE); break; } - case (startrackerDOWNLOAD_CENTROID): { - result = handleActionReplySet(downloadCentroidSet, startrackerDownloadCentroidSet::SIZE); + case (startracker::DOWNLOAD_MATCHED_STAR): { + result = handleActionReplySet(downloadMatchedStar, startracker::DownloadMatchedStar::SIZE); break; } - case (startrackerDOWNLOAD_MATCHED_STAR): { - result = handleActionReplySet(downloadMatchedStar, startrackerDownloadMatchedStar::SIZE); + case (startracker::DOWNLOAD_DBIMAGE): { + result = handleActionReplySet(downloadDbImage, startracker::DownloadDBImage::SIZE); break; } - case (startrackerDOWNLOAD_DBIMAGE): { - result = handleActionReplySet(downloadDbImage, startrackerDownloadDBImage::SIZE); + case (startracker::DOWNLOAD_BLOBPIXEL): { + result = handleActionReplySet(downloadBlobPixel, startracker::DownloadBlobPixel::SIZE); break; } - case (startrackerDOWNLOAD_BLOBPIXEL): { - result = handleActionReplySet(downloadBlobPixel, startrackerDownloadBlobPixel::SIZE); - break; - } - case (startrackerUPLOAD_CENTROID): { + case (startracker::UPLOAD_CENTROID): { result = handleUploadCentroidReply(); break; } - case (startrackerERASE): { + case (startracker::ERASE): { result = handleEraseReply(); break; } - case (startrackerCHECKSUM): { + case (startracker::CHECKSUM): { result = handleChecksumReply(); break; } - case (startrackerREQ_VERSION): { - result = handleTm(versionSet, startrackerVersionSet::SIZE); + case (startracker::REQ_VERSION): { + result = handleTm(versionSet, startracker::VersionSet::SIZE); if (result != RETURN_OK) { return result; } @@ -837,101 +823,101 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, } break; } - case (startrackerREQ_INTERFACE): { - result = handleTm(interfaceSet, startrackerInterfaceSet::SIZE); + case (startracker::REQ_INTERFACE): { + result = handleTm(interfaceSet, startracker::InterfaceSet::SIZE); break; } - case (startrackerREQ_POWER): { - result = handleTm(powerSet, startrackerPowerSet::SIZE); + case (startracker::REQ_POWER): { + result = handleTm(powerSet, startracker::PowerSet::SIZE); break; } - case (startrackerREQ_SOLUTION): { - result = handleTm(solutionSet, startrackerSolutionSet::SIZE); + case (startracker::REQ_SOLUTION): { + result = handleTm(solutionSet, startracker::SolutionSet::SIZE); break; } - case (startrackerREQ_TEMPERATURE): { - result = handleTm(temperatureSet, startrackerTemperatureSet::SIZE); + case (startracker::REQ_TEMPERATURE): { + result = handleTm(temperatureSet, startracker::TemperatureSet::SIZE); break; } - case (startrackerREQ_HISTOGRAM): { - result = handleTm(histogramSet, startrackerHistogramSet::SIZE); + case (startracker::REQ_HISTOGRAM): { + result = handleTm(histogramSet, startracker::HistogramSet::SIZE); break; } - case (startrackerREQ_CONTRAST): { - result = handleTm(contrastSet, startrackerContrastSet::SIZE); + case (startracker::REQ_CONTRAST): { + result = handleTm(contrastSet, startracker::ContrastSet::SIZE); break; } - case (startrackerSUBSCRIPTION): - case (startrackerLOGLEVEL): - case (startrackerLOGSUBSCRIPTION): - case (startrackerDEBUG_CAMERA): - case (startrackerLIMITS): - case (startrackerMOUNTING): - case (startrackerCAMERA): - case (startrackerCENTROIDING): - case (startrackerLISA): - case (startrackerMATCHING): - case (startrackerTRACKING): - case (startrackerVALIDATION): - case (startrackerIMAGE_PROCESSOR): - case (startrackerALGO): { + case (startracker::SUBSCRIPTION): + case (startracker::LOGLEVEL): + case (startracker::LOGSUBSCRIPTION): + case (startracker::DEBUG_CAMERA): + case (startracker::LIMITS): + case (startracker::MOUNTING): + case (startracker::CAMERA): + case (startracker::CENTROIDING): + case (startracker::LISA): + case (startracker::MATCHING): + case (startracker::TRACKING): + case (startracker::VALIDATION): + case (startracker::IMAGE_PROCESSOR): + case (startracker::ALGO): { result = handleSetParamReply(); break; } - case (startrackerREQ_CAMERA): { - handleParamRequest(cameraSet, startrackerCameraSet::SIZE); + case (startracker::REQ_CAMERA): { + handleParamRequest(cameraSet, startracker::CameraSet::SIZE); break; } - case (startrackerREQ_LIMITS): { - handleParamRequest(limitsSet, startrackerLimitsSet::SIZE); + case (startracker::REQ_LIMITS): { + handleParamRequest(limitsSet, startracker::LimitsSet::SIZE); break; } - case (startrackerREQ_LOG_LEVEL): { - handleParamRequest(loglevelSet, startrackerLogLevelSet::SIZE); + case (startracker::REQ_LOG_LEVEL): { + handleParamRequest(loglevelSet, startracker::LogLevelSet::SIZE); break; } - case (startrackerREQ_MOUNTING): { - handleParamRequest(mountingSet, startrackerMountingSet::SIZE); + case (startracker::REQ_MOUNTING): { + handleParamRequest(mountingSet, startracker::MountingSet::SIZE); break; } - case (startrackerREQ_IMAGE_PROCESSOR): { - handleParamRequest(imageProcessorSet, startrackerImageProcessorSet::SIZE); + case (startracker::REQ_IMAGE_PROCESSOR): { + handleParamRequest(imageProcessorSet, startracker::ImageProcessorSet::SIZE); break; } - case (startrackerREQ_CENTROIDING): { - handleParamRequest(centroidingSet, startrackerCentroidingSet::SIZE); + case (startracker::REQ_CENTROIDING): { + handleParamRequest(centroidingSet, startracker::CentroidingSet::SIZE); break; } - case (startrackerREQ_LISA): { - handleParamRequest(lisaSet, startrackerLisaSet::SIZE); + case (startracker::REQ_LISA): { + handleParamRequest(lisaSet, startracker::LisaSet::SIZE); break; } - case (startrackerREQ_MATCHING): { - handleParamRequest(matchingSet, startrackerMatchingSet::SIZE); + case (startracker::REQ_MATCHING): { + handleParamRequest(matchingSet, startracker::MatchingSet::SIZE); break; } - case (startrackerREQ_TRACKING): { - handleParamRequest(trackingSet, startrackerTrackingSet::SIZE); + case (startracker::REQ_TRACKING): { + handleParamRequest(trackingSet, startracker::TrackingSet::SIZE); break; } - case (startrackerREQ_VALIDATION): { - handleParamRequest(validationSet, startrackerValidationSet::SIZE); + case (startracker::REQ_VALIDATION): { + handleParamRequest(validationSet, startracker::ValidationSet::SIZE); break; } - case (startrackerREQ_ALGO): { - handleParamRequest(algoSet, startrackerAlgoSet::SIZE); + case (startracker::REQ_ALGO): { + handleParamRequest(algoSet, startracker::AlgoSet::SIZE); break; } - case (startrackerREQ_SUBSCRIPTION): { - handleParamRequest(subscriptionSet, startrackerSubscriptionSet::SIZE); + case (startracker::REQ_SUBSCRIPTION): { + handleParamRequest(subscriptionSet, startracker::SubscriptionSet::SIZE); break; } - case (startrackerREQ_LOG_SUBSCRIPTION): { - handleParamRequest(logSubscriptionSet, startrackerLogSubscriptionSet::SIZE); + case (startracker::REQ_LOG_SUBSCRIPTION): { + handleParamRequest(logSubscriptionSet, startracker::LogSubscriptionSet::SIZE); break; } - case (startrackerREQ_DEBUG_CAMERA): { - handleParamRequest(debugCameraSet, startrackerDebugCameraSet::SIZE); + case (startracker::REQ_DEBUG_CAMERA): { + handleParamRequest(debugCameraSet, startracker::DebugCameraSet::SIZE); break; } default: { @@ -949,335 +935,343 @@ uint32_t StarTrackerHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { - localDataPoolMap.emplace(startrackerTICKS_TIME_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTIME_TIME_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerRUN_TIME, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerUNIX_TIME, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_TIME_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_TIME_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::RUN_TIME, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::UNIX_TIME, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTICKS_VERSION_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTIME_VERSION_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerPROGRAM, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMAJOR, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMINOR, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_VERSION_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_VERSION_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::PROGRAM, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MAJOR, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MINOR, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTICKS_INTERFACE_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTIME_INTERFACE_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerFRAME_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCHECKSUM_ERROR_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSET_PARAM_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSET_PARAM_REPLY_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerPARAM_REQUEST_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerPARAM_REPLY_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerREQ_TM_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTM_REPLY_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerACTION_REQ_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerACTION_REPLY_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_INTERFACE_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_INTERFACE_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FRAME_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CHECKSUM_ERROR_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SET_PARAM_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SET_PARAM_REPLY_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::PARAM_REQUEST_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::PARAM_REPLY_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::REQ_TM_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TM_REPLY_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::ACTION_REQ_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::ACTION_REPLY_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTICKS_POWER_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTIME_POWER_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMCU_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMCU_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerFPGA_CORE_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerFPGA_CORE_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerFPGA_18_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerFPGA_18_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerFPGA_25_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerFPGA_25_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCMV_21_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCMV_21_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCMV_PIX_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCMV_PIX_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCMV_33_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCMV_33_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCMV_RES_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCMV_RES_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_POWER_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_POWER_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MCU_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MCU_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_CORE_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_CORE_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_18_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_18_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_25_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_25_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_21_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_21_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_PIX_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_PIX_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_33_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_33_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_RES_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMV_RES_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTICKS_TEMPERATURE_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTIME_TEMPERATURE_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMCU_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCMOS_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerFPGA_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_TEMPERATURE_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_TEMPERATURE_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MCU_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CMOS_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FPGA_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTICKS_SOLUTION_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTIME_SOLUTION_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCALI_QW, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCALI_QX, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCALI_QY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCALI_QZ, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTRACK_CONFIDENCE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTRACK_QW, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTRACK_QX, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTRACK_QY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTRACK_QZ, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTRACK_REMOVED, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSTARS_CENTROIDED, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSTARS_MATCHED_DATABASE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_QW, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_QX, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_QY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_QZ, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_PERC_CLOSE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_NR_CLOSE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTRUST_WORTHY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSTABLE_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSOLUTION_STRATEGY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_SOLUTION_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_SOLUTION_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CALI_QW, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CALI_QX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CALI_QY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CALI_QZ, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACK_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACK_QW, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACK_QX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACK_QY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACK_QZ, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACK_REMOVED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::STARS_CENTROIDED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::STARS_MATCHED_DATABASE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_QW, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_QX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_QY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_QZ, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_PERC_CLOSE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_NR_CLOSE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRUST_WORTHY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::STABLE_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SOLUTION_STRATEGY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTICKS_HISTOGRAM_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTIME_HISTOGRAM_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINA0, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINA1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINA2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINA3, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINA4, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINA5, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINA6, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINA7, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINA8, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINB0, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINB1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINB2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINB3, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINB4, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINB5, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINB6, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINB7, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINB8, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINC0, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINC1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINC2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINC3, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINC4, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINC5, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINC6, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINC7, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BINC8, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BIND0, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BIND1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BIND2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BIND3, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BIND4, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BIND5, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BIND6, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BIND7, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerHISTOGRAM_BIND8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_HISTOGRAM_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_HISTOGRAM_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINA8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINB8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BINC8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::HISTOGRAM_BIND8, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTICKS_CONTRAST_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTIME_CONTRAST_SET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINA0, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINA1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINA2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINA3, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINA4, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINA5, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINA6, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINA7, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINA8, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINB0, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINB1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINB2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINB3, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINB4, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINB5, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINB6, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINB7, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINB8, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINC8, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINC0, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINC1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINC2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINC3, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINC4, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINC5, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINC6, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINC7, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BINC8, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BIND0, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BIND1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BIND2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BIND3, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BIND4, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BIND5, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BIND6, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BIND7, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCONTRAST_BIND8, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCHKSUM, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TICKS_CONTRAST_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TIME_CONTRAST_SET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINA8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINB8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BINC8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND0, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CONTRAST_BIND8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CHKSUM, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerDWL_ID, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerDWL_PIXX, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerDWL_PIXY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerDWL_X_UNCORRECTED, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerDWL_Y_UNCORRECTED, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerDWL_X_CORRECTED, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerDWL_Y_CORRECTED, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerDWL_MAGNITUDE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerDWL_CXA, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerDWL_CYA, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerDWL_QUALITY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_ID, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_PIXX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_PIXY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_X_UNCORRECTED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_Y_UNCORRECTED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_X_CORRECTED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_Y_CORRECTED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_MAGNITUDE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_CXA, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_CYA, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DWL_QUALITY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_ID, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_CAMFPX, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_CAMFPY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_CAMCARTX, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_CAMCARTY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_CAMCARTZ, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_CAMMAGNITUDE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_DBFPX, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_DBFPY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_DBCARTX, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_DBCARTY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_DBCARTZ, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_DBMAGNITUDE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHEDSTR_CATALOGID, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_ID, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMFPX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMFPY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMCARTX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMCARTY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMCARTZ, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CAMMAGNITUDE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_DBFPX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_DBFPY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_DBCARTX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_DBCARTY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_DBCARTZ, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_DBMAGNITUDE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHEDSTR_CATALOGID, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerBLOBPIX_ID, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerBLOBPIX_X, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerBLOBPIX_Y, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerBLOBPIX_TOT_VAL, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerBLOBPIX_IN_USE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerBLOBPIX_BRIGHT_NEIGHBOURS, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerBLOBPIX_REGION, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_ID, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_X, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_Y, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_TOT_VAL, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_IN_USE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_BRIGHT_NEIGHBOURS, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::BLOBPIX_REGION, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAMERA_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerFOCALLENGTH, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerEXPOSURE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerINTERVAL, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAMERA_OFFSET, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerPGAGAIN, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerADCGAIN, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_REG1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_VAL1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_REG2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_VAL2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_REG3, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_VAL3, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_REG4, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_VAL4, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_REG5, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_VAL5, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_REG6, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_VAL6, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_REG7, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_VAL7, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_REG8, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_VAL8, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCAM_FREQ_1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAMERA_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::FOCALLENGTH, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::EXPOSURE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::INTERVAL, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAMERA_OFFSET, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::PGAGAIN, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::ADCGAIN, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_REG1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_VAL1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_REG2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_VAL2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_REG3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_VAL3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_REG4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_VAL4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_REG5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_VAL5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_REG6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_VAL6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_REG7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_VAL7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_REG8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_VAL8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CAM_FREQ_1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLIMITS_ACTION, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLIMITS_FPGA18CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLIMITS_FPGA25CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLIMITS_FPGA10CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLIMITS_MCUCURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLIMITS_CMOS21CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLIMITS_CMOSPIXCURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLIMITS_CMOS33CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLIMITS_CMOSVRESCURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLIMITS_CMOSTEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_ACTION, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_FPGA18CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_FPGA25CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_FPGA10CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_MCUCURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_CMOS21CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_CMOSPIXCURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_CMOS33CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_CMOSVRESCURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LIMITS_CMOSTEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL3, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL4, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL5, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL6, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL7, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL8, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL9, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL10, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL11, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL12, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL13, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL14, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL15, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOGLEVEL16, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL9, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL10, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL11, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL12, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL13, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL14, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL15, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOGLEVEL16, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMOUNTING_QW, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMOUNTING_QX, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMOUNTING_QY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMOUNTING_QZ, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MOUNTING_QW, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MOUNTING_QX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MOUNTING_QY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MOUNTING_QZ, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerIMAGE_PROCESSOR_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerIMAGE_PROCESSOR_STORE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerIMAGE_PROCESSOR_SIGNALTHRESHOLD, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerIMAGE_PROCESSOR_DARKTHRESHOLD, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerIMAGE_PROCESSOR_BACKGROUNDCOMPENSATION, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::IMAGE_PROCESSOR_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::IMAGE_PROCESSOR_STORE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::IMAGE_PROCESSOR_SIGNALTHRESHOLD, + new PoolEntry({0})); + localDataPoolMap.emplace(startracker::IMAGE_PROCESSOR_DARKTHRESHOLD, + new PoolEntry({0})); + localDataPoolMap.emplace(startracker::IMAGE_PROCESSOR_BACKGROUNDCOMPENSATION, + new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCENTROIDING_ENABLE_FILTER, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCENTROIDING_MAX_QUALITY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCENTROIDING_DARK_THRESHOLD, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCENTROIDING_MIN_QUALITY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCENTROIDING_MAX_INTENSITY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCENTROIDING_MIN_INTENSITY, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCENTROIDING_MAX_MAGNITUDE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCENTROIDING_GAUSSIAN_CMAX, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCENTROIDING_GAUSSIAN_CMIN, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCENTROIDING_TRANSMATRIX00, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCENTROIDING_TRANSMATRIX01, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCENTROIDING_TRANSMATRIX10, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerCENTROIDING_TRANSMATRIX11, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CENTROIDING_ENABLE_FILTER, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CENTROIDING_MAX_QUALITY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CENTROIDING_DARK_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CENTROIDING_MIN_QUALITY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CENTROIDING_MAX_INTENSITY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CENTROIDING_MIN_INTENSITY, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CENTROIDING_MAX_MAGNITUDE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CENTROIDING_GAUSSIAN_CMAX, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CENTROIDING_GAUSSIAN_CMIN, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CENTROIDING_TRANSMATRIX00, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CENTROIDING_TRANSMATRIX01, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CENTROIDING_TRANSMATRIX10, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::CENTROIDING_TRANSMATRIX11, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_PREFILTER_DIST_THRESHOLD, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_PREFILTER_ANGLE_THRESHOLD, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_FOV_WIDTH, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_FOV_HEIGHT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_FLOAT_STAR_LIMIT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_CLOSE_STAR_LIMIT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_RATING_WEIGHT_CLOSE_STAR_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_RATING_WEIGHT_FRACTION_CLOSE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_RATING_WEIGHT_MEAN_SUM, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_RATING_WEIGHT_DB_STAR_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_MAX_COMBINATIONS, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_NR_STARS_STOP, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLISA_FRACTION_CLOSE_STOP, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_PREFILTER_DIST_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_PREFILTER_ANGLE_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_FOV_WIDTH, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_FOV_HEIGHT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_FLOAT_STAR_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_CLOSE_STAR_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_RATING_WEIGHT_CLOSE_STAR_COUNT, + new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_RATING_WEIGHT_FRACTION_CLOSE, + new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_RATING_WEIGHT_MEAN_SUM, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_RATING_WEIGHT_DB_STAR_COUNT, + new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_MAX_COMBINATIONS, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_NR_STARS_STOP, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LISA_FRACTION_CLOSE_STOP, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHING_SQUARED_DISTANCE_LIMIT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerMATCHING_SQUARED_SHIFT_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHING_SQUARED_DISTANCE_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::MATCHING_SQUARED_SHIFT_LIMIT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTRACKING_THIN_LIMIT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTRACKING_OUTLIER_THRESHOLD, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTRACKING_OUTLIER_THRESHOLD_QUEST, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerTRACKING_TRACKER_CHOICE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACKING_THIN_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACKING_OUTLIER_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACKING_OUTLIER_THRESHOLD_QUEST, + new PoolEntry({0})); + localDataPoolMap.emplace(startracker::TRACKING_TRACKER_CHOICE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerVALIDATION_STABLE_COUNT, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerVALIDATION_MAX_DIFFERENCE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerVALIDATION_MIN_TRACKER_CONFIDENCE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerVALIDATION_MIN_MATCHED_STARS, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::VALIDATION_STABLE_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::VALIDATION_MAX_DIFFERENCE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::VALIDATION_MIN_TRACKER_CONFIDENCE, + new PoolEntry({0})); + localDataPoolMap.emplace(startracker::VALIDATION_MIN_MATCHED_STARS, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerALGO_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerALGO_I2T_MIN_CONFIDENCE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerALGO_I2T_MIN_MATCHED, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerALGO_I2L_MIN_CONFIDENCE, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerALGO_I2L_MIN_MATCHED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::ALGO_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::ALGO_I2T_MIN_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::ALGO_I2T_MIN_MATCHED, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::ALGO_I2L_MIN_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::ALGO_I2L_MIN_MATCHED, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM3, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM4, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM5, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM6, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM7, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM8, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM9, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM10, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM11, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM12, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM13, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM14, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM15, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerSUBSCRIPTION_TM16, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM3, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM4, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM5, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM6, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM7, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM8, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM9, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM10, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM11, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM12, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM13, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM14, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM15, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::SUBSCRIPTION_TM16, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOG_SUBSCRIPTION_LEVEL1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOG_SUBSCRIPTION_MODULE1, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOG_SUBSCRIPTION_LEVEL2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerLOG_SUBSCRIPTION_MODULE2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOG_SUBSCRIPTION_LEVEL1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOG_SUBSCRIPTION_MODULE1, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOG_SUBSCRIPTION_LEVEL2, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::LOG_SUBSCRIPTION_MODULE2, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerDEBUG_CAMERA_TIMING, new PoolEntry({0})); - localDataPoolMap.emplace(startrackerDEBUG_CAMERA_TEST, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DEBUG_CAMERA_TIMING, new PoolEntry({0})); + localDataPoolMap.emplace(startracker::DEBUG_CAMERA_TEST, new PoolEntry({0})); return RETURN_OK; } size_t StarTrackerHandler::getNextReplyLength(DeviceCommandId_t commandId) { - return startrackerMAX_FRAME_SIZE; + return startracker::MAX_FRAME_SIZE; } ReturnValue_t StarTrackerHandler::doSendReadHook() { @@ -1290,8 +1284,10 @@ ReturnValue_t StarTrackerHandler::doSendReadHook() { ReturnValue_t StarTrackerHandler::checkMode(ActionId_t actionId) { switch (actionId) { - case startrackerUPLOAD_IMAGE: - case startrackerDOWNLOAD_IMAGE: { + case startracker::UPLOAD_IMAGE: + case startracker::DOWNLOAD_IMAGE: + case startracker::READ: + case startracker::FIRMWARE_UPDATE: { return DeviceHandlerBase::acceptExternalDeviceCommands(); default: break; @@ -1303,68 +1299,60 @@ ReturnValue_t StarTrackerHandler::checkMode(ActionId_t actionId) { ReturnValue_t StarTrackerHandler::scanForActionReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (startrackerID::PING): { - *foundId = startrackerPING_REQUEST; + case (startracker::ID::PING): { + *foundId = startracker::PING_REQUEST; break; } - case (startrackerID::WRITE): { - *foundId = startrackerWRITE; + case (startracker::ID::BOOT): { + *foundId = startracker::BOOT; break; } - case (startrackerID::BOOT): { - *foundId = startrackerBOOT; + case (startracker::ID::TAKE_IMAGE): { + *foundId = startracker::TAKE_IMAGE; break; } - case (startrackerID::TAKE_IMAGE): { - *foundId = startrackerTAKE_IMAGE; + case (startracker::ID::UPLOAD_IMAGE): { + *foundId = startracker::UPLOAD_IMAGE; break; } - case (startrackerID::UPLOAD_IMAGE): { - *foundId = startrackerUPLOAD_IMAGE; + case (startracker::ID::ERROR_RESET): { + *foundId = startracker::RESET_ERROR; break; } - case (startrackerID::ERROR_RESET): { - *foundId = startrackerRESET_ERROR; + case (startracker::ID::ERASE): { + *foundId = startracker::ERASE; break; } - case (startrackerID::ERASE): { - *foundId = startrackerERASE; + case (startracker::ID::UNLOCK): { + *foundId = startracker::UNLOCK; break; } - case (startrackerID::UNLOCK): { - *foundId = startrackerUNLOCK; + case (startracker::ID::CHECKSUM): { + *foundId = startracker::CHECKSUM; break; } - case (startrackerID::CHECKSUM): { - *foundId = startrackerCHECKSUM; + case (startracker::ID::SET_TIME): { + *foundId = startracker::SET_TIME; break; } - case (startrackerID::SET_TIME): { - *foundId = startrackerSET_TIME; + case (startracker::ID::DOWNLOAD_CENTROID): { + *foundId = startracker::DOWNLOAD_CENTROID; break; } - case (startrackerID::DOWNLOAD_CENTROID): { - *foundId = startrackerDOWNLOAD_CENTROID; + case (startracker::ID::UPLOAD_CENTROID): { + *foundId = startracker::UPLOAD_CENTROID; break; } - case (startrackerID::UPLOAD_CENTROID): { - *foundId = startrackerUPLOAD_CENTROID; + case (startracker::ID::DOWNLOAD_MATCHED_STAR): { + *foundId = startracker::DOWNLOAD_MATCHED_STAR; break; } - case (startrackerID::DOWNLOAD_MATCHED_STAR): { - *foundId = startrackerDOWNLOAD_MATCHED_STAR; + case (startracker::ID::DOWNLOAD_DBIMAGE): { + *foundId = startracker::DOWNLOAD_DBIMAGE; break; } - case (startrackerID::DOWNLOAD_DBIMAGE): { - *foundId = startrackerDOWNLOAD_DBIMAGE; - break; - } - case (startrackerID::DOWNLOAD_BLOBPIXEL): { - *foundId = startrackerDOWNLOAD_BLOBPIXEL; - break; - } - case (startrackerID::FPGA_ACTION): { - *foundId = startrackerFPGA_ACTION; + case (startracker::ID::DOWNLOAD_BLOBPIXEL): { + *foundId = startracker::DOWNLOAD_BLOBPIXEL; break; } default: @@ -1378,60 +1366,60 @@ ReturnValue_t StarTrackerHandler::scanForActionReply(DeviceCommandId_t* foundId) ReturnValue_t StarTrackerHandler::scanForSetParameterReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (startrackerID::SUBSCRIPTION): { - *foundId = startrackerSUBSCRIPTION; + case (startracker::ID::SUBSCRIPTION): { + *foundId = startracker::SUBSCRIPTION; break; } - case (startrackerID::LIMITS): { - *foundId = startrackerLIMITS; + case (startracker::ID::LIMITS): { + *foundId = startracker::LIMITS; break; } - case (startrackerID::MOUNTING): { - *foundId = startrackerMOUNTING; + case (startracker::ID::MOUNTING): { + *foundId = startracker::MOUNTING; break; } - case (startrackerID::IMAGE_PROCESSOR): { - *foundId = startrackerIMAGE_PROCESSOR; + case (startracker::ID::IMAGE_PROCESSOR): { + *foundId = startracker::IMAGE_PROCESSOR; break; } - case (startrackerID::CAMERA): { - *foundId = startrackerCAMERA; + case (startracker::ID::CAMERA): { + *foundId = startracker::CAMERA; break; } - case (startrackerID::CENTROIDING): { - *foundId = startrackerCENTROIDING; + case (startracker::ID::CENTROIDING): { + *foundId = startracker::CENTROIDING; break; } - case (startrackerID::LISA): { - *foundId = startrackerLISA; + case (startracker::ID::LISA): { + *foundId = startracker::LISA; break; } - case (startrackerID::MATCHING): { - *foundId = startrackerMATCHING; + case (startracker::ID::MATCHING): { + *foundId = startracker::MATCHING; break; } - case (startrackerID::TRACKING): { - *foundId = startrackerTRACKING; + case (startracker::ID::TRACKING): { + *foundId = startracker::TRACKING; break; } - case (startrackerID::VALIDATION): { - *foundId = startrackerVALIDATION; + case (startracker::ID::VALIDATION): { + *foundId = startracker::VALIDATION; break; } - case (startrackerID::ALGO): { - *foundId = startrackerALGO; + case (startracker::ID::ALGO): { + *foundId = startracker::ALGO; break; } - case (startrackerID::LOG_LEVEL): { - *foundId = startrackerLOGLEVEL; + case (startracker::ID::LOG_LEVEL): { + *foundId = startracker::LOGLEVEL; break; } - case (startrackerID::DEBUG_CAMERA): { - *foundId = startrackerDEBUG_CAMERA; + case (startracker::ID::DEBUG_CAMERA): { + *foundId = startracker::DEBUG_CAMERA; break; } - case (startrackerID::LOG_SUBSCRIPTION): { - *foundId = startrackerLOGSUBSCRIPTION; + case (startracker::ID::LOG_SUBSCRIPTION): { + *foundId = startracker::LOGSUBSCRIPTION; break; } default: @@ -1445,60 +1433,60 @@ ReturnValue_t StarTrackerHandler::scanForSetParameterReply(DeviceCommandId_t* fo ReturnValue_t StarTrackerHandler::scanForGetParameterReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (startrackerID::CAMERA): { - *foundId = startrackerREQ_CAMERA; + case (startracker::ID::CAMERA): { + *foundId = startracker::REQ_CAMERA; break; } - case (startrackerID::LIMITS): { - *foundId = startrackerREQ_LIMITS; + case (startracker::ID::LIMITS): { + *foundId = startracker::REQ_LIMITS; break; } - case (startrackerID::LOG_LEVEL): { - *foundId = startrackerREQ_LOG_LEVEL; + case (startracker::ID::LOG_LEVEL): { + *foundId = startracker::REQ_LOG_LEVEL; break; } - case (startrackerID::MOUNTING): { - *foundId = startrackerREQ_MOUNTING; + case (startracker::ID::MOUNTING): { + *foundId = startracker::REQ_MOUNTING; break; } - case (startrackerID::IMAGE_PROCESSOR): { - *foundId = startrackerREQ_IMAGE_PROCESSOR; + case (startracker::ID::IMAGE_PROCESSOR): { + *foundId = startracker::REQ_IMAGE_PROCESSOR; break; } - case (startrackerID::CENTROIDING): { - *foundId = startrackerREQ_CENTROIDING; + case (startracker::ID::CENTROIDING): { + *foundId = startracker::REQ_CENTROIDING; break; } - case (startrackerID::LISA): { - *foundId = startrackerREQ_LISA; + case (startracker::ID::LISA): { + *foundId = startracker::REQ_LISA; break; } - case (startrackerID::MATCHING): { - *foundId = startrackerREQ_MATCHING; + case (startracker::ID::MATCHING): { + *foundId = startracker::REQ_MATCHING; break; } - case (startrackerID::TRACKING): { - *foundId = startrackerREQ_TRACKING; + case (startracker::ID::TRACKING): { + *foundId = startracker::REQ_TRACKING; break; } - case (startrackerID::VALIDATION): { - *foundId = startrackerREQ_VALIDATION; + case (startracker::ID::VALIDATION): { + *foundId = startracker::REQ_VALIDATION; break; } - case (startrackerID::ALGO): { - *foundId = startrackerREQ_ALGO; + case (startracker::ID::ALGO): { + *foundId = startracker::REQ_ALGO; break; } - case (startrackerID::SUBSCRIPTION): { - *foundId = startrackerREQ_SUBSCRIPTION; + case (startracker::ID::SUBSCRIPTION): { + *foundId = startracker::REQ_SUBSCRIPTION; break; } - case (startrackerID::LOG_SUBSCRIPTION): { - *foundId = startrackerREQ_LOG_SUBSCRIPTION; + case (startracker::ID::LOG_SUBSCRIPTION): { + *foundId = startracker::REQ_LOG_SUBSCRIPTION; break; } - case (startrackerID::DEBUG_CAMERA): { - *foundId = startrackerREQ_DEBUG_CAMERA; + case (startracker::ID::DEBUG_CAMERA): { + *foundId = startracker::REQ_DEBUG_CAMERA; break; } default: { @@ -1513,36 +1501,36 @@ ReturnValue_t StarTrackerHandler::scanForGetParameterReply(DeviceCommandId_t* fo ReturnValue_t StarTrackerHandler::scanForTmReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (startrackerID::VERSION): { - *foundId = startrackerREQ_VERSION; + case (startracker::ID::VERSION): { + *foundId = startracker::REQ_VERSION; break; } - case (startrackerID::INTERFACE): { - *foundId = startrackerREQ_INTERFACE; + case (startracker::ID::INTERFACE): { + *foundId = startracker::REQ_INTERFACE; break; } - case (startrackerID::POWER): { - *foundId = startrackerREQ_POWER; + case (startracker::ID::POWER): { + *foundId = startracker::REQ_POWER; break; } - case (startrackerID::TEMPERATURE): { - *foundId = startrackerREQ_TEMPERATURE; + case (startracker::ID::TEMPERATURE): { + *foundId = startracker::REQ_TEMPERATURE; break; } - case (startrackerID::HISTOGRAM): { - *foundId = startrackerREQ_HISTOGRAM; + case (startracker::ID::HISTOGRAM): { + *foundId = startracker::REQ_HISTOGRAM; break; } - case (startrackerID::CONTRAST): { - *foundId = startrackerREQ_CONTRAST; + case (startracker::ID::CONTRAST): { + *foundId = startracker::REQ_CONTRAST; break; } - case (startrackerID::TIME): { - *foundId = startrackerREQ_TIME; + case (startracker::ID::TIME): { + *foundId = startracker::REQ_TIME; break; } - case (startrackerID::SOLUTION): { - *foundId = startrackerREQ_SOLUTION; + case (startracker::ID::SOLUTION): { + *foundId = startracker::REQ_SOLUTION; break; } default: { @@ -1570,79 +1558,6 @@ void StarTrackerHandler::handleEvent(EventMessage* eventMessage) { } } -ReturnValue_t StarTrackerHandler::executeWriteCommand(const uint8_t* commandData, - size_t commandDataLen) { - ReturnValue_t result = RETURN_OK; - if (commandDataLen < WriteCmd::MIN_LENGTH) { - sif::warning << "StarTrackerHandler::executeWriteCommand: Command too short" << std::endl; - return COMMAND_TOO_SHORT; - } - uint8_t region = *(commandData); - uint32_t address; - size_t size = sizeof(address); - const uint8_t* addressPtr = commandData + WriteCmd::ADDRESS_OFFSET; - result = SerializeAdapter::deSerialize(&address, addressPtr, &size, SerializeIF::Endianness::BIG); - if (result != RETURN_OK) { - sif::debug << "StarTrackerHandler::executeWriteCommand: Deserialization of address failed" - << std::endl; - return result; - } - if (commandDataLen - sizeof(address) - sizeof(region) > MAX_PATH_SIZE) { - sif::warning << "StarTrackerHandler::executeWriteCommand: Received command with invalid" - << " path and filename" << std::endl; - return FILE_PATH_TOO_LONG; - } - const uint8_t* filePtr = commandData + WriteCmd::FILE_OFFSET; - std::string fullname = std::string(reinterpret_cast(filePtr), - commandDataLen - sizeof(address) - sizeof(region)); - result = strHelper->startFlashWrite(fullname, region, address); - if (result != RETURN_OK) { - return result; - } - return result; -} - -ReturnValue_t StarTrackerHandler::executeFpgaDownloadCommand(const uint8_t* commandData, - size_t commandDataLen) { - ReturnValue_t result = RETURN_OK; - if (commandDataLen < FpgaDownloadCmd::MIN_LENGTH) { - sif::warning << "StarTrackerHandler::executeFpgaDownloadCommand: Command too short" - << std::endl; - return COMMAND_TOO_SHORT; - } - uint32_t position; - size_t size = sizeof(position); - result = - SerializeAdapter::deSerialize(&position, &commandData, &size, SerializeIF::Endianness::BIG); - if (result != RETURN_OK) { - sif::debug << "StarTrackerHandler::executeWriteCommand: Deserialization of position failed" - << std::endl; - return result; - } - uint32_t length; - size = sizeof(length); - result = - SerializeAdapter::deSerialize(&length, &commandData, &size, SerializeIF::Endianness::BIG); - if (result != RETURN_OK) { - sif::debug << "StarTrackerHandler::executeWriteCommand: Deserialization of length failed" - << std::endl; - return result; - } - if (commandDataLen - sizeof(position) - sizeof(length) > MAX_PATH_SIZE) { - sif::warning << "StarTrackerHandler::executeFpgaDownloadCommand: Received command with " - " invalid path and filename" - << std::endl; - return FILE_PATH_TOO_LONG; - } - std::string fullname = std::string(reinterpret_cast(commandData), - commandDataLen - sizeof(position) - sizeof(length)); - result = strHelper->startFpgaDownload(fullname, position, length); - if (result != RETURN_OK) { - return result; - } - return result; -} - ReturnValue_t StarTrackerHandler::executeReadCommand(const uint8_t* commandData, size_t commandDataLen) { ReturnValue_t result = RETURN_OK; @@ -1825,72 +1740,70 @@ ReturnValue_t StarTrackerHandler::prepareUploadCentroidCommand(const uint8_t* co << " does not exist" << std::endl; return result; } - result = j.getValue(startrackerUploadCentroidKeys::id, &req.id); + result = j.getValue(startracker::UploadCentroidKeys::id, &req.id); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startrackerUploadCentroidKeys::id << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::id << " does not exist" << std::endl; return result; } - result = j.getValue(startrackerUploadCentroidKeys::pixx, &req.pixx); + result = j.getValue(startracker::UploadCentroidKeys::pixx, &req.pixx); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startrackerUploadCentroidKeys::pixx << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::pixx << " does not exist" << std::endl; return result; } - result = j.getValue(startrackerUploadCentroidKeys::pixy, &req.pixy); + result = j.getValue(startracker::UploadCentroidKeys::pixy, &req.pixy); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startrackerUploadCentroidKeys::pixy << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::pixy << " does not exist" << std::endl; return result; } - result = j.getValue(startrackerUploadCentroidKeys::x_uncorrected, &req.x_uncorrected); + result = j.getValue(startracker::UploadCentroidKeys::x_uncorrected, &req.x_uncorrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startrackerUploadCentroidKeys::x_uncorrected << " does not exist" - << std::endl; + << startracker::UploadCentroidKeys::x_uncorrected << " does not exist" << std::endl; return result; } - result = j.getValue(startrackerUploadCentroidKeys::y_uncorrected, &req.y_uncorrected); + result = j.getValue(startracker::UploadCentroidKeys::y_uncorrected, &req.y_uncorrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startrackerUploadCentroidKeys::y_uncorrected << " does not exist" - << std::endl; + << startracker::UploadCentroidKeys::y_uncorrected << " does not exist" << std::endl; return result; } - result = j.getValue(startrackerUploadCentroidKeys::x_corrected, &req.x_corrected); + result = j.getValue(startracker::UploadCentroidKeys::x_corrected, &req.x_corrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startrackerUploadCentroidKeys::x_corrected << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::x_corrected << " does not exist" << std::endl; return result; } - result = j.getValue(startrackerUploadCentroidKeys::y_corrected, &req.y_corrected); + result = j.getValue(startracker::UploadCentroidKeys::y_corrected, &req.y_corrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startrackerUploadCentroidKeys::y_corrected << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::y_corrected << " does not exist" << std::endl; return result; } - result = j.getValue(startrackerUploadCentroidKeys::magnitude, &req.magnitude); + result = j.getValue(startracker::UploadCentroidKeys::magnitude, &req.magnitude); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startrackerUploadCentroidKeys::magnitude << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::magnitude << " does not exist" << std::endl; return result; } - result = j.getValue(startrackerUploadCentroidKeys::cxa, &req.cxa); + result = j.getValue(startracker::UploadCentroidKeys::cxa, &req.cxa); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startrackerUploadCentroidKeys::cxa << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::cxa << " does not exist" << std::endl; return result; } - result = j.getValue(startrackerUploadCentroidKeys::cya, &req.cya); + result = j.getValue(startracker::UploadCentroidKeys::cya, &req.cya); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startrackerUploadCentroidKeys::cya << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::cya << " does not exist" << std::endl; return result; } - result = j.getValue(startrackerUploadCentroidKeys::quality, &req.quality); + result = j.getValue(startracker::UploadCentroidKeys::quality, &req.quality); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startrackerUploadCentroidKeys::quality << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::quality << " does not exist" << std::endl; return result; } uint32_t length = 0; @@ -2218,7 +2131,7 @@ ReturnValue_t StarTrackerHandler::prepareRequestDebugCameraParams() { ReturnValue_t StarTrackerHandler::handleSetParamReply() { const uint8_t* reply = dataLinkLayer.getReply(); uint8_t status = *(reply + STATUS_OFFSET); - if (status != startrackerSTATUS_OK) { + if (status != startracker::STATUS_OK) { sif::warning << "StarTrackerHandler::handleSetParamReply: Failed to execute parameter set " " command with parameter ID" << static_cast(*(reply + PARAMETER_ID_OFFSET)) << std::endl; @@ -2236,7 +2149,7 @@ ReturnValue_t StarTrackerHandler::handleSetParamReply() { ReturnValue_t StarTrackerHandler::handleActionReply() { const uint8_t* reply = dataLinkLayer.getReply(); uint8_t status = *(reply + STATUS_OFFSET); - if (status != startrackerSTATUS_OK) { + if (status != startracker::STATUS_OK) { sif::warning << "StarTrackerHandler::handleActionReply: Failed to execute action " << "command with action ID " << static_cast(*(reply + ACTION_ID_OFFSET)) << " and status " @@ -2266,7 +2179,7 @@ ReturnValue_t StarTrackerHandler::handleEraseReply() { return result; } const uint8_t* replyData = dataLinkLayer.getReply() + ACTION_DATA_OFFSET; - startrackerEraseReply eraseReply(replyData); + startracker::EraseReply eraseReply(replyData); if (eraseReply.getRegion() != eraseCmd.rememberRegion) { sif::warning << "StarTrackerHandler::handleEraseReply: Region mismatch" << std::endl; return REGION_MISMATCH; @@ -2281,7 +2194,7 @@ ReturnValue_t StarTrackerHandler::handleChecksumReply() { return result; } const uint8_t* replyData = dataLinkLayer.getReply() + ACTION_DATA_OFFSET; - startrackerChecksumReply checksumReply(replyData); + startracker::ChecksumReply checksumReply(replyData); if (checksumReply.getRegion() != checksumCmd.rememberRegion) { sif::warning << "StarTrackerHandler::handleChecksumReply: Region mismatch" << std::endl; return REGION_MISMATCH; @@ -2296,7 +2209,7 @@ ReturnValue_t StarTrackerHandler::handleChecksumReply() { } PoolReadGuard rg(&checksumSet); checksumSet.checksum = checksumReply.getChecksum(); - handleDeviceTM(&checksumSet, startrackerCHECKSUM); + handleDeviceTM(&checksumSet, startracker::CHECKSUM); #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 checksumReply.printChecksum(); #endif /* OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 */ @@ -2339,7 +2252,7 @@ ReturnValue_t StarTrackerHandler::handlePingReply() { sif::info << "StarTracker: Ping status: " << static_cast(status) << std::endl; sif::info << "Ping id: 0x" << std::hex << pingId << std::endl; #endif /* OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 */ - if (status != startrackerSTATUS_OK || pingId != PING_ID) { + if (status != startracker::STATUS_OK || pingId != PING_ID) { sif::warning << "StarTrackerHandler::handlePingReply: Ping failed" << std::endl; result = PING_FAILED; } else { @@ -2353,17 +2266,32 @@ ReturnValue_t StarTrackerHandler::handlePingReply() { ReturnValue_t StarTrackerHandler::checkProgram() { PoolReadGuard pg(&versionSet); switch (versionSet.program.value) { - case startrackerProgram::BOOTLOADER: + case startracker::Program::BOOTLOADER: // Star tracker currently in bootloader program. Need to send boot command to switch to // firmware program - if (startupState != StartupState::IDLE) { + currentProgram = startracker::Program::BOOTLOADER; + if (startupState == StartupState::STARTUP_CHECK) { startupState = StartupState::BOOT; } + else if (startupState == StartupState::FIRMWARE_CHECK) { + startupState = StartupState::FAILED_FIRMWARE_BOOT; + } + if (internalState == InternalState::CHECK_PROGRAM){ + // Firmware boot failed when trying to switch to normal mode + internalState = InternalState::IDLE; + sif::warning << "StarTrackerHandler::checkProgram: Failed to boot firmware when " + << "trying to switch to normal mode" << std::endl; + setMode(_MODE_TO_ON); + } break; - case startrackerProgram::FIRMWARE: + case startracker::Program::FIRMWARE: // Firmware already booted - if (startupState != StartupState::IDLE) { - startupState = StartupState::LIMITS; + currentProgram = startracker::Program::FIRMWARE; + if (startupState == StartupState::FIRMWARE_CHECK) { + startupState = StartupState::LOGLEVEL; + } + if (internalState == InternalState::CHECK_PROGRAM) { + internalState = InternalState::TEMPERATURE_REQUEST; } break; default: @@ -2377,7 +2305,7 @@ ReturnValue_t StarTrackerHandler::checkProgram() { ReturnValue_t StarTrackerHandler::handleTm(LocalPoolDataSetBase& dataset, size_t size) { ReturnValue_t result = RETURN_OK; uint8_t status = *(dataLinkLayer.getReply() + STATUS_OFFSET); - if (status != startrackerSTATUS_OK) { + if (status != startracker::STATUS_OK) { sif::warning << "StarTrackerHandler::handleTm: Reply error: " << static_cast(status) << std::endl; return REPLY_ERROR; @@ -2407,7 +2335,7 @@ ReturnValue_t StarTrackerHandler::handleTm(LocalPoolDataSetBase& dataset, size_t ReturnValue_t StarTrackerHandler::handleActionReplySet(LocalPoolDataSetBase& dataset, size_t size) { ReturnValue_t result = RETURN_OK; uint8_t status = *(dataLinkLayer.getReply() + STATUS_OFFSET); - if (status != startrackerSTATUS_OK) { + if (status != startracker::STATUS_OK) { sif::warning << "StarTrackerHandler::handleActionReplySet: Reply error: " << static_cast(status) << std::endl; return REPLY_ERROR; @@ -2436,55 +2364,55 @@ ReturnValue_t StarTrackerHandler::handleActionReplySet(LocalPoolDataSetBase& dat void StarTrackerHandler::handleStartup(const uint8_t* parameterId) { switch (*parameterId) { - case (startrackerID::LOG_LEVEL): { + case (startracker::ID::LOG_LEVEL): { startupState = StartupState::LIMITS; break; } - case (startrackerID::LIMITS): { + case (startracker::ID::LIMITS): { startupState = StartupState::TRACKING; break; } - case (startrackerID::TRACKING): { + case (startracker::ID::TRACKING): { startupState = StartupState::MOUNTING; break; } - case (startrackerID::MOUNTING): { + case (startracker::ID::MOUNTING): { startupState = StartupState::IMAGE_PROCESSOR; break; } - case (startrackerID::IMAGE_PROCESSOR): { + case (startracker::ID::IMAGE_PROCESSOR): { startupState = StartupState::CAMERA; break; } - case (startrackerID::CAMERA): { + case (startracker::ID::CAMERA): { startupState = StartupState::CENTROIDING; break; } - case (startrackerID::CENTROIDING): { + case (startracker::ID::CENTROIDING): { startupState = StartupState::LISA; break; } - case (startrackerID::LISA): { + case (startracker::ID::LISA): { startupState = StartupState::MATCHING; break; } - case (startrackerID::MATCHING): { + case (startracker::ID::MATCHING): { startupState = StartupState::VALIDATION; break; } - case (startrackerID::VALIDATION): { + case (startracker::ID::VALIDATION): { startupState = StartupState::ALGO; break; } - case (startrackerID::ALGO): { + case (startracker::ID::ALGO): { startupState = StartupState::LOG_SUBSCRIPTION; break; } - case (startrackerID::LOG_SUBSCRIPTION): { + case (startracker::ID::LOG_SUBSCRIPTION): { startupState = StartupState::DEBUG_CAMERA; break; } - case (startrackerID::DEBUG_CAMERA): { + case (startracker::ID::DEBUG_CAMERA): { startupState = StartupState::DONE; break; } @@ -2495,3 +2423,41 @@ void StarTrackerHandler::handleStartup(const uint8_t* parameterId) { } } } + +ReturnValue_t StarTrackerHandler::checkCommand(ActionId_t actionId) { + switch(actionId) { + case startracker::BOOT: + if (currentProgram != startracker::Program::BOOTLOADER) { + return STARTRACKER_ALREADY_BOOTED; + } + break; + case startracker::REQ_INTERFACE: + case startracker::REQ_TIME: + case startracker::SWITCH_TO_BOOTLOADER_PROGRAM: + case startracker::DOWNLOAD_IMAGE: + case startracker::UPLOAD_IMAGE: + case startracker::REQ_POWER: + case startracker::TAKE_IMAGE: + case startracker::DOWNLOAD_CENTROID: + case startracker::UPLOAD_CENTROID: + case startracker::REQ_SOLUTION: + case startracker::REQ_TEMPERATURE: + case startracker::REQ_HISTOGRAM: + case startracker::REQ_CONTRAST: + case startracker::DOWNLOAD_MATCHED_STAR: + case startracker::DOWNLOAD_DBIMAGE: + case startracker::DOWNLOAD_BLOBPIXEL: + if (currentProgram != startracker::Program::FIRMWARE) { + return STARTRACKER_RUNNING_BOOTLOADER; + } + break; + case startracker::FIRMWARE_UPDATE: + if (currentProgram != startracker::Program::BOOTLOADER) { + return STARTRACKER_RUNNING_FIRMWARE; + } + break; + default: + break; + } + return RETURN_OK; +} diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 37411179..dc140015 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -131,6 +131,12 @@ class StarTrackerHandler : public DeviceHandlerBase { //! [EXPORT] : [COMMENT] Star tracker handler currently executing a command and using the //! communication interface static const ReturnValue_t STR_HELPER_EXECUTING = MAKE_RETURN_CODE(0xBA); + //! [EXPORT] : [COMMENT] Star tracker is already in firmware mode + static const ReturnValue_t STARTRACKER_ALREADY_BOOTED = MAKE_RETURN_CODE(0xBB); + //! [EXPORT] : [COMMENT] Star tracker is in firmware mode but must be in bootloader mode to execute this command + static const ReturnValue_t STARTRACKER_RUNNING_FIRMWARE = MAKE_RETURN_CODE(0xBC); + //! [EXPORT] : [COMMENT] Star tracker is in bootloader mode but must be in firmware mode to execute this command + static const ReturnValue_t STARTRACKER_RUNNING_BOOTLOADER = MAKE_RETURN_CODE(0xBD); static const size_t MAX_PATH_SIZE = 50; static const size_t MAX_FILE_NAME = 30; @@ -246,33 +252,33 @@ class StarTrackerHandler : public DeviceHandlerBase { ArcsecDatalinkLayer dataLinkLayer; - StarTracker::TemperatureSet temperatureSet; - StarTracker::VersionSet versionSet; - StarTracker::PowerSet powerSet; - StarTracker::InterfaceSet interfaceSet; - StarTracker::TimeSet timeSet; - StarTracker::SolutionSet solutionSet; - StarTracker::HistogramSet histogramSet; - StarTracker::ContrastSet contrastSet; - StarTracker::ChecksumSet checksumSet; - StarTracker::DownloadCentroidSet downloadCentroidSet; - StarTracker::DownloadMatchedStar downloadMatchedStar; - StarTracker::DownloadDBImage downloadDbImage; - StarTracker::DownloadBlobPixel downloadBlobPixel; - StarTracker::CameraSet cameraSet; - StarTracker::LimitsSet limitsSet; - StarTracker::LogLevelSet loglevelSet; - StarTracker::MountingSet mountingSet; - StarTracker::ImageProcessorSet imageProcessorSet; - StarTracker::CentroidingSet centroidingSet; - StarTracker::LisaSet lisaSet; - StarTracker::MatchingSet matchingSet; - StarTracker::TrackingSet trackingSet; - StarTracker::ValidationSet validationSet; - StarTracker::AlgoSet algoSet; - StarTracker::SubscriptionSet subscriptionSet; - StarTracker::LogSubscriptionSet logSubscriptionSet; - StarTracker::DebugCameraSet debugCameraSet; + startracker::TemperatureSet temperatureSet; + startracker::VersionSet versionSet; + startracker::PowerSet powerSet; + startracker::InterfaceSet interfaceSet; + startracker::TimeSet timeSet; + startracker::SolutionSet solutionSet; + startracker::HistogramSet histogramSet; + startracker::ContrastSet contrastSet; + startracker::ChecksumSet checksumSet; + startracker::DownloadCentroidSet downloadCentroidSet; + startracker::DownloadMatchedStar downloadMatchedStar; + startracker::DownloadDBImage downloadDbImage; + startracker::DownloadBlobPixel downloadBlobPixel; + startracker::CameraSet cameraSet; + startracker::LimitsSet limitsSet; + startracker::LogLevelSet loglevelSet; + startracker::MountingSet mountingSet; + startracker::ImageProcessorSet imageProcessorSet; + startracker::CentroidingSet centroidingSet; + startracker::LisaSet lisaSet; + startracker::MatchingSet matchingSet; + startracker::TrackingSet trackingSet; + startracker::ValidationSet validationSet; + startracker::AlgoSet algoSet; + startracker::SubscriptionSet subscriptionSet; + startracker::LogSubscriptionSet logSubscriptionSet; + startracker::DebugCameraSet debugCameraSet; // Pointer to object responsible for uploading and downloading images to/from the star tracker StrHelper* strHelper = nullptr; @@ -280,10 +286,11 @@ class StarTrackerHandler : public DeviceHandlerBase { uint8_t commandBuffer[startracker::MAX_FRAME_SIZE]; // Countdown to insert delay for star tracker to switch from bootloader to firmware program + // Loading firmware requires some time and the command will not trigger a reply when executed Countdown bootCountdown; -#ifndef EGSE - std::string paramJsonFile = "/mnt/sd0/startracker/flight-config.json"; +#ifdef EGSE + std::string paramJsonFile = "/home/pi/arcsec/json/flight-config.json"; #else #if OBSW_STAR_TRACKER_GROUND_CONFIG == 1 std::string paramJsonFile = "/mnt/sd0/startracker/ground-config.json"; @@ -292,15 +299,22 @@ class StarTrackerHandler : public DeviceHandlerBase { #endif #endif - enum class InternalState { TEMPERATURE_REQUEST }; + enum class InternalState { + IDLE, + CHECK_PROGRAM, + TEMPERATURE_REQUEST, + }; - InternalState internalState = InternalState::TEMPERATURE_REQUEST; + InternalState internalState = InternalState::IDLE; enum class StartupState { IDLE, CHECK_BOOT_STATE, BOOT, + VERIFY_BOOT, + STARTUP_CHECK, BOOT_DELAY, + FIRMWARE_CHECK, LOGLEVEL, LIMITS, TRACKING, @@ -316,13 +330,16 @@ class StarTrackerHandler : public DeviceHandlerBase { LOG_SUBSCRIPTION, DEBUG_CAMERA, WAIT_FOR_EXECUTION, - DONE + DONE, + FAILED_FIRMWARE_BOOT }; StartupState startupState = StartupState::IDLE; bool strHelperExecuting = false; + uint8_t currentProgram = startracker::Program::BOOTLOADER; + /** * @brief Handles internal state */ @@ -360,24 +377,6 @@ class StarTrackerHandler : public DeviceHandlerBase { */ void handleEvent(EventMessage* eventMessage); - /** - * @brief Executes the write command - * - * @param commandData Pointer to received command data - * @param commandDataLen Size of received command data - * - * @return RETURN_OK if start of execution was successful, otherwise error return value - */ - ReturnValue_t executeWriteCommand(const uint8_t* commandData, size_t commandDataLen); - - /** - * @brief Starts the execution of the fpga download command - * - * @param commandData Pointer to buffer with command data - * @param commandDataLen Size of received command - */ - ReturnValue_t executeFpgaDownloadCommand(const uint8_t* commandData, size_t commandDataLen); - /** * @brief Extracts information for flash-read-command from TC data and starts execution of * flash-read-procedure @@ -586,6 +585,15 @@ class StarTrackerHandler : public DeviceHandlerBase { * @return RETURN_OK if successful, otherwise error return value */ ReturnValue_t handleTm(LocalPoolDataSetBase& dataset, size_t size); + + /** + * @brief Checks if star tracker is in valid mode for executing the received command. + * + * @param actioId Id of received command + * + * @return RETURN_OK if star tracker is in valid mode, otherwise error return value + */ + ReturnValue_t checkCommand(ActionId_t actionId); }; #endif /* MISSION_DEVICES_STARTRACKERHANDLER_H_ */ diff --git a/linux/devices/startracker/StarTrackerJsonCommands.cpp b/linux/devices/startracker/StarTrackerJsonCommands.cpp index d8ddb7ca..c481c72a 100644 --- a/linux/devices/startracker/StarTrackerJsonCommands.cpp +++ b/linux/devices/startracker/StarTrackerJsonCommands.cpp @@ -10,7 +10,7 @@ ReturnValue_t Limits::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::LIMITS); + addSetParamHeader(buffer, startracker::ID::LIMITS); offset = 2; result = getParam(arcseckeys::ACTION, param); if (result != RETURN_OK) { @@ -88,7 +88,7 @@ ReturnValue_t Tracking::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::TRACKING); + addSetParamHeader(buffer, startracker::ID::TRACKING); offset = 2; result = getParam(arcseckeys::THIN_LIMIT, param); if (result != RETURN_OK) { @@ -124,7 +124,7 @@ ReturnValue_t Mounting::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::MOUNTING); + addSetParamHeader(buffer, startracker::ID::MOUNTING); offset = 2; result = getParam(arcseckeys::qw, param); if (result != RETURN_OK) { @@ -160,7 +160,7 @@ ReturnValue_t ImageProcessor::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::IMAGE_PROCESSOR); + addSetParamHeader(buffer, startracker::ID::IMAGE_PROCESSOR); offset = 2; result = getParam(arcseckeys::IMAGE_PROCESSOR_MODE, param); if (result != RETURN_OK) { @@ -202,7 +202,7 @@ ReturnValue_t Camera::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::CAMERA); + addSetParamHeader(buffer, startracker::ID::CAMERA); offset = 2; result = getParam(arcseckeys::MODE, param); if (result != RETURN_OK) { @@ -358,7 +358,7 @@ ReturnValue_t Centroiding::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::CENTROIDING); + addSetParamHeader(buffer, startracker::ID::CENTROIDING); offset = 2; result = getParam(arcseckeys::ENABLE_FILTER, param); if (result != RETURN_OK) { @@ -448,7 +448,7 @@ ReturnValue_t Lisa::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::LISA); + addSetParamHeader(buffer, startracker::ID::LISA); offset = 2; result = getParam(arcseckeys::LISA_MODE, param); if (result != RETURN_OK) { @@ -545,7 +545,7 @@ ReturnValue_t Matching::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::MATCHING); + addSetParamHeader(buffer, startracker::ID::MATCHING); offset = 2; result = getParam(arcseckeys::SQUARED_DISTANCE_LIMIT, param); if (result != RETURN_OK) { @@ -569,7 +569,7 @@ ReturnValue_t Validation::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::VALIDATION); + addSetParamHeader(buffer, startracker::ID::VALIDATION); offset = 2; result = getParam(arcseckeys::STABLE_COUNT, param); if (result != RETURN_OK) { @@ -605,7 +605,7 @@ ReturnValue_t Algo::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::ALGO); + addSetParamHeader(buffer, startracker::ID::ALGO); offset = 2; result = getParam(arcseckeys::MODE, param); if (result != RETURN_OK) { @@ -647,7 +647,7 @@ ReturnValue_t LogLevel::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::LOG_LEVEL); + addSetParamHeader(buffer, startracker::ID::LOG_LEVEL); offset = 2; result = getParam(arcseckeys::LOGLEVEL1, param); if (result != RETURN_OK) { @@ -756,7 +756,7 @@ ReturnValue_t Subscription::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::SUBSCRIPTION); + addSetParamHeader(buffer, startracker::ID::SUBSCRIPTION); offset = 2; result = getParam(arcseckeys::TELEMETRY_1, param); if (result != RETURN_OK) { @@ -864,7 +864,7 @@ ReturnValue_t LogSubscription::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::LOG_SUBSCRIPTION); + addSetParamHeader(buffer, startracker::ID::LOG_SUBSCRIPTION); offset = 2; result = getParam(arcseckeys::LEVEL1, param); if (result != RETURN_OK) { @@ -900,7 +900,7 @@ ReturnValue_t DebugCamera::createCommand(uint8_t* buffer) { ReturnValue_t result = RETURN_OK; uint8_t offset = 0; std::string param; - addSetParamHeader(buffer, StarTracker::ID::DEBUG_CAMERA); + addSetParamHeader(buffer, startracker::ID::DEBUG_CAMERA); offset = 2; result = getParam(arcseckeys::TIMING, param); if (result != RETURN_OK) { diff --git a/linux/devices/startracker/StrHelper.cpp b/linux/devices/startracker/StrHelper.cpp index 77bfe3d9..f2f89a31 100644 --- a/linux/devices/startracker/StrHelper.cpp +++ b/linux/devices/startracker/StrHelper.cpp @@ -1,4 +1,5 @@ #include "StrHelper.h" +#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include #include @@ -60,26 +61,6 @@ ReturnValue_t StrHelper::performOperation(uint8_t operationCode) { internalState = InternalState::IDLE; break; } - case InternalState::DOWNLOAD_FPGA_IMAGE: { - result = performFpgaDownload(); - if (result == RETURN_OK) { - triggerEvent(FPGA_DOWNLOAD_SUCCESSFUL); - } else { - triggerEvent(FPGA_DOWNLOAD_FAILED); - } - internalState = InternalState::IDLE; - break; - } - case InternalState::UPLOAD_FPGA_IMAGE: { - result = performFpgaUpload(); - if (result == RETURN_OK) { - triggerEvent(FPGA_UPLOAD_SUCCESSFUL); - } else { - triggerEvent(FPGA_UPLOAD_FAILED); - } - internalState = InternalState::IDLE; - break; - } case InternalState::FIRMWARE_UPDATE: { result = performFirmwareUpdate(); if (result == RETURN_OK) { @@ -148,8 +129,6 @@ void StrHelper::setDownloadImageName(std::string filename) { downloadImage.filen void StrHelper::setFlashReadFilename(std::string filename) { flashRead.filename = filename; } -void StrHelper::setDownloadFpgaImage(std::string filename) { fpgaDownload.fileName = filename; } - ReturnValue_t StrHelper::startFirmwareUpdate(std::string fullname) { #ifdef XIPHOS_Q7S ReturnValue_t result = checkPath(fullname); @@ -162,7 +141,8 @@ ReturnValue_t StrHelper::startFirmwareUpdate(std::string fullname) { return FILE_NOT_EXISTS; } flashWrite.address = 0; - flashWrite.section = static_cast(RegionId::MAIN_FIRMWARE_SECTION); + flashWrite.firstRegion = static_cast(startracker::FirmwareRegions::FIRST); + flashWrite.lastRegion = static_cast(startracker::FirmwareRegions::LAST); internalState = InternalState::FIRMWARE_UPDATE; semaphore.release(); terminate = false; @@ -190,25 +170,6 @@ ReturnValue_t StrHelper::startFlashRead(std::string path, uint8_t region, uint32 return RETURN_OK; } -ReturnValue_t StrHelper::startFpgaDownload(std::string path, uint32_t startPosition, - uint32_t length) { - fpgaDownload.path = path; - fpgaDownload.startPosition = startPosition; - fpgaDownload.length = length; - internalState = InternalState::DOWNLOAD_FPGA_IMAGE; - semaphore.release(); - terminate = false; - return RETURN_OK; -} - -ReturnValue_t StrHelper::startFpgaUpload(std::string uploadFile) { - fpgaUpload.uploadFile = uploadFile; - internalState = InternalState::UPLOAD_FPGA_IMAGE; - semaphore.release(); - terminate = false; - return RETURN_OK; -} - ReturnValue_t StrHelper::performImageDownload() { ReturnValue_t result; struct DownloadActionRequest downloadReq; @@ -223,6 +184,7 @@ ReturnValue_t StrHelper::performImageDownload() { downloadReq.position = 0; while (downloadReq.position < ImageDownload::LAST_POSITION) { if (terminate) { + file.close(); return RETURN_OK; } arc_pack_download_action_req(&downloadReq, commandBuffer, &size); @@ -257,7 +219,7 @@ ReturnValue_t StrHelper::performImageDownload() { return result; } file.write(reinterpret_cast(datalinkLayer.getReply() + IMAGE_DATA_OFFSET), - IMAGE_DATA_SIZE); + CHUNK_SIZE); downloadReq.position++; #if OBSW_DEBUG_STARTRACKER == 1 printProgress(downloadReq.position, ImageDownload::LAST_POSITION); @@ -287,6 +249,7 @@ ReturnValue_t StrHelper::performImageUpload() { imageSize = file.tellg(); while ((uploadReq.position + 1) * SIZE_IMAGE_PART < imageSize) { if (terminate) { + file.close(); return RETURN_OK; } file.seekg(uploadReq.position * SIZE_IMAGE_PART, file.beg); @@ -294,10 +257,12 @@ ReturnValue_t StrHelper::performImageUpload() { arc_pack_upload_action_req(&uploadReq, commandBuffer, &size); result = sendAndRead(size, uploadReq.position); if (result != RETURN_OK) { + file.close(); return RETURN_FAILED; } result = checkActionReply(); if (result != RETURN_OK) { + file.close(); return result; } #if OBSW_DEBUG_STARTRACKER == 1 @@ -329,8 +294,8 @@ ReturnValue_t StrHelper::performImageUpload() { ReturnValue_t StrHelper::performFirmwareUpdate() { using namespace startracker; ReturnValue_t result = RETURN_OK; - result = unlockAndEraseRegions(static_cast(FirmwareRegions::START), - static_cast(FirmwareRegions::END)); + result = unlockAndEraseRegions(static_cast(startracker::FirmwareRegions::FIRST), + static_cast(startracker::FirmwareRegions::LAST)); if (result != RETURN_OK) { return result; } @@ -341,7 +306,7 @@ ReturnValue_t StrHelper::performFirmwareUpdate() { ReturnValue_t StrHelper::performFlashWrite() { ReturnValue_t result = RETURN_OK; uint32_t size = 0; - uint32_t remainingBytes = 0; + uint32_t bytesWritten = 0; uint32_t fileSize = 0; struct WriteActionRequest req; if (not std::filesystem::exists(flashWrite.fullname)) { @@ -352,30 +317,49 @@ ReturnValue_t StrHelper::performFlashWrite() { std::ifstream file(flashWrite.fullname, std::ifstream::binary); file.seekg(0, file.end); fileSize = file.tellg(); - remainingBytes = fileSize; - req.region = flashWrite.section; - req.address = flashWrite.address; - req.length = MAX_FLASH_DATA; - while (remainingBytes >= MAX_FLASH_DATA) { + if (fileSize > FLASH_REGION_SIZE * (flashWrite.lastRegion - flashWrite.firstRegion)) { + sif::warning << "StrHelper::performFlashWrite: Invalid file" << std::endl; + return RETURN_FAILED; + } + uint32_t fileChunks = fileSize / CHUNK_SIZE; + bytesWritten = 0; + req.region = flashWrite.firstRegion; + req.length = CHUNK_SIZE; + for (uint32_t idx = 0; idx < fileChunks; idx++) { if (terminate) { + file.close(); return RETURN_OK; } - file.seekg(fileSize - remainingBytes, file.beg); - file.read(reinterpret_cast(req.data), MAX_FLASH_DATA); + file.seekg(idx * CHUNK_SIZE, file.beg); + file.read(reinterpret_cast(req.data), CHUNK_SIZE); + if (bytesWritten + CHUNK_SIZE > FLASH_REGION_SIZE) { + req.region++; + bytesWritten = 0; + } + req.address = bytesWritten; arc_pack_write_action_req(&req, commandBuffer, &size); result = sendAndRead(size, req.address); if (result != RETURN_OK) { + file.close(); return result; } result = checkFlashActionReply(req.region, req.address, req.length); if (result != RETURN_OK) { + file.close(); return result; } - remainingBytes = remainingBytes - MAX_FLASH_DATA; + bytesWritten += CHUNK_SIZE; } - file.seekg(fileSize - remainingBytes, file.beg); + uint32_t remainingBytes = fileSize - fileChunks * CHUNK_SIZE; + file.seekg((fileChunks - 1) * CHUNK_SIZE , file.beg); file.read(reinterpret_cast(req.data), remainingBytes); file.close(); + if (bytesWritten + CHUNK_SIZE > FLASH_REGION_SIZE) { + req.region++; + bytesWritten = 0; + } + req.address = bytesWritten; + req.length = remainingBytes; arc_pack_write_action_req(&req, commandBuffer, &size); result = sendAndRead(size, req.address); if (result != RETURN_OK) { @@ -405,10 +389,10 @@ ReturnValue_t StrHelper::performFlashRead() { if (terminate) { return RETURN_OK; } - if ((flashRead.size - bytesRead) < MAX_FLASH_DATA) { + if ((flashRead.size - bytesRead) < CHUNK_SIZE) { req.length = flashRead.size - bytesRead; } else { - req.length = MAX_FLASH_DATA; + req.length = CHUNK_SIZE; } req.address = flashRead.address + bytesRead; arc_pack_read_action_req(&req, commandBuffer, &size); @@ -451,97 +435,6 @@ ReturnValue_t StrHelper::performFlashRead() { return RETURN_OK; } -ReturnValue_t StrHelper::performFpgaDownload() { - ReturnValue_t result; - struct DownloadFPGAImageActionRequest req; - uint32_t size = 0; - uint32_t retries = 0; - Timestamp timestamp; - std::string image = fpgaDownload.path + "/" + timestamp.str() + fpgaDownload.fileName; - std::ofstream file(image, std::ios_base::app | std::ios_base::out); - if (not std::filesystem::exists(image)) { - return FILE_CREATION_FAILED; - } - req.pos = fpgaDownload.startPosition; - while (req.pos < fpgaDownload.length) { - if (terminate) { - return RETURN_OK; - } - if (fpgaDownload.length - req.pos >= FpgaDownload::MAX_DATA) { - req.length = FpgaDownload::MAX_DATA; - } else { - req.length = fpgaDownload.length - req.pos; - } - arc_pack_downloadfpgaimage_action_req(&req, commandBuffer, &size); - result = sendAndRead(size, req.pos); - if (result != RETURN_OK) { - if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) { - uartComIF->flushUartRxBuffer(comCookie); - retries++; - continue; - } - file.close(); - return result; - } - result = checkFpgaActionReply(req.pos, req.length); - if (result != RETURN_OK) { - if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) { - uartComIF->flushUartRxBuffer(comCookie); - retries++; - continue; - } - file.close(); - return result; - } - file.write(reinterpret_cast(datalinkLayer.getReply() + FpgaDownload::DATA_OFFSET), - req.length); - req.pos += req.length; - retries = 0; - } - file.close(); - return RETURN_OK; -} - -ReturnValue_t StrHelper::performFpgaUpload() { - ReturnValue_t result = RETURN_OK; - uint32_t commandSize = 0; - uint32_t bytesUploaded = 0; - uint32_t fileSize = 0; - struct UploadFPGAImageActionRequest req; - if (not std::filesystem::exists(fpgaUpload.uploadFile)) { - triggerEvent(STR_HELPER_FILE_NOT_EXISTS, static_cast(internalState)); - internalState = InternalState::IDLE; - return RETURN_FAILED; - } - std::ifstream file(flashWrite.fullname, std::ifstream::binary); - file.seekg(0, file.end); - fileSize = file.tellg(); - req.pos = 0; - while (bytesUploaded <= fileSize) { - if (terminate) { - return RETURN_OK; - } - if (fileSize - bytesUploaded > FpgaUpload::MAX_DATA) { - req.length = FpgaUpload::MAX_DATA; - } else { - req.length = fileSize - bytesUploaded; - } - file.seekg(bytesUploaded, file.beg); - file.read(reinterpret_cast(req.data), req.length); - arc_pack_uploadfpgaimage_action_req(&req, commandBuffer, &commandSize); - result = sendAndRead(commandSize, req.pos); - if (result != RETURN_OK) { - return RETURN_FAILED; - } - result = checkFpgaActionReply(req.pos, req.length); - if (result != RETURN_OK) { - return result; - } - bytesUploaded += req.length; - } - return RETURN_OK; -} - ReturnValue_t StrHelper::sendAndRead(size_t size, uint32_t parameter) { ReturnValue_t result = RETURN_OK; ReturnValue_t decResult = RETURN_OK; @@ -660,32 +553,6 @@ ReturnValue_t StrHelper::checkFlashActionReply(uint8_t region_, uint32_t address return RETURN_OK; } -ReturnValue_t StrHelper::checkFpgaActionReply(uint32_t expectedPosition, uint32_t expectedLength) { - ReturnValue_t result = RETURN_OK; - result = checkActionReply(); - if (result != RETURN_OK) { - return result; - } - const uint8_t* data = datalinkLayer.getReply() + ACTION_DATA_OFFSET; - uint32_t position; - size_t size = sizeof(position); - result = SerializeAdapter::deSerialize(&position, &data, &size, SerializeIF::Endianness::LITTLE); - if (result != RETURN_OK) { - sif::warning << "StrHelper::checkFpgaActionReply: Deserialization of position failed" - << std::endl; - return result; - } - uint32_t length; - size = sizeof(length); - result = SerializeAdapter::deSerialize(&length, &data, &size, SerializeIF::Endianness::LITTLE); - if (result != RETURN_OK) { - sif::warning << "StrHelper::checkFpgaActionReply: Deserialization of length failed" - << std::endl; - return result; - } - return result; -} - #ifdef XIPHOS_Q7S ReturnValue_t StrHelper::checkPath(std::string name) { if (name.substr(0, sizeof(SdCardManager::SD_0_MOUNT_POINT)) == @@ -718,15 +585,15 @@ void StrHelper::printProgress(uint32_t itemsTransferred, uint32_t fullNumItems) } ReturnValue_t StrHelper::unlockAndEraseRegions(uint32_t from, uint32_t to) { - using namespace startracker::region_secrets; + ReturnValue_t result = RETURN_OK; struct UnlockActionRequest unlockReq; struct EraseActionRequest eraseReq; uint32_t size = 0; for (uint8_t idx = from; idx <= to; idx++) { unlockReq.region = idx; - unlockReq.code = secret[idx]; - arc_pack_unlock_action_req(&req, commandBuffer, &size); - sendAndRead(size, req.region); + unlockReq.code = startracker::region_secrets::secret[idx]; + arc_pack_unlock_action_req(&unlockReq, commandBuffer, &size); + sendAndRead(size, unlockReq.region); result = checkActionReply(); if (result != RETURN_OK) { sif::warning << "StrHelper::unlockAndEraseRegions: Failed to unlock region with id " diff --git a/linux/devices/startracker/StrHelper.h b/linux/devices/startracker/StrHelper.h index 85ae0b49..e65ce782 100644 --- a/linux/devices/startracker/StrHelper.h +++ b/linux/devices/startracker/StrHelper.h @@ -24,11 +24,11 @@ extern "C" { /** * @brief Helper class for the star tracker handler to accelerate large data transfers. + * + * @author J. Meier */ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasReturnvaluesIF { - using namespace startracker; - public: static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::STR_HELPER; @@ -44,53 +44,43 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu static const Event FLASH_WRITE_SUCCESSFUL = MAKE_EVENT(4, severity::LOW); //! [EXPORT] : [COMMENT] Finished flash read procedure successfully static const Event FLASH_READ_SUCCESSFUL = MAKE_EVENT(5, severity::LOW); - //! [EXPORT] : [COMMENT] Flash write procedure failed - static const Event FLASH_WRITE_FAILED = MAKE_EVENT(6, severity::LOW); //! [EXPORT] : [COMMENT] Flash read procedure failed - static const Event FLASH_READ_FAILED = MAKE_EVENT(7, severity::LOW); - //! [EXPORT] : [COMMENT] Download of FPGA image successful - static const Event FPGA_DOWNLOAD_SUCCESSFUL = MAKE_EVENT(8, severity::LOW); - //! [EXPORT] : [COMMENT] Download of FPGA image failed - static const Event FPGA_DOWNLOAD_FAILED = MAKE_EVENT(9, severity::LOW); - //! [EXPORT] : [COMMENT] Upload of FPGA image successful - static const Event FPGA_UPLOAD_SUCCESSFUL = MAKE_EVENT(10, severity::LOW); - //! [EXPORT] : [COMMENT] Upload of FPGA image failed - static const Event FPGA_UPLOAD_FAILED = MAKE_EVENT(11, severity::LOW); + static const Event FLASH_READ_FAILED = MAKE_EVENT(6, severity::LOW); //! [EXPORT] : [COMMENT] Firmware update was successful - static const Event FIRMWARE_UPDATE_SUCCESSFUL = MAKE_EVENT(12, severity::LOW); + static const Event FIRMWARE_UPDATE_SUCCESSFUL = MAKE_EVENT(7, severity::LOW); //! [EXPORT] : [COMMENT] Firmware update failed - static const Event FIRMWARE_UPDATE_FAILED = MAKE_EVENT(13, severity::LOW); + static const Event FIRMWARE_UPDATE_FAILED = MAKE_EVENT(8, severity::LOW); //! [EXPORT] : [COMMENT] Failed to read communication interface reply data //! P1: Return code of failed communication interface read call //! P1: Upload/download position for which the read call failed - static const Event STR_HELPER_READING_REPLY_FAILED = MAKE_EVENT(14, severity::LOW); + static const Event STR_HELPER_READING_REPLY_FAILED = MAKE_EVENT(9, severity::LOW); //! [EXPORT] : [COMMENT] Unexpected stop of decoding sequence //! P1: Return code of failed communication interface read call //! P1: Upload/download position for which the read call failed - static const Event STR_HELPER_COM_ERROR = MAKE_EVENT(15, severity::LOW); + static const Event STR_HELPER_COM_ERROR = MAKE_EVENT(10, severity::LOW); //! [EXPORT] : [COMMENT] Star tracker did not send replies (maybe device is powered off) //! P1: Position of upload or download packet for which no reply was sent - static const Event STR_HELPER_NO_REPLY = MAKE_EVENT(16, severity::LOW); + static const Event STR_HELPER_NO_REPLY = MAKE_EVENT(11, severity::LOW); //! [EXPORT] : [COMMENT] Error during decoding of received reply occurred // P1: Return value of decoding function // P2: Position of upload/download packet, or address of flash write/read request - static const Event STR_HELPER_DEC_ERROR = MAKE_EVENT(17, severity::LOW); + static const Event STR_HELPER_DEC_ERROR = MAKE_EVENT(12, severity::LOW); //! [EXPORT] : [COMMENT] Position mismatch //! P1: The expected position and thus the position for which the image upload/download failed - static const Event POSITION_MISMATCH = MAKE_EVENT(18, severity::LOW); + static const Event POSITION_MISMATCH = MAKE_EVENT(13, severity::LOW); //! [EXPORT] : [COMMENT] Specified file does not exist //! P1: Internal state of str helper - static const Event STR_HELPER_FILE_NOT_EXISTS = MAKE_EVENT(19, severity::LOW); + static const Event STR_HELPER_FILE_NOT_EXISTS = MAKE_EVENT(14, severity::LOW); //! [EXPORT] : [COMMENT] Sending packet to star tracker failed //! P1: Return code of communication interface sendMessage function //! P2: Position of upload/download packet, or address of flash write/read request for which //! sending failed - static const Event STR_HELPER_SENDING_PACKET_FAILED = MAKE_EVENT(20, severity::LOW); + static const Event STR_HELPER_SENDING_PACKET_FAILED = MAKE_EVENT(15, severity::LOW); //! [EXPORT] : [COMMENT] Communication interface requesting reply failed //! P1: Return code of failed request //! P1: Upload/download position, or address of flash write/read request for which transmission //! failed - static const Event STR_HELPER_REQUESTING_MSG_FAILED = MAKE_EVENT(21, severity::LOW); + static const Event STR_HELPER_REQUESTING_MSG_FAILED = MAKE_EVENT(16, severity::LOW); StrHelper(object_id_t objectId); virtual ~StrHelper(); @@ -134,23 +124,6 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu */ ReturnValue_t startFlashRead(std::string path, uint8_t region, uint32_t address, uint32_t length); - /** - * @brief Starts the download of the FPGA image - * - * @param path The path where the file with the downloaded data will be created - * @param startPosition Offset in fpga image to read from - * @param length Number of bytes to dwonload from the FPGA image - * - */ - ReturnValue_t startFpgaDownload(std::string path, uint32_t startPosition, uint32_t length); - - /** - * @brief Starts upload of new image to FPGA - * - * @param uploadFile Full name of file containing FPGA image data - */ - ReturnValue_t startFpgaUpload(std::string uploadFile); - /** * @brief Can be used to interrupt a running data transfer. */ @@ -166,11 +139,6 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu */ void setFlashReadFilename(std::string filename); - /** - * @brief Set download FPGA image name - */ - void setDownloadFpgaImage(std::string filename); - private: static const uint8_t INTERFACE_ID = CLASS_ID::STR_HELPER; @@ -196,35 +164,13 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu // Size of one image part which can be sent per action request static const size_t SIZE_IMAGE_PART = 1024; static constexpr uint32_t FIVE_PERCENT = 5; + static const uint32_t FLASH_REGION_SIZE = 0x20000; class ImageDownload { public: static const uint32_t LAST_POSITION = 4095; }; - class FpgaDownload { - public: - static const uint16_t MAX_DATA = 1024; - static const uint8_t DATA_OFFSET = 10; - // Start position of fpga image part to download - uint32_t startPosition = 0; - // Length of image part to download - uint32_t length = 0; - // Path where downloaded FPGA image will be stored - std::string path; - // Name of file containing downloaded FPGA image - std::string fileName = "fpgaimage.bin"; - }; - FpgaDownload fpgaDownload; - - class FpgaUpload { - public: - static const uint32_t MAX_DATA = 1024; - // Full name of file to upload - std::string uploadFile; - }; - FpgaUpload fpgaUpload; - static const uint32_t MAX_POLLS = 10000; static const uint8_t ACTION_DATA_OFFSET = 2; @@ -234,18 +180,14 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu static const uint8_t REGION_OFFSET = 2; static const uint8_t ADDRESS_OFFSET = 3; static const uint8_t LENGTH_OFFSET = 7; - static const size_t IMAGE_DATA_SIZE = 1024; - static const size_t MAX_FLASH_DATA = 1024; + static const size_t CHUNK_SIZE = 1024; static const size_t CONFIG_MAX_DOWNLOAD_RETRIES = 3; enum class InternalState { IDLE, UPLOAD_IMAGE, DOWNLOAD_IMAGE, - FLASH_WRITE, FLASH_READ, - DOWNLOAD_FPGA_IMAGE, - UPLOAD_FPGA_IMAGE, FIRMWARE_UPDATE }; @@ -275,8 +217,10 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu public: // File which contains data to write when executing the flash write command std::string fullname; - // Section where to write to - uint8_t section = 0; + // The first region to write to + uint8_t firstRegion = 0; + // Maximum region the flash write command is allowed to write to + uint8_t lastRegion = 0; // Will be set with the flash write command and specifies the start address where to write the // flash data to uint32_t address = 0; @@ -325,6 +269,13 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu */ ReturnValue_t performImageUpload(); + /** + * @brief Performs firmware update + * + * @return RETURN_OK if successful, otherwise error return value + */ + ReturnValue_t performFirmwareUpdate(); + /** * @brief Performs download of last taken image from the star tracker. * @@ -338,6 +289,8 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu /** * @brief Handles flash write procedure * + * @param ID of first region to write to + * * @return RETURN_OK if successful, otherwise RETURN_FAILED */ ReturnValue_t performFlashWrite(); @@ -348,18 +301,6 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu */ ReturnValue_t performFlashRead(); - /** - * @brief Performs the download of the FPGA image which requires to be slip over multiple - * action requests. - */ - ReturnValue_t performFpgaDownload(); - - /** - * @brief Performs upload of new FPGA image. Upload sequence split over multiple commands - * because one command can only transport 1024 bytes of image data. - */ - ReturnValue_t performFpgaUpload(); - /** * @brief Sends packet to the star tracker and reads reply by using the communication * interface @@ -395,14 +336,6 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu */ ReturnValue_t checkFlashActionReply(uint8_t region_, uint32_t address_, uint16_t length_); - /** - * @brief Checks the reply to the fpga download and upload request - * - * @param expectedPosition The expected position value in the reply - * @param expectedLength The expected length field in the reply - */ - ReturnValue_t checkFpgaActionReply(uint32_t expectedPosition, uint32_t expectedLength); - #ifdef XIPHOS_Q7S /** * @brief Checks if a path points to an sd card and whether the SD card is monuted. @@ -427,7 +360,7 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu * @param to Last region in range to unlock * */ - ReturnValue_t unlockRegions(uint32_t from, uint32_t to); + ReturnValue_t unlockAndEraseRegions(uint32_t from, uint32_t to); }; #endif /* BSP_Q7S_DEVICES_STRHELPER_H_ */ diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 922892c8..117e264f 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 140 translations. + * @brief Auto-generated event translation file. Contains 137 translations. * @details - * Generated on: 2022-02-03 17:30:40 + * Generated on: 2022-02-13 15:31:27 */ #include "translateEvents.h" @@ -131,12 +131,9 @@ const char *IMAGE_UPLOAD_SUCCESSFUL_STRING = "IMAGE_UPLOAD_SUCCESSFUL"; const char *IMAGE_DOWNLOAD_SUCCESSFUL_STRING = "IMAGE_DOWNLOAD_SUCCESSFUL"; const char *FLASH_WRITE_SUCCESSFUL_STRING = "FLASH_WRITE_SUCCESSFUL"; const char *FLASH_READ_SUCCESSFUL_STRING = "FLASH_READ_SUCCESSFUL"; -const char *FLASH_WRITE_FAILED_STRING = "FLASH_WRITE_FAILED"; const char *FLASH_READ_FAILED_STRING = "FLASH_READ_FAILED"; -const char *FPGA_DOWNLOAD_SUCCESSFUL_STRING = "FPGA_DOWNLOAD_SUCCESSFUL"; -const char *FPGA_DOWNLOAD_FAILED_STRING = "FPGA_DOWNLOAD_FAILED"; -const char *FPGA_UPLOAD_SUCCESSFUL_STRING = "FPGA_UPLOAD_SUCCESSFUL"; -const char *FPGA_UPLOAD_FAILED_STRING = "FPGA_UPLOAD_FAILED"; +const char *FIRMWARE_UPDATE_SUCCESSFUL_STRING = "FIRMWARE_UPDATE_SUCCESSFUL"; +const char *FIRMWARE_UPDATE_FAILED_STRING = "FIRMWARE_UPDATE_FAILED"; const char *STR_HELPER_READING_REPLY_FAILED_STRING = "STR_HELPER_READING_REPLY_FAILED"; const char *STR_HELPER_COM_ERROR_STRING = "STR_HELPER_COM_ERROR"; const char *STR_HELPER_NO_REPLY_STRING = "STR_HELPER_NO_REPLY"; @@ -146,290 +143,284 @@ const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS"; const char *STR_HELPER_SENDING_PACKET_FAILED_STRING = "STR_HELPER_SENDING_PACKET_FAILED"; const char *STR_HELPER_REQUESTING_MSG_FAILED_STRING = "STR_HELPER_REQUESTING_MSG_FAILED"; -const char *translateEvents(Event event) { - switch ((event & 0xffff)) { - case (2200): - return STORE_SEND_WRITE_FAILED_STRING; - case (2201): - return STORE_WRITE_FAILED_STRING; - case (2202): - return STORE_SEND_READ_FAILED_STRING; - case (2203): - return STORE_READ_FAILED_STRING; - case (2204): - return UNEXPECTED_MSG_STRING; - case (2205): - return STORING_FAILED_STRING; - case (2206): - return TM_DUMP_FAILED_STRING; - case (2207): - return STORE_INIT_FAILED_STRING; - case (2208): - return STORE_INIT_EMPTY_STRING; - case (2209): - return STORE_CONTENT_CORRUPTED_STRING; - case (2210): - return STORE_INITIALIZE_STRING; - case (2211): - return INIT_DONE_STRING; - case (2212): - return DUMP_FINISHED_STRING; - case (2213): - return DELETION_FINISHED_STRING; - case (2214): - return DELETION_FAILED_STRING; - case (2215): - return AUTO_CATALOGS_SENDING_FAILED_STRING; - case (2600): - return GET_DATA_FAILED_STRING; - case (2601): - return STORE_DATA_FAILED_STRING; - case (2800): - return DEVICE_BUILDING_COMMAND_FAILED_STRING; - case (2801): - return DEVICE_SENDING_COMMAND_FAILED_STRING; - case (2802): - return DEVICE_REQUESTING_REPLY_FAILED_STRING; - case (2803): - return DEVICE_READING_REPLY_FAILED_STRING; - case (2804): - return DEVICE_INTERPRETING_REPLY_FAILED_STRING; - case (2805): - return DEVICE_MISSED_REPLY_STRING; - case (2806): - return DEVICE_UNKNOWN_REPLY_STRING; - case (2807): - return DEVICE_UNREQUESTED_REPLY_STRING; - case (2808): - return INVALID_DEVICE_COMMAND_STRING; - case (2809): - return MONITORING_LIMIT_EXCEEDED_STRING; - case (2810): - return MONITORING_AMBIGUOUS_STRING; - case (2811): - return DEVICE_WANTS_HARD_REBOOT_STRING; - case (4201): - return FUSE_CURRENT_HIGH_STRING; - case (4202): - return FUSE_WENT_OFF_STRING; - case (4204): - return POWER_ABOVE_HIGH_LIMIT_STRING; - case (4205): - return POWER_BELOW_LOW_LIMIT_STRING; - case (4300): - return SWITCH_WENT_OFF_STRING; - case (5000): - return HEATER_ON_STRING; - case (5001): - return HEATER_OFF_STRING; - case (5002): - return HEATER_TIMEOUT_STRING; - case (5003): - return HEATER_STAYED_ON_STRING; - case (5004): - return HEATER_STAYED_OFF_STRING; - case (5200): - return TEMP_SENSOR_HIGH_STRING; - case (5201): - return TEMP_SENSOR_LOW_STRING; - case (5202): - return TEMP_SENSOR_GRADIENT_STRING; - case (5901): - return COMPONENT_TEMP_LOW_STRING; - case (5902): - return COMPONENT_TEMP_HIGH_STRING; - case (5903): - return COMPONENT_TEMP_OOL_LOW_STRING; - case (5904): - return COMPONENT_TEMP_OOL_HIGH_STRING; - case (5905): - return TEMP_NOT_IN_OP_RANGE_STRING; - case (7101): - return FDIR_CHANGED_STATE_STRING; - case (7102): - return FDIR_STARTS_RECOVERY_STRING; - case (7103): - return FDIR_TURNS_OFF_DEVICE_STRING; - case (7201): - return MONITOR_CHANGED_STATE_STRING; - case (7202): - return VALUE_BELOW_LOW_LIMIT_STRING; - case (7203): - return VALUE_ABOVE_HIGH_LIMIT_STRING; - case (7204): - return VALUE_OUT_OF_RANGE_STRING; - case (7400): - return CHANGING_MODE_STRING; - case (7401): - return MODE_INFO_STRING; - case (7402): - return FALLBACK_FAILED_STRING; - case (7403): - return MODE_TRANSITION_FAILED_STRING; - case (7404): - return CANT_KEEP_MODE_STRING; - case (7405): - return OBJECT_IN_INVALID_MODE_STRING; - case (7406): - return FORCING_MODE_STRING; - case (7407): - return MODE_CMD_REJECTED_STRING; - case (7506): - return HEALTH_INFO_STRING; - case (7507): - return CHILD_CHANGED_HEALTH_STRING; - case (7508): - return CHILD_PROBLEMS_STRING; - case (7509): - return OVERWRITING_HEALTH_STRING; - case (7510): - return TRYING_RECOVERY_STRING; - case (7511): - return RECOVERY_STEP_STRING; - case (7512): - return RECOVERY_DONE_STRING; - case (7900): - return RF_AVAILABLE_STRING; - case (7901): - return RF_LOST_STRING; - case (7902): - return BIT_LOCK_STRING; - case (7903): - return BIT_LOCK_LOST_STRING; - case (7905): - return FRAME_PROCESSING_FAILED_STRING; - case (8900): - return CLOCK_SET_STRING; - case (8901): - return CLOCK_SET_FAILURE_STRING; - case (9700): - return TEST_STRING; - case (10600): - return CHANGE_OF_SETUP_PARAMETER_STRING; - case (10900): - return GPIO_PULL_HIGH_FAILED_STRING; - case (10901): - return GPIO_PULL_LOW_FAILED_STRING; - case (10902): - return SWITCH_ALREADY_ON_STRING; - case (10903): - return SWITCH_ALREADY_OFF_STRING; - case (10904): - return MAIN_SWITCH_TIMEOUT_STRING; - case (11000): - return MAIN_SWITCH_ON_TIMEOUT_STRING; - case (11001): - return MAIN_SWITCH_OFF_TIMEOUT_STRING; - case (11002): - return DEPLOYMENT_FAILED_STRING; - case (11003): - return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; - case (11004): - return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; - case (11101): - return MEMORY_READ_RPT_CRC_FAILURE_STRING; - case (11102): - return ACK_FAILURE_STRING; - case (11103): - return EXE_FAILURE_STRING; - case (11104): - return CRC_FAILURE_EVENT_STRING; - case (11201): - return SELF_TEST_I2C_FAILURE_STRING; - case (11202): - return SELF_TEST_SPI_FAILURE_STRING; - case (11203): - return SELF_TEST_ADC_FAILURE_STRING; - case (11204): - return SELF_TEST_PWM_FAILURE_STRING; - case (11205): - return SELF_TEST_TC_FAILURE_STRING; - case (11206): - return SELF_TEST_MTM_RANGE_FAILURE_STRING; - case (11207): - return SELF_TEST_COIL_CURRENT_FAILURE_STRING; - case (11208): - return INVALID_ERROR_BYTE_STRING; - case (11301): - return ERROR_STATE_STRING; - case (11501): - return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; - case (11502): - return SUPV_ACK_FAILURE_STRING; - case (11503): - return SUPV_EXE_FAILURE_STRING; - case (11504): - return SUPV_CRC_FAILURE_EVENT_STRING; - case (11600): - return SANITIZATION_FAILED_STRING; - case (11700): - return UPDATE_FILE_NOT_EXISTS_STRING; - case (11701): - return ACTION_COMMANDING_FAILED_STRING; - case (11702): - return UPDATE_AVAILABLE_FAILED_STRING; - case (11703): - return UPDATE_TRANSFER_FAILED_STRING; - case (11704): - return UPDATE_VERIFY_FAILED_STRING; - case (11705): - return UPDATE_FINISHED_STRING; - case (11800): - return SEND_MRAM_DUMP_FAILED_STRING; - case (11801): - return MRAM_DUMP_FAILED_STRING; - case (11802): - return MRAM_DUMP_FINISHED_STRING; - case (11901): - return INVALID_TC_FRAME_STRING; - case (11902): - return INVALID_FAR_STRING; - case (11903): - return CARRIER_LOCK_STRING; - case (11904): - return BIT_LOCK_PDEC_STRING; - case (12000): - return IMAGE_UPLOAD_FAILED_STRING; - case (12001): - return IMAGE_DOWNLOAD_FAILED_STRING; - case (12002): - return IMAGE_UPLOAD_SUCCESSFUL_STRING; - case (12003): - return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; - case (12004): - return FLASH_WRITE_SUCCESSFUL_STRING; - case (12005): - return FLASH_READ_SUCCESSFUL_STRING; - case (12006): - return FLASH_WRITE_FAILED_STRING; - case (12007): - return FLASH_READ_FAILED_STRING; - case (12008): - return FPGA_DOWNLOAD_SUCCESSFUL_STRING; - case (12009): - return FPGA_DOWNLOAD_FAILED_STRING; - case (12010): - return FPGA_UPLOAD_SUCCESSFUL_STRING; - case (12011): - return FPGA_UPLOAD_FAILED_STRING; - case (12012): - return STR_HELPER_READING_REPLY_FAILED_STRING; - case (12013): - return STR_HELPER_COM_ERROR_STRING; - case (12014): - return STR_HELPER_NO_REPLY_STRING; - case (12015): - return STR_HELPER_DEC_ERROR_STRING; - case (12016): - return POSITION_MISMATCH_STRING; - case (12017): - return STR_HELPER_FILE_NOT_EXISTS_STRING; - case (12018): - return STR_HELPER_SENDING_PACKET_FAILED_STRING; - case (12019): - return STR_HELPER_REQUESTING_MSG_FAILED_STRING; - default: - return "UNKNOWN_EVENT"; - } - return 0; +const char * translateEvents(Event event) { + switch( (event & 0xffff) ) { + case(2200): + return STORE_SEND_WRITE_FAILED_STRING; + case(2201): + return STORE_WRITE_FAILED_STRING; + case(2202): + return STORE_SEND_READ_FAILED_STRING; + case(2203): + return STORE_READ_FAILED_STRING; + case(2204): + return UNEXPECTED_MSG_STRING; + case(2205): + return STORING_FAILED_STRING; + case(2206): + return TM_DUMP_FAILED_STRING; + case(2207): + return STORE_INIT_FAILED_STRING; + case(2208): + return STORE_INIT_EMPTY_STRING; + case(2209): + return STORE_CONTENT_CORRUPTED_STRING; + case(2210): + return STORE_INITIALIZE_STRING; + case(2211): + return INIT_DONE_STRING; + case(2212): + return DUMP_FINISHED_STRING; + case(2213): + return DELETION_FINISHED_STRING; + case(2214): + return DELETION_FAILED_STRING; + case(2215): + return AUTO_CATALOGS_SENDING_FAILED_STRING; + case(2600): + return GET_DATA_FAILED_STRING; + case(2601): + return STORE_DATA_FAILED_STRING; + case(2800): + return DEVICE_BUILDING_COMMAND_FAILED_STRING; + case(2801): + return DEVICE_SENDING_COMMAND_FAILED_STRING; + case(2802): + return DEVICE_REQUESTING_REPLY_FAILED_STRING; + case(2803): + return DEVICE_READING_REPLY_FAILED_STRING; + case(2804): + return DEVICE_INTERPRETING_REPLY_FAILED_STRING; + case(2805): + return DEVICE_MISSED_REPLY_STRING; + case(2806): + return DEVICE_UNKNOWN_REPLY_STRING; + case(2807): + return DEVICE_UNREQUESTED_REPLY_STRING; + case(2808): + return INVALID_DEVICE_COMMAND_STRING; + case(2809): + return MONITORING_LIMIT_EXCEEDED_STRING; + case(2810): + return MONITORING_AMBIGUOUS_STRING; + case(2811): + return DEVICE_WANTS_HARD_REBOOT_STRING; + case(4201): + return FUSE_CURRENT_HIGH_STRING; + case(4202): + return FUSE_WENT_OFF_STRING; + case(4204): + return POWER_ABOVE_HIGH_LIMIT_STRING; + case(4205): + return POWER_BELOW_LOW_LIMIT_STRING; + case(4300): + return SWITCH_WENT_OFF_STRING; + case(5000): + return HEATER_ON_STRING; + case(5001): + return HEATER_OFF_STRING; + case(5002): + return HEATER_TIMEOUT_STRING; + case(5003): + return HEATER_STAYED_ON_STRING; + case(5004): + return HEATER_STAYED_OFF_STRING; + case(5200): + return TEMP_SENSOR_HIGH_STRING; + case(5201): + return TEMP_SENSOR_LOW_STRING; + case(5202): + return TEMP_SENSOR_GRADIENT_STRING; + case(5901): + return COMPONENT_TEMP_LOW_STRING; + case(5902): + return COMPONENT_TEMP_HIGH_STRING; + case(5903): + return COMPONENT_TEMP_OOL_LOW_STRING; + case(5904): + return COMPONENT_TEMP_OOL_HIGH_STRING; + case(5905): + return TEMP_NOT_IN_OP_RANGE_STRING; + case(7101): + return FDIR_CHANGED_STATE_STRING; + case(7102): + return FDIR_STARTS_RECOVERY_STRING; + case(7103): + return FDIR_TURNS_OFF_DEVICE_STRING; + case(7201): + return MONITOR_CHANGED_STATE_STRING; + case(7202): + return VALUE_BELOW_LOW_LIMIT_STRING; + case(7203): + return VALUE_ABOVE_HIGH_LIMIT_STRING; + case(7204): + return VALUE_OUT_OF_RANGE_STRING; + case(7400): + return CHANGING_MODE_STRING; + case(7401): + return MODE_INFO_STRING; + case(7402): + return FALLBACK_FAILED_STRING; + case(7403): + return MODE_TRANSITION_FAILED_STRING; + case(7404): + return CANT_KEEP_MODE_STRING; + case(7405): + return OBJECT_IN_INVALID_MODE_STRING; + case(7406): + return FORCING_MODE_STRING; + case(7407): + return MODE_CMD_REJECTED_STRING; + case(7506): + return HEALTH_INFO_STRING; + case(7507): + return CHILD_CHANGED_HEALTH_STRING; + case(7508): + return CHILD_PROBLEMS_STRING; + case(7509): + return OVERWRITING_HEALTH_STRING; + case(7510): + return TRYING_RECOVERY_STRING; + case(7511): + return RECOVERY_STEP_STRING; + case(7512): + return RECOVERY_DONE_STRING; + case(7900): + return RF_AVAILABLE_STRING; + case(7901): + return RF_LOST_STRING; + case(7902): + return BIT_LOCK_STRING; + case(7903): + return BIT_LOCK_LOST_STRING; + case(7905): + return FRAME_PROCESSING_FAILED_STRING; + case(8900): + return CLOCK_SET_STRING; + case(8901): + return CLOCK_SET_FAILURE_STRING; + case(9700): + return TEST_STRING; + case(10600): + return CHANGE_OF_SETUP_PARAMETER_STRING; + case(10900): + return GPIO_PULL_HIGH_FAILED_STRING; + case(10901): + return GPIO_PULL_LOW_FAILED_STRING; + case(10902): + return SWITCH_ALREADY_ON_STRING; + case(10903): + return SWITCH_ALREADY_OFF_STRING; + case(10904): + return MAIN_SWITCH_TIMEOUT_STRING; + case(11000): + return MAIN_SWITCH_ON_TIMEOUT_STRING; + case(11001): + return MAIN_SWITCH_OFF_TIMEOUT_STRING; + case(11002): + return DEPLOYMENT_FAILED_STRING; + case(11003): + return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; + case(11004): + return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; + case(11101): + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case(11102): + return ACK_FAILURE_STRING; + case(11103): + return EXE_FAILURE_STRING; + case(11104): + return CRC_FAILURE_EVENT_STRING; + case(11201): + return SELF_TEST_I2C_FAILURE_STRING; + case(11202): + return SELF_TEST_SPI_FAILURE_STRING; + case(11203): + return SELF_TEST_ADC_FAILURE_STRING; + case(11204): + return SELF_TEST_PWM_FAILURE_STRING; + case(11205): + return SELF_TEST_TC_FAILURE_STRING; + case(11206): + return SELF_TEST_MTM_RANGE_FAILURE_STRING; + case(11207): + return SELF_TEST_COIL_CURRENT_FAILURE_STRING; + case(11208): + return INVALID_ERROR_BYTE_STRING; + case(11301): + return ERROR_STATE_STRING; + case(11501): + return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; + case(11502): + return SUPV_ACK_FAILURE_STRING; + case(11503): + return SUPV_EXE_FAILURE_STRING; + case(11504): + return SUPV_CRC_FAILURE_EVENT_STRING; + case(11600): + return SANITIZATION_FAILED_STRING; + case(11700): + return UPDATE_FILE_NOT_EXISTS_STRING; + case(11701): + return ACTION_COMMANDING_FAILED_STRING; + case(11702): + return UPDATE_AVAILABLE_FAILED_STRING; + case(11703): + return UPDATE_TRANSFER_FAILED_STRING; + case(11704): + return UPDATE_VERIFY_FAILED_STRING; + case(11705): + return UPDATE_FINISHED_STRING; + case(11800): + return SEND_MRAM_DUMP_FAILED_STRING; + case(11801): + return MRAM_DUMP_FAILED_STRING; + case(11802): + return MRAM_DUMP_FINISHED_STRING; + case(11901): + return INVALID_TC_FRAME_STRING; + case(11902): + return INVALID_FAR_STRING; + case(11903): + return CARRIER_LOCK_STRING; + case(11904): + return BIT_LOCK_PDEC_STRING; + case(12000): + return IMAGE_UPLOAD_FAILED_STRING; + case(12001): + return IMAGE_DOWNLOAD_FAILED_STRING; + case(12002): + return IMAGE_UPLOAD_SUCCESSFUL_STRING; + case(12003): + return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; + case(12004): + return FLASH_WRITE_SUCCESSFUL_STRING; + case(12005): + return FLASH_READ_SUCCESSFUL_STRING; + case(12006): + return FLASH_READ_FAILED_STRING; + case(12007): + return FIRMWARE_UPDATE_SUCCESSFUL_STRING; + case(12008): + return FIRMWARE_UPDATE_FAILED_STRING; + case(12009): + return STR_HELPER_READING_REPLY_FAILED_STRING; + case(12010): + return STR_HELPER_COM_ERROR_STRING; + case(12011): + return STR_HELPER_NO_REPLY_STRING; + case(12012): + return STR_HELPER_DEC_ERROR_STRING; + case(12013): + return POSITION_MISMATCH_STRING; + case(12014): + return STR_HELPER_FILE_NOT_EXISTS_STRING; + case(12015): + return STR_HELPER_SENDING_PACKET_FAILED_STRING; + case(12016): + return STR_HELPER_REQUESTING_MSG_FAILED_STRING; + default: + return "UNKNOWN_EVENT"; + } + return 0; } diff --git a/linux/fsfwconfig/events/translateEvents.h b/linux/fsfwconfig/events/translateEvents.h index 1b8a8831..bdabb21b 100644 --- a/linux/fsfwconfig/events/translateEvents.h +++ b/linux/fsfwconfig/events/translateEvents.h @@ -3,6 +3,6 @@ #include "fsfw/events/Event.h" -const char* translateEvents(Event event); +const char * translateEvents(Event event); #endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */ diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 08e6e126..2400e1d8 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 110 translations. - * Generated on: 2022-02-03 12:01:36 + * Contains 111 translations. + * Generated on: 2022-02-13 15:31:32 */ #include "translateObjects.h" @@ -109,6 +109,7 @@ const char *TIME_STAMPER_STRING = "TIME_STAMPER"; const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; const char *SPI_TEST_STRING = "SPI_TEST"; const char *UART_TEST_STRING = "UART_TEST"; +const char *I2C_TEST_STRING = "I2C_TEST"; const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST"; @@ -117,230 +118,232 @@ const char *TM_FUNNEL_STRING = "TM_FUNNEL"; const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE"; const char *NO_OBJECT_STRING = "NO_OBJECT"; -const char *translateObject(object_id_t object) { - switch ((object & 0xFFFFFFFF)) { - case 0x00005060: - return P60DOCK_TEST_TASK_STRING; - case 0x43000003: - return CORE_CONTROLLER_STRING; - case 0x43100002: - return ACS_CONTROLLER_STRING; - case 0x43400001: - return THERMAL_CONTROLLER_STRING; - case 0x44120006: - return MGM_0_LIS3_HANDLER_STRING; - case 0x44120010: - return GYRO_0_ADIS_HANDLER_STRING; - case 0x44120032: - return SUS_1_STRING; - case 0x44120033: - return SUS_2_STRING; - case 0x44120034: - return SUS_3_STRING; - case 0x44120035: - return SUS_4_STRING; - case 0x44120036: - return SUS_5_STRING; - case 0x44120037: - return SUS_6_STRING; - case 0x44120038: - return SUS_7_STRING; - case 0x44120039: - return SUS_8_STRING; - case 0x44120040: - return SUS_9_STRING; - case 0x44120041: - return SUS_10_STRING; - case 0x44120042: - return SUS_11_STRING; - case 0x44120043: - return SUS_12_STRING; - case 0x44120044: - return SUS_13_STRING; - case 0x44120047: - return RW1_STRING; - case 0x44120107: - return MGM_1_RM3100_HANDLER_STRING; - case 0x44120111: - return GYRO_1_L3G_HANDLER_STRING; - case 0x44120148: - return RW2_STRING; - case 0x44120208: - return MGM_2_LIS3_HANDLER_STRING; - case 0x44120212: - return GYRO_2_ADIS_HANDLER_STRING; - case 0x44120249: - return RW3_STRING; - case 0x44120309: - return MGM_3_RM3100_HANDLER_STRING; - case 0x44120313: - return GYRO_3_L3G_HANDLER_STRING; - case 0x44120350: - return RW4_STRING; - case 0x44130001: - return STAR_TRACKER_STRING; - case 0x44130045: - return GPS_CONTROLLER_STRING; - case 0x44140014: - return IMTQ_HANDLER_STRING; - case 0x442000A1: - return PCDU_HANDLER_STRING; - case 0x44250000: - return P60DOCK_HANDLER_STRING; - case 0x44250001: - return PDU1_HANDLER_STRING; - case 0x44250002: - return PDU2_HANDLER_STRING; - case 0x44250003: - return ACU_HANDLER_STRING; - case 0x44260000: - return BPX_BATT_HANDLER_STRING; - case 0x443200A5: - return RAD_SENSOR_STRING; - case 0x44330000: - return PLOC_UPDATER_STRING; - case 0x44330001: - return PLOC_MEMORY_DUMPER_STRING; - case 0x44330002: - return STR_HELPER_STRING; - case 0x44330015: - return PLOC_MPSOC_HANDLER_STRING; - case 0x44330016: - return PLOC_SUPERVISOR_HANDLER_STRING; - case 0x444100A2: - return SOLAR_ARRAY_DEPL_HANDLER_STRING; - case 0x444100A4: - return HEATER_HANDLER_STRING; - case 0x44420004: - return TMP1075_HANDLER_1_STRING; - case 0x44420005: - return TMP1075_HANDLER_2_STRING; - case 0x44420016: - return RTD_IC_3_STRING; - case 0x44420017: - return RTD_IC_4_STRING; - case 0x44420018: - return RTD_IC_5_STRING; - case 0x44420019: - return RTD_IC_6_STRING; - case 0x44420020: - return RTD_IC_7_STRING; - case 0x44420021: - return RTD_IC_8_STRING; - case 0x44420022: - return RTD_IC_9_STRING; - case 0x44420023: - return RTD_IC_10_STRING; - case 0x44420024: - return RTD_IC_11_STRING; - case 0x44420025: - return RTD_IC_12_STRING; - case 0x44420026: - return RTD_IC_13_STRING; - case 0x44420027: - return RTD_IC_14_STRING; - case 0x44420028: - return RTD_IC_15_STRING; - case 0x44420029: - return RTD_IC_16_STRING; - case 0x44420030: - return RTD_IC_17_STRING; - case 0x44420031: - return RTD_IC_18_STRING; - case 0x445300A3: - return SYRLINKS_HK_HANDLER_STRING; - case 0x49000000: - return ARDUINO_COM_IF_STRING; - case 0x49010005: - return GPIO_IF_STRING; - case 0x49020004: - return SPI_COM_IF_STRING; - case 0x49030003: - return UART_COM_IF_STRING; - case 0x49040002: - return I2C_COM_IF_STRING; - case 0x49050001: - return CSP_COM_IF_STRING; - case 0x50000100: - return CCSDS_PACKET_DISTRIBUTOR_STRING; - case 0x50000200: - return PUS_PACKET_DISTRIBUTOR_STRING; - case 0x50000300: - return TMTC_BRIDGE_STRING; - case 0x50000400: - return TMTC_POLLING_TASK_STRING; - case 0x50000500: - return FILE_SYSTEM_HANDLER_STRING; - case 0x50000600: - return PTME_STRING; - case 0x50000700: - return PDEC_HANDLER_STRING; - case 0x50000800: - return CCSDS_HANDLER_STRING; - case 0x51000500: - return PUS_SERVICE_6_STRING; - case 0x53000000: - return FSFW_OBJECTS_START_STRING; - case 0x53000001: - return PUS_SERVICE_1_VERIFICATION_STRING; - case 0x53000002: - return PUS_SERVICE_2_DEVICE_ACCESS_STRING; - case 0x53000003: - return PUS_SERVICE_3_HOUSEKEEPING_STRING; - case 0x53000005: - return PUS_SERVICE_5_EVENT_REPORTING_STRING; - case 0x53000008: - return PUS_SERVICE_8_FUNCTION_MGMT_STRING; - case 0x53000009: - return PUS_SERVICE_9_TIME_MGMT_STRING; - case 0x53000017: - return PUS_SERVICE_17_TEST_STRING; - case 0x53000020: - return PUS_SERVICE_20_PARAMETERS_STRING; - case 0x53000200: - return PUS_SERVICE_200_MODE_MGMT_STRING; - case 0x53000201: - return PUS_SERVICE_201_HEALTH_STRING; - case 0x53001000: - return CFDP_PACKET_DISTRIBUTOR_STRING; - case 0x53010000: - return HEALTH_TABLE_STRING; - case 0x53010100: - return MODE_STORE_STRING; - case 0x53030000: - return EVENT_MANAGER_STRING; - case 0x53040000: - return INTERNAL_ERROR_REPORTER_STRING; - case 0x534f0100: - return TC_STORE_STRING; - case 0x534f0200: - return TM_STORE_STRING; - case 0x534f0300: - return IPC_STORE_STRING; - case 0x53500010: - return TIME_STAMPER_STRING; - case 0x53ffffff: - return FSFW_OBJECTS_END_STRING; - case 0x54000010: - return SPI_TEST_STRING; - case 0x54000020: - return UART_TEST_STRING; - case 0x5400AFFE: - return DUMMY_HANDLER_STRING; - case 0x5400CAFE: - return DUMMY_INTERFACE_STRING; - case 0x54123456: - return LIBGPIOD_TEST_STRING; - case 0x54694269: - return TEST_TASK_STRING; - case 0x73000100: - return TM_FUNNEL_STRING; - case 0x73500000: - return CCSDS_IP_CORE_BRIDGE_STRING; - case 0xFFFFFFFF: - return NO_OBJECT_STRING; - default: - return "UNKNOWN_OBJECT"; - } - return 0; +const char* translateObject(object_id_t object) { + switch( (object & 0xFFFFFFFF) ) { + case 0x00005060: + return P60DOCK_TEST_TASK_STRING; + case 0x43000003: + return CORE_CONTROLLER_STRING; + case 0x43100002: + return ACS_CONTROLLER_STRING; + case 0x43400001: + return THERMAL_CONTROLLER_STRING; + case 0x44120006: + return MGM_0_LIS3_HANDLER_STRING; + case 0x44120010: + return GYRO_0_ADIS_HANDLER_STRING; + case 0x44120032: + return SUS_1_STRING; + case 0x44120033: + return SUS_2_STRING; + case 0x44120034: + return SUS_3_STRING; + case 0x44120035: + return SUS_4_STRING; + case 0x44120036: + return SUS_5_STRING; + case 0x44120037: + return SUS_6_STRING; + case 0x44120038: + return SUS_7_STRING; + case 0x44120039: + return SUS_8_STRING; + case 0x44120040: + return SUS_9_STRING; + case 0x44120041: + return SUS_10_STRING; + case 0x44120042: + return SUS_11_STRING; + case 0x44120043: + return SUS_12_STRING; + case 0x44120044: + return SUS_13_STRING; + case 0x44120047: + return RW1_STRING; + case 0x44120107: + return MGM_1_RM3100_HANDLER_STRING; + case 0x44120111: + return GYRO_1_L3G_HANDLER_STRING; + case 0x44120148: + return RW2_STRING; + case 0x44120208: + return MGM_2_LIS3_HANDLER_STRING; + case 0x44120212: + return GYRO_2_ADIS_HANDLER_STRING; + case 0x44120249: + return RW3_STRING; + case 0x44120309: + return MGM_3_RM3100_HANDLER_STRING; + case 0x44120313: + return GYRO_3_L3G_HANDLER_STRING; + case 0x44120350: + return RW4_STRING; + case 0x44130001: + return STAR_TRACKER_STRING; + case 0x44130045: + return GPS_CONTROLLER_STRING; + case 0x44140014: + return IMTQ_HANDLER_STRING; + case 0x442000A1: + return PCDU_HANDLER_STRING; + case 0x44250000: + return P60DOCK_HANDLER_STRING; + case 0x44250001: + return PDU1_HANDLER_STRING; + case 0x44250002: + return PDU2_HANDLER_STRING; + case 0x44250003: + return ACU_HANDLER_STRING; + case 0x44260000: + return BPX_BATT_HANDLER_STRING; + case 0x443200A5: + return RAD_SENSOR_STRING; + case 0x44330000: + return PLOC_UPDATER_STRING; + case 0x44330001: + return PLOC_MEMORY_DUMPER_STRING; + case 0x44330002: + return STR_HELPER_STRING; + case 0x44330015: + return PLOC_MPSOC_HANDLER_STRING; + case 0x44330016: + return PLOC_SUPERVISOR_HANDLER_STRING; + case 0x444100A2: + return SOLAR_ARRAY_DEPL_HANDLER_STRING; + case 0x444100A4: + return HEATER_HANDLER_STRING; + case 0x44420004: + return TMP1075_HANDLER_1_STRING; + case 0x44420005: + return TMP1075_HANDLER_2_STRING; + case 0x44420016: + return RTD_IC_3_STRING; + case 0x44420017: + return RTD_IC_4_STRING; + case 0x44420018: + return RTD_IC_5_STRING; + case 0x44420019: + return RTD_IC_6_STRING; + case 0x44420020: + return RTD_IC_7_STRING; + case 0x44420021: + return RTD_IC_8_STRING; + case 0x44420022: + return RTD_IC_9_STRING; + case 0x44420023: + return RTD_IC_10_STRING; + case 0x44420024: + return RTD_IC_11_STRING; + case 0x44420025: + return RTD_IC_12_STRING; + case 0x44420026: + return RTD_IC_13_STRING; + case 0x44420027: + return RTD_IC_14_STRING; + case 0x44420028: + return RTD_IC_15_STRING; + case 0x44420029: + return RTD_IC_16_STRING; + case 0x44420030: + return RTD_IC_17_STRING; + case 0x44420031: + return RTD_IC_18_STRING; + case 0x445300A3: + return SYRLINKS_HK_HANDLER_STRING; + case 0x49000000: + return ARDUINO_COM_IF_STRING; + case 0x49010005: + return GPIO_IF_STRING; + case 0x49020004: + return SPI_COM_IF_STRING; + case 0x49030003: + return UART_COM_IF_STRING; + case 0x49040002: + return I2C_COM_IF_STRING; + case 0x49050001: + return CSP_COM_IF_STRING; + case 0x50000100: + return CCSDS_PACKET_DISTRIBUTOR_STRING; + case 0x50000200: + return PUS_PACKET_DISTRIBUTOR_STRING; + case 0x50000300: + return TMTC_BRIDGE_STRING; + case 0x50000400: + return TMTC_POLLING_TASK_STRING; + case 0x50000500: + return FILE_SYSTEM_HANDLER_STRING; + case 0x50000600: + return PTME_STRING; + case 0x50000700: + return PDEC_HANDLER_STRING; + case 0x50000800: + return CCSDS_HANDLER_STRING; + case 0x51000500: + return PUS_SERVICE_6_STRING; + case 0x53000000: + return FSFW_OBJECTS_START_STRING; + case 0x53000001: + return PUS_SERVICE_1_VERIFICATION_STRING; + case 0x53000002: + return PUS_SERVICE_2_DEVICE_ACCESS_STRING; + case 0x53000003: + return PUS_SERVICE_3_HOUSEKEEPING_STRING; + case 0x53000005: + return PUS_SERVICE_5_EVENT_REPORTING_STRING; + case 0x53000008: + return PUS_SERVICE_8_FUNCTION_MGMT_STRING; + case 0x53000009: + return PUS_SERVICE_9_TIME_MGMT_STRING; + case 0x53000017: + return PUS_SERVICE_17_TEST_STRING; + case 0x53000020: + return PUS_SERVICE_20_PARAMETERS_STRING; + case 0x53000200: + return PUS_SERVICE_200_MODE_MGMT_STRING; + case 0x53000201: + return PUS_SERVICE_201_HEALTH_STRING; + case 0x53001000: + return CFDP_PACKET_DISTRIBUTOR_STRING; + case 0x53010000: + return HEALTH_TABLE_STRING; + case 0x53010100: + return MODE_STORE_STRING; + case 0x53030000: + return EVENT_MANAGER_STRING; + case 0x53040000: + return INTERNAL_ERROR_REPORTER_STRING; + case 0x534f0100: + return TC_STORE_STRING; + case 0x534f0200: + return TM_STORE_STRING; + case 0x534f0300: + return IPC_STORE_STRING; + case 0x53500010: + return TIME_STAMPER_STRING; + case 0x53ffffff: + return FSFW_OBJECTS_END_STRING; + case 0x54000010: + return SPI_TEST_STRING; + case 0x54000020: + return UART_TEST_STRING; + case 0x54000030: + return I2C_TEST_STRING; + case 0x5400AFFE: + return DUMMY_HANDLER_STRING; + case 0x5400CAFE: + return DUMMY_INTERFACE_STRING; + case 0x54123456: + return LIBGPIOD_TEST_STRING; + case 0x54694269: + return TEST_TASK_STRING; + case 0x73000100: + return TM_FUNNEL_STRING; + case 0x73500000: + return CCSDS_IP_CORE_BRIDGE_STRING; + case 0xFFFFFFFF: + return NO_OBJECT_STRING; + default: + return "UNKNOWN_OBJECT"; + } + return 0; } diff --git a/tmtc b/tmtc index 5d8b9aac..f1542990 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 5d8b9aac1fea707015bd991b865da7f3405859e8 +Subproject commit f15429906931de519bda712efd8025ae7de12248 From 88a9f8f8deb6841cd39a01e418997caf25ad7e41 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Mon, 14 Feb 2022 16:42:04 +0100 Subject: [PATCH 32/61] introduced current program check --- README.md | 2 + .../startracker/StarTrackerHandler.cpp | 71 ++++++++++--------- .../devices/startracker/StarTrackerHandler.h | 3 + 3 files changed, 41 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 7acc6342..8a588aab 100644 --- a/README.md +++ b/README.md @@ -1145,6 +1145,8 @@ Password: raspberry To run the obsw perform the following steps: 1. Build the cmake EGSE Configuration * the sysroots for the EGSE can be found [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/egse&fileid=1190471) + * toolchain for linux host can be downloaded from [here](https://github.com/Pro/raspi-toolchain) + * toolchain for windows host from [here](https://gnutoolchains.com/raspberry/) (the raspios-buster-armhf toolchain is the right one for the EGSE) 2. Disable the ser2net systemd service on the EGSE ````sh $ sudo systemctl stop ser2net.service diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index 5dde524b..7cf857d7 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -130,7 +130,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu result = checkCommand(actionId); if (result != RETURN_OK) { - return result; + return result; } // Intercept image loader commands which do not follow the common DHB communication flow @@ -241,11 +241,11 @@ void StarTrackerHandler::doStartUp() { } return; case StartupState::FAILED_FIRMWARE_BOOT: - startupState = StartupState::IDLE; - // Though the star tracker failed to boot the firmware the device handler will go to - // mode on. In bootloader mode the star tracker is still on and can e.g. perform firmware - // updates. - break; + startupState = StartupState::IDLE; + // Though the star tracker failed to boot the firmware the device handler will go to + // mode on. In bootloader mode the star tracker is still on and can e.g. perform firmware + // updates. + break; case StartupState::DONE: startupState = StartupState::IDLE; break; @@ -267,7 +267,7 @@ void StarTrackerHandler::doOffActivity() { startupState = StartupState::IDLE; } ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { if (!bootCountdown.hasTimedOut()) { - return NOTHING_TO_SEND; + return NOTHING_TO_SEND; } switch (internalState) { case InternalState::CHECK_PROGRAM: @@ -1761,13 +1761,15 @@ ReturnValue_t StarTrackerHandler::prepareUploadCentroidCommand(const uint8_t* co result = j.getValue(startracker::UploadCentroidKeys::x_uncorrected, &req.x_uncorrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startracker::UploadCentroidKeys::x_uncorrected << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::x_uncorrected << " does not exist" + << std::endl; return result; } result = j.getValue(startracker::UploadCentroidKeys::y_uncorrected, &req.y_uncorrected); if (result != RETURN_OK) { sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key " - << startracker::UploadCentroidKeys::y_uncorrected << " does not exist" << std::endl; + << startracker::UploadCentroidKeys::y_uncorrected << " does not exist" + << std::endl; return result; } result = j.getValue(startracker::UploadCentroidKeys::x_corrected, &req.x_corrected); @@ -2271,17 +2273,16 @@ ReturnValue_t StarTrackerHandler::checkProgram() { // firmware program currentProgram = startracker::Program::BOOTLOADER; if (startupState == StartupState::STARTUP_CHECK) { - startupState = StartupState::BOOT; + startupState = StartupState::BOOT; + } else if (startupState == StartupState::FIRMWARE_CHECK) { + startupState = StartupState::FAILED_FIRMWARE_BOOT; } - else if (startupState == StartupState::FIRMWARE_CHECK) { - startupState = StartupState::FAILED_FIRMWARE_BOOT; - } - if (internalState == InternalState::CHECK_PROGRAM){ - // Firmware boot failed when trying to switch to normal mode - internalState = InternalState::IDLE; - sif::warning << "StarTrackerHandler::checkProgram: Failed to boot firmware when " - << "trying to switch to normal mode" << std::endl; - setMode(_MODE_TO_ON); + if (internalState == InternalState::CHECK_PROGRAM) { + // Firmware boot failed when trying to switch to normal mode + internalState = InternalState::IDLE; + sif::warning << "StarTrackerHandler::checkProgram: Failed to boot firmware when " + << "trying to switch to normal mode" << std::endl; + setMode(_MODE_TO_ON); } break; case startracker::Program::FIRMWARE: @@ -2425,12 +2426,12 @@ void StarTrackerHandler::handleStartup(const uint8_t* parameterId) { } ReturnValue_t StarTrackerHandler::checkCommand(ActionId_t actionId) { - switch(actionId) { + switch (actionId) { case startracker::BOOT: - if (currentProgram != startracker::Program::BOOTLOADER) { - return STARTRACKER_ALREADY_BOOTED; - } - break; + if (currentProgram != startracker::Program::BOOTLOADER) { + return STARTRACKER_ALREADY_BOOTED; + } + break; case startracker::REQ_INTERFACE: case startracker::REQ_TIME: case startracker::SWITCH_TO_BOOTLOADER_PROGRAM: @@ -2447,17 +2448,17 @@ ReturnValue_t StarTrackerHandler::checkCommand(ActionId_t actionId) { case startracker::DOWNLOAD_MATCHED_STAR: case startracker::DOWNLOAD_DBIMAGE: case startracker::DOWNLOAD_BLOBPIXEL: - if (currentProgram != startracker::Program::FIRMWARE) { - return STARTRACKER_RUNNING_BOOTLOADER; - } - break; + if (currentProgram != startracker::Program::FIRMWARE) { + return STARTRACKER_RUNNING_BOOTLOADER; + } + break; case startracker::FIRMWARE_UPDATE: - if (currentProgram != startracker::Program::BOOTLOADER) { - return STARTRACKER_RUNNING_FIRMWARE; - } - break; + if (currentProgram != startracker::Program::BOOTLOADER) { + return STARTRACKER_RUNNING_FIRMWARE; + } + break; default: - break; - } - return RETURN_OK; + break; + } + return RETURN_OK; } diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index dc140015..3a078b51 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -48,6 +48,9 @@ class StarTrackerHandler : public DeviceHandlerBase { void performOperationHook() override; + static const Submode_t SUBMODE_BOOTLOADER = 0; + static const Submode_t SUBMODE_FIRMWARE = 1; + protected: void doStartUp() override; void doShutDown() override; From 583ab285d8ed910f12622a9134a7150c597a8642 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Mon, 14 Feb 2022 16:53:01 +0100 Subject: [PATCH 33/61] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index f1542990..0a8a2fb9 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit f15429906931de519bda712efd8025ae7de12248 +Subproject commit 0a8a2fb9c6833f2e1d89dabaf4c06bd79190fb50 From b722b15b26d79069a8c5c0d544b8a5e53f261a07 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Wed, 16 Feb 2022 15:06:02 +0100 Subject: [PATCH 34/61] changed target name for egse bsp --- bsp_egse/CMakeLists.txt | 2 +- bsp_egse/boardconfig/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bsp_egse/CMakeLists.txt b/bsp_egse/CMakeLists.txt index a8bf5c4f..cb02f937 100644 --- a/bsp_egse/CMakeLists.txt +++ b/bsp_egse/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PUBLIC +target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp diff --git a/bsp_egse/boardconfig/CMakeLists.txt b/bsp_egse/boardconfig/CMakeLists.txt index 67fbaf88..f9136e3e 100644 --- a/bsp_egse/boardconfig/CMakeLists.txt +++ b/bsp_egse/boardconfig/CMakeLists.txt @@ -1,7 +1,7 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE print.c ) -target_include_directories(${TARGET_NAME} PUBLIC +target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) From b10bf2c68dc0c085c0e8d7148c9ae5e98584806d Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Mon, 21 Feb 2022 10:03:49 +0100 Subject: [PATCH 35/61] introduced bootloader and firmware submodes --- .../startracker/StarTrackerHandler.cpp | 24 +++++++++++++++++++ .../devices/startracker/StarTrackerHandler.h | 5 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index 7cf857d7..caf9ebdc 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -713,6 +713,30 @@ void StarTrackerHandler::fillCommandAndReplyMap() { startracker::MAX_FRAME_SIZE * 2 + 2); } +ReturnValue_t StarTrackerHandler::isModeCombinationValid(Mode_t mode, Submode_t submode) { + if (this->mode == MODE_NORMAL && mode == MODE_ON) { + return TRANS_NOT_ALLOWED; + } + switch (mode) { + case MODE_OFF: + case MODE_NORMAL: + case MODE_RAW: + if (submode == SUBMODE_NONE) { + return RETURN_OK; + } else { + return INVALID_SUBMODE; + } + case MODE_ON: + if (submode == SUBMODE_BOOTLOADER || submode == SUBMODE_FIRMWARE || submode == SUBMODE_NONE) { + return RETURN_OK; + } else { + return INVALID_SUBMODE; + } + default: + return HasModesIF::INVALID_MODE; + } +} + ReturnValue_t StarTrackerHandler::scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId, size_t* foundLen) { ReturnValue_t result = RETURN_OK; diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 3a078b51..691237a4 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -48,8 +48,8 @@ class StarTrackerHandler : public DeviceHandlerBase { void performOperationHook() override; - static const Submode_t SUBMODE_BOOTLOADER = 0; - static const Submode_t SUBMODE_FIRMWARE = 1; + static const Submode_t SUBMODE_BOOTLOADER = 1; + static const Submode_t SUBMODE_FIRMWARE = 2; protected: void doStartUp() override; @@ -60,6 +60,7 @@ class StarTrackerHandler : public DeviceHandlerBase { void fillCommandAndReplyMap() override; ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData, size_t commandDataLen) override; + ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) 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; From b822ee77bc9e7fed534055e8970b50eb0aff3aa7 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 23 Feb 2022 18:15:34 +0100 Subject: [PATCH 36/61] star tracker firmware update --- generators/.run/events.run.xml | 4 +- generators/bsp_q7s_events.csv | 1 + generators/events/translateEvents.cpp | 7 +- generators/objects/translateObjects.cpp | 2 +- .../startracker/StarTrackerHandler.cpp | 297 +++++++++++------- .../devices/startracker/StarTrackerHandler.h | 43 ++- linux/devices/startracker/StrHelper.cpp | 147 ++++----- linux/devices/startracker/StrHelper.h | 14 +- linux/fsfwconfig/events/translateEvents.cpp | 7 +- linux/fsfwconfig/events/translateEvents.h | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- 11 files changed, 294 insertions(+), 232 deletions(-) diff --git a/generators/.run/events.run.xml b/generators/.run/events.run.xml index 18f71033..f495007e 100644 --- a/generators/.run/events.run.xml +++ b/generators/.run/events.run.xml @@ -6,9 +6,9 @@ -