trying to find out whats wrong
This commit is contained in:
parent
4b1221ab99
commit
795486ae6c
@ -486,7 +486,8 @@ endif()
|
||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_FSFW_NAME}
|
||||
${LIB_OS_NAME})
|
||||
|
||||
target_link_libraries(${LIB_DUMMIES} PUBLIC ${LIB_FSFW_NAME} ${LIB_JSON_NAME})
|
||||
target_link_libraries(${LIB_DUMMIES} PUBLIC ${LIB_EIVE_MISSION}
|
||||
${LIB_FSFW_NAME} ${LIB_JSON_NAME})
|
||||
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_EIVE_MISSION} ${LIB_DUMMIES})
|
||||
|
||||
|
@ -795,28 +795,34 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) {
|
||||
new VirtualChannelWithQueue(objects::PTME_VC0_LIVE_TM, ccsds::VC0, "PTME VC0 LIVE TM", *ptme,
|
||||
LINK_STATE, args.tmStore, 500);
|
||||
args.liveDestination = vcWithQueue;
|
||||
new LiveTmTask(objects::LIVE_TM_TASK, args.pusFunnel, args.cfdpFunnel, *vcWithQueue);
|
||||
auto* liveTask =
|
||||
new LiveTmTask(objects::LIVE_TM_TASK, args.pusFunnel, args.cfdpFunnel, *vcWithQueue);
|
||||
liveTask->connectModeTreeParent(satsystem::com::SUBSYSTEM);
|
||||
|
||||
// Set up log store.
|
||||
auto* vc = new VirtualChannel(objects::PTME_VC1_LOG_TM, ccsds::VC1, "PTME VC1 LOG TM", *ptme,
|
||||
LINK_STATE);
|
||||
LogStores logStores(args.stores);
|
||||
// Core task which handles the LOG store and takes care of dumping it as TM using a VC directly
|
||||
new PersistentLogTmStoreTask(objects::LOG_STORE_AND_TM_TASK, args.ipcStore, logStores, *vc,
|
||||
*SdCardManager::instance());
|
||||
auto* logStore = new PersistentLogTmStoreTask(objects::LOG_STORE_AND_TM_TASK, args.ipcStore,
|
||||
logStores, *vc, *SdCardManager::instance());
|
||||
logStore->connectModeTreeParent(satsystem::com::SUBSYSTEM);
|
||||
|
||||
vc = new VirtualChannel(objects::PTME_VC2_HK_TM, ccsds::VC2, "PTME VC2 HK TM", *ptme, LINK_STATE);
|
||||
// Core task which handles the HK store and takes care of dumping it as TM using a VC directly
|
||||
new PersistentSingleTmStoreTask(objects::HK_STORE_AND_TM_TASK, args.ipcStore,
|
||||
*args.stores.hkStore, *vc, persTmStore::DUMP_HK_STORE_DONE,
|
||||
persTmStore::DUMP_HK_STORE_DONE, *SdCardManager::instance());
|
||||
auto* hkStore = new PersistentSingleTmStoreTask(
|
||||
objects::HK_STORE_AND_TM_TASK, args.ipcStore, *args.stores.hkStore, *vc,
|
||||
persTmStore::DUMP_HK_STORE_DONE, persTmStore::DUMP_HK_STORE_DONE, *SdCardManager::instance());
|
||||
hkStore->connectModeTreeParent(satsystem::com::SUBSYSTEM);
|
||||
|
||||
vc = new VirtualChannel(objects::PTME_VC3_CFDP_TM, ccsds::VC3, "PTME VC3 CFDP TM", *ptme,
|
||||
LINK_STATE);
|
||||
// Core task which handles the CFDP store and takes care of dumping it as TM using a VC directly
|
||||
new PersistentSingleTmStoreTask(objects::CFDP_STORE_AND_TM_TASK, args.ipcStore,
|
||||
*args.stores.cfdpStore, *vc, persTmStore::DUMP_CFDP_STORE_DONE,
|
||||
persTmStore::DUMP_CFDP_CANCELLED, *SdCardManager::instance());
|
||||
auto* cfdpTask = new PersistentSingleTmStoreTask(
|
||||
objects::CFDP_STORE_AND_TM_TASK, args.ipcStore, *args.stores.cfdpStore, *vc,
|
||||
persTmStore::DUMP_CFDP_STORE_DONE, persTmStore::DUMP_CFDP_CANCELLED,
|
||||
*SdCardManager::instance());
|
||||
cfdpTask->connectModeTreeParent(satsystem::com::SUBSYSTEM);
|
||||
|
||||
ReturnValue_t result = (*args.ipCoreHandler)->connectModeTreeParent(satsystem::com::SUBSYSTEM);
|
||||
if (result != returnvalue::OK) {
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "bsp_q7s/core/ObjectFactory.h"
|
||||
#include "busConf.h"
|
||||
#include "devConf.h"
|
||||
#include "dummies/helpers.h"
|
||||
#include "dummies/helperFactory.h"
|
||||
#include "eive/objects.h"
|
||||
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
||||
#include "linux/ObjectFactory.h"
|
||||
|
@ -26,6 +26,6 @@ target_sources(
|
||||
CoreControllerDummy.cpp
|
||||
PlocMpsocDummy.cpp
|
||||
PlocSupervisorDummy.cpp
|
||||
helpers.cpp
|
||||
helperFactory.cpp
|
||||
MgmRm3100Dummy.cpp
|
||||
Tmp1075Dummy.cpp)
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "helpers.h"
|
||||
#include "helperFactory.h"
|
||||
|
||||
#include <dummies/AcuDummy.h>
|
||||
#include <dummies/BpxDummy.h>
|
||||
@ -24,6 +24,7 @@
|
||||
#include <dummies/StarTrackerDummy.h>
|
||||
#include <dummies/SusDummy.h>
|
||||
#include <dummies/SyrlinksDummy.h>
|
||||
#include <fsfw/devicehandlers/HealthDevice.h>
|
||||
#include <fsfw_hal/common/gpio/GpioIF.h>
|
||||
#include <mission/power/gsDefs.h>
|
||||
#include <mission/system/acs/ImtqAssembly.h>
|
||||
@ -98,6 +99,8 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio
|
||||
new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
||||
assemblyDhbs[7] =
|
||||
new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
|
||||
new HealthDevice(objects::GPS_0_HEALTH_DEV, objects::ACS_BOARD_ASS);
|
||||
new HealthDevice(objects::GPS_1_HEALTH_DEV, objects::ACS_BOARD_ASS);
|
||||
auto* gpsCtrl = new GpsCtrlDummy(objects::GPS_CONTROLLER);
|
||||
ObjectFactory::createAcsBoardAssy(pwrSwitcher, assemblyDhbs, gpsCtrl, gpioIF);
|
||||
}
|
@ -99,3 +99,8 @@ void LiveTmTask::readCommandQueue(void) {
|
||||
}
|
||||
|
||||
ModeTreeChildIF& LiveTmTask::getModeTreeChildIF() { return *this; }
|
||||
|
||||
ReturnValue_t LiveTmTask::initialize() {
|
||||
modeHelper.initialize();
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
@ -21,6 +21,8 @@ class LiveTmTask : public SystemObject,
|
||||
VirtualChannelWithQueue& channel);
|
||||
|
||||
ReturnValue_t performOperation(uint8_t opCode) override;
|
||||
ReturnValue_t initialize() override;
|
||||
ReturnValue_t connectModeTreeParent(HasModeTreeChildrenIF& parent) override;
|
||||
|
||||
private:
|
||||
MessageQueueIF* requestQueue;
|
||||
@ -48,7 +50,6 @@ class LiveTmTask : public SystemObject,
|
||||
object_id_t getObjectId() const override;
|
||||
const HasHealthIF* getOptHealthIF() const override;
|
||||
const HasModesIF& getModeIF() const override;
|
||||
ReturnValue_t connectModeTreeParent(HasModeTreeChildrenIF& parent) override;
|
||||
ModeTreeChildIF& getModeTreeChildIF() override;
|
||||
};
|
||||
|
||||
|
@ -21,6 +21,7 @@ SyrlinksHandler::~SyrlinksHandler() = default;
|
||||
|
||||
void SyrlinksHandler::doStartUp() {
|
||||
if (internalState == InternalState::OFF) {
|
||||
transitionCommandPending = false;
|
||||
internalState = InternalState::ENABLE_TEMPERATURE_PROTECTION;
|
||||
commandExecuted = false;
|
||||
}
|
||||
@ -38,6 +39,7 @@ void SyrlinksHandler::doShutDown() {
|
||||
// In any case, always disable TX first.
|
||||
if (internalState != InternalState::SET_TX_STANDBY) {
|
||||
internalState = InternalState::SET_TX_STANDBY;
|
||||
transitionCommandPending = false;
|
||||
commandExecuted = false;
|
||||
}
|
||||
if (internalState == InternalState::SET_TX_STANDBY) {
|
||||
@ -97,6 +99,10 @@ ReturnValue_t SyrlinksHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
||||
}
|
||||
|
||||
ReturnValue_t SyrlinksHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
||||
if (transitionCommandPending) {
|
||||
return NOTHING_TO_SEND;
|
||||
}
|
||||
transitionCommandPending = true;
|
||||
switch (internalState) {
|
||||
case InternalState::ENABLE_TEMPERATURE_PROTECTION: {
|
||||
*id = syrlinks::WRITE_LCL_CONFIG;
|
||||
@ -122,8 +128,10 @@ ReturnValue_t SyrlinksHandler::buildTransitionDeviceCommand(DeviceCommandId_t* i
|
||||
*id = syrlinks::SET_TX_MODE_STANDBY;
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
default:
|
||||
default: {
|
||||
transitionCommandPending = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return NOTHING_TO_SEND;
|
||||
}
|
||||
@ -442,7 +450,6 @@ ReturnValue_t SyrlinksHandler::interpretDeviceReply(DeviceCommandId_t id, const
|
||||
return DeviceHandlerIF::UNKNOWN_DEVICE_REPLY;
|
||||
}
|
||||
}
|
||||
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
@ -682,6 +689,9 @@ ReturnValue_t SyrlinksHandler::handleAckReply(const uint8_t* packet) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
sif::error << "Syrlinks: Unexpected ACK reply" << std::endl;
|
||||
}
|
||||
}
|
||||
switch (rememberCommandId) {
|
||||
case (syrlinks::SET_TX_MODE_STANDBY): {
|
||||
@ -728,16 +738,19 @@ void SyrlinksHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
||||
Mode_t tgtMode = getBaseMode(getMode());
|
||||
auto commandDone = [&]() {
|
||||
setMode(tgtMode);
|
||||
transitionCommandPending = false;
|
||||
internalState = InternalState::IDLE;
|
||||
};
|
||||
auto txOnHandler = [&](InternalState selMod) {
|
||||
if (internalState == InternalState::IDLE) {
|
||||
transitionCommandPending = false;
|
||||
commandExecuted = false;
|
||||
internalState = selMod;
|
||||
}
|
||||
// Select modulation first (BPSK or 0QPSK).
|
||||
if (internalState == selMod) {
|
||||
if (commandExecuted) {
|
||||
transitionCommandPending = false;
|
||||
internalState = InternalState::SET_TX_MODULATION;
|
||||
commandExecuted = false;
|
||||
}
|
||||
@ -753,6 +766,7 @@ void SyrlinksHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
||||
};
|
||||
auto txStandbyHandler = [&]() {
|
||||
if (internalState == InternalState::IDLE) {
|
||||
transitionCommandPending = false;
|
||||
internalState = InternalState::SET_TX_STANDBY;
|
||||
commandExecuted = false;
|
||||
}
|
||||
|
@ -112,6 +112,7 @@ class SyrlinksHandler : public DeviceHandlerBase {
|
||||
float tempPowerAmplifier = 0;
|
||||
float tempBasebandBoard = 0;
|
||||
bool commandExecuted = false;
|
||||
bool transitionCommandPending = false;
|
||||
|
||||
uint8_t commandBuffer[syrlinks::MAX_COMMAND_SIZE];
|
||||
|
||||
|
@ -35,7 +35,7 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store,
|
||||
tmToStoreReceived = true;
|
||||
}
|
||||
// Dump TMs when applicable and allowed (mode is on)
|
||||
if (mode == MODE_ON and store.getState() == PersistentTmStore::State::DUMPING) {
|
||||
if (store.getState() == PersistentTmStore::State::DUMPING) {
|
||||
if (handleOneDump(store, dumpContext, dumpPerformed) != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
@ -78,8 +78,10 @@ bool TmStoreTaskBase::cyclicStoreCheck() {
|
||||
}
|
||||
|
||||
void TmStoreTaskBase::cancelDump(DumpContext& ctx, PersistentTmStore& store, bool isTxOn) {
|
||||
triggerEvent(ctx.eventIfCancelled, ctx.numberOfDumpedPackets, ctx.dumpedBytes);
|
||||
ctx.reset();
|
||||
if (store.getState() == PersistentTmStore::State::DUMPING) {
|
||||
triggerEvent(ctx.eventIfCancelled, ctx.numberOfDumpedPackets, ctx.dumpedBytes);
|
||||
}
|
||||
store.cancelDump();
|
||||
if (isTxOn) {
|
||||
channel.cancelTransfer();
|
||||
@ -175,6 +177,7 @@ ReturnValue_t TmStoreTaskBase::connectModeTreeParent(HasModeTreeChildrenIF& pare
|
||||
}
|
||||
|
||||
ModeTreeChildIF& TmStoreTaskBase::getModeTreeChildIF() { return *this; }
|
||||
|
||||
void TmStoreTaskBase::readCommandQueue(void) {
|
||||
CommandMessage commandMessage;
|
||||
ReturnValue_t result = returnvalue::FAILED;
|
||||
|
@ -42,6 +42,7 @@ class TmStoreTaskBase : public SystemObject,
|
||||
SdCardMountedIF& sdcMan);
|
||||
|
||||
ReturnValue_t initialize() override;
|
||||
ReturnValue_t connectModeTreeParent(HasModeTreeChildrenIF& parent) override;
|
||||
|
||||
protected:
|
||||
MessageQueueIF* requestQueue;
|
||||
@ -91,7 +92,6 @@ class TmStoreTaskBase : public SystemObject,
|
||||
object_id_t getObjectId() const override;
|
||||
const HasHealthIF* getOptHealthIF() const override;
|
||||
const HasModesIF& getModeIF() const override;
|
||||
ReturnValue_t connectModeTreeParent(HasModeTreeChildrenIF& parent) override;
|
||||
ModeTreeChildIF& getModeTreeChildIF() override;
|
||||
};
|
||||
|
||||
|
@ -26,10 +26,12 @@ ReturnValue_t pst::pstSyrlinks(FixedTimeslotTaskIF *thisSequence) {
|
||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.25, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.25, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.4,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.7, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.75, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.75, DeviceHandlerIF::GET_READ);
|
||||
|
||||
static_cast<void>(length);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user