this is more useful information
This commit is contained in:
parent
97698a08d5
commit
a4e6d877ff
@ -28,15 +28,15 @@ static constexpr Event BUSY_DUMPING_EVENT = event::makeEvent(SUBSYSTEM_ID, 2, se
|
|||||||
//! [EXPORT] : [COMMENT] Dump was cancelled. P1: Object ID of store.
|
//! [EXPORT] : [COMMENT] Dump was cancelled. P1: Object ID of store.
|
||||||
static constexpr Event DUMP_WAS_CANCELLED = event::makeEvent(SUBSYSTEM_ID, 3, severity::LOW);
|
static constexpr Event DUMP_WAS_CANCELLED = event::makeEvent(SUBSYSTEM_ID, 3, severity::LOW);
|
||||||
|
|
||||||
//! [EXPORT] : [COMMENT] P1: Number of dumped packets.
|
//! [EXPORT] : [COMMENT] P1: Number of dumped packets. P2: Total dumped bytes.
|
||||||
static constexpr Event DUMP_OK_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 5, severity::INFO);
|
static constexpr Event DUMP_OK_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 5, severity::INFO);
|
||||||
//! [EXPORT] : [COMMENT] P1: Number of dumped packets.
|
//! [EXPORT] : [COMMENT] P1: Number of dumped packets. P2: Total dumped bytes.
|
||||||
static constexpr Event DUMP_NOK_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 6, severity::INFO);
|
static constexpr Event DUMP_NOK_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 6, severity::INFO);
|
||||||
//! [EXPORT] : [COMMENT] P1: Number of dumped packets.
|
//! [EXPORT] : [COMMENT] P1: Number of dumped packets. P2: Total dumped bytes.
|
||||||
static constexpr Event DUMP_MISC_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 7, severity::INFO);
|
static constexpr Event DUMP_MISC_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 7, severity::INFO);
|
||||||
//! [EXPORT] : [COMMENT] P1: Number of dumped packets.
|
//! [EXPORT] : [COMMENT] P1: Number of dumped packets. P2: Total dumped bytes.
|
||||||
static constexpr Event DUMP_HK_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 8, severity::INFO);
|
static constexpr Event DUMP_HK_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 8, severity::INFO);
|
||||||
//! [EXPORT] : [COMMENT] P1: Number of dumped packets.
|
//! [EXPORT] : [COMMENT] P1: Number of dumped packets. P2: Total dumped bytes.
|
||||||
static constexpr Event DUMP_CFDP_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 9, severity::INFO);
|
static constexpr Event DUMP_CFDP_STORE_DONE = event::makeEvent(SUBSYSTEM_ID, 9, severity::INFO);
|
||||||
}; // namespace persTmStore
|
}; // namespace persTmStore
|
||||||
|
|
||||||
|
@ -6,7 +6,10 @@
|
|||||||
PersistentLogTmStoreTask::PersistentLogTmStoreTask(object_id_t objectId, StorageManagerIF& ipcStore,
|
PersistentLogTmStoreTask::PersistentLogTmStoreTask(object_id_t objectId, StorageManagerIF& ipcStore,
|
||||||
LogStores stores, VirtualChannel& channel,
|
LogStores stores, VirtualChannel& channel,
|
||||||
SdCardMountedIF& sdcMan)
|
SdCardMountedIF& sdcMan)
|
||||||
: TmStoreTaskBase(objectId, ipcStore, channel, sdcMan), stores(stores) {}
|
: TmStoreTaskBase(objectId, ipcStore, channel, sdcMan), stores(stores),
|
||||||
|
okStoreContext(persTmStore::DUMP_OK_STORE_DONE),
|
||||||
|
notOkStoreContext(persTmStore::DUMP_NOK_STORE_DONE),
|
||||||
|
miscStoreContext(persTmStore::DUMP_MISC_STORE_DONE) {}
|
||||||
|
|
||||||
ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) {
|
ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) {
|
||||||
while (true) {
|
while (true) {
|
||||||
@ -15,15 +18,15 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) {
|
|||||||
}
|
}
|
||||||
bool someonesBusy = false;
|
bool someonesBusy = false;
|
||||||
bool busy = false;
|
bool busy = false;
|
||||||
busy = handleOneStore(stores.okStore, persTmStore::DUMP_OK_STORE_DONE);
|
busy = handleOneStore(stores.okStore, okStoreContext);
|
||||||
if (busy) {
|
if (busy) {
|
||||||
someonesBusy = true;
|
someonesBusy = true;
|
||||||
}
|
}
|
||||||
busy = handleOneStore(stores.notOkStore, persTmStore::DUMP_NOK_STORE_DONE);
|
busy = handleOneStore(stores.notOkStore, notOkStoreContext);
|
||||||
if (busy) {
|
if (busy) {
|
||||||
someonesBusy = true;
|
someonesBusy = true;
|
||||||
}
|
}
|
||||||
busy = handleOneStore(stores.miscStore, persTmStore::DUMP_MISC_STORE_DONE);
|
busy = handleOneStore(stores.miscStore, miscStoreContext);
|
||||||
if (busy) {
|
if (busy) {
|
||||||
someonesBusy = true;
|
someonesBusy = true;
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,9 @@ class PersistentLogTmStoreTask : public TmStoreTaskBase, public ExecutableObject
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
LogStores stores;
|
LogStores stores;
|
||||||
|
DumpContext okStoreContext;
|
||||||
|
DumpContext notOkStoreContext;
|
||||||
|
DumpContext miscStoreContext;
|
||||||
Countdown tcHandlingCd = Countdown(400);
|
Countdown tcHandlingCd = Countdown(400);
|
||||||
|
|
||||||
bool initStoresIfPossible();
|
bool initStoresIfPossible();
|
||||||
|
@ -7,7 +7,7 @@ PersistentSingleTmStoreTask::PersistentSingleTmStoreTask(
|
|||||||
VirtualChannel& channel, Event eventIfDumpDone, SdCardMountedIF& sdcMan)
|
VirtualChannel& channel, Event eventIfDumpDone, SdCardMountedIF& sdcMan)
|
||||||
: TmStoreTaskBase(objectId, ipcStore, channel, sdcMan),
|
: TmStoreTaskBase(objectId, ipcStore, channel, sdcMan),
|
||||||
storeWithQueue(tmStore),
|
storeWithQueue(tmStore),
|
||||||
eventIfDumpDone(eventIfDumpDone) {}
|
dumpContext(eventIfDumpDone) {}
|
||||||
|
|
||||||
ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) {
|
ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) {
|
||||||
while (true) {
|
while (true) {
|
||||||
@ -15,7 +15,7 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) {
|
|||||||
if (not cyclicStoreCheck()) {
|
if (not cyclicStoreCheck()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bool busy = handleOneStore(storeWithQueue, eventIfDumpDone);
|
bool busy = handleOneStore(storeWithQueue, dumpContext);
|
||||||
if (not busy) {
|
if (not busy) {
|
||||||
TaskFactory::delayTask(40);
|
TaskFactory::delayTask(40);
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,7 @@ class PersistentSingleTmStoreTask : public TmStoreTaskBase, public ExecutableObj
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
PersistentTmStoreWithTmQueue& storeWithQueue;
|
PersistentTmStoreWithTmQueue& storeWithQueue;
|
||||||
Event eventIfDumpDone;
|
DumpContext dumpContext;
|
||||||
uint32_t numberOfDumpedPackets = 0;
|
|
||||||
Countdown tcHandlingCd = Countdown(400);
|
Countdown tcHandlingCd = Countdown(400);
|
||||||
|
|
||||||
bool initStoresIfPossible();
|
bool initStoresIfPossible();
|
||||||
|
@ -11,8 +11,8 @@ TmStoreTaskBase::TmStoreTaskBase(object_id_t objectId, StorageManagerIF& ipcStor
|
|||||||
VirtualChannel& channel, SdCardMountedIF& sdcMan)
|
VirtualChannel& channel, SdCardMountedIF& sdcMan)
|
||||||
: SystemObject(objectId), ipcStore(ipcStore), channel(channel), sdcMan(sdcMan) {}
|
: SystemObject(objectId), ipcStore(ipcStore), channel(channel), sdcMan(sdcMan) {}
|
||||||
|
|
||||||
bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, Event eventIfDone,
|
bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store,
|
||||||
uint32_t& numberOfDumpedPackets) {
|
DumpContext& dumpContext) {
|
||||||
ReturnValue_t result;
|
ReturnValue_t result;
|
||||||
bool tmToStoreReceived = false;
|
bool tmToStoreReceived = false;
|
||||||
bool tcRequestReceived = false;
|
bool tcRequestReceived = false;
|
||||||
@ -24,17 +24,21 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, Event
|
|||||||
}
|
}
|
||||||
// Dump TMs when applicable
|
// Dump TMs when applicable
|
||||||
if (store.getState() == PersistentTmStore::State::DUMPING) {
|
if (store.getState() == PersistentTmStore::State::DUMPING) {
|
||||||
size_t dumpedLen;
|
size_t dumpedLen = 0;
|
||||||
bool fileHasSwapped;
|
bool fileHasSwapped;
|
||||||
if (not channel.isBusy()) {
|
if (not channel.isBusy()) {
|
||||||
tmSinkBusyCd.resetTimer();
|
tmSinkBusyCd.resetTimer();
|
||||||
// TODO: We could continously dump until a file swap during active downlink..
|
|
||||||
result = store.dumpNextPacket(channel, dumpedLen, fileHasSwapped);
|
result = store.dumpNextPacket(channel, dumpedLen, fileHasSwapped);
|
||||||
|
if ((result == PersistentTmStore::DUMP_DONE or result == returnvalue::OK) and dumpedLen > 0) {
|
||||||
|
dumpContext.dumpedBytes += dumpedLen;
|
||||||
|
dumpContext.numberOfDumpedPackets += 1;
|
||||||
|
}
|
||||||
if (result == PersistentTmStore::DUMP_DONE) {
|
if (result == PersistentTmStore::DUMP_DONE) {
|
||||||
uint32_t startTime;
|
uint32_t startTime;
|
||||||
uint32_t endTime;
|
uint32_t endTime;
|
||||||
store.getStartAndEndTimeCurrentOrLastDump(startTime, endTime);
|
store.getStartAndEndTimeCurrentOrLastDump(startTime, endTime);
|
||||||
triggerEvent(eventIfDone, numberOfDumpedPackets);
|
triggerEvent(dumpContext.eventIfDone, dumpContext.numberOfDumpedPackets,
|
||||||
|
dumpContext.dumpedBytes);
|
||||||
dumpsPerformed = true;
|
dumpsPerformed = true;
|
||||||
} else if (result == returnvalue::OK) {
|
} else if (result == returnvalue::OK) {
|
||||||
dumpsPerformed = true;
|
dumpsPerformed = true;
|
||||||
@ -52,6 +56,7 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, Event
|
|||||||
if (execCmd == TmStoreMessage::DOWNLINK_STORE_CONTENT_TIME) {
|
if (execCmd == TmStoreMessage::DOWNLINK_STORE_CONTENT_TIME) {
|
||||||
cancelDumpCd.resetTimer();
|
cancelDumpCd.resetTimer();
|
||||||
tmSinkBusyCd.resetTimer();
|
tmSinkBusyCd.resetTimer();
|
||||||
|
dumpContext.reset();
|
||||||
}
|
}
|
||||||
tcRequestReceived = true;
|
tcRequestReceived = true;
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,17 @@
|
|||||||
|
|
||||||
class TmStoreTaskBase : public SystemObject {
|
class TmStoreTaskBase : public SystemObject {
|
||||||
public:
|
public:
|
||||||
|
struct DumpContext {
|
||||||
|
DumpContext(Event eventIfDone) : eventIfDone(eventIfDone) {}
|
||||||
|
void reset() {
|
||||||
|
numberOfDumpedPackets = 0;
|
||||||
|
dumpedBytes = 0;
|
||||||
|
}
|
||||||
|
const Event eventIfDone;
|
||||||
|
uint32_t numberOfDumpedPackets = 0;
|
||||||
|
uint32_t dumpedBytes = 0;
|
||||||
|
};
|
||||||
|
|
||||||
TmStoreTaskBase(object_id_t objectId, StorageManagerIF& ipcStore, VirtualChannel& channel,
|
TmStoreTaskBase(object_id_t objectId, StorageManagerIF& ipcStore, VirtualChannel& channel,
|
||||||
SdCardMountedIF& sdcMan);
|
SdCardMountedIF& sdcMan);
|
||||||
|
|
||||||
@ -16,7 +27,7 @@ class TmStoreTaskBase : public SystemObject {
|
|||||||
* @param store
|
* @param store
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bool handleOneStore(PersistentTmStoreWithTmQueue& store, Event eventIfDone);
|
bool handleOneStore(PersistentTmStoreWithTmQueue& store, DumpContext& dumpContext);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Occasionally check whether SD card is okay to be used. If not, poll whether it is ready to
|
* Occasionally check whether SD card is okay to be used. If not, poll whether it is ready to
|
||||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit cd0fd4d5a7142554c95d90574b5539931adcd5ff
|
Subproject commit 4686550eb9455175227559dc36902469255e36b7
|
Loading…
Reference in New Issue
Block a user