sth with eclipse indentiation

This commit is contained in:
Robin Müller 2020-11-03 22:58:09 +01:00
parent d87f78f5c3
commit e9aecdac26
2 changed files with 341 additions and 316 deletions

View File

@ -1,3 +1,4 @@
#include <fsfw/timemanager/CCSDSTime.h>
#include <fsfw/timemanager/TimeStamperIF.h>
#include "LocalDataPoolManager.h"
#include "LocalPoolObjectBase.h"
@ -204,32 +205,54 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(
if(poolObj == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
if(poolObj->hasChanged()) {
if (not poolObj->hasChanged()) {
return HasReturnvaluesIF::RETURN_OK;
}
// prepare and send update snapshot.
CommandMessage notification;
// todo: serialize into store with timestamp.
//TimeStamperIF* timeStamper = objectManager->
// get<TimeStamperIF>(objects::TIME_STAMPER)
//HousekeepingPacketUpdate updatePacket(timeStamp, timeStampSize,
// owner->getDataSetHandle(receiver.dataId.sid));
timeval now;
Clock::getClock_timeval(&now);
CCSDSTime::CDS_short cds;
CCSDSTime::convertToCcsds(&cds, &now);
HousekeepingPacketUpdate updatePacket(reinterpret_cast<uint8_t*>(&cds),
sizeof(cds), owner->getDataSetHandle(receiver.dataId.sid));
size_t updatePacketSize = updatePacket.getSerializedSize();
store_address_t storeId;
HousekeepingMessage::setUpdateSnapshotSetCommand(
&notification, receiver.dataId.sid, storeId);
ReturnValue_t result = hkQueue->sendMessage(
receiver.destinationQueue, &notification);
if(result != HasReturnvaluesIF::RETURN_OK) {
uint8_t *storePtr = nullptr;
ReturnValue_t result = ipcStore->getFreeElement(&storeId,
updatePacket.getSerializedSize(), &storePtr);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
size_t serializedSize = 0;
result = updatePacket.serialize(&storePtr, &serializedSize,
updatePacketSize, SerializeIF::Endianness::MACHINE);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
HousekeepingMessage::setUpdateSnapshotSetCommand(&notification,
receiver.dataId.sid, storeId);
result = hkQueue->sendMessage(receiver.destinationQueue,
&notification);
if (result != HasReturnvaluesIF::RETURN_OK) {
status = result;
}
toReset = poolObj;
}
}
else {
LocalPoolDataSetBase* dataSet = owner->getDataSetHandle(
receiver.dataId.sid);
if(dataSet == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
if(dataSet->hasChanged()) {
if(not dataSet->hasChanged()) {
return HasReturnvaluesIF::RETURN_OK;
}
// prepare and send update snapshot.
CommandMessage notification;
// todo: serialize into store with timestamp.
@ -242,7 +265,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(
status = result;
}
toReset = dataSet;
}
}
if(toReset != nullptr) {
handleChangeResetLogic(receiver.dataType,

View File

@ -236,12 +236,14 @@ void LocalPoolDataSetBase::initializePeriodicHelper(
}
void LocalPoolDataSetBase::setChanged(bool changed) {
MutexHelper(mutex, MutexIF::TimeoutType::WAITING, 5);
// TODO: Make this configurable?
MutexHelper(mutex, MutexIF::TimeoutType::WAITING, 20);
this->changed = changed;
}
bool LocalPoolDataSetBase::hasChanged() const {
MutexHelper(mutex, MutexIF::TimeoutType::WAITING, 5);
// TODO: Make this configurable?
MutexHelper(mutex, MutexIF::TimeoutType::WAITING, 20);
return changed;
}