add keep alive PDU serializer #67
@@ -18,12 +18,12 @@ else
|
||||
echo "No ${cmake_fmt} tool found, not formatting CMake files"
|
||||
fi
|
||||
|
||||
cpp_format="clang-format"
|
||||
cpp_format="clang-format-19"
|
||||
file_selectors="-iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp"
|
||||
if command -v ${cpp_format} &> /dev/null; then
|
||||
for dir in ${folder_list[@]}; do
|
||||
echo "Auto-formatting ${dir} recursively"
|
||||
find ${dir} ${file_selectors} | xargs clang-format --style=file -i
|
||||
find ${dir} ${file_selectors} | xargs ${cpp_format} --style=file -i
|
||||
done
|
||||
else
|
||||
echo "No ${cpp_format} tool found, not formatting C++/C files"
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
#include "fsfw/cfdp/pdu/FileDataReader.h"
|
||||
#include "fsfw/cfdp/pdu/FinishedPduCreator.h"
|
||||
#include "fsfw/cfdp/pdu/HeaderReader.h"
|
||||
#include "fsfw/cfdp/pdu/KeepAlivePduCreator.h"
|
||||
#include "fsfw/objectmanager.h"
|
||||
#include "fsfw/returnvalues/returnvalue.h"
|
||||
#include "fsfw/tmtcservices/TmTcMessage.h"
|
||||
|
||||
using namespace returnvalue;
|
||||
@@ -450,6 +452,19 @@ ReturnValue_t cfdp::DestHandler::noticeOfCompletion() {
|
||||
return OK;
|
||||
}
|
||||
|
||||
ReturnValue_t cfdp::DestHandler::sendKeepAlivePdu() {
|
||||
Fss progress(transactionParams.progress);
|
||||
KeepAlivePduCreator keepAlivePdu(transactionParams.pduConf, progress);
|
||||
size_t serLen = 0;
|
||||
ReturnValue_t result =
|
||||
keepAlivePdu.serialize(pduBuf.data(), serLen, keepAlivePdu.getSerializedSize());
|
||||
if (result != OK) {
|
||||
return result;
|
||||
}
|
||||
return pduSender.sendPdu(PduType::FILE_DIRECTIVE, FileDirective::KEEP_ALIVE, pduBuf.data(),
|
||||
serLen);
|
||||
}
|
||||
|
||||
ReturnValue_t cfdp::DestHandler::sendFinishedPdu() {
|
||||
FinishedInfo info(transactionParams.conditionCode, transactionParams.deliveryCode,
|
||||
transactionParams.deliveryStatus);
|
||||
@@ -496,6 +511,8 @@ const cfdp::TransactionId& cfdp::DestHandler::getTransactionId() const {
|
||||
return transactionParams.transactionId;
|
||||
}
|
||||
|
||||
uint64_t cfdp::DestHandler::getProgress() const { return transactionParams.progress; }
|
||||
|
||||
void cfdp::DestHandler::checkAndHandleError(ReturnValue_t result, uint8_t& errorIdx) {
|
||||
if (result != OK and errorIdx < 3) {
|
||||
fsmRes.errorCodes[errorIdx] = result;
|
||||
@@ -509,4 +526,4 @@ void cfdp::DestHandler::setEventReporter(EventReportingProxyIF& reporter) {
|
||||
|
||||
const cfdp::DestHandlerParams& cfdp::DestHandler::getDestHandlerParams() const {
|
||||
return destParams;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,8 @@ class DestHandler {
|
||||
|
||||
[[nodiscard]] CfdpState getCfdpState() const;
|
||||
[[nodiscard]] TransactionStep getTransactionStep() const;
|
||||
[[nodiscard]] uint64_t getProgress() const;
|
||||
ReturnValue_t sendKeepAlivePdu();
|
||||
[[nodiscard]] const TransactionId& getTransactionId() const;
|
||||
[[nodiscard]] const DestHandlerParams& getDestHandlerParams() const;
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ class KeepAlivePduCreator : public FileDirectiveCreator {
|
||||
|
||||
ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize,
|
||||
Endianness streamEndianness) const override;
|
||||
using FileDirectiveCreator::serialize;
|
||||
|
||||
private:
|
||||
cfdp::Fss& progress;
|
||||
|
||||
@@ -113,6 +113,4 @@ ReturnValue_t HealthTable::iterate(HealthEntry* value, bool reset) {
|
||||
return result;
|
||||
}
|
||||
|
||||
MutexIF* HealthTable::getMutex() {
|
||||
return mutex;
|
||||
}
|
||||
MutexIF* HealthTable::getMutex() { return mutex; }
|
||||
|
||||
@@ -114,7 +114,7 @@ class SubsystemBase : public SystemObject,
|
||||
* Still, we have a default for all child implementations which do not use submode inheritance
|
||||
*/
|
||||
virtual void executeTable(HybridIterator<ModeListEntry> tableIter,
|
||||
Submode_t targetSubmode = SUBMODE_NONE);
|
||||
Submode_t targetSubmode = SUBMODE_NONE);
|
||||
|
||||
ReturnValue_t updateChildMode(MessageQueueId_t queue, Mode_t mode, Submode_t submode);
|
||||
ReturnValue_t updateChildModeByObjId(object_id_t objectId, Mode_t mode, Submode_t submode);
|
||||
|
||||
Reference in New Issue
Block a user