some more minor fixes

This commit is contained in:
Robin Müller 2022-07-27 19:40:54 +02:00
parent 356d778743
commit 4e571e5082
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
3 changed files with 26 additions and 9 deletions

View File

@ -263,7 +263,8 @@ void CommandingServiceBase::handleRequestQueue() {
object_id_t objectId;
for (result = requestQueue->receiveMessage(&message); result == RETURN_OK;
result = requestQueue->receiveMessage(&message)) {
result = setUpTcReader(message.getStorageId());
address = message.getStorageId();
result = setUpTcReader(address);
if (result != HasReturnvaluesIF::RETURN_OK) {
// TODO: Warning?
rejectPacket(tcverif::START_FAILURE, address, result);

View File

@ -140,12 +140,15 @@ void PusServiceBase::setErrorReporter(InternalErrorReporterIF& errReporter_) {
psbParams.errReporter = &errReporter_;
}
void PusServiceBase::initializeTmHelpers(TmSendHelper& tmSendHelper, TmStoreHelper& tmStoreHelper) {
initializeTmSendHelper(tmSendHelper);
initializeTmStoreHelper(tmStoreHelper);
ReturnValue_t PusServiceBase::initializeTmHelpers(TmSendHelper& tmSendHelper, TmStoreHelper& tmStoreHelper) {
ReturnValue_t result = initializeTmSendHelper(tmSendHelper);
if(result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
return initializeTmStoreHelper(tmStoreHelper);
}
void PusServiceBase::initializeTmSendHelper(TmSendHelper& tmSendHelper) {
ReturnValue_t PusServiceBase::initializeTmSendHelper(TmSendHelper& tmSendHelper) {
if (psbParams.reqQueue != nullptr) {
tmSendHelper.setMsgQueue(*psbParams.reqQueue);
tmSendHelper.setDefaultDestination(psbParams.reqQueue->getDefaultDestination());
@ -160,16 +163,29 @@ void PusServiceBase::initializeTmSendHelper(TmSendHelper& tmSendHelper) {
} else {
tmSendHelper.setInternalErrorReporter(*psbParams.errReporter);
}
return RETURN_OK;
}
void PusServiceBase::initializeTmStoreHelper(TmStoreHelper& tmStoreHelper) const {
ReturnValue_t PusServiceBase::initializeTmStoreHelper(TmStoreHelper& tmStoreHelper) const {
tmStoreHelper.setApid(psbParams.apid);
if(tmStoreHelper.getTmStore() == nullptr) {
auto* tmStore = ObjectManager::instance()->get<StorageManagerIF>(objects::TM_STORE);
if(tmStore == nullptr) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
tmStoreHelper.setTmStore(*tmStore);
}
if (psbParams.timeStamper == nullptr) {
auto timerStamper = ObjectManager::instance()->get<TimeStamperIF>(objects::TIME_STAMPER);
if (timerStamper != nullptr) {
tmStoreHelper.setTimeStamper(*timerStamper);
}
}
// Generally, all TM packets will pass through a layer where the sequence count is set.
// This avoids duplicate calculation of the CRC16
tmStoreHelper.disableCrcCalculation();
return RETURN_OK;
}
void PusServiceBase::setVerificationReporter(VerificationReporterIF& reporter) {

View File

@ -132,19 +132,19 @@ class PusServiceBase : public ExecutableObjectIF,
* Helper methods if the implementing class wants to send telemetry
* @param tmSendHelper
*/
void initializeTmSendHelper(TmSendHelper& tmSendHelper);
ReturnValue_t initializeTmSendHelper(TmSendHelper& tmSendHelper);
/**
* Helper methods if the implementing class wants to store telemetry. It will set the correct APID
* and it will also attempt to set a valid time stamper. If the manually specified time stamper is
* null, it will attempt to find a suitable one using @objects::TIME_STAMPER
* @param tmSendHelper
*/
void initializeTmStoreHelper(TmStoreHelper& tmStoreHelper) const;
ReturnValue_t initializeTmStoreHelper(TmStoreHelper& tmStoreHelper) const;
/**
* Helper methods if the implementing class wants to both send and store telemetry
* @param tmSendHelper
*/
void initializeTmHelpers(TmSendHelper& tmSendHelper, TmStoreHelper& tmStoreHelper);
ReturnValue_t initializeTmHelpers(TmSendHelper& tmSendHelper, TmStoreHelper& tmStoreHelper);
/**
* @brief The handleRequest method shall handle any kind of Telecommand