cancel transfer on TX disabled
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
parent
437288de1e
commit
746254a838
@ -28,6 +28,12 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store,
|
||||
}
|
||||
// Dump TMs when applicable
|
||||
if (store.getState() == PersistentTmStore::State::DUMPING) {
|
||||
// The PTME might have been reset an transmitter state change, so there is
|
||||
// not point in continuing the dump.
|
||||
if(not channel.isTxOn()) {
|
||||
cancelDump(dumpContext, store, false);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
size_t dumpedLen = 0;
|
||||
if (not channel.isBusy()) {
|
||||
dumpContext.ptmeBusyCounter = 0;
|
||||
@ -60,15 +66,12 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store,
|
||||
sif::warning << "PTME busy for longer period. Dumped length so far: "
|
||||
<< dumpContext.dumpedBytes << std::endl;
|
||||
triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId());
|
||||
dumpContext.reset();
|
||||
store.cancelDump();
|
||||
channel.cancelTransfer();
|
||||
cancelDump(dumpContext, store, channel.isTxOn());
|
||||
}
|
||||
}
|
||||
if (cancelDumpCd.hasTimedOut() or tmSinkBusyCd.hasTimedOut()) {
|
||||
triggerEvent(persTmStore::DUMP_WAS_CANCELLED, store.getObjectId());
|
||||
dumpDoneHandler(dumpContext);
|
||||
store.cancelDump();
|
||||
cancelDump(dumpContext, store, channel.isTxOn());
|
||||
}
|
||||
} else {
|
||||
Command_t execCmd;
|
||||
@ -108,4 +111,10 @@ bool TmStoreTaskBase::cyclicStoreCheck() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void TmStoreTaskBase::dumpDoneHandler(DumpContext& ctx) { ctx.reset(); }
|
||||
void TmStoreTaskBase::cancelDump(DumpContext& ctx, PersistentTmStore& store, bool isTxOn) {
|
||||
ctx.reset();
|
||||
store.cancelDump();
|
||||
if(isTxOn) {
|
||||
channel.cancelTransfer();
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class TmStoreTaskBase : public SystemObject {
|
||||
bool fileHasSwapped = false;
|
||||
SdCardMountedIF& sdcMan;
|
||||
|
||||
void dumpDoneHandler(DumpContext& ctx);
|
||||
void cancelDump(DumpContext& ctx, PersistentTmStore& store, bool isTxOn);
|
||||
};
|
||||
|
||||
#endif /* MISSION_TMTC_TMSTORETASKBASE_H_ */
|
||||
|
@ -11,10 +11,10 @@ ReturnValue_t VirtualChannel::sendNextTm(const uint8_t* data, size_t size) {
|
||||
}
|
||||
|
||||
ReturnValue_t VirtualChannel::write(const uint8_t* data, size_t size) {
|
||||
// if (txOn) {
|
||||
return ptme.writeToVc(vcId, data, size);
|
||||
//}
|
||||
// return returnvalue::OK;
|
||||
if (txOn) {
|
||||
return ptme.writeToVc(vcId, data, size);
|
||||
}
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
uint8_t VirtualChannel::getVcid() const { return vcId; }
|
||||
@ -23,10 +23,16 @@ const char* VirtualChannel::getName() const { return vcName.c_str(); }
|
||||
|
||||
bool VirtualChannel::isBusy() const {
|
||||
// Data is discarded, so channel is not busy.
|
||||
// if (not txOn) {
|
||||
// return false;
|
||||
//}
|
||||
if (not txOn) {
|
||||
return false;
|
||||
}
|
||||
return ptme.isBusy(vcId);
|
||||
}
|
||||
|
||||
void VirtualChannel::cancelTransfer() { ptme.cancelTransfer(vcId); }
|
||||
void VirtualChannel::cancelTransfer() {
|
||||
ptme.cancelTransfer(vcId);
|
||||
}
|
||||
|
||||
bool VirtualChannel::isTxOn() const {
|
||||
return txOn;
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ class VirtualChannel : public SystemObject, public VirtualChannelIF {
|
||||
ReturnValue_t write(const uint8_t* data, size_t size) override;
|
||||
void cancelTransfer() override;
|
||||
uint8_t getVcid() const;
|
||||
bool isTxOn() const;
|
||||
|
||||
const char* getName() const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user