correct function used now

This commit is contained in:
Robin Müller 2020-09-26 15:32:16 +02:00
parent 55bdd2c2f5
commit 5062170407

View File

@ -154,9 +154,9 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(
} }
case(HousekeepingMessage::REPORT_DIAGNOSTICS_REPORT_STRUCTURES): case(HousekeepingMessage::REPORT_DIAGNOSTICS_REPORT_STRUCTURES):
return generateSetStructurePacket(sid, true);
case(HousekeepingMessage::REPORT_HK_REPORT_STRUCTURES): case(HousekeepingMessage::REPORT_HK_REPORT_STRUCTURES):
//return generateSetStructurePacket(sid, ); return generateSetStructurePacket(sid, false);
return HasReturnvaluesIF::RETURN_OK;
case(HousekeepingMessage::MODIFY_DIAGNOSTICS_REPORT_COLLECTION_INTERVAL): case(HousekeepingMessage::MODIFY_DIAGNOSTICS_REPORT_COLLECTION_INTERVAL):
case(HousekeepingMessage::MODIFY_PARAMETER_REPORT_COLLECTION_INTERVAL): { case(HousekeepingMessage::MODIFY_PARAMETER_REPORT_COLLECTION_INTERVAL): {
float newCollIntvl = 0; float newCollIntvl = 0;
@ -354,6 +354,7 @@ ReturnValue_t LocalDataPoolManager::changeCollectionInterval(sid_t sid,
ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid, ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid,
bool isDiagnostics) { bool isDiagnostics) {
// Get and check dataset first.
LocalPoolDataSetBase* dataSet = dynamic_cast<LocalPoolDataSetBase*>( LocalPoolDataSetBase* dataSet = dynamic_cast<LocalPoolDataSetBase*>(
owner->getDataSetHandle(sid)); owner->getDataSetHandle(sid));
if(dataSet == nullptr) { if(dataSet == nullptr) {
@ -373,6 +374,7 @@ ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid,
float collectionInterval = float collectionInterval =
dataSet->periodicHelper->getCollectionIntervalInSeconds(); dataSet->periodicHelper->getCollectionIntervalInSeconds();
// Generate set packet which can be serialized.
HousekeepingSetPacket setPacket = HousekeepingSetPacket(sid, HousekeepingSetPacket setPacket = HousekeepingSetPacket(sid,
reportingEnabled, valid, collectionInterval, dataSet); reportingEnabled, valid, collectionInterval, dataSet);
size_t expectedSize = setPacket.getSerializedSize(); size_t expectedSize = setPacket.getSerializedSize();
@ -386,6 +388,7 @@ ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid,
return result; return result;
} }
// Serialize set packet into store.
size_t size = 0; size_t size = 0;
result = setPacket.serialize(&storePtr, &size, expectedSize, result = setPacket.serialize(&storePtr, &size, expectedSize,
SerializeIF::Endianness::BIG); SerializeIF::Endianness::BIG);
@ -394,6 +397,7 @@ ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid,
"Expected size is not equal to serialized size" << std::endl; "Expected size is not equal to serialized size" << std::endl;
} }
// Send structure reporting reply.
CommandMessage reply; CommandMessage reply;
if(isDiagnostics) { if(isDiagnostics) {
HousekeepingMessage::setDiagnosticsStuctureReportReply(&reply, HousekeepingMessage::setDiagnosticsStuctureReportReply(&reply,