another tweak for TM stores

This commit is contained in:
Robin Müller 2023-05-25 08:43:52 +02:00
parent 65223ad3c7
commit 276501c504
Signed by: muellerr
GPG Key ID: A649FB78196E3849
2 changed files with 11 additions and 16 deletions

View File

@ -131,25 +131,22 @@ ReturnValue_t TmStoreTaskBase::performDump(PersistentTmStoreWithTmQueue& store,
dumpContext.ptmeBusyCounter = 0; dumpContext.ptmeBusyCounter = 0;
tmSinkBusyCd.resetTimer(); tmSinkBusyCd.resetTimer();
ReturnValue_t result = store.getNextDumpPacket(tmReader, fileHasSwapped); ReturnValue_t result = store.getNextDumpPacket(tmReader, fileHasSwapped);
if (result != returnvalue::OK) { if (fileHasSwapped and result == PersistentTmStore::DUMP_DONE) {
sif::error << "PersistentTmStore: Getting next dump packet failed" << std::endl;
} else if (fileHasSwapped and result == PersistentTmStore::DUMP_DONE) {
// This can happen if a file is corrupted and the next file swap completes the dump. // This can happen if a file is corrupted and the next file swap completes the dump.
dumpDoneHandler(); dumpDoneHandler();
return returnvalue::OK; return returnvalue::OK;
} else if (result != returnvalue::OK) {
sif::error << "PersistentTmStore: Getting next dump packet failed" << std::endl;
return result;
} }
dumpedLen = tmReader.getFullPacketLen(); dumpedLen = tmReader.getFullPacketLen();
// Only write to VC if mode is on, but always confirm the dump. result = channel.write(tmReader.getFullData(), dumpedLen);
// If the mode is OFF, it is assumed the PTME is not usable and is not allowed to be written if (result == DirectTmSinkIF::IS_BUSY) {
// (e.g. to confirm a reset or the transmitter is off anyway). sif::warning << "PersistentTmStore: Unexpected VC channel busy" << std::endl;
if (mode == MODE_ON) { } else if (result != returnvalue::OK) {
result = channel.write(tmReader.getFullData(), dumpedLen); sif::warning << "PersistentTmStore: Unexpected VC channel write failure" << std::endl;
if (result == DirectTmSinkIF::IS_BUSY) {
sif::warning << "PersistentTmStore: Unexpected VC channel busy" << std::endl;
} else if (result != returnvalue::OK) {
sif::warning << "PersistentTmStore: Unexpected VC channel write failure" << std::endl;
}
} }
result = store.confirmDump(tmReader, fileHasSwapped); result = store.confirmDump(tmReader, fileHasSwapped);
if ((result == PersistentTmStore::DUMP_DONE or result == returnvalue::OK)) { if ((result == PersistentTmStore::DUMP_DONE or result == returnvalue::OK)) {
dumpPerformed = true; dumpPerformed = true;

View File

@ -18,9 +18,7 @@ uint8_t VirtualChannel::getVcid() const { return vcId; }
const char* VirtualChannel::getName() const { return vcName.c_str(); } const char* VirtualChannel::getName() const { return vcName.c_str(); }
bool VirtualChannel::isBusy() const { bool VirtualChannel::isBusy() const { return ptme.isBusy(vcId); }
return ptme.isBusy(vcId);
}
void VirtualChannel::cancelTransfer() { ptme.cancelTransfer(vcId); } void VirtualChannel::cancelTransfer() { ptme.cancelTransfer(vcId); }