sth with eclipse indentiation
This commit is contained in:
parent
d87f78f5c3
commit
e9aecdac26
@ -1,3 +1,4 @@
|
|||||||
|
#include <fsfw/timemanager/CCSDSTime.h>
|
||||||
#include <fsfw/timemanager/TimeStamperIF.h>
|
#include <fsfw/timemanager/TimeStamperIF.h>
|
||||||
#include "LocalDataPoolManager.h"
|
#include "LocalDataPoolManager.h"
|
||||||
#include "LocalPoolObjectBase.h"
|
#include "LocalPoolObjectBase.h"
|
||||||
@ -204,32 +205,54 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(
|
|||||||
if(poolObj == nullptr) {
|
if(poolObj == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
if(poolObj->hasChanged()) {
|
|
||||||
|
if (not poolObj->hasChanged()) {
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
// prepare and send update snapshot.
|
// prepare and send update snapshot.
|
||||||
CommandMessage notification;
|
CommandMessage notification;
|
||||||
// todo: serialize into store with timestamp.
|
timeval now;
|
||||||
//TimeStamperIF* timeStamper = objectManager->
|
Clock::getClock_timeval(&now);
|
||||||
// get<TimeStamperIF>(objects::TIME_STAMPER)
|
CCSDSTime::CDS_short cds;
|
||||||
//HousekeepingPacketUpdate updatePacket(timeStamp, timeStampSize,
|
CCSDSTime::convertToCcsds(&cds, &now);
|
||||||
// owner->getDataSetHandle(receiver.dataId.sid));
|
HousekeepingPacketUpdate updatePacket(reinterpret_cast<uint8_t*>(&cds),
|
||||||
|
sizeof(cds), owner->getDataSetHandle(receiver.dataId.sid));
|
||||||
|
size_t updatePacketSize = updatePacket.getSerializedSize();
|
||||||
|
|
||||||
store_address_t storeId;
|
store_address_t storeId;
|
||||||
HousekeepingMessage::setUpdateSnapshotSetCommand(
|
uint8_t *storePtr = nullptr;
|
||||||
¬ification, receiver.dataId.sid, storeId);
|
ReturnValue_t result = ipcStore->getFreeElement(&storeId,
|
||||||
ReturnValue_t result = hkQueue->sendMessage(
|
updatePacket.getSerializedSize(), &storePtr);
|
||||||
receiver.destinationQueue, ¬ification);
|
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(¬ification,
|
||||||
|
receiver.dataId.sid, storeId);
|
||||||
|
result = hkQueue->sendMessage(receiver.destinationQueue,
|
||||||
|
¬ification);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
status = result;
|
status = result;
|
||||||
}
|
}
|
||||||
toReset = poolObj;
|
toReset = poolObj;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
LocalPoolDataSetBase* dataSet = owner->getDataSetHandle(
|
LocalPoolDataSetBase* dataSet = owner->getDataSetHandle(
|
||||||
receiver.dataId.sid);
|
receiver.dataId.sid);
|
||||||
if(dataSet == nullptr) {
|
if(dataSet == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
if(dataSet->hasChanged()) {
|
|
||||||
|
if(not dataSet->hasChanged()) {
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
// prepare and send update snapshot.
|
// prepare and send update snapshot.
|
||||||
CommandMessage notification;
|
CommandMessage notification;
|
||||||
// todo: serialize into store with timestamp.
|
// todo: serialize into store with timestamp.
|
||||||
@ -242,7 +265,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(
|
|||||||
status = result;
|
status = result;
|
||||||
}
|
}
|
||||||
toReset = dataSet;
|
toReset = dataSet;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(toReset != nullptr) {
|
if(toReset != nullptr) {
|
||||||
handleChangeResetLogic(receiver.dataType,
|
handleChangeResetLogic(receiver.dataType,
|
||||||
|
@ -236,12 +236,14 @@ void LocalPoolDataSetBase::initializePeriodicHelper(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LocalPoolDataSetBase::setChanged(bool changed) {
|
void LocalPoolDataSetBase::setChanged(bool changed) {
|
||||||
MutexHelper(mutex, MutexIF::TimeoutType::WAITING, 5);
|
// TODO: Make this configurable?
|
||||||
|
MutexHelper(mutex, MutexIF::TimeoutType::WAITING, 20);
|
||||||
this->changed = changed;
|
this->changed = changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LocalPoolDataSetBase::hasChanged() const {
|
bool LocalPoolDataSetBase::hasChanged() const {
|
||||||
MutexHelper(mutex, MutexIF::TimeoutType::WAITING, 5);
|
// TODO: Make this configurable?
|
||||||
|
MutexHelper(mutex, MutexIF::TimeoutType::WAITING, 20);
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user