From b0e8a8624a5623e5bdca97304dc2f01d9fed1d26 Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" Date: Fri, 16 Apr 2021 18:59:48 +0200 Subject: [PATCH] wip --- mission/devices/PlocHandler.cpp | 4 ++-- mission/devices/devicedefinitions/PlocDefinitions.h | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mission/devices/PlocHandler.cpp b/mission/devices/PlocHandler.cpp index 7300a610..802c26e5 100644 --- a/mission/devices/PlocHandler.cpp +++ b/mission/devices/PlocHandler.cpp @@ -89,7 +89,7 @@ ReturnValue_t PlocHandler::prepareTcMemReadCommand(const uint8_t * commandData, void PlocHandler::fillCommandAndReplyMap() { this->insertInCommandAndReplyMap(PLOC::TC_MEM_WRITE, 1, nullptr, PLOC::SIZE_ACK_REPORT); - this->insertInCommandAndReplyMap(PLOC::TC_MEM_READ, 1, nullptr, PLOC::SIZE_ACK_REPORT); + this->insertInCommandAndReplyMap(PLOC::TC_MEM_READ, 1, nullptr, PLOC::SIZE_TC_MEM_READ_REPLY); } ReturnValue_t PlocHandler::scanForReply(const uint8_t *start, @@ -198,7 +198,7 @@ ReturnValue_t PlocHandler::receiveExecutionReport() { result = handleExecutionReport(receivedData, receivedDataLen); } -void PlocHandler::handleExecutionReport(const uint8_t* receivedData, size_t receivedDataLen) { +ReturnValue_t PlocHandler::handleExecutionReport(const uint8_t* receivedData, size_t receivedDataLen) { uint16_t apid = (*(receivedData) << 8 | *(receivedData + 1)) & APID_MASK; diff --git a/mission/devices/devicedefinitions/PlocDefinitions.h b/mission/devices/devicedefinitions/PlocDefinitions.h index 74dd3c09..89cef3da 100644 --- a/mission/devices/devicedefinitions/PlocDefinitions.h +++ b/mission/devices/devicedefinitions/PlocDefinitions.h @@ -15,6 +15,9 @@ namespace PLOC { static const uint16_t SIZE_EXE_REPORT = 14; static const uint16_t SIZE_TM_MEM_READ_REPORT = 18; + /** Reply comprises one ack report, the telemetry packet and the execution report */ + static const uint16_t SIZE_TC_MEM_READ_REPLY = 49; + /** * SpacePacket apids of PLOC telecommands and telemetry. */ @@ -33,7 +36,7 @@ namespace PLOC { static const uint16_t LENGTH_TC_MEM_WRITE = 12; static const uint16_t LENGTH_TC_MEM_READ = 8; - static const size_t MAX_REPLY_SIZE = SIZE_TM_MEM_READ_REPORT; + static const size_t MAX_REPLY_SIZE = SIZE_TC_MEM_READ_REPLY; static const size_t MAX_COMMAND_SIZE = 18; /**