Compare commits
25 Commits
0f76cdb3ba
...
develop_up
Author | SHA1 | Date | |
---|---|---|---|
a837a78bd4 | |||
d246ce34d0 | |||
796c7a9e37 | |||
d575da8540 | |||
62ace649a7
|
|||
aac74fae38
|
|||
a26b0c38ac
|
|||
42e74d22cc | |||
36caa58043 | |||
988e07f0be
|
|||
88e8665280
|
|||
9c8b1c697b
|
|||
110cb903a6
|
|||
8da89eba80 | |||
7e8845f2c2 | |||
6aff3250c2 | |||
c3572e31a8
|
|||
2293e7f2bb | |||
a85a38c882 | |||
54ef9ec3f6 | |||
4dc49c57d5 | |||
e9d629b9b3 | |||
48403c002d | |||
e86d8c64db | |||
1de1b045cd |
8
.idea/cmake.xml
generated
Normal file
8
.idea/cmake.xml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CMakeSharedSettings">
|
||||||
|
<configurations>
|
||||||
|
<configuration PROFILE_NAME="Debug Test" ENABLED="true" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DFSFW_BUILD_TESTS=ON -DFSFW_OSAL=host" />
|
||||||
|
</configurations>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
|
|
||||||
|
- The `PusTmCreator` API only accepted 255 bytes of source data. It can now accept source
|
||||||
|
data with a size limited only by the size of `size_t`.
|
||||||
- Important bugfix in CFDP PDU header format: The entity length field and the transaction sequence
|
- Important bugfix in CFDP PDU header format: The entity length field and the transaction sequence
|
||||||
number fields stored the actual length of the field instead of the length minus 1 like specified
|
number fields stored the actual length of the field instead of the length minus 1 like specified
|
||||||
in the CFDP standard.
|
in the CFDP standard.
|
||||||
@ -26,8 +27,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
- add CFDP subsystem ID
|
- add CFDP subsystem ID
|
||||||
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/742
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/742
|
||||||
|
- `PusTmZcWriter` now exposes API to set message counter field.
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
|
- HK generation is now countdown based.
|
||||||
- Bump ETL version to 20.35.14
|
- Bump ETL version to 20.35.14
|
||||||
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/748
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/748
|
||||||
- Renamed `PCDU_2` subsystem ID to `POWER_SWITCH_IF`.
|
- Renamed `PCDU_2` subsystem ID to `POWER_SWITCH_IF`.
|
||||||
|
@ -166,9 +166,9 @@ ReturnValue_t Sgp4Propagator::propagate(double* position, double* velocity, time
|
|||||||
timeval timeSinceEpoch = time - epoch;
|
timeval timeSinceEpoch = time - epoch;
|
||||||
double minutesSinceEpoch = timeSinceEpoch.tv_sec / 60. + timeSinceEpoch.tv_usec / 60000000.;
|
double minutesSinceEpoch = timeSinceEpoch.tv_sec / 60. + timeSinceEpoch.tv_usec / 60000000.;
|
||||||
|
|
||||||
double yearsSinceEpoch = minutesSinceEpoch / 60 / 24 / 365;
|
double monthsSinceEpoch = minutesSinceEpoch / 60 / 24 / 30;
|
||||||
|
|
||||||
if ((yearsSinceEpoch > 1) || (yearsSinceEpoch < -1)) {
|
if ((monthsSinceEpoch > 1) || (monthsSinceEpoch < -1)) {
|
||||||
return TLE_TOO_OLD;
|
return TLE_TOO_OLD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include "fsfw/datapoollocal/LocalPoolDataSetBase.h"
|
#include "fsfw/datapoollocal/LocalPoolDataSetBase.h"
|
||||||
|
#include "fsfw/serviceinterface.h"
|
||||||
|
|
||||||
PeriodicHousekeepingHelper::PeriodicHousekeepingHelper(LocalPoolDataSetBase* owner)
|
PeriodicHousekeepingHelper::PeriodicHousekeepingHelper(LocalPoolDataSetBase* owner)
|
||||||
: owner(owner) {}
|
: owner(owner) {}
|
||||||
@ -10,51 +11,29 @@ PeriodicHousekeepingHelper::PeriodicHousekeepingHelper(LocalPoolDataSetBase* own
|
|||||||
void PeriodicHousekeepingHelper::initialize(float collectionInterval,
|
void PeriodicHousekeepingHelper::initialize(float collectionInterval,
|
||||||
dur_millis_t minimumPeriodicInterval) {
|
dur_millis_t minimumPeriodicInterval) {
|
||||||
this->minimumPeriodicInterval = minimumPeriodicInterval;
|
this->minimumPeriodicInterval = minimumPeriodicInterval;
|
||||||
collectionIntervalTicks = intervalSecondsToIntervalTicks(collectionInterval);
|
changeCollectionInterval(collectionInterval);
|
||||||
/* This will cause a checkOpNecessary call to be true immediately. I think it's okay
|
|
||||||
if a HK packet is generated immediately instead of waiting one generation cycle. */
|
|
||||||
internalTickCounter = collectionIntervalTicks;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float PeriodicHousekeepingHelper::getCollectionIntervalInSeconds() const {
|
float PeriodicHousekeepingHelper::getCollectionIntervalInSeconds() const {
|
||||||
return intervalTicksToSeconds(collectionIntervalTicks);
|
return collectionInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PeriodicHousekeepingHelper::checkOpNecessary() {
|
bool PeriodicHousekeepingHelper::checkOpNecessary() {
|
||||||
if (internalTickCounter >= collectionIntervalTicks) {
|
if (hkGenerationCd.hasTimedOut()) {
|
||||||
internalTickCounter = 1;
|
hkGenerationCd.resetTimer();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
internalTickCounter++;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t PeriodicHousekeepingHelper::intervalSecondsToIntervalTicks(
|
|
||||||
float collectionIntervalSeconds) {
|
|
||||||
if (owner == nullptr) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Avoid division by zero */
|
|
||||||
if (minimumPeriodicInterval == 0) {
|
|
||||||
/* Perform operation each cycle */
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
dur_millis_t intervalInMs = collectionIntervalSeconds * 1000;
|
|
||||||
uint32_t divisor = minimumPeriodicInterval;
|
|
||||||
uint32_t ticks = std::ceil(static_cast<float>(intervalInMs) / divisor);
|
|
||||||
|
|
||||||
return ticks;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float PeriodicHousekeepingHelper::intervalTicksToSeconds(uint32_t collectionInterval) const {
|
|
||||||
/* Number of ticks times the minimum interval is in milliseconds, so we divide by 1000 to get
|
|
||||||
the value in seconds */
|
|
||||||
return static_cast<float>(collectionInterval * minimumPeriodicInterval / 1000.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PeriodicHousekeepingHelper::changeCollectionInterval(float newIntervalSeconds) {
|
void PeriodicHousekeepingHelper::changeCollectionInterval(float newIntervalSeconds) {
|
||||||
collectionIntervalTicks = intervalSecondsToIntervalTicks(newIntervalSeconds);
|
uint32_t intervalMs = newIntervalSeconds * 1000;
|
||||||
|
if (newIntervalSeconds <= 0) {
|
||||||
|
intervalMs = minimumPeriodicInterval;
|
||||||
|
newIntervalSeconds = static_cast<float>(minimumPeriodicInterval) / 1000.0;
|
||||||
|
}
|
||||||
|
collectionInterval = newIntervalSeconds;
|
||||||
|
hkGenerationCd.setTimeout(intervalMs);
|
||||||
|
// We want an immediate HK packet at the start, so time out the generation CD immediately.
|
||||||
|
hkGenerationCd.timeOut();
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#include "fsfw/timemanager/Clock.h"
|
#include "fsfw/timemanager/Clock.h"
|
||||||
|
#include "fsfw/timemanager/Countdown.h"
|
||||||
|
|
||||||
class LocalPoolDataSetBase;
|
class LocalPoolDataSetBase;
|
||||||
|
|
||||||
@ -19,13 +20,10 @@ class PeriodicHousekeepingHelper {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
LocalPoolDataSetBase* owner = nullptr;
|
LocalPoolDataSetBase* owner = nullptr;
|
||||||
|
Countdown hkGenerationCd;
|
||||||
uint32_t intervalSecondsToIntervalTicks(float collectionIntervalSeconds);
|
float collectionInterval = 0.0;
|
||||||
float intervalTicksToSeconds(uint32_t collectionInterval) const;
|
|
||||||
|
|
||||||
dur_millis_t minimumPeriodicInterval = 0;
|
dur_millis_t minimumPeriodicInterval = 0;
|
||||||
uint32_t internalTickCounter = 1;
|
|
||||||
uint32_t collectionIntervalTicks = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FSFW_HOUSEKEEPING_PERIODICHOUSEKEEPINGHELPER_H_ */
|
#endif /* FSFW_HOUSEKEEPING_PERIODICHOUSEKEEPINGHELPER_H_ */
|
||||||
|
@ -5,9 +5,12 @@
|
|||||||
#include "fsfw/ipc/QueueFactory.h"
|
#include "fsfw/ipc/QueueFactory.h"
|
||||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||||
|
|
||||||
InternalErrorReporter::InternalErrorReporter(object_id_t setObjectId, uint32_t messageQueueDepth)
|
InternalErrorReporter::InternalErrorReporter(object_id_t setObjectId, uint32_t messageQueueDepth,
|
||||||
|
bool enableSetByDefault, float generationFrequency)
|
||||||
: SystemObject(setObjectId),
|
: SystemObject(setObjectId),
|
||||||
poolManager(this, commandQueue),
|
poolManager(this, commandQueue),
|
||||||
|
enableSetByDefault(enableSetByDefault),
|
||||||
|
generationFrequency(generationFrequency),
|
||||||
internalErrorSid(setObjectId, InternalErrorDataset::ERROR_SET_ID),
|
internalErrorSid(setObjectId, InternalErrorDataset::ERROR_SET_ID),
|
||||||
internalErrorDataset(this) {
|
internalErrorDataset(this) {
|
||||||
commandQueue = QueueFactory::instance()->createMessageQueue(messageQueueDepth);
|
commandQueue = QueueFactory::instance()->createMessageQueue(messageQueueDepth);
|
||||||
@ -134,9 +137,8 @@ ReturnValue_t InternalErrorReporter::initializeLocalDataPool(localpool::DataPool
|
|||||||
localDataPoolMap.emplace(errorPoolIds::TM_HITS, &tmHitsEntry);
|
localDataPoolMap.emplace(errorPoolIds::TM_HITS, &tmHitsEntry);
|
||||||
localDataPoolMap.emplace(errorPoolIds::QUEUE_HITS, &queueHitsEntry);
|
localDataPoolMap.emplace(errorPoolIds::QUEUE_HITS, &queueHitsEntry);
|
||||||
localDataPoolMap.emplace(errorPoolIds::STORE_HITS, &storeHitsEntry);
|
localDataPoolMap.emplace(errorPoolIds::STORE_HITS, &storeHitsEntry);
|
||||||
poolManager.subscribeForDiagPeriodicPacket(subdp::DiagnosticsHkPeriodicParams(
|
poolManager.subscribeForRegularPeriodicPacket(
|
||||||
internalErrorSid, false,
|
subdp::RegularHkPeriodicParams(internalErrorSid, enableSetByDefault, generationFrequency));
|
||||||
static_cast<float>(getPeriodicOperationFrequency()) / static_cast<float>(1000.0)));
|
|
||||||
internalErrorDataset.setValidity(true, true);
|
internalErrorDataset.setValidity(true, true);
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,8 @@ class InternalErrorReporter : public SystemObject,
|
|||||||
public InternalErrorReporterIF,
|
public InternalErrorReporterIF,
|
||||||
public HasLocalDataPoolIF {
|
public HasLocalDataPoolIF {
|
||||||
public:
|
public:
|
||||||
InternalErrorReporter(object_id_t setObjectId, uint32_t messageQueueDepth = 5);
|
InternalErrorReporter(object_id_t setObjectId, uint32_t messageQueueDepth,
|
||||||
|
bool enableSetByDefault, float generationFrequency);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable diagnostic printout. Please note that this feature will
|
* Enable diagnostic printout. Please note that this feature will
|
||||||
@ -63,6 +64,8 @@ class InternalErrorReporter : public SystemObject,
|
|||||||
MutexIF* mutex = nullptr;
|
MutexIF* mutex = nullptr;
|
||||||
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
||||||
uint32_t timeoutMs = 20;
|
uint32_t timeoutMs = 20;
|
||||||
|
bool enableSetByDefault;
|
||||||
|
float generationFrequency;
|
||||||
|
|
||||||
sid_t internalErrorSid;
|
sid_t internalErrorSid;
|
||||||
InternalErrorDataset internalErrorDataset;
|
InternalErrorDataset internalErrorDataset;
|
||||||
|
@ -40,7 +40,7 @@ struct PusTmParams {
|
|||||||
size_t dataLen)
|
size_t dataLen)
|
||||||
: secHeader(service, subservice, timeStamper), adapter(data, dataLen), sourceData(&adapter) {}
|
: secHeader(service, subservice, timeStamper), adapter(data, dataLen), sourceData(&adapter) {}
|
||||||
PusTmSecHeader secHeader;
|
PusTmSecHeader secHeader;
|
||||||
SerialBufferAdapter<uint8_t> adapter;
|
SerialBufferAdapter<size_t> adapter;
|
||||||
const SerializeIF* sourceData = nullptr;
|
const SerializeIF* sourceData = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,3 +24,9 @@ void PusTmZeroCopyWriter::updateErrorControl() {
|
|||||||
crcStart[0] = (crc16 >> 8) & 0xff;
|
crcStart[0] = (crc16 >> 8) & 0xff;
|
||||||
crcStart[1] = crc16 & 0xff;
|
crcStart[1] = crc16 & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PusTmZeroCopyWriter::setMessageCount(uint16_t msgCount) {
|
||||||
|
size_t serSize = 0;
|
||||||
|
SerializeAdapter::serialize(&msgCount, const_cast<uint8_t*>(pointers.secHeaderStart + 3),
|
||||||
|
&serSize, 2, SerializeIF::Endianness::NETWORK);
|
||||||
|
}
|
||||||
|
@ -14,6 +14,7 @@ class PusTmZeroCopyWriter : public PusTmReader {
|
|||||||
PusTmZeroCopyWriter(TimeReaderIF& timeReader, uint8_t* data, size_t size);
|
PusTmZeroCopyWriter(TimeReaderIF& timeReader, uint8_t* data, size_t size);
|
||||||
|
|
||||||
void setSequenceCount(uint16_t seqCount);
|
void setSequenceCount(uint16_t seqCount);
|
||||||
|
void setMessageCount(uint16_t msgCount);
|
||||||
void updateErrorControl();
|
void updateErrorControl();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -32,7 +32,7 @@ void Factory::produceFrameworkObjects(void* args) {
|
|||||||
setStaticFrameworkObjectIds();
|
setStaticFrameworkObjectIds();
|
||||||
new EventManager(objects::EVENT_MANAGER, 120);
|
new EventManager(objects::EVENT_MANAGER, 120);
|
||||||
new HealthTable(objects::HEALTH_TABLE);
|
new HealthTable(objects::HEALTH_TABLE);
|
||||||
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
|
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER, 20, false, 1.0);
|
||||||
|
|
||||||
{
|
{
|
||||||
PoolManager::LocalPoolConfig poolCfg = {{100, 16}, {50, 32}, {25, 64}, {15, 128}, {5, 1024}};
|
PoolManager::LocalPoolConfig poolCfg = {{100, 16}, {50, 32}, {25, 64}, {15, 128}, {5, 1024}};
|
||||||
|
Reference in New Issue
Block a user