COM Subsystem #358
@ -17,6 +17,12 @@ change warranting a new major release:
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- First COM subsystem implementation. It mirrors the Syrlinks mode/submodes but also takes
|
||||||
|
care of commanding the CCSDS handler. It expects the Syrlinks submodes as mode commands.
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/358
|
||||||
|
|
||||||
# [v1.21.0] 2023-01-26
|
# [v1.21.0] 2023-01-26
|
||||||
|
|
||||||
TMTC version: v2.5.0
|
TMTC version: v2.5.0
|
||||||
|
@ -44,8 +44,7 @@ ReturnValue_t dummy_pst::pst(FixedTimeslotTaskIF *thisSequence) {
|
|||||||
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_READ);
|
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_READ);
|
||||||
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_READ);
|
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_READ);
|
||||||
|
|
||||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0,
|
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||||
DeviceHandlerIF::PERFORM_OPERATION);
|
|
||||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
|
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
|
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||||
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
|
thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
#include "mission/system/tree/comModeTree.h"
|
|
||||||
#include "bsp_q7s/core/CoreController.h"
|
#include "bsp_q7s/core/CoreController.h"
|
||||||
#include "bsp_q7s/core/ObjectFactory.h"
|
#include "bsp_q7s/core/ObjectFactory.h"
|
||||||
#include "busConf.h"
|
#include "busConf.h"
|
||||||
@ -15,6 +14,7 @@
|
|||||||
#include "linux/ObjectFactory.h"
|
#include "linux/ObjectFactory.h"
|
||||||
#include "linux/callbacks/gpioCallbacks.h"
|
#include "linux/callbacks/gpioCallbacks.h"
|
||||||
#include "mission/core/GenericFactory.h"
|
#include "mission/core/GenericFactory.h"
|
||||||
|
#include "mission/system/tree/comModeTree.h"
|
||||||
|
|
||||||
void ObjectFactory::produce(void* args) {
|
void ObjectFactory::produce(void* args) {
|
||||||
ObjectFactory::setStatics();
|
ObjectFactory::setStatics();
|
||||||
|
@ -7,3 +7,4 @@ add_subdirectory(tmtc)
|
|||||||
add_subdirectory(system)
|
add_subdirectory(system)
|
||||||
add_subdirectory(csp)
|
add_subdirectory(csp)
|
||||||
add_subdirectory(cfdp)
|
add_subdirectory(cfdp)
|
||||||
|
add_subdirectory(config)
|
||||||
|
@ -18,7 +18,13 @@ enum Submode : uint8_t {
|
|||||||
NUM_SUBMODES
|
NUM_SUBMODES
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class CcsdsSubmode : uint8_t { UNSET = 0, DATARATE_LOW = 1, DATARATE_HIGH = 2 };
|
enum class CcsdsSubmode : uint8_t {
|
||||||
|
UNSET = 0,
|
||||||
|
DATARATE_LOW = 1,
|
||||||
|
DATARATE_HIGH = 2,
|
||||||
|
DATARATE_DEFAULT = 3
|
||||||
|
};
|
||||||
|
enum class ParameterId : uint8_t { DATARATE = 0 };
|
||||||
|
|
||||||
} // namespace com
|
} // namespace com
|
||||||
|
|
||||||
|
1
mission/config/CMakeLists.txt
Normal file
1
mission/config/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
target_sources(${LIB_EIVE_MISSION} PRIVATE comCfg.cpp torquer.cpp)
|
26
mission/config/comCfg.cpp
Normal file
26
mission/config/comCfg.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include "comCfg.h"
|
||||||
|
|
||||||
|
#include <fsfw/ipc/MutexFactory.h>
|
||||||
|
#include <fsfw/ipc/MutexGuard.h>
|
||||||
|
|
||||||
|
com::Datarate DATARATE_CFG_RAW = com::Datarate::LOW_RATE_MODULATION_BPSK;
|
||||||
|
MutexIF* DATARATE_LOCK = nullptr;
|
||||||
|
|
||||||
|
MutexIF* lazyLock();
|
||||||
|
|
||||||
|
com::Datarate com::getCurrentDatarate() {
|
||||||
|
MutexGuard mg(lazyLock());
|
||||||
|
return DATARATE_CFG_RAW;
|
||||||
|
}
|
||||||
|
|
||||||
|
void com::setCurrentDatarate(com::Datarate newRate) {
|
||||||
|
MutexGuard mg(lazyLock());
|
||||||
|
DATARATE_CFG_RAW = newRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
MutexIF* lazyLock() {
|
||||||
|
if (DATARATE_LOCK == nullptr) {
|
||||||
|
return MutexFactory::instance()->createMutex();
|
||||||
|
}
|
||||||
|
return DATARATE_LOCK;
|
||||||
|
}
|
15
mission/config/comCfg.h
Normal file
15
mission/config/comCfg.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#ifndef MISSION_COMCFG_H_
|
||||||
|
#define MISSION_COMCFG_H_
|
||||||
|
|
||||||
|
#include <fsfw/ipc/MutexIF.h>
|
||||||
|
|
||||||
|
#include "mission/comDefs.h"
|
||||||
|
|
||||||
|
namespace com {
|
||||||
|
|
||||||
|
com::Datarate getCurrentDatarate();
|
||||||
|
void setCurrentDatarate(com::Datarate newRate);
|
||||||
|
|
||||||
|
} // namespace com
|
||||||
|
|
||||||
|
#endif /* MISSION_COMCFG_H_ */
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <fsfw/datapool/PoolReadGuard.h>
|
#include <fsfw/datapool/PoolReadGuard.h>
|
||||||
|
|
||||||
#include "mission/devices/torquer.h"
|
#include "mission/config/torquer.h"
|
||||||
|
|
||||||
AcsController::AcsController(object_id_t objectId)
|
AcsController::AcsController(object_id_t objectId)
|
||||||
: ExtendedControllerBase(objectId),
|
: ExtendedControllerBase(objectId),
|
||||||
|
@ -20,7 +20,6 @@ target_sources(
|
|||||||
SusHandler.cpp
|
SusHandler.cpp
|
||||||
PayloadPcduHandler.cpp
|
PayloadPcduHandler.cpp
|
||||||
SolarArrayDeploymentHandler.cpp
|
SolarArrayDeploymentHandler.cpp
|
||||||
ScexDeviceHandler.cpp
|
ScexDeviceHandler.cpp)
|
||||||
torquer.cpp)
|
|
||||||
|
|
||||||
add_subdirectory(devicedefinitions)
|
add_subdirectory(devicedefinitions)
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <fsfw/datapoollocal/LocalPoolVariable.tpp>
|
#include <fsfw/datapoollocal/LocalPoolVariable.tpp>
|
||||||
|
|
||||||
#include "mission/devices/torquer.h"
|
#include "mission/config/torquer.h"
|
||||||
|
|
||||||
static constexpr bool ACTUATION_WIRETAPPING = false;
|
static constexpr bool ACTUATION_WIRETAPPING = false;
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include <mission/devices/SyrlinksHandler.h>
|
#include <mission/devices/SyrlinksHandler.h>
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
|
#include "mission/config/comCfg.h"
|
||||||
|
|
||||||
SyrlinksHandler::SyrlinksHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
|
SyrlinksHandler::SyrlinksHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
|
||||||
power::Switch_t powerSwitch, FailureIsolationBase* customFdir)
|
power::Switch_t powerSwitch, FailureIsolationBase* customFdir)
|
||||||
@ -685,7 +686,7 @@ ReturnValue_t SyrlinksHandler::handleAckReply(const uint8_t* packet) {
|
|||||||
}
|
}
|
||||||
case (syrlinks::SET_TX_MODE_MODULATION):
|
case (syrlinks::SET_TX_MODE_MODULATION):
|
||||||
case (syrlinks::SET_TX_MODE_CW): {
|
case (syrlinks::SET_TX_MODE_CW): {
|
||||||
triggerEvent(syrlinks::TX_ON, getSubmode(), datarateCfgRaw);
|
triggerEvent(syrlinks::TX_ON, getSubmode(), static_cast<uint8_t>(com::getCurrentDatarate()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -706,18 +707,6 @@ ReturnValue_t SyrlinksHandler::getParameter(uint8_t domainId, uint8_t uniqueId,
|
|||||||
ParameterWrapper* parameterWrapper,
|
ParameterWrapper* parameterWrapper,
|
||||||
const ParameterWrapper* newValues,
|
const ParameterWrapper* newValues,
|
||||||
uint16_t startAtIndex) {
|
uint16_t startAtIndex) {
|
||||||
if ((domainId == 0) and (uniqueId == static_cast<uint8_t>(syrlinks::ParameterId::DATARATE))) {
|
|
||||||
uint8_t newVal = 0;
|
|
||||||
ReturnValue_t result = newValues->getElement(&newVal);
|
|
||||||
if (result != returnvalue::OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
if (newVal >= static_cast<uint8_t>(com::Datarate::NUM_DATARATES)) {
|
|
||||||
return HasParametersIF::INVALID_VALUE;
|
|
||||||
}
|
|
||||||
parameterWrapper->set(datarateCfgRaw);
|
|
||||||
return returnvalue::OK;
|
|
||||||
}
|
|
||||||
return DeviceHandlerBase::getParameter(domainId, uniqueId, parameterWrapper, newValues,
|
return DeviceHandlerBase::getParameter(domainId, uniqueId, parameterWrapper, newValues,
|
||||||
startAtIndex);
|
startAtIndex);
|
||||||
}
|
}
|
||||||
@ -773,12 +762,12 @@ void SyrlinksHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
|||||||
if (tgtMode == HasModesIF::MODE_ON or tgtMode == DeviceHandlerIF::MODE_NORMAL) {
|
if (tgtMode == HasModesIF::MODE_ON or tgtMode == DeviceHandlerIF::MODE_NORMAL) {
|
||||||
switch (getSubmode()) {
|
switch (getSubmode()) {
|
||||||
case (com::Submode::RX_AND_TX_DEFAULT_DATARATE): {
|
case (com::Submode::RX_AND_TX_DEFAULT_DATARATE): {
|
||||||
if (datarateCfgRaw == static_cast<uint8_t>(com::Datarate::LOW_RATE_MODULATION_BPSK)) {
|
auto currentDatarate = com::getCurrentDatarate();
|
||||||
|
if (currentDatarate == com::Datarate::LOW_RATE_MODULATION_BPSK) {
|
||||||
if (txOnHandler(InternalState::SELECT_MODULATION_BPSK)) {
|
if (txOnHandler(InternalState::SELECT_MODULATION_BPSK)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (datarateCfgRaw ==
|
} else if (currentDatarate == com::Datarate::HIGH_RATE_MODULATION_0QPSK) {
|
||||||
static_cast<uint8_t>(com::Datarate::HIGH_RATE_MODULATION_0QPSK)) {
|
|
||||||
if (txOnHandler(InternalState::SELECT_MODULATION_0QPSK)) {
|
if (txOnHandler(InternalState::SELECT_MODULATION_0QPSK)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -104,9 +104,6 @@ class SyrlinksHandler : public DeviceHandlerBase {
|
|||||||
syrlinks::TemperatureSet temperatureSet;
|
syrlinks::TemperatureSet temperatureSet;
|
||||||
|
|
||||||
const power::Switch_t powerSwitch = power::NO_SWITCH;
|
const power::Switch_t powerSwitch = power::NO_SWITCH;
|
||||||
// Use uint8_t for compatibility with parameter interface
|
|
||||||
uint8_t datarateCfgRaw = static_cast<uint8_t>(com::Datarate::LOW_RATE_MODULATION_BPSK);
|
|
||||||
// com::Datarate datarateCfg = com::Datarate::LOW_RATE_MODULATION_BPSK;
|
|
||||||
|
|
||||||
bool debugMode = false;
|
bool debugMode = false;
|
||||||
uint8_t agcValueHighByte = 0;
|
uint8_t agcValueHighByte = 0;
|
||||||
|
@ -1,5 +1,32 @@
|
|||||||
#include "ComSubsystem.h"
|
#include "ComSubsystem.h"
|
||||||
|
|
||||||
|
#include <fsfw/ipc/MutexGuard.h>
|
||||||
|
|
||||||
|
#include "mission/config/comCfg.h"
|
||||||
|
|
||||||
ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
|
ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
|
||||||
uint32_t maxNumberOfTables)
|
uint32_t maxNumberOfTables)
|
||||||
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {}
|
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables), paramHelper(this) {
|
||||||
|
com::setCurrentDatarate(com::Datarate::LOW_RATE_MODULATION_BPSK);
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageQueueId_t ComSubsystem::getCommandQueue() const { return Subsystem::getCommandQueue(); }
|
||||||
|
|
||||||
|
ReturnValue_t ComSubsystem::getParameter(uint8_t domainId, uint8_t uniqueIdentifier,
|
||||||
|
ParameterWrapper *parameterWrapper,
|
||||||
|
const ParameterWrapper *newValues, uint16_t startAtIndex) {
|
||||||
|
if ((domainId == 0) and (uniqueIdentifier == static_cast<uint8_t>(com::ParameterId::DATARATE))) {
|
||||||
|
uint8_t newVal = 0;
|
||||||
|
ReturnValue_t result = newValues->getElement(&newVal);
|
||||||
|
if (result != returnvalue::OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if (newVal >= static_cast<uint8_t>(com::Datarate::NUM_DATARATES)) {
|
||||||
|
return HasParametersIF::INVALID_VALUE;
|
||||||
|
}
|
||||||
|
parameterWrapper->set(datarateCfg);
|
||||||
|
com::setCurrentDatarate(static_cast<com::Datarate>(newVal));
|
||||||
|
return returnvalue::OK;
|
||||||
|
}
|
||||||
|
return returnvalue::OK;
|
||||||
|
}
|
||||||
|
@ -1,13 +1,24 @@
|
|||||||
#ifndef MISSION_SYSTEM_COMSUBSYSTEM_H_
|
#ifndef MISSION_SYSTEM_COMSUBSYSTEM_H_
|
||||||
#define MISSION_SYSTEM_COMSUBSYSTEM_H_
|
#define MISSION_SYSTEM_COMSUBSYSTEM_H_
|
||||||
|
|
||||||
|
#include <fsfw/parameters/HasParametersIF.h>
|
||||||
|
#include <fsfw/parameters/ParameterHelper.h>
|
||||||
#include <fsfw/subsystem/Subsystem.h>
|
#include <fsfw/subsystem/Subsystem.h>
|
||||||
|
|
||||||
class ComSubsystem : public Subsystem {
|
#include "mission/comDefs.h"
|
||||||
|
|
||||||
|
class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
|
||||||
public:
|
public:
|
||||||
ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables);
|
ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables);
|
||||||
|
|
||||||
|
MessageQueueId_t getCommandQueue() const override;
|
||||||
|
ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueIdentifier,
|
||||||
|
ParameterWrapper *parameterWrapper, const ParameterWrapper *newValues,
|
||||||
|
uint16_t startAtIndex) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
uint8_t datarateCfg = static_cast<uint8_t>(com::Datarate::LOW_RATE_MODULATION_BPSK);
|
||||||
|
ParameterHelper paramHelper;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MISSION_SYSTEM_COMSUBSYSTEM_H_ */
|
#endif /* MISSION_SYSTEM_COMSUBSYSTEM_H_ */
|
||||||
|
@ -19,7 +19,8 @@ static const auto NML = DeviceHandlerIF::MODE_NORMAL;
|
|||||||
|
|
||||||
auto COM_SEQUENCE_RX_ONLY =
|
auto COM_SEQUENCE_RX_ONLY =
|
||||||
std::make_pair(::com::Submode::RX_ONLY, FixedArrayList<ModeListEntry, 3>());
|
std::make_pair(::com::Submode::RX_ONLY, FixedArrayList<ModeListEntry, 3>());
|
||||||
auto COM_TABLE_RX_ONLY_TGT = std::make_pair((::com::Submode::RX_ONLY << 24) | 1, FixedArrayList<ModeListEntry, 3>());
|
auto COM_TABLE_RX_ONLY_TGT =
|
||||||
|
std::make_pair((::com::Submode::RX_ONLY << 24) | 1, FixedArrayList<ModeListEntry, 3>());
|
||||||
auto COM_TABLE_RX_ONLY_TRANS_0 =
|
auto COM_TABLE_RX_ONLY_TRANS_0 =
|
||||||
std::make_pair((::com::Submode::RX_ONLY << 24) | 2, FixedArrayList<ModeListEntry, 3>());
|
std::make_pair((::com::Submode::RX_ONLY << 24) | 2, FixedArrayList<ModeListEntry, 3>());
|
||||||
auto COM_TABLE_RX_ONLY_TRANS_1 =
|
auto COM_TABLE_RX_ONLY_TRANS_1 =
|
||||||
@ -27,26 +28,28 @@ auto COM_TABLE_RX_ONLY_TRANS_1 =
|
|||||||
|
|
||||||
auto COM_SEQUENCE_RX_AND_TX_LOW_RATE =
|
auto COM_SEQUENCE_RX_AND_TX_LOW_RATE =
|
||||||
std::make_pair(::com::Submode::RX_AND_TX_LOW_DATARATE, FixedArrayList<ModeListEntry, 3>());
|
std::make_pair(::com::Submode::RX_AND_TX_LOW_DATARATE, FixedArrayList<ModeListEntry, 3>());
|
||||||
auto COM_TABLE_RX_AND_TX_LOW_RATE_TGT =
|
auto COM_TABLE_RX_AND_TX_LOW_RATE_TGT = std::make_pair(
|
||||||
std::make_pair((::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 1, FixedArrayList<ModeListEntry, 3>());
|
(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 1, FixedArrayList<ModeListEntry, 3>());
|
||||||
auto COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_0 =
|
auto COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_0 = std::make_pair(
|
||||||
std::make_pair((::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 2, FixedArrayList<ModeListEntry, 3>());
|
(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 2, FixedArrayList<ModeListEntry, 3>());
|
||||||
auto COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_1 =
|
auto COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_1 = std::make_pair(
|
||||||
std::make_pair((::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 3, FixedArrayList<ModeListEntry, 3>());
|
(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 3, FixedArrayList<ModeListEntry, 3>());
|
||||||
|
|
||||||
auto COM_SEQUENCE_RX_AND_TX_HIGH_RATE =
|
auto COM_SEQUENCE_RX_AND_TX_HIGH_RATE =
|
||||||
std::make_pair(::com::Submode::RX_AND_TX_HIGH_DATARATE, FixedArrayList<ModeListEntry, 3>());
|
std::make_pair(::com::Submode::RX_AND_TX_HIGH_DATARATE, FixedArrayList<ModeListEntry, 3>());
|
||||||
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TGT =
|
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TGT = std::make_pair(
|
||||||
std::make_pair((::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 1, FixedArrayList<ModeListEntry, 3>());
|
(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 1, FixedArrayList<ModeListEntry, 3>());
|
||||||
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_0 =
|
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_0 = std::make_pair(
|
||||||
std::make_pair((::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 2, FixedArrayList<ModeListEntry, 3>());
|
(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 2, FixedArrayList<ModeListEntry, 3>());
|
||||||
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_1 =
|
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_1 = std::make_pair(
|
||||||
std::make_pair((::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 3, FixedArrayList<ModeListEntry, 3>());
|
(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 3, FixedArrayList<ModeListEntry, 3>());
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
void buildRxOnlySequence(Subsystem& ss, ModeListEntry& eh);
|
void buildRxOnlySequence(Subsystem& ss, ModeListEntry& eh);
|
||||||
void buildTxAndRxLowRateSequence(Subsystem& ss, ModeListEntry& eh);
|
void buildTxAndRxLowRateSequence(Subsystem& ss, ModeListEntry& eh);
|
||||||
void buildTxAndRxHighRateSequence(Subsystem& ss, ModeListEntry& eh);
|
void buildTxAndRxHighRateSequence(Subsystem& ss, ModeListEntry& eh);
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
void satsystem::com::init() {
|
void satsystem::com::init() {
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include <fsfw/subsystem/helper.h>
|
#include <fsfw/subsystem/helper.h>
|
||||||
#include <linux/ipcore/PdecHandler.h>
|
#include <linux/ipcore/PdecHandler.h>
|
||||||
#include <linux/ipcore/PtmeConfig.h>
|
#include <linux/ipcore/PtmeConfig.h>
|
||||||
|
#include <mission/config/comCfg.h>
|
||||||
|
|
||||||
#include "eive/definitions.h"
|
#include "eive/definitions.h"
|
||||||
#include "fsfw/events/EventManagerIF.h"
|
#include "fsfw/events/EventManagerIF.h"
|
||||||
@ -378,18 +379,31 @@ ReturnValue_t CcsdsIpCoreHandler::checkModeCommand(Mode_t mode, Submode_t submod
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) {
|
void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) {
|
||||||
if (mode == HasModesIF::MODE_ON) {
|
auto rateHigh = [&]() {
|
||||||
enableTransmit();
|
|
||||||
if (submode == static_cast<Submode_t>(com::CcsdsSubmode::DATARATE_HIGH)) {
|
|
||||||
ReturnValue_t result = ptmeConfig->setRate(RATE_500KBPS);
|
ReturnValue_t result = ptmeConfig->setRate(RATE_500KBPS);
|
||||||
if (result == returnvalue::OK) {
|
if (result == returnvalue::OK) {
|
||||||
mode = HasModesIF::MODE_ON;
|
mode = HasModesIF::MODE_ON;
|
||||||
}
|
}
|
||||||
} else if (submode == static_cast<Submode_t>(com::CcsdsSubmode::DATARATE_LOW)) {
|
};
|
||||||
|
auto rateLow = [&]() {
|
||||||
ReturnValue_t result = ptmeConfig->setRate(RATE_100KBPS);
|
ReturnValue_t result = ptmeConfig->setRate(RATE_100KBPS);
|
||||||
if (result == returnvalue::OK) {
|
if (result == returnvalue::OK) {
|
||||||
mode = HasModesIF::MODE_ON;
|
mode = HasModesIF::MODE_ON;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
if (mode == HasModesIF::MODE_ON) {
|
||||||
|
enableTransmit();
|
||||||
|
if (submode == static_cast<Submode_t>(com::CcsdsSubmode::DATARATE_DEFAULT)) {
|
||||||
|
com::Datarate currentDatarate = com::getCurrentDatarate();
|
||||||
|
if (currentDatarate == com::Datarate::LOW_RATE_MODULATION_BPSK) {
|
||||||
|
rateLow();
|
||||||
|
} else if (currentDatarate == com::Datarate::HIGH_RATE_MODULATION_0QPSK) {
|
||||||
|
rateHigh();
|
||||||
|
}
|
||||||
|
} else if (submode == static_cast<Submode_t>(com::CcsdsSubmode::DATARATE_HIGH)) {
|
||||||
|
rateHigh();
|
||||||
|
} else if (submode == static_cast<Submode_t>(com::CcsdsSubmode::DATARATE_LOW)) {
|
||||||
|
rateLow();
|
||||||
}
|
}
|
||||||
} else if (mode == HasModesIF::MODE_OFF) {
|
} else if (mode == HasModesIF::MODE_OFF) {
|
||||||
disableTransmit();
|
disableTransmit();
|
||||||
@ -399,9 +413,7 @@ void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) {
|
|||||||
announceMode(false);
|
announceMode(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CcsdsIpCoreHandler::announceMode(bool recursive) {
|
void CcsdsIpCoreHandler::announceMode(bool recursive) { triggerEvent(MODE_INFO, mode, submode); }
|
||||||
triggerEvent(MODE_INFO, mode, submode);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CcsdsIpCoreHandler::disableTransmit() {
|
void CcsdsIpCoreHandler::disableTransmit() {
|
||||||
#ifndef TE0720_1CFA
|
#ifndef TE0720_1CFA
|
||||||
|
Loading…
x
Reference in New Issue
Block a user