smaller fixes for internal error reporter

This commit is contained in:
2024-11-05 17:34:20 +01:00
parent 324b00db58
commit 583fe177db
2 changed files with 15 additions and 31 deletions

View File

@ -9,10 +9,10 @@ InternalErrorReporter::InternalErrorReporter(object_id_t setObjectId, uint32_t m
bool enableSetByDefault, bool enableSetByDefault,
dur_millis_t generationFrequency) dur_millis_t generationFrequency)
: SystemObject(setObjectId), : SystemObject(setObjectId),
sharedPool(getObjectId()),
hkHelper(this, nullptr), hkHelper(this, nullptr),
enableSetByDefault(enableSetByDefault), enableSetByDefault(enableSetByDefault),
generationFrequency(generationFrequency), generationFrequency(generationFrequency),
sharedPool(getObjectId()),
internalErrorSid(setObjectId, InternalErrorDataset::ERROR_SET_ID), internalErrorSid(setObjectId, InternalErrorDataset::ERROR_SET_ID),
internalErrorDataset(sharedPool) { internalErrorDataset(sharedPool) {
commandQueue = QueueFactory::instance()->createMessageQueue(messageQueueDepth); commandQueue = QueueFactory::instance()->createMessageQueue(messageQueueDepth);
@ -144,14 +144,6 @@ ReturnValue_t InternalErrorReporter::initializeLocalDataPool(
} }
*/ */
// dur_millis_t InternalErrorReporter::getPeriodicOperationFrequency() const {
// return this->executingTask->getPeriodMs();
//}
// LocalPoolDataSetBase *InternalErrorReporter::getDataSetHandle(sid_t sid) {
// return &internalErrorDataset;
//}
void InternalErrorReporter::setTaskIF(PeriodicTaskIF *task) { this->executingTask = task; } void InternalErrorReporter::setTaskIF(PeriodicTaskIF *task) { this->executingTask = task; }
ReturnValue_t InternalErrorReporter::initialize() { ReturnValue_t InternalErrorReporter::initialize() {
@ -162,23 +154,18 @@ ReturnValue_t InternalErrorReporter::initialize() {
return SystemObject::initialize(); return SystemObject::initialize();
} }
ReturnValue_t InternalErrorReporter::initializeAfterTaskCreation() {
// return poolManager.initializeAfterTaskCreation();
}
void InternalErrorReporter::setMutexTimeout(MutexIF::TimeoutType timeoutType, uint32_t timeoutMs) { void InternalErrorReporter::setMutexTimeout(MutexIF::TimeoutType timeoutType, uint32_t timeoutMs) {
this->timeoutType = timeoutType; this->timeoutType = timeoutType;
this->timeoutMs = timeoutMs; this->timeoutMs = timeoutMs;
} }
// PeriodicHkGenerationHelper *InternalErrorReporter::getHkManagerHandle() { return &poolManager; }
ReturnValue_t InternalErrorReporter::serializeDataset(sid_t structureId, uint8_t *buf, ReturnValue_t InternalErrorReporter::serializeDataset(sid_t structureId, uint8_t *buf,
size_t maxSize) { size_t maxSize) {
if (structureId == internalErrorDataset.getSid()) { if (structureId == internalErrorDataset.getSid()) {
size_t serSize = 0; size_t serSize = 0;
internalErrorDataset.serialize(buf, serSize, maxSize, SerializeIF::Endianness::NETWORK); return internalErrorDataset.serialize(buf, serSize, maxSize, SerializeIF::Endianness::NETWORK);
} }
return returnvalue::FAILED;
} }
ReturnValue_t InternalErrorReporter::specifyDatasets( ReturnValue_t InternalErrorReporter::specifyDatasets(

View File

@ -33,31 +33,28 @@ class InternalErrorReporter : public SystemObject,
void setMutexTimeout(MutexIF::TimeoutType timeoutType, uint32_t timeoutMs); void setMutexTimeout(MutexIF::TimeoutType timeoutType, uint32_t timeoutMs);
virtual ~InternalErrorReporter(); ~InternalErrorReporter() override;
virtual object_id_t getObjectId() const override; [[nodiscard]] object_id_t getObjectId() const override;
virtual MessageQueueId_t getCommandQueue() const override; [[nodiscard]] MessageQueueId_t getCommandQueue() const override;
virtual localpool::SharedPool* getOptionalSharedPool() override; localpool::SharedPool* getOptionalSharedPool() override;
virtual ReturnValue_t serializeDataset(sid_t structureId, uint8_t* buf, size_t maxSize) override; ReturnValue_t serializeDataset(sid_t structureId, uint8_t* buf, size_t maxSize) override;
virtual ReturnValue_t specifyDatasets( ReturnValue_t specifyDatasets(
std::vector<periodicHk::SetSpecification>& setSpecification) override; std::vector<periodicHk::SetSpecification>& setSpecification) override;
// PeriodicHkGenerationHelper* getHkManagerHandle() override; ReturnValue_t initialize() override;
ReturnValue_t performOperation(uint8_t opCode) override;
virtual ReturnValue_t initialize() override; void queueMessageNotSent() override;
virtual ReturnValue_t initializeAfterTaskCreation() override;
virtual ReturnValue_t performOperation(uint8_t opCode) override;
virtual void queueMessageNotSent() override; void lostTm() override;
virtual void lostTm() override; void storeFull() override;
virtual void storeFull() override; void setTaskIF(PeriodicTaskIF* task) override;
virtual void setTaskIF(PeriodicTaskIF* task) override;
protected: protected:
MessageQueueIF* commandQueue; MessageQueueIF* commandQueue;