several simplifications

This commit is contained in:
Robin Müller 2020-08-10 18:33:28 +02:00
parent 87eb31b65a
commit f39b8bdb41
5 changed files with 7 additions and 22 deletions

View File

@ -131,11 +131,6 @@ ReturnValue_t LocalDataPoolManager::generateHousekeepingPacket(sid_t sid,
return HasReturnvaluesIF::RETURN_FAILED;
}
// do we generate hk packets for invalid datasets?
// if(not dataSetToSerialize->isValid()) {
// return HasReturnvaluesIF::RETURN_OK;
// }
store_address_t storeId;
HousekeepingPacketDownlink hkPacket(sid, collectionInterval,
dataSetToSerialize->getFillCount(), dataSetToSerialize);
@ -249,7 +244,7 @@ ReturnValue_t LocalDataPoolManager::performHkOperation() {
void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver* receiver) {
if(receiver->intervalCounter >= intervalSecondsToInterval(
receiver->isDiagnostics,
receiver->hkParameter.collectionInterval)) {
receiver->hkParameter.collectionIntervalSeconds)) {
ReturnValue_t result = generateHousekeepingPacket(
receiver->dataId.dataSetSid, receiver->destinationQueue);
if(result != HasReturnvaluesIF::RETURN_OK) {
@ -279,7 +274,7 @@ uint32_t LocalDataPoolManager::intervalSecondsToInterval(bool isDiagnostics,
float LocalDataPoolManager::intervalToIntervalSeconds(bool isDiagnostics,
uint32_t collectionInterval) {
if(isDiagnostics) {
return static_cast<float>(collectionInterval * diagnosticMinimumInterval);
return static_cast<float>(collectionInterval * diagnosticMinimumInterval);
}
else {
return static_cast<float>(collectionInterval * regularMinimumInterval);

View File

@ -176,7 +176,7 @@ private:
type */
union HkParameter {
/** This parameter will be used for the PERIODIC type */
dur_seconds_t collectionInterval = 0;
float collectionIntervalSeconds = 0;
/** This parameter will be used for the ON_UPDATE type */
bool hkDataChanged;
};

View File

@ -8,7 +8,7 @@ void HousekeepingMessage::setHkReportMessage(CommandMessage* message, sid_t sid,
message->setCommand(HK_REPORT);
message->setMessageSize(HK_MESSAGE_SIZE);
setSid(message, sid);
setParameter(message, storeId.raw);
message->setParameter3(storeId.raw);
}
void HousekeepingMessage::setHkDiagnosticsMessage(CommandMessage* message,
@ -16,13 +16,13 @@ void HousekeepingMessage::setHkDiagnosticsMessage(CommandMessage* message,
message->setCommand(DIAGNOSTICS_REPORT);
message->setMessageSize(HK_MESSAGE_SIZE);
setSid(message, sid);
setParameter(message, storeId.raw);
message->setParameter3(storeId.raw);
}
sid_t HousekeepingMessage::getHkReportMessage(const CommandMessage *message,
store_address_t *storeIdToSet) {
if(storeIdToSet != nullptr) {
*storeIdToSet = getParameter(message);
*storeIdToSet = message->getParameter3();
}
return getSid(message);
}
@ -37,12 +37,3 @@ void HousekeepingMessage::setSid(CommandMessage *message, sid_t sid) {
std::memcpy(message->getData(), &sid.raw, sizeof(sid.raw));
}
void HousekeepingMessage::setParameter(CommandMessage *message,
uint32_t parameter) {
message->setParameter3(parameter);
}
uint32_t HousekeepingMessage::getParameter(const CommandMessage *message) {
return message->getParameter3();
}

View File

@ -112,8 +112,6 @@ public:
private:
static void setSid(CommandMessage* message, sid_t sid);
static void setParameter(CommandMessage* message, uint32_t parameter);
static uint32_t getParameter(const CommandMessage* message);
};

View File

@ -132,6 +132,7 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo,
else {
destination = reinterpret_cast<QueueHandle_t>(sendTo);
}
message->setSender(sentFrom);