meier/seqCount #46

Merged
muellerr merged 5 commits from meier/seqCount into eive/develop 2022-03-28 10:21:49 +02:00
903 changed files with 51899 additions and 57484 deletions
Showing only changes of commit d4ade5e885 - Show all commits

View File

@@ -6,6 +6,7 @@
class SourceSequenceCounter { class SourceSequenceCounter {
private: private:
uint16_t sequenceCount; uint16_t sequenceCount;
public: public:
SourceSequenceCounter() : sequenceCount(0) {} SourceSequenceCounter() : sequenceCount(0) {}
void increment() { void increment() {
@@ -18,7 +19,17 @@ public:
void reset(uint16_t toValue = 0) { void reset(uint16_t toValue = 0) {
sequenceCount = toValue % (SpacePacketBase::LIMIT_SEQUENCE_COUNT); sequenceCount = toValue % (SpacePacketBase::LIMIT_SEQUENCE_COUNT);
} }
SourceSequenceCounter& operator++(int) {
this->increment();
return *this;
}
SourceSequenceCounter& operator=(const uint16_t& newCount) {
sequenceCount = newCount;
return *this;
}
operator uint16_t() {
return this->get();
}
}; };
#endif /* FSFW_TMTCSERVICES_SOURCESEQUENCECOUNTER_H_ */ #endif /* FSFW_TMTCSERVICES_SOURCESEQUENCECOUNTER_H_ */