From 74837753bfe05beee3e90a005730a958a9ad7699 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 4 Nov 2022 12:45:20 +0100 Subject: [PATCH] add IPC ring buf and buffer --- linux/devices/ploc/PlocSupvHelper.cpp | 4 +++- linux/devices/ploc/PlocSupvHelper.h | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/linux/devices/ploc/PlocSupvHelper.cpp b/linux/devices/ploc/PlocSupvHelper.cpp index f4d25707..371da37d 100644 --- a/linux/devices/ploc/PlocSupvHelper.cpp +++ b/linux/devices/ploc/PlocSupvHelper.cpp @@ -27,7 +27,9 @@ using namespace returnvalue; PlocSupvHelper::PlocSupvHelper(object_id_t objectId) - : SystemObject(objectId), recRingBuf(4096, true) { + : SystemObject(objectId), + recRingBuf(4096, true), + ipcRingBuf(1200 * MAX_STORED_DECODED_PACKETS, true) { spParams.maxSize = sizeof(commandBuffer); resetSpParams(); semaphore = SemaphoreFactory::instance()->createBinarySemaphore(); diff --git a/linux/devices/ploc/PlocSupvHelper.h b/linux/devices/ploc/PlocSupvHelper.h index b07e120c..8a693460 100644 --- a/linux/devices/ploc/PlocSupvHelper.h +++ b/linux/devices/ploc/PlocSupvHelper.h @@ -7,6 +7,7 @@ #include #include "OBSWConfig.h" +#include "fsfw/container/FIFO.h" #include "fsfw/devicehandlers/CookieIF.h" #include "fsfw/objectmanager/SystemObject.h" #include "fsfw/osal/linux/BinarySemaphore.h" @@ -172,6 +173,7 @@ class PlocSupvHelper : public DeviceCommunicationIF, static const uint32_t CRC_EXECUTION_TIMEOUT = 60000; static const uint32_t PREPARE_UPDATE_EXECUTION_REPORT = 2000; + static constexpr uint8_t MAX_STORED_DECODED_PACKETS = 4; static constexpr uint8_t HDLC_START_MARKER = 0x7C; static constexpr uint8_t HDLC_END_MARKER = 0x7E; @@ -224,10 +226,14 @@ class PlocSupvHelper : public DeviceCommunicationIF, #ifdef XIPHOS_Q7S SdCardManager* sdcMan = nullptr; #endif + SimpleRingBuffer recRingBuf; std::array recBuf = {}; std::array encodedBuf = {}; std::array decodedBuf = {}; - SimpleRingBuffer recRingBuf; + std::array ipcBuffer = {}; + SimpleRingBuffer ipcRingBuf; + FIFO ipcQueue; + uint8_t commandBuffer[supv::MAX_COMMAND_SIZE]{}; SpacePacketCreator creator; ploc::SpTcParams spParams = ploc::SpTcParams(creator);