important CFDP bugfix
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2023-02-20 15:02:58 +01:00
parent a918d61f2b
commit 6b931dce7f
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
4 changed files with 17 additions and 7 deletions

View File

@ -17,6 +17,10 @@ change warranting a new major release:
# [unreleased] # [unreleased]
## Fixed
- CFDP Funnel bugfix: CCSDS wrapping was buggy and works properly now.
## Changed ## Changed
- Add `-Wshadow=local` shadowing warnings and fixed all of them - Add `-Wshadow=local` shadowing warnings and fixed all of them

View File

@ -50,6 +50,8 @@
//! If set to 1 the binary needs "cap_sys_nice=eip" privileges to run //! If set to 1 the binary needs "cap_sys_nice=eip" privileges to run
#define FSFW_USE_REALTIME_FOR_LINUX 0 #define FSFW_USE_REALTIME_FOR_LINUX 0
#define FSFW_UDP_SEND_WIRETAPPING_ENABLED 0
namespace fsfwconfig { namespace fsfwconfig {
//! Default timestamp size. The default timestamp will be an seven byte CDC short timestamp. //! Default timestamp size. The default timestamp will be an seven byte CDC short timestamp.

2
fsfw

@ -1 +1 @@
Subproject commit c8469ca6473f64676e007e2e2f1c733fe6252053 Subproject commit c32798522283d89028b7c1ecd3bd33b8391e1a39

View File

@ -53,16 +53,19 @@ ReturnValue_t CfdpTmFunnel::handlePacket(TmTcMessage& msg) {
#endif #endif
return result; return result;
} }
size_t serSize = 0; size_t packetLen = 0;
uint8_t* serPtr = newPacketData;
result = result =
spacePacketHeader.serializeBe(&newPacketData, &serSize, spacePacketHeader.getFullPacketLen()); spacePacketHeader.serializeBe(&serPtr, &packetLen, spacePacketHeader.getFullPacketLen());
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "CfdpTmFunnel::handlePacket: Error serializing packet" << std::endl; sif::error << "CfdpTmFunnel::handlePacket: Error serializing packet" << std::endl;
#endif #endif
return result; return result;
} }
std::memcpy(newPacketData, cfdpPacket, cfdpPacketLen); std::memcpy(serPtr, cfdpPacket, cfdpPacketLen);
packetLen += cfdpPacketLen;
// Delete old packet // Delete old packet
tmStore.deleteData(msg.getStorageId()); tmStore.deleteData(msg.getStorageId());
msg.setStorageId(newStoreId); msg.setStorageId(newStoreId);
@ -74,13 +77,14 @@ ReturnValue_t CfdpTmFunnel::handlePacket(TmTcMessage& msg) {
// Create copy of data to ensure each TM recipient has its own copy. That way, we don't need // Create copy of data to ensure each TM recipient has its own copy. That way, we don't need
// to bother with send order and where the data is deleted. // to bother with send order and where the data is deleted.
store_address_t storeId; store_address_t storeId;
result = tmStore.addData(&storeId, newPacketData, serSize); result = tmStore.addData(&storeId, newPacketData, packetLen);
if (result == returnvalue::OK) { if (result == returnvalue::OK) {
msg.setStorageId(storeId); msg.setStorageId(storeId);
} else { } else {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "PusTmFunnel::handlePacket: Store too full to create data copy" sif::error << "PusTmFunnel::handlePacket: Store too full to create data copy or store "
<< std::endl; "error" << std::endl;
break;
#endif #endif
} }
} else { } else {