local data pool manager bugfixes

This commit is contained in:
Robin Müller 2020-09-10 20:24:49 +02:00
parent d7bbd4b652
commit 2d2d0de35c
2 changed files with 11 additions and 11 deletions

View File

@ -177,8 +177,7 @@ const HasLocalDataPoolIF* LocalDataPoolManager::getOwner() const {
} }
ReturnValue_t LocalDataPoolManager::generateHousekeepingPacket(sid_t sid, ReturnValue_t LocalDataPoolManager::generateHousekeepingPacket(sid_t sid,
/*float collectionInterval, bool reportingEnabled, */ bool isDiagnostics, bool forDownlink, MessageQueueId_t destination) {
bool forDownlink, MessageQueueId_t destination) {
LocalPoolDataSetBase* dataSetToSerialize = LocalPoolDataSetBase* dataSetToSerialize =
dynamic_cast<LocalPoolDataSetBase*>(owner->getDataSetHandle(sid)); dynamic_cast<LocalPoolDataSetBase*>(owner->getDataSetHandle(sid));
if(dataSetToSerialize == nullptr) { if(dataSetToSerialize == nullptr) {
@ -188,9 +187,7 @@ ReturnValue_t LocalDataPoolManager::generateHousekeepingPacket(sid_t sid,
} }
store_address_t storeId; store_address_t storeId;
HousekeepingPacketDownlink hkPacket(sid,/* reportingEnabled, HousekeepingPacketDownlink hkPacket(sid, dataSetToSerialize);
collectionInterval, dataSetToSerialize->getFillCount(), */
dataSetToSerialize);
size_t serializedSize = 0; size_t serializedSize = 0;
ReturnValue_t result = serializeHkPacketIntoStore(hkPacket, storeId, ReturnValue_t result = serializeHkPacketIntoStore(hkPacket, storeId,
forDownlink, &serializedSize); forDownlink, &serializedSize);
@ -200,7 +197,13 @@ ReturnValue_t LocalDataPoolManager::generateHousekeepingPacket(sid_t sid,
// and now we set a HK message and send it the HK packet destination. // and now we set a HK message and send it the HK packet destination.
CommandMessage hkMessage; CommandMessage hkMessage;
if(isDiagnostics) {
HousekeepingMessage::setHkDiagnosticsMessage(&hkMessage, sid, storeId);
}
else {
HousekeepingMessage::setHkReportMessage(&hkMessage, sid, storeId); HousekeepingMessage::setHkReportMessage(&hkMessage, sid, storeId);
}
if(hkQueue == nullptr) { if(hkQueue == nullptr) {
return QUEUE_OR_DESTINATION_NOT_SET; return QUEUE_OR_DESTINATION_NOT_SET;
} }
@ -273,9 +276,7 @@ void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver* receiver) {
if(receiver->intervalCounter >= if(receiver->intervalCounter >=
receiver->hkParameter.collectionIntervalTicks) { receiver->hkParameter.collectionIntervalTicks) {
ReturnValue_t result = generateHousekeepingPacket( ReturnValue_t result = generateHousekeepingPacket(
receiver->dataId.dataSetSid, true receiver->dataId.dataSetSid, receiver->isDiagnostics, true);
/*intervalToIntervalSeconds(receiver->isDiagnostics,
receiver->hkParameter.collectionIntervalTicks), true */);
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
// configuration error // configuration error
sif::debug << "LocalDataPoolManager::performHkOperation:" sif::debug << "LocalDataPoolManager::performHkOperation:"

View File

@ -110,8 +110,7 @@ public:
* @return * @return
*/ */
ReturnValue_t generateHousekeepingPacket(sid_t sid, ReturnValue_t generateHousekeepingPacket(sid_t sid,
bool forDownlink, bool isDiagnostics, bool forDownlink,
/*float collectionInterval, bool reportingEnabled, */
MessageQueueId_t destination = MessageQueueIF::NO_QUEUE); MessageQueueId_t destination = MessageQueueIF::NO_QUEUE);
ReturnValue_t generateSetStructurePacket(sid_t sid); ReturnValue_t generateSetStructurePacket(sid_t sid);