no bugs
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-02-16 16:54:58 +01:00
parent feb59d321c
commit c29d7e6f3e
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
4 changed files with 22 additions and 2 deletions

View File

@ -680,7 +680,7 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF,
std::array<DeviceHandlerBase*, 4> 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,
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);

View File

@ -107,6 +107,7 @@ ReturnValue_t RwPollingTask::initializeInterface(CookieIF* cookie) {
auto* rwCookie = dynamic_cast<RwCookie*>(cookie);
if (rwCookie == nullptr) {
sif::error << "RwPollingTask::initializeInterface: Wrong cookie" << std::endl;
return returnvalue::FAILED;
}
rwCookies[rwCookie->rwIdx] = rwCookie;

View File

@ -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;

View File

@ -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