From 58f29e16c54193cf3ea0460dd375ba68bfce39dd Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 14 Feb 2023 14:00:53 +0100 Subject: [PATCH] mode snapshot command --- .../devices/devicedefinitions/PlocMPSoCDefinitions.h | 10 ++++++++++ linux/devices/ploc/PlocMPSoCHandler.cpp | 11 +++++++++++ linux/devices/ploc/PlocMPSoCHandler.h | 1 + tmtc | 2 +- 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h b/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h index 1b9ea6b9..1896eb5d 100644 --- a/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h +++ b/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h @@ -34,6 +34,7 @@ static const DeviceCommandId_t RELEASE_UART_TX = 21; static const DeviceCommandId_t TC_CAM_TAKE_PIC = 22; static const DeviceCommandId_t TC_SIMPLEX_SEND_FILE = 23; static const DeviceCommandId_t TC_DOWNLINK_DATA_MODULATE = 24; +static const DeviceCommandId_t TC_MODE_SNAPSHOT = 25; // Will reset the sequence count of the OBSW static const DeviceCommandId_t OBSW_RESET_SEQ_COUNT = 50; @@ -653,6 +654,15 @@ class TcModeIdle : public TcBase { : TcBase(params, apid::TC_MODE_IDLE, sequenceCount) {} }; +/** + * @brief Class to build mode idle command + */ +class TcModeSnapshot : public TcBase { + public: + TcModeSnapshot(ploc::SpTcParams params, uint16_t sequenceCount) + : TcBase(params, apid::TC_MODE_SNAPSHOT, sequenceCount) {} +}; + /** * @brief Class to build camera take picture command */ diff --git a/linux/devices/ploc/PlocMPSoCHandler.cpp b/linux/devices/ploc/PlocMPSoCHandler.cpp index 8218990e..07153878 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.cpp +++ b/linux/devices/ploc/PlocMPSoCHandler.cpp @@ -585,6 +585,17 @@ ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkDataModulate(const uint8_t* com return returnvalue::OK; } +ReturnValue_t PlocMPSoCHandler::prepareTcModeSnapshot() { + ReturnValue_t result = returnvalue::OK; + mpsoc::TcModeSnapshot tcModeSnapshot(spParams, sequenceCount); + result = tcModeSnapshot.buildPacket(); + if (result != returnvalue::OK) { + return result; + } + finishTcPrep(tcModeSnapshot.getFullPacketLen()); + return returnvalue::OK; +} + void PlocMPSoCHandler::finishTcPrep(size_t packetLen) { nextReplyId = mpsoc::ACK_REPORT; rawPacket = commandBuffer; diff --git a/linux/devices/ploc/PlocMPSoCHandler.h b/linux/devices/ploc/PlocMPSoCHandler.h index ddd5b548..f14fbe9d 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.h +++ b/linux/devices/ploc/PlocMPSoCHandler.h @@ -172,6 +172,7 @@ class PlocMPSoCHandler : public DeviceHandlerBase, public CommandsActionsIF { ReturnValue_t prepareTcCamTakePic(const uint8_t* commandData, size_t commandDataLen); ReturnValue_t prepareTcSimplexSendFile(const uint8_t* commandData, size_t commandDataLen); ReturnValue_t prepareTcDownlinkDataModulate(const uint8_t* commandData, size_t commandDataLen); + ReturnValue_t prepareTcModeSnapshot(); void finishTcPrep(size_t packetLen); /** diff --git a/tmtc b/tmtc index 9b7471e9..8d036bcd 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 9b7471e9097edd410995ba0c76125b626440d9be +Subproject commit 8d036bcd4fed1211ad5b15ddae7b42e61e22fcfd