internal bugfix

This commit is contained in:
Robin Müller 2020-09-18 15:06:14 +02:00
parent 33e7cca23c
commit 757d2275ea
2 changed files with 10 additions and 10 deletions

View File

@ -121,7 +121,7 @@ ReturnValue_t Service3Housekeeping::prepareReportingTogglingCommand(
return CommandingServiceBase::INVALID_TC;
}
sid_t targetSid = buildSid(objectId, tcData, tcDataLen);
sid_t targetSid = buildSid(objectId, &tcData, &tcDataLen);
HousekeepingMessage::setToggleReportingCommand(command, targetSid,
enableReporting, isDiagnostics);
return HasReturnvaluesIF::RETURN_OK;
@ -135,7 +135,7 @@ ReturnValue_t Service3Housekeeping::prepareStructureReportingCommand(
return CommandingServiceBase::INVALID_TC;
}
sid_t targetSid = buildSid(objectId, tcData, tcDataLen);
sid_t targetSid = buildSid(objectId, &tcData, &tcDataLen);
HousekeepingMessage::setStructureReportingCommand(command, targetSid,
isDiagnostics);
return HasReturnvaluesIF::RETURN_OK;
@ -149,7 +149,7 @@ ReturnValue_t Service3Housekeeping::prepareOneShotReportCommand(
return CommandingServiceBase::INVALID_TC;
}
sid_t targetSid = buildSid(objectId, tcData, tcDataLen);
sid_t targetSid = buildSid(objectId, &tcData, &tcDataLen);
HousekeepingMessage::setOneShotReportCommand(command, targetSid,
isDiagnostics);
return HasReturnvaluesIF::RETURN_OK;
@ -163,7 +163,7 @@ ReturnValue_t Service3Housekeeping::prepareCollectionIntervalModificationCommand
return CommandingServiceBase::INVALID_TC;
}
sid_t targetSid = buildSid(objectId, tcData, tcDataLen);
sid_t targetSid = buildSid(objectId, &tcData, &tcDataLen);
float newCollectionInterval = 0;
SerializeAdapter::deSerialize(&newCollectionInterval, &tcData, &tcDataLen,
SerializeIF::Endianness::BIG);
@ -270,14 +270,14 @@ ReturnValue_t Service3Housekeeping::generateHkReport(
}
sid_t Service3Housekeeping::buildSid(object_id_t objectId,
const uint8_t* tcData, size_t tcDataLen) {
const uint8_t** tcData, size_t* tcDataLen) {
sid_t targetSid;
targetSid.objectId = objectId;
// skip deserialization of object ID, was already done.
tcData += sizeof(object_id_t);
tcDataLen -= sizeof(object_id_t);
*tcData += sizeof(object_id_t);
*tcDataLen -= sizeof(object_id_t);
// size check is expected to be performed beforehand!
SerializeAdapter::deSerialize(&targetSid.ownerSetId, &tcData, &tcDataLen,
SerializeAdapter::deSerialize(&targetSid.ownerSetId, tcData, tcDataLen,
SerializeIF::Endianness::BIG);
return targetSid;
}

View File

@ -98,8 +98,8 @@ private:
const uint8_t* tcData, size_t tcDataLen);
void handleUnrequestedReply(CommandMessage* reply) override;
sid_t buildSid(object_id_t objectId, const uint8_t* tcData,
size_t tcDataLen);
sid_t buildSid(object_id_t objectId, const uint8_t** tcData,
size_t* tcDataLen);
};
#endif /* FSFW_PUS_SERVICE3HOUSEKEEPINGSERVICE_H_ */