commanding service base hotfix

This commit is contained in:
Robin Müller 2020-09-22 14:00:18 +02:00
parent 42bfedd36c
commit 7851a71a8e
2 changed files with 8 additions and 4 deletions

View File

@ -384,7 +384,7 @@ void CommandingServiceBase::acceptPacket(uint8_t reportId,
} }
void CommandingServiceBase::checkAndExecuteFifo(CommandMapIter iter) { void CommandingServiceBase::checkAndExecuteFifo(CommandMapIter& iter) {
store_address_t address; store_address_t address;
if (iter->second.fifo.retrieve(&address) != RETURN_OK) { if (iter->second.fifo.retrieve(&address) != RETURN_OK) {
commandMap.erase(&iter); commandMap.erase(&iter);

View File

@ -39,7 +39,11 @@ class CommandingServiceBase: public SystemObject,
public HasReturnvaluesIF { public HasReturnvaluesIF {
friend void (Factory::setStaticFrameworkObjectIds)(); friend void (Factory::setStaticFrameworkObjectIds)();
public: public:
// We could make this configurable via preprocessor and the FSFWConfig file.
static constexpr uint8_t COMMAND_INFO_FIFO_DEPTH = 3;
static const uint8_t INTERFACE_ID = CLASS_ID::COMMAND_SERVICE_BASE; static const uint8_t INTERFACE_ID = CLASS_ID::COMMAND_SERVICE_BASE;
static const ReturnValue_t EXECUTION_COMPLETE = MAKE_RETURN_CODE(1); static const ReturnValue_t EXECUTION_COMPLETE = MAKE_RETURN_CODE(1);
static const ReturnValue_t NO_STEP_MESSAGE = MAKE_RETURN_CODE(2); static const ReturnValue_t NO_STEP_MESSAGE = MAKE_RETURN_CODE(2);
static const ReturnValue_t OBJECT_BUSY = MAKE_RETURN_CODE(3); static const ReturnValue_t OBJECT_BUSY = MAKE_RETURN_CODE(3);
@ -223,7 +227,7 @@ protected:
uint32_t state; uint32_t state;
Command_t command; Command_t command;
object_id_t objectId; object_id_t objectId;
FIFO<store_address_t, 3> fifo; FIFO<store_address_t, COMMAND_INFO_FIFO_DEPTH> fifo;
virtual ReturnValue_t serialize(uint8_t **buffer, size_t *size, virtual ReturnValue_t serialize(uint8_t **buffer, size_t *size,
size_t maxSize, Endianness streamEndianness) const override{ size_t maxSize, Endianness streamEndianness) const override{
@ -235,7 +239,7 @@ protected:
}; };
virtual ReturnValue_t deSerialize(const uint8_t **buffer, size_t *size, virtual ReturnValue_t deSerialize(const uint8_t **buffer, size_t *size,
Endianness streamEndianness) override{ Endianness streamEndianness) override {
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;
}; };
}; };
@ -312,7 +316,7 @@ protected:
ReturnValue_t sendTmPacket(uint8_t subservice, SerializeIF* content, ReturnValue_t sendTmPacket(uint8_t subservice, SerializeIF* content,
SerializeIF* header = nullptr); SerializeIF* header = nullptr);
void checkAndExecuteFifo(CommandMapIter iter); void checkAndExecuteFifo(CommandMapIter& iter);
private: private:
/** /**