Merge remote-tracking branch 'upstream/development' into mueller/master

This commit is contained in:
2022-03-04 15:08:45 +01:00
12 changed files with 214 additions and 42 deletions

View File

@ -84,8 +84,8 @@ ReturnValue_t LocalDataPoolManager::initializeHousekeepingPoolEntriesOnce() {
return result;
}
printWarningOrError(sif::OutputTypes::OUT_WARNING, "initialize", HasReturnvaluesIF::RETURN_FAILED,
"The map should only be initialized once");
printWarningOrError(sif::OutputTypes::OUT_WARNING, "initializeHousekeepingPoolEntriesOnce",
HasReturnvaluesIF::RETURN_FAILED, "The map should only be initialized once");
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -58,6 +58,9 @@ ReturnValue_t InternalErrorReporter::performOperation(uint8_t opCode) {
internalErrorDataset.storeHits.value += newStoreHits;
internalErrorDataset.tmHits.value += newTmHits;
internalErrorDataset.setValidity(true, true);
if ((newQueueHits != 0) or (newStoreHits != 0) or (newTmHits != 0)) {
internalErrorDataset.setChanged(true);
}
}
}
@ -78,14 +81,6 @@ uint32_t InternalErrorReporter::getAndResetQueueHits() {
return value;
}
uint32_t InternalErrorReporter::getQueueHits() {
uint32_t value;
mutex->lockMutex(timeoutType, timeoutMs);
value = queueHits;
mutex->unlockMutex();
return value;
}
void InternalErrorReporter::incrementQueueHits() {
mutex->lockMutex(timeoutType, timeoutMs);
queueHits++;
@ -101,14 +96,6 @@ uint32_t InternalErrorReporter::getAndResetTmHits() {
return value;
}
uint32_t InternalErrorReporter::getTmHits() {
uint32_t value;
mutex->lockMutex(timeoutType, timeoutMs);
value = tmHits;
mutex->unlockMutex();
return value;
}
void InternalErrorReporter::incrementTmHits() {
mutex->lockMutex(timeoutType, timeoutMs);
tmHits++;
@ -126,14 +113,6 @@ uint32_t InternalErrorReporter::getAndResetStoreHits() {
return value;
}
uint32_t InternalErrorReporter::getStoreHits() {
uint32_t value;
mutex->lockMutex(timeoutType, timeoutMs);
value = storeHits;
mutex->unlockMutex();
return value;
}
void InternalErrorReporter::incrementStoreHits() {
mutex->lockMutex(timeoutType, timeoutMs);
storeHits++;

View File

@ -46,11 +46,11 @@ class InternalErrorReporter : public SystemObject,
virtual ReturnValue_t initializeAfterTaskCreation() override;
virtual ReturnValue_t performOperation(uint8_t opCode) override;
virtual void queueMessageNotSent();
virtual void queueMessageNotSent() override;
virtual void lostTm();
virtual void lostTm() override;
virtual void storeFull();
virtual void storeFull() override;
virtual void setTaskIF(PeriodicTaskIF* task) override;
@ -74,15 +74,12 @@ class InternalErrorReporter : public SystemObject,
uint32_t storeHits = 0;
uint32_t getAndResetQueueHits();
uint32_t getQueueHits();
void incrementQueueHits();
uint32_t getAndResetTmHits();
uint32_t getTmHits();
void incrementTmHits();
uint32_t getAndResetStoreHits();
uint32_t getStoreHits();
void incrementStoreHits();
};

View File

@ -1,22 +1,34 @@
#ifndef INTERNALERRORREPORTERIF_H_
#define INTERNALERRORREPORTERIF_H_
/**
* @brief Interface which is used to report internal errors like full message queues or stores.
* @details
* This interface smust be used for the InteralErrorReporter object.
* It should be used to indicate that there was a Problem with Queues or Stores.
*
* It can be used to report missing Telemetry which could not be sent due to a internal problem.
*
*/
class InternalErrorReporterIF {
public:
virtual ~InternalErrorReporterIF() {}
/**
* Thread safe
* @brief Function to be called if a message queue could not be sent.
* @details OSAL Implementations should call this function to indicate that
* a message was lost.
*
* Implementations are required to be Thread safe
*/
virtual void queueMessageNotSent() = 0;
/**
* Thread safe
* @brief Function to be called if Telemetry could not be sent
* @details Implementations must be Thread safe
*/
virtual void lostTm() = 0;
/**
* Thread safe
* @brief Function to be called if a onboard storage is full
* @details Implementations must be Thread safe
*/
virtual void storeFull() = 0;
};

View File

@ -125,6 +125,13 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo,
memcpy(targetQueue->messageQueue.back().data(), message->getBuffer(),
message->getMaximumMessageSize());
} else {
if (not ignoreFault) {
InternalErrorReporterIF* internalErrorReporter =
ObjectManager::instance()->get<InternalErrorReporterIF>(objects::INTERNAL_ERROR_REPORTER);
if (internalErrorReporter != nullptr) {
internalErrorReporter->queueMessageNotSent();
}
}
return MessageQueueIF::FULL;
}
return HasReturnvaluesIF::RETURN_OK;