Compare commits
16 Commits
5322de0599
...
88e8665280
Author | SHA1 | Date | |
---|---|---|---|
88e8665280
|
|||
8da89eba80 | |||
7e8845f2c2 | |||
6aff3250c2 | |||
c3572e31a8
|
|||
2293e7f2bb | |||
a85a38c882 | |||
0f76cdb3ba | |||
268c2e87c9 | |||
87f94a252f | |||
c7037d417a | |||
f80c5980ea | |||
ad01642fee | |||
f2947bc78e | |||
0a977ea688 | |||
74b164b1da |
@ -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,6 +27,7 @@ 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
|
||||||
- Bump ETL version to 20.35.14
|
- Bump ETL version to 20.35.14
|
||||||
|
@ -53,8 +53,9 @@ class VectorOperations {
|
|||||||
mulScalar(vector, 1 / norm(vector, size), normalizedVector, size);
|
mulScalar(vector, 1 / norm(vector, size), normalizedVector, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static T maxAbsValue(const T *vector, uint8_t size, uint8_t *index = 0) {
|
static T maxAbsValue(const T *vector, uint8_t size, uint8_t *index = nullptr) {
|
||||||
T max = -1;
|
T max = vector[size - 1];
|
||||||
|
uint8_t foundIndex = size - 1;
|
||||||
|
|
||||||
for (; size > 0; size--) {
|
for (; size > 0; size--) {
|
||||||
T abs = vector[size - 1];
|
T abs = vector[size - 1];
|
||||||
@ -64,24 +65,35 @@ class VectorOperations {
|
|||||||
if (abs > max) {
|
if (abs > max) {
|
||||||
max = abs;
|
max = abs;
|
||||||
if (index != 0) {
|
if (index != 0) {
|
||||||
*index = size - 1;
|
foundIndex = size - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (index != nullptr) {
|
||||||
|
*index = foundIndex;
|
||||||
|
}
|
||||||
|
|
||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
static T maxValue(const T *vector, uint8_t size, uint8_t *index = 0) {
|
static T maxValue(const T *vector, uint8_t size, uint8_t *index = nullptr) {
|
||||||
T max = -1;
|
T max = vector[size - 1];
|
||||||
|
uint8_t foundIndex = size - 1;
|
||||||
|
|
||||||
for (; size > 0; size--) {
|
for (; size > 0; size--) {
|
||||||
if (vector[size - 1] > max) {
|
if (vector[size - 1] > max) {
|
||||||
max = vector[size - 1];
|
max = vector[size - 1];
|
||||||
if (index != 0) {
|
if (index != 0) {
|
||||||
*index = size - 1;
|
foundIndex = size - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (index != nullptr) {
|
||||||
|
*index = foundIndex;
|
||||||
|
}
|
||||||
|
|
||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
#include "fsfw/pus/servicepackets/Service3Packets.h"
|
#include "fsfw/pus/servicepackets/Service3Packets.h"
|
||||||
|
|
||||||
Service3Housekeeping::Service3Housekeeping(object_id_t objectId, uint16_t apid, uint8_t serviceId,
|
Service3Housekeeping::Service3Housekeeping(object_id_t objectId, uint16_t apid, uint8_t serviceId,
|
||||||
uint32_t queueDepth)
|
uint32_t queueDepth, uint8_t numParallelCommands)
|
||||||
: CommandingServiceBase(objectId, apid, "PUS 3 HK", serviceId, NUM_OF_PARALLEL_COMMANDS,
|
: CommandingServiceBase(objectId, apid, "PUS 3 HK", serviceId, numParallelCommands,
|
||||||
COMMAND_TIMEOUT_SECONDS, queueDepth) {}
|
COMMAND_TIMEOUT_SECONDS, queueDepth) {}
|
||||||
|
|
||||||
Service3Housekeeping::~Service3Housekeeping() {}
|
Service3Housekeeping::~Service3Housekeeping() {}
|
||||||
|
@ -28,7 +28,8 @@ class Service3Housekeeping : public CommandingServiceBase, public AcceptsHkPacke
|
|||||||
static constexpr uint8_t NUM_OF_PARALLEL_COMMANDS = 4;
|
static constexpr uint8_t NUM_OF_PARALLEL_COMMANDS = 4;
|
||||||
static constexpr uint16_t COMMAND_TIMEOUT_SECONDS = 60;
|
static constexpr uint16_t COMMAND_TIMEOUT_SECONDS = 60;
|
||||||
|
|
||||||
Service3Housekeeping(object_id_t objectId, uint16_t apid, uint8_t serviceId, uint32_t queueDepth);
|
Service3Housekeeping(object_id_t objectId, uint16_t apid, uint8_t serviceId, uint32_t queueDepth,
|
||||||
|
uint8_t numParallelCommands);
|
||||||
virtual ~Service3Housekeeping();
|
virtual ~Service3Housekeeping();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -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:
|
||||||
|
@ -165,7 +165,8 @@ ReturnValue_t HostFilesystem::truncateFile(FilesystemParams params) {
|
|||||||
if (not filesystem::exists(path, e)) {
|
if (not filesystem::exists(path, e)) {
|
||||||
return FILE_DOES_NOT_EXIST;
|
return FILE_DOES_NOT_EXIST;
|
||||||
}
|
}
|
||||||
ofstream of(path);
|
// Specify truncation flug explicitely.
|
||||||
|
ofstream of(path, std::ios::out | std::ios::trunc);
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user