- COM Subsystem now handles datarate config - torquer config and comCfg moved to mission/config folder - CCSDS Handler: Added default rate submode
This commit is contained in:
@ -1,5 +1,32 @@
|
||||
#include "ComSubsystem.h"
|
||||
|
||||
#include <fsfw/ipc/MutexGuard.h>
|
||||
|
||||
#include "mission/config/comCfg.h"
|
||||
|
||||
ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
|
||||
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_
|
||||
#define MISSION_SYSTEM_COMSUBSYSTEM_H_
|
||||
|
||||
#include <fsfw/parameters/HasParametersIF.h>
|
||||
#include <fsfw/parameters/ParameterHelper.h>
|
||||
#include <fsfw/subsystem/Subsystem.h>
|
||||
|
||||
class ComSubsystem : public Subsystem {
|
||||
#include "mission/comDefs.h"
|
||||
|
||||
class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
|
||||
public:
|
||||
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:
|
||||
uint8_t datarateCfg = static_cast<uint8_t>(com::Datarate::LOW_RATE_MODULATION_BPSK);
|
||||
ParameterHelper paramHelper;
|
||||
};
|
||||
|
||||
#endif /* MISSION_SYSTEM_COMSUBSYSTEM_H_ */
|
||||
|
Reference in New Issue
Block a user