Missing Initialization of FDIR in FreshDeviceHandlerBase #33

Merged
muellerr merged 8 commits from meier/debug into develop 2024-03-29 12:50:44 +01:00
5 changed files with 17 additions and 14 deletions

View File

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## Fixes
- FreshDeviceHandlerBase did not initialize the fdirInstance
- 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

View File

@ -52,14 +52,15 @@ DynamicFIFO<size_t>* SharedRingBuffer::getReceiveSizesFifo() {
return receiveSizesFifo;
}
ReturnValue_t SharedRingBuffer::fifoEmpty(bool& empty, MutexIF::TimeoutType timeoutType, uint32_t timeoutMs) {
if(receiveSizesFifo == nullptr) {
ReturnValue_t SharedRingBuffer::fifoEmpty(bool& empty, MutexIF::TimeoutType timeoutType,
uint32_t timeoutMs) {
if (receiveSizesFifo == nullptr) {
return returnvalue::FAILED;
}
MutexGuard mg(mutex, timeoutType, timeoutMs);
if(mg.getLockResult() != returnvalue::OK) {
if (mg.getLockResult() != returnvalue::OK) {
return mg.getLockResult();
}
empty = receiveSizesFifo->empty();
return returnvalue::OK;
}
}

View File

@ -20,7 +20,7 @@ class SharedRingBuffer : public SystemObject, public SimpleRingBuffer {
* This constructor allocates a new internal buffer with the supplied size.
* @param size
* @param overwriteOld
* If the ring buffer is overflowing at a write operartion, the oldest data
* If the ring buffer is overflowing at a write operation, the oldest data
* will be overwritten.
*/
SharedRingBuffer(object_id_t objectId, const size_t size, bool overwriteOld,
@ -30,7 +30,7 @@ class SharedRingBuffer : public SystemObject, public SimpleRingBuffer {
* @param buffer
* @param size
* @param overwriteOld
* If the ring buffer is overflowing at a write operartion, the oldest data
* If the ring buffer is overflowing at a write operation, the oldest data
* will be overwritten.
*/
SharedRingBuffer(object_id_t objectId, uint8_t* buffer, const size_t size, bool overwriteOld,

View File

@ -11,6 +11,7 @@ FreshDeviceHandlerBase::FreshDeviceHandlerBase(DhbConfig config)
healthHelper(this, getObjectId()),
paramHelper(this),
poolManager(this, nullptr),
fdirInstance(config.fdirInstance),
defaultFdirParent(config.defaultFdirParent) {
auto mqArgs = MqArgs(config.objectId, static_cast<void*>(this));
messageQueue = QueueFactory::instance()->createMessageQueue(

View File

@ -94,7 +94,7 @@ class FreshDeviceHandlerBase : public SystemObject,
virtual void modeChanged(Mode_t mode, Submode_t submode);
/**
* The default implementation sets the new mode immediately. If this is not applicable for
* certain modes, the user should provide a custom implementation, which performs rougly
* certain modes, the user should provide a custom implementation, which performs roughly
* the same functionality of this function, when all the steps have been taken to reach the
* new mode.
*/