From c29d7e6f3e7fd72bda8ef3dcac8cb4efe212ae11 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 16 Feb 2023 16:54:58 +0100 Subject: [PATCH] no bugs --- bsp_q7s/core/ObjectFactory.cpp | 4 ++-- linux/devices/RwPollingTask.cpp | 1 + mission/devices/RwHandler.cpp | 18 ++++++++++++++++++ mission/devices/RwHandler.h | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 0f154542..ea310f87 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -680,8 +680,8 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, std::array rws = {}; new RwPollingTask(objects::SPI_RW_COM_IF, q7s::SPI_RW_DEV, *gpioComIF); for (uint8_t idx = 0; idx < rwCookies.size(); idx++) { - rwCookies[idx] = new SpiCookie(rwCookieParams[idx].first, rwCookieParams[idx].second, - rws::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED); + rwCookies[idx] = new RwCookie(idx, rwCookieParams[idx].first, rwCookieParams[idx].second, + rws::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED); auto* rwHandler = new RwHandler(rwIds[idx], objects::SPI_RW_COM_IF, rwCookies[idx], gpioComIF, rwGpioIds[idx], idx); rwCookies[idx]->setCallbackArgs(rwHandler); diff --git a/linux/devices/RwPollingTask.cpp b/linux/devices/RwPollingTask.cpp index 643c7608..8b6320ff 100644 --- a/linux/devices/RwPollingTask.cpp +++ b/linux/devices/RwPollingTask.cpp @@ -107,6 +107,7 @@ ReturnValue_t RwPollingTask::initializeInterface(CookieIF* cookie) { auto* rwCookie = dynamic_cast(cookie); if (rwCookie == nullptr) { + sif::error << "RwPollingTask::initializeInterface: Wrong cookie" << std::endl; return returnvalue::FAILED; } rwCookies[rwCookie->rwIdx] = rwCookie; diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index 456e0940..1c1263b4 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -514,6 +514,24 @@ void RwHandler::handleTemperatureReply(const uint8_t* packet) { } } +LocalPoolDataSetBase* RwHandler::getDataSetHandle(sid_t sid) { + switch (sid.ownerSetId) { + case (rws::SetIds::STATUS_SET_ID): { + return &statusSet; + } + case (rws::SetIds::LAST_RESET_ID): { + return &lastResetStatusSet; + } + case (rws::SetIds::SPEED_CMD_SET): { + return &rwSpeedActuationSet; + } + case (rws::SetIds::TM_SET_ID): { + return &tmDataset; + } + } + return nullptr; +} + void RwHandler::handleGetTelemetryReply(const uint8_t* packet) { PoolReadGuard rg(&tmDataset); uint8_t offset = 2; diff --git a/mission/devices/RwHandler.h b/mission/devices/RwHandler.h index beba8376..756aed53 100644 --- a/mission/devices/RwHandler.h +++ b/mission/devices/RwHandler.h @@ -56,6 +56,7 @@ class RwHandler : public DeviceHandlerBase { uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) override; + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; private: //! [EXPORT] : [COMMENT] Action Message with invalid speed was received. Valid speeds must be in