diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ffdcbc8..5525389c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,12 @@ list yields a list of all related PRs for each release. # [unreleased] -# [v1.13.0] +# [v1.14.0] + +# [v1.13.0] 24.08.2022 - Added first version of ACS Controller with gathers MGM data in a set +- Some tweaks for IMTQ handler # [v1.12.1] 05.07.2022 diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d3baf59..e9cee859 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,8 @@ # ############################################################################## cmake_minimum_required(VERSION 3.13) -set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0) -set(OBSW_VERSION_MINOR_IF_GIT_FAILS 0) +set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 1) +set(OBSW_VERSION_MINOR_IF_GIT_FAILS 13) set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0) # set(CMAKE_VERBOSE TRUE) diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index 8129790c..64092bad 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -45,8 +45,8 @@ #include void Factory::setStaticFrameworkObjectIds() { - PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR; - PusServiceBase::packetDestination = objects::TM_FUNNEL; + PusServiceBase::PUS_DISTRIBUTOR = objects::PUS_PACKET_DISTRIBUTOR; + PusServiceBase::PACKET_DESTINATION = objects::TM_FUNNEL; CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; @@ -55,8 +55,7 @@ void Factory::setStaticFrameworkObjectIds() { // No storage object for now. TmFunnel::storageDestination = objects::NO_OBJECT; - VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; - TmPacketBase::timeStamperId = objects::TIME_STAMPER; + VerificationReporter::DEFAULT_RECEIVER = objects::PUS_SERVICE_1_VERIFICATION; } void ObjectFactory::produce(void* args) { diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index e387aa71..25d47b7c 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -92,7 +92,7 @@ ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &local localDataPoolMap.emplace(core::TEMPERATURE, new PoolEntry({0})); localDataPoolMap.emplace(core::PS_VOLTAGE, new PoolEntry({0})); localDataPoolMap.emplace(core::PL_VOLTAGE, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(hkSet.getSid(), false, 10.0, false); + poolManager.subscribeForRegularPeriodicPacket({hkSet.getSid(), false, 10.0}); return HasReturnvaluesIF::RETURN_OK; } diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 43b1da31..3ac765ff 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -95,8 +95,8 @@ ResetArgs RESET_ARGS_GNSS; void Factory::setStaticFrameworkObjectIds() { - PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR; - PusServiceBase::packetDestination = objects::TM_FUNNEL; + PusServiceBase::PUS_DISTRIBUTOR = objects::PUS_PACKET_DISTRIBUTOR; + PusServiceBase::PACKET_DESTINATION = objects::TM_FUNNEL; CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; @@ -117,8 +117,7 @@ void Factory::setStaticFrameworkObjectIds() { LocalDataPoolManager::defaultHkDestination = objects::PUS_SERVICE_3_HOUSEKEEPING; - VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; - TmPacketBase::timeStamperId = objects::TIME_STAMPER; + VerificationReporter::DEFAULT_RECEIVER = objects::PUS_SERVICE_1_VERIFICATION; } void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); } diff --git a/common/config/commonConfig.cpp b/common/config/commonConfig.cpp index 0fd78a61..08b7439f 100644 --- a/common/config/commonConfig.cpp +++ b/common/config/commonConfig.cpp @@ -1,8 +1,8 @@ #include "commonConfig.h" -#include "fsfw/tmtcpacket/SpacePacket.h" +#include "fsfw/tmtcpacket/ccsds/defs.h" #include "tmtc/apid.h" const fsfw::Version common::OBSW_VERSION{OBSW_VERSION_MAJOR, OBSW_VERSION_MINOR, OBSW_VERSION_REVISION, OBSW_VERSION_CST_GIT_SHA1}; -const uint16_t common::PUS_PACKET_ID = spacepacket::getTcSpacePacketIdFromApid(apid::EIVE_OBSW); +const uint16_t common::PUS_PACKET_ID = ccsds::getTcSpacePacketIdFromApid(apid::EIVE_OBSW); diff --git a/fsfw b/fsfw index d9759581..7881f5ba 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit d975958120bd151dabdc450a104e9cc8069ff509 +Subproject commit 7881f5bab86212035b94f4995551d75e843174b5 diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 8699f753..c7001a82 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -159,6 +159,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 12609;0x3141;MPSOC_ACK_INVALID_APID;LOW;Expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h 12610;0x3142;MPSOC_EXE_INVALID_APID;LOW;Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h 12611;0x3143;MPSOC_HELPER_SEQ_CNT_MISMATCH;LOW;Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHelper.h +12612;0x3144;MPSOC_TM_SIZE_ERROR;LOW;;linux/devices/ploc/PlocMPSoCHelper.h +12613;0x3145;MPSOC_TM_CRC_MISSMATCH;LOW;;linux/devices/ploc/PlocMPSoCHelper.h 12700;0x319c;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission/devices/PayloadPcduHandler.h 12701;0x319d;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h 12702;0x319e;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h @@ -192,18 +194,23 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 13605;0x3525;SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL;LOW;Requesting event buffer was successful;linux/devices/ploc/PlocSupvHelper.h 13606;0x3526;SUPV_EVENT_BUFFER_REQUEST_FAILED;LOW;Requesting event buffer failed;linux/devices/ploc/PlocSupvHelper.h 13607;0x3527;SUPV_EVENT_BUFFER_REQUEST_TERMINATED;LOW;Terminated event buffer request by command P1: Number of packets read before process was terminated;linux/devices/ploc/PlocSupvHelper.h -13608;0x3528;SUPV_SENDING_COMMAND_FAILED;LOW;;linux/devices/ploc/PlocSupvHelper.h -13609;0x3529;SUPV_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h -13610;0x352a;SUPV_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h -13611;0x352b;SUPV_MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocSupvHelper.h -13612;0x352c;SUPV_MISSING_EXE;LOW;Supervisor did not receive execution report P1: Number of bytes missing P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h -13613;0x352d;SUPV_ACK_FAILURE_REPORT;LOW;Supervisor received acknowledgment failure report P1: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h -13614;0x352e;SUPV_EXE_FAILURE_REPORT;LOW;Execution report failure P1:;linux/devices/ploc/PlocSupvHelper.h -13615;0x352f;SUPV_ACK_INVALID_APID;LOW;Supervisor expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h -13616;0x3530;SUPV_EXE_INVALID_APID;LOW;Supervisor helper expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h -13617;0x3531;ACK_RECEPTION_FAILURE;LOW;Failed to receive acknowledgment report P1: Return value P2: Apid of command for which the reception of the acknowledgment report failed;linux/devices/ploc/PlocSupvHelper.h -13618;0x3532;EXE_RECEPTION_FAILURE;LOW;Failed to receive execution report P1: Return value P2: Apid of command for which the reception of the execution report failed;linux/devices/ploc/PlocSupvHelper.h -13619;0x3533;WRITE_MEMORY_FAILED;LOW;Update procedure failed when sending packet with number P1 P1: Packet number for which the memory write command fails;linux/devices/ploc/PlocSupvHelper.h +13608;0x3528;SUPV_MEM_CHECK_OK;INFO;;linux/devices/ploc/PlocSupvHelper.h +13609;0x3529;SUPV_MEM_CHECK_FAIL;INFO;;linux/devices/ploc/PlocSupvHelper.h +13616;0x3530;SUPV_SENDING_COMMAND_FAILED;LOW;;linux/devices/ploc/PlocSupvHelper.h +13617;0x3531;SUPV_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h +13618;0x3532;SUPV_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h +13619;0x3533;SUPV_MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocSupvHelper.h +13620;0x3534;SUPV_MISSING_EXE;LOW;Supervisor did not receive execution report P1: Number of bytes missing P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h +13621;0x3535;SUPV_ACK_FAILURE_REPORT;LOW;Supervisor received acknowledgment failure report P1: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h +13622;0x3536;SUPV_EXE_FAILURE_REPORT;LOW;Execution report failure P1:;linux/devices/ploc/PlocSupvHelper.h +13623;0x3537;SUPV_ACK_INVALID_APID;LOW;Supervisor expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h +13624;0x3538;SUPV_EXE_INVALID_APID;LOW;Supervisor helper expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h +13625;0x3539;ACK_RECEPTION_FAILURE;LOW;Failed to receive acknowledgment report P1: Return value P2: Apid of command for which the reception of the acknowledgment report failed;linux/devices/ploc/PlocSupvHelper.h +13626;0x353a;EXE_RECEPTION_FAILURE;LOW;Failed to receive execution report P1: Return value P2: Apid of command for which the reception of the execution report failed;linux/devices/ploc/PlocSupvHelper.h +13627;0x353b;WRITE_MEMORY_FAILED;LOW;Update procedure failed when sending packet. P1: First byte percent, third and fourth byte Sequence Count, P2: Bytes written;linux/devices/ploc/PlocSupvHelper.h +13628;0x353c;SUPV_REPLY_SIZE_MISSMATCH;LOW;;linux/devices/ploc/PlocSupvHelper.h +13629;0x353d;SUPV_REPLY_CRC_MISSMATCH;LOW;;linux/devices/ploc/PlocSupvHelper.h +13630;0x353e;SUPV_UPDATE_PROGRESS;INFO;Will be triggered every 5 percent of the update progress. P1: First byte percent, third and fourth byte Sequence Count, P2: Bytes written;linux/devices/ploc/PlocSupvHelper.h 13700;0x3584;ALLOC_FAILURE;MEDIUM;;bsp_q7s/core/CoreController.h 13701;0x3585;REBOOT_SW;MEDIUM; Software reboot occurred. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h 13702;0x3586;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s/core/CoreController.h diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index 098b0b08..04f39106 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -1,6 +1,6 @@ 0x00005060;P60DOCK_TEST_TASK +0x43000002;ACS_CONTROLLER 0x43000003;CORE_CONTROLLER -0x43100002;ACS_CONTROLLER 0x43400001;THERMAL_CONTROLLER 0x44120006;MGM_0_LIS3_HANDLER 0x44120010;GYRO_0_ADIS_HANDLER @@ -108,6 +108,7 @@ 0x534f0200;TM_STORE 0x534f0300;IPC_STORE 0x53500010;TIME_STAMPER +0x53500020;VERIFICATION_REPORTER 0x53ffffff;FSFW_OBJECTS_END 0x54000010;SPI_TEST 0x54000020;UART_TEST diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index b614f324..ab196298 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -1,169 +1,169 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x0000;OK;System-wide code for ok.;0;HasReturnvaluesIF;fsfw/returnvalues/HasReturnvaluesIF.h 0x0001;Failed;Unspecified system-wide code for failed.;1;HasReturnvaluesIF;fsfw/returnvalues/HasReturnvaluesIF.h -0x5fa0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/tmtc/CCSDSHandler.h -0x5c00;GOMS_PacketTooLong;;0;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5c01;GOMS_InvalidTableId;;1;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5c02;GOMS_InvalidAddress;;2;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5c03;GOMS_InvalidParamSize;;3;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5c04;GOMS_InvalidPayloadSize;;4;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5c05;GOMS_UnknownReplyId;;5;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x51b0;RWHA_SpiWriteFailure;;176;RW_HANDLER;mission/devices/RwHandler.h -0x51b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/devices/RwHandler.h -0x51b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/devices/RwHandler.h -0x51b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/devices/RwHandler.h -0x51b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/devices/RwHandler.h -0x51b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/devices/RwHandler.h -0x51b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/devices/RwHandler.h -0x51a0;RWHA_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;RW_HANDLER;mission/devices/RwHandler.h -0x51a1;RWHA_InvalidRampTime;Action Message with invalid ramp time was received.;161;RW_HANDLER;mission/devices/RwHandler.h -0x51a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/devices/RwHandler.h -0x51a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/devices/RwHandler.h -0x51a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/devices/RwHandler.h -0x4ea1;HEATER_CommandNotSupported;;161;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4ea2;HEATER_InitFailed;;162;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4ea3;HEATER_InvalidSwitchNr;;163;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4ea4;HEATER_MainSwitchSetTimeout;;164;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4ea5;HEATER_CommandAlreadyWaiting;;165;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x57a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h -0x57a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h -0x50a0;IMTQ_InvalidCommandCode;;160;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x50a1;IMTQ_ParameterMissing;;161;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x50a2;IMTQ_ParameterInvalid;;162;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x50a3;IMTQ_CcUnavailable;;163;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x50a4;IMTQ_InternalProcessingError;;164;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x50a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x50a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x50a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;167;IMTQ_HANDLER;mission/devices/IMTQHandler.h -0x4fa0;SYRLINKS_CrcFailure;;160;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x4fa1;SYRLINKS_UartFraminOrParityErrorAck;;161;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x4fa2;SYRLINKS_BadCharacterAck;;162;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x4fa3;SYRLINKS_BadParameterValueAck;;163;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x4fa4;SYRLINKS_BadEndOfFrameAck;;164;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x4fa5;SYRLINKS_UnknownCommandIdAck;;165;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x4fa6;SYRLINKS_BadCrcAck;;166;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x4fa7;SYRLINKS_ReplyWrongSize;;167;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x4fa8;SYRLINKS_MissingStartFrameCharacter;;168;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h -0x65a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x65a1;SADPL_DeploymentAlreadyExecuting;;161;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x65a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x65a3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x65a4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x62a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h -0x2b01;CCS_BcIsSetVrCommand;;1;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2b02;CCS_BcIsUnlockCommand;;2;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bb0;CCS_BcIllegalCommand;;176;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bb1;CCS_BoardReadingNotFinished;;177;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bf0;CCS_NsPositiveW;;240;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bf1;CCS_NsNegativeW;;241;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bf2;CCS_NsLockout;;242;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bf3;CCS_FarmInLockout;;243;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bf4;CCS_FarmInWait;;244;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2be0;CCS_WrongSymbol;;224;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2be1;CCS_DoubleStart;;225;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2be2;CCS_StartSymbolMissed;;226;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2be3;CCS_EndWithoutStart;;227;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2be4;CCS_TooLarge;;228;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2be5;CCS_TooShort;;229;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2be6;CCS_WrongTfVersion;;230;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2be7;CCS_WrongSpacecraftId;;231;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2be8;CCS_NoValidFrameType;;232;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2be9;CCS_CrcFailed;;233;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bea;CCS_VcNotFound;;234;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2beb;CCS_ForwardingFailed;;235;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bec;CCS_ContentTooLarge;;236;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bed;CCS_ResidualData;;237;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bee;CCS_DataCorrupted;;238;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bef;CCS_IllegalSegmentationFlag;;239;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bd0;CCS_IllegalFlagCombination;;208;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bd1;CCS_ShorterThanHeader;;209;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bd2;CCS_TooShortBlockedPacket;;210;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2bd3;CCS_TooShortMapExtraction;;211;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x3a00;SPH_ConnBroken;;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h -0x2901;IEC_NoConfigurationTable;;1;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2902;IEC_NoCpuTable;;2;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2903;IEC_InvalidWorkspaceAddress;;3;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2904;IEC_TooLittleWorkspace;;4;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2905;IEC_WorkspaceAllocation;;5;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2906;IEC_InterruptStackTooSmall;;6;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2907;IEC_ThreadExitted;;7;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2908;IEC_InconsistentMpInformation;;8;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2909;IEC_InvalidNode;;9;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x290a;IEC_NoMpci;;10;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x290b;IEC_BadPacket;;11;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x290c;IEC_OutOfPackets;;12;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x290d;IEC_OutOfGlobalObjects;;13;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x290e;IEC_OutOfProxies;;14;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x290f;IEC_InvalidGlobalId;;15;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2910;IEC_BadStackHook;;16;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2911;IEC_BadAttributes;;17;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2912;IEC_ImplementationKeyCreateInconsistency;;18;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2913;IEC_ImplementationBlockingOperationCancel;;19;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2914;IEC_MutexObtainFromBadState;;20;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2915;IEC_UnlimitedAndMaximumIs0;;21;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h +0x58a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h +0x58a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h +0x66a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a1;SADPL_DeploymentAlreadyExecuting;;161;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x52b0;RWHA_SpiWriteFailure;;176;RW_HANDLER;mission/devices/RwHandler.h +0x52b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/devices/RwHandler.h +0x52b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/devices/RwHandler.h +0x52b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/devices/RwHandler.h +0x52b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/devices/RwHandler.h +0x52b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/devices/RwHandler.h +0x52b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/devices/RwHandler.h +0x52a0;RWHA_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;RW_HANDLER;mission/devices/RwHandler.h +0x52a1;RWHA_InvalidRampTime;Action Message with invalid ramp time was received.;161;RW_HANDLER;mission/devices/RwHandler.h +0x52a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/devices/RwHandler.h +0x52a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/devices/RwHandler.h +0x52a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/devices/RwHandler.h +0x5d00;GOMS_PacketTooLong;;0;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d01;GOMS_InvalidTableId;;1;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d02;GOMS_InvalidAddress;;2;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d03;GOMS_InvalidParamSize;;3;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d04;GOMS_InvalidPayloadSize;;4;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d05;GOMS_UnknownReplyId;;5;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x51a0;IMTQ_InvalidCommandCode;;160;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x51a1;IMTQ_ParameterMissing;;161;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x51a2;IMTQ_ParameterInvalid;;162;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x51a3;IMTQ_CcUnavailable;;163;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x51a4;IMTQ_InternalProcessingError;;164;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x51a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x51a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x51a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;167;IMTQ_HANDLER;mission/devices/IMTQHandler.h +0x50a0;SYRLINKS_CrcFailure;;160;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x50a1;SYRLINKS_UartFraminOrParityErrorAck;;161;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x50a2;SYRLINKS_BadCharacterAck;;162;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x50a3;SYRLINKS_BadParameterValueAck;;163;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x50a4;SYRLINKS_BadEndOfFrameAck;;164;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x50a5;SYRLINKS_UnknownCommandIdAck;;165;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x50a6;SYRLINKS_BadCrcAck;;166;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x50a7;SYRLINKS_ReplyWrongSize;;167;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x50a8;SYRLINKS_MissingStartFrameCharacter;;168;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h +0x4fa1;HEATER_CommandNotSupported;;161;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa2;HEATER_InitFailed;;162;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa3;HEATER_InvalidSwitchNr;;163;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa4;HEATER_MainSwitchSetTimeout;;164;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa5;HEATER_CommandAlreadyWaiting;;165;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x60a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/tmtc/CCSDSHandler.h +0x4500;HSPI_OpeningFileFailed;;0;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h +0x4501;HSPI_FullDuplexTransferFailed;;1;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h +0x4502;HSPI_HalfDuplexTransferFailed;;2;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h +0x4801;HGIO_UnknownGpioId;;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4802;HGIO_DriveGpioFailure;;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4803;HGIO_GpioTypeFailure;;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4804;HGIO_GpioInvalidInstance;;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4805;HGIO_GpioDuplicateDetected;;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4806;HGIO_GpioInitFailed;;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4807;HGIO_GpioGetValueFailed;;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4601;HURT_UartReadFailure;;1;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h +0x4602;HURT_UartReadSizeMissmatch;;2;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h +0x4603;HURT_UartRxBufferTooSmall;;3;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h +0x4400;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4401;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4402;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4406;UXOS_PcloseCallError;;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x2801;SM_DataTooLarge;;1;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2802;SM_DataStorageFull;;2;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2803;SM_IllegalStorageId;;3;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2804;SM_DataDoesNotExist;;4;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2805;SM_IllegalAddress;;5;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2806;SM_PoolTooLarge;;6;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x0601;PP_DoItMyself;;1;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0602;PP_PointsToVariable;;2;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0603;PP_PointsToMemory;;3;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0604;PP_ActivityCompleted;;4;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0605;PP_PointsToVectorUint8;;5;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0606;PP_PointsToVectorUint16;;6;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0607;PP_PointsToVectorUint32;;7;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0608;PP_PointsToVectorFloat;;8;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06a0;PP_DumpNotSupported;;160;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e0;PP_InvalidSize;;224;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e1;PP_InvalidAddress;;225;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e2;PP_InvalidContent;;226;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e3;PP_UnalignedAccess;;227;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e4;PP_WriteProtected;;228;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x4300;FILS_GenericFileError;;0;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h +0x4301;FILS_IsBusy;;1;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h +0x4302;FILS_InvalidParameters;;2;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h +0x4305;FILS_FileDoesNotExist;;5;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h +0x4306;FILS_FileAlreadyExists;;6;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h +0x4307;FILS_FileLocked;;7;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h +0x430a;FILS_DirectoryDoesNotExist;;10;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h +0x430b;FILS_DirectoryAlreadyExists;;11;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h +0x430c;FILS_DirectoryNotEmpty;;12;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h +0x430f;FILS_SequencePacketMissingWrite;;15;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h +0x4310;FILS_SequencePacketMissingRead;;16;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h +0x13e0;MH_UnknownCmd;;224;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e1;MH_InvalidAddress;;225;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e2;MH_InvalidSize;;226;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e3;MH_StateMismatch;;227;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x38a1;SGP4_InvalidEccentricity;;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a2;SGP4_InvalidMeanMotion;;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a3;SGP4_InvalidPerturbationElements;;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a4;SGP4_InvalidSemiLatusRectum;;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a5;SGP4_InvalidEpochElements;;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a6;SGP4_SatelliteHasDecayed;;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38b1;SGP4_TleTooOld;;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38b2;SGP4_TleNotInitialized;;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x1101;AL_Full;;1;ARRAY_LIST;fsfw/src/fsfw/container/ArrayList.h +0x1501;FM_KeyAlreadyExists;;1;FIXED_MAP;fsfw/src/fsfw/container/FixedMap.h +0x1502;FM_MapFull;;2;FIXED_MAP;fsfw/src/fsfw/container/FixedMap.h +0x1503;FM_KeyDoesNotExist;;3;FIXED_MAP;fsfw/src/fsfw/container/FixedMap.h +0x1801;FF_Full;;1;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h +0x1802;FF_Empty;;2;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h +0x1601;FMM_MapFull;;1;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h +0x1602;FMM_KeyDoesNotExist;;2;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h +0x3901;MUX_NotEnoughResources;;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3902;MUX_InsufficientMemory;;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3903;MUX_NoPrivilege;;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3904;MUX_WrongAttributeSetting;;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3905;MUX_MutexAlreadyLocked;;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3906;MUX_MutexNotFound;;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3907;MUX_MutexMaxLocks;;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3908;MUX_CurrThreadAlreadyOwnsMutex;;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3909;MUX_CurrThreadDoesNotOwnMutex;;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390a;MUX_MutexTimeout;;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390b;MUX_MutexInvalidId;;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390c;MUX_MutexDestroyedWhileWaiting;;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a01;MQI_Empty;;1;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3a02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3a03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3a04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x0f01;CM_UnknownCommand;;1;COMMAND_MESSAGE;fsfw/src/fsfw/ipc/CommandMessageIF.h 0x0e01;HM_InvalidMode;;1;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h 0x0e02;HM_TransNotAllowed;;2;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h 0x0e03;HM_InTransition;;3;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h 0x0e04;HM_InvalidSubmode;;4;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h -0x2d01;HPA_InvalidIdentifierId;;1;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2d02;HPA_InvalidDomainId;;2;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2d03;HPA_InvalidValue;;3;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2d05;HPA_ReadOnly;;5;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2c01;PAW_UnknownDatatype;;1;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2c02;PAW_DatatypeMissmatch;;2;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2c03;PAW_Readonly;;3;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2c04;PAW_TooBig;;4;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2c05;PAW_SourceNotSet;;5;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2c06;PAW_OutOfBounds;;6;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2c07;PAW_NotSet;;7;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2c08;PAW_ColumnOrRowsZero;;8;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x3101;CF_ObjectHasNoFunctions;;1;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h -0x3102;CF_AlreadyCommanding;;2;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h -0x3201;HF_IsBusy;;1;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x3202;HF_InvalidParameters;;2;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x3203;HF_ExecutionFinished;;3;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x3204;HF_InvalidActionId;;4;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x0201;OM_InsertionFailed;;1;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x0202;OM_NotFound;;2;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x0203;OM_ChildInitFailed;;3;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x0204;OM_InternalErrReporterUninit;;4;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x2500;FDI_YourFault;;0;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h -0x2501;FDI_MyFault;;1;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h -0x2502;FDI_ConfirmLater;;2;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h -0x2101;TMF_Busy;;1;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2102;TMF_LastPacketFound;;2;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2103;TMF_StopFetch;;3;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2104;TMF_Timeout;;4;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2105;TMF_TmChannelFull;;5;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2106;TMF_NotStored;;6;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2107;TMF_AllDeleted;;7;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2108;TMF_InvalidData;;8;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2109;TMF_NotReady;;9;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2001;TMB_Busy;;1;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2002;TMB_Full;;2;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2003;TMB_Empty;;3;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2004;TMB_NullRequested;;4;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2005;TMB_TooLarge;;5;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2006;TMB_NotReady;;6;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2007;TMB_DumpError;;7;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2008;TMB_CrcError;;8;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2009;TMB_Timeout;;9;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x200a;TMB_IdlePacketFound;;10;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x200b;TMB_TelecommandFound;;11;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x200c;TMB_NoPusATm;;12;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x200d;TMB_TooSmall;;13;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x200e;TMB_BlockNotFound;;14;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x200f;TMB_InvalidRequest;;15;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x1c01;TCD_PacketLost;;1;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributor.h -0x1c02;TCD_DestinationNotFound;;2;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributor.h -0x1c03;TCD_ServiceIdAlreadyExists;;3;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributor.h -0x1b00;TCC_IllegalApid;;0;TC_PACKET_CHECK;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h -0x1b01;TCC_IncompletePacket;;1;TC_PACKET_CHECK;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h -0x1b02;TCC_IncorrectChecksum;;2;TC_PACKET_CHECK;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h -0x1b03;TCC_IllegalPacketType;;3;TC_PACKET_CHECK;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h -0x1b04;TCC_IllegalPacketSubtype;;4;TC_PACKET_CHECK;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h -0x1b05;TCC_IncorrectPrimaryHeader;;5;TC_PACKET_CHECK;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h -0x1b06;TCC_IncorrectSecondaryHeader;;6;TC_PACKET_CHECK;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h +0x0c02;MS_InvalidEntry;;2;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0c03;MS_TooManyElements;;3;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0c04;MS_CantStoreEmpty;;4;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0b01;SB_ChildNotFound;;1;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b02;SB_ChildInfoUpdated;;2;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b03;SB_ChildDoesntHaveModes;;3;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b04;SB_CouldNotInsertChild;;4;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b05;SB_TableContainsInvalidObjectId;;5;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0d01;SS_SequenceAlreadyExists;;1;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d02;SS_TableAlreadyExists;;2;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d03;SS_TableDoesNotExist;;3;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d04;SS_TableOrSequenceLengthInvalid;;4;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d05;SS_SequenceDoesNotExist;;5;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d06;SS_TableContainsInvalidObjectId;;6;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d07;SS_FallbackSequenceDoesNotExist;;7;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d08;SS_NoTargetTable;;8;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d09;SS_SequenceOrTableTooLong;;9;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0b;SS_IsFallbackSequence;;11;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0c;SS_AccessDenied;;12;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0e;SS_TableInUse;;14;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0da1;SS_TargetTableNotReached;;161;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0da2;SS_TableCheckFailed;;162;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x2501;EV_ListenerNotFound;;1;EVENT_MANAGER_IF;fsfw/src/fsfw/events/EventManagerIF.h 0x04e1;RMP_CommandNoDescriptorsAvailable;;225;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x04e2;RMP_CommandBufferFull;;226;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x04e3;RMP_CommandChannelOutOfRange;;227;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h @@ -204,195 +204,171 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x040a;RMP_ReplyCommandNotImplementedOrNotAuthorised;;10;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x040b;RMP_ReplyRmwDataLengthError;;11;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x040c;RMP_ReplyInvalidTargetLogicalAddress;;12;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h -0x2701;SM_DataTooLarge;;1;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2702;SM_DataStorageFull;;2;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2703;SM_IllegalStorageId;;3;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2704;SM_DataDoesNotExist;;4;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2705;SM_IllegalAddress;;5;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2706;SM_PoolTooLarge;;6;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x37a1;SGP4_InvalidEccentricity;;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x37a2;SGP4_InvalidMeanMotion;;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x37a3;SGP4_InvalidPerturbationElements;;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x37a4;SGP4_InvalidSemiLatusRectum;;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x37a5;SGP4_InvalidEpochElements;;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x37a6;SGP4_SatelliteHasDecayed;;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x37b1;SGP4_TleTooOld;;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x37b2;SGP4_TleNotInitialized;;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x2301;MT_TooDetailedRequest;;1;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2302;MT_TooGeneralRequest;;2;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2303;MT_NoMatch;;3;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2304;MT_Full;;4;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2305;MT_NewNodeCreated;;5;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x3e01;DLEE_StreamTooShort;;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h -0x3e02;DLEE_DecodingError;;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h -0x2e01;ASC_TooLongForTargetType;;1;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h -0x2e02;ASC_InvalidCharacters;;2;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h -0x2e03;ASC_BufferTooSmall;;3;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h -0x0f01;CM_UnknownCommand;;1;COMMAND_MESSAGE;fsfw/src/fsfw/ipc/CommandMessageIF.h -0x3901;MQI_Empty;;1;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3902;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3903;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3904;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3801;MUX_NotEnoughResources;;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3802;MUX_InsufficientMemory;;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3803;MUX_NoPrivilege;;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3804;MUX_WrongAttributeSetting;;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3805;MUX_MutexAlreadyLocked;;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3806;MUX_MutexNotFound;;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3807;MUX_MutexMaxLocks;;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3808;MUX_CurrThreadAlreadyOwnsMutex;;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3809;MUX_CurrThreadDoesNotOwnMutex;;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x380a;MUX_MutexTimeout;;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x380b;MUX_MutexInvalidId;;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x380c;MUX_MutexDestroyedWhileWaiting;;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3a01;SPH_SemaphoreTimeout;;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3a02;SPH_SemaphoreNotOwned;;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3a03;SPH_SemaphoreInvalid;;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3501;CFDP_InvalidTlvType;;1;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3502;CFDP_InvalidDirectiveFields;;2;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3503;CFDP_InvalidPduDatafieldLen;;3;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3504;CFDP_InvalidAckDirectiveFields;;4;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3505;CFDP_MetadataCantParseOptions;;5;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3506;CFDP_FinishedCantParseFsResponses;;6;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3508;CFDP_FilestoreRequiresSecondFile;;8;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3509;CFDP_FilestoreResponseCantParseFsMessage;;9;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x2801;TC_InvalidTargetState;;1;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h -0x28f1;TC_AboveOperationalLimit;;241;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h -0x28f2;TC_BelowOperationalLimit;;242;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h -0x0c02;MS_InvalidEntry;;2;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h -0x0c03;MS_TooManyElements;;3;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h -0x0c04;MS_CantStoreEmpty;;4;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h -0x0d01;SS_SequenceAlreadyExists;;1;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d02;SS_TableAlreadyExists;;2;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d03;SS_TableDoesNotExist;;3;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d04;SS_TableOrSequenceLengthInvalid;;4;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d05;SS_SequenceDoesNotExist;;5;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d06;SS_TableContainsInvalidObjectId;;6;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d07;SS_FallbackSequenceDoesNotExist;;7;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d08;SS_NoTargetTable;;8;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d09;SS_SequenceOrTableTooLong;;9;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d0b;SS_IsFallbackSequence;;11;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d0c;SS_AccessDenied;;12;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d0e;SS_TableInUse;;14;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0da1;SS_TargetTableNotReached;;161;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0da2;SS_TableCheckFailed;;162;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0b01;SB_ChildNotFound;;1;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b02;SB_ChildInfoUpdated;;2;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b03;SB_ChildDoesntHaveModes;;3;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b04;SB_CouldNotInsertChild;;4;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b05;SB_TableContainsInvalidObjectId;;5;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x3d00;HKM_QueueOrDestinationInvalid;;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3d01;HKM_WrongHkPacketType;;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3d02;HKM_ReportingStatusUnchanged;;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3d03;HKM_PeriodicHelperInvalid;;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3d04;HKM_PoolobjectNotFound;;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3d05;HKM_DatasetNotFound;;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3b00;LPIF_PoolEntryNotFound;;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h -0x3b01;LPIF_PoolEntryTypeConflict;;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h -0x3ca0;PVA_InvalidReadWriteMode;;160;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h -0x3ca1;PVA_InvalidPoolEntry;;161;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h +0x1401;SE_BufferTooShort;;1;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x1402;SE_StreamTooShort;;2;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x1403;SE_TooManyElements;;3;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x3da0;PVA_InvalidReadWriteMode;;160;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h +0x3da1;PVA_InvalidPoolEntry;;161;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h 0x0801;DPS_InvalidParameterDefinition;;1;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h 0x0802;DPS_SetWasAlreadyRead;;2;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h 0x0803;DPS_CommitingWithoutReading;;3;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h 0x0804;DPS_DataSetUninitialised;;4;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h 0x0805;DPS_DataSetFull;;5;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h 0x0806;DPS_PoolVarNull;;6;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h -0x1000;TIM_UnsupportedTimeFormat;;0;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1001;TIM_NotEnoughInformationForTargetFormat;;1;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1002;TIM_LengthMismatch;;2;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1003;TIM_InvalidTimeFormat;;3;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1004;TIM_InvalidDayOfYear;;4;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1005;TIM_TimeDoesNotFitFormat;;5;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x3601;TSI_BadTimestamp;;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStamperIF.h -0x1d01;PUS_ActivityStarted;;1;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d02;PUS_InvalidSubservice;;2;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d03;PUS_IllegalApplicationData;;3;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d04;PUS_SendTmFailed;;4;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d05;PUS_Timeout;;5;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x4b00;SPPA_NoPacketFound;;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h -0x4b01;SPPA_SplitPacket;;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h -0x1f01;CSB_ExecutionComplete;;1;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x1f02;CSB_NoStepMessage;;2;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x1f03;CSB_ObjectBusy;;3;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x1f04;CSB_Busy;;4;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x1f05;CSB_InvalidTc;;5;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x1f06;CSB_InvalidObject;;6;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x1f07;CSB_InvalidReply;;7;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x1101;AL_Full;;1;ARRAY_LIST;fsfw/src/fsfw/container/ArrayList.h -0x1801;FF_Full;;1;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h -0x1802;FF_Empty;;2;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h -0x1601;FMM_MapFull;;1;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h -0x1602;FMM_KeyDoesNotExist;;2;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h -0x1501;FM_KeyAlreadyExists;;1;FIXED_MAP;fsfw/src/fsfw/container/FixedMap.h -0x1502;FM_MapFull;;2;FIXED_MAP;fsfw/src/fsfw/container/FixedMap.h -0x1503;FM_KeyDoesNotExist;;3;FIXED_MAP;fsfw/src/fsfw/container/FixedMap.h -0x2401;EV_ListenerNotFound;;1;EVENT_MANAGER_IF;fsfw/src/fsfw/events/EventManagerIF.h -0x1701;HHI_ObjectNotHealthy;;1;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h -0x1702;HHI_InvalidHealthState;;2;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h -0x1703;HHI_IsExternallyControlled;;3;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h -0x2f01;POS_InPowerTransition;;1;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h -0x2f02;POS_SwitchStateMismatch;;2;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h +0x1c01;TCD_PacketLost;;1;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributor.h +0x1c02;TCD_DestinationNotFound;;2;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributor.h +0x1c03;TCD_ServiceIdAlreadyExists;;3;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributor.h +0x1b00;TCC_InvalidCcsdsVersion;;0;PACKET_CHECK;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b01;TCC_InvalidApid;;1;PACKET_CHECK;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b02;TCC_InvalidPacketType;;2;PACKET_CHECK;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b03;TCC_InvalidSecHeaderField;;3;PACKET_CHECK;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b04;TCC_IncorrectPrimaryHeader;;4;PACKET_CHECK;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b05;TCC_IncompletePacket;;5;PACKET_CHECK;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b06;TCC_InvalidPusVersion;;6;PACKET_CHECK;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b07;TCC_IncorrectChecksum;;7;PACKET_CHECK;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b08;TCC_IllegalPacketSubtype;;8;PACKET_CHECK;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b09;TCC_IncorrectSecondaryHeader;;9;PACKET_CHECK;fsfw/src/fsfw/tcdistribution/definitions.h +0x3001;POS_InPowerTransition;;1;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h +0x3002;POS_SwitchStateMismatch;;2;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h 0x0501;PS_SwitchOn;;1;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h 0x0500;PS_SwitchOff;;0;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h 0x0502;PS_SwitchTimeout;;2;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h 0x0503;PS_FuseOn;;3;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h 0x0504;PS_FuseOff;;4;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h +0x3b00;SPH_ConnBroken;;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h +0x2a01;IEC_NoConfigurationTable;;1;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a02;IEC_NoCpuTable;;2;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a03;IEC_InvalidWorkspaceAddress;;3;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a04;IEC_TooLittleWorkspace;;4;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a05;IEC_WorkspaceAllocation;;5;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a06;IEC_InterruptStackTooSmall;;6;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a07;IEC_ThreadExitted;;7;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a08;IEC_InconsistentMpInformation;;8;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a09;IEC_InvalidNode;;9;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0a;IEC_NoMpci;;10;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0b;IEC_BadPacket;;11;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0c;IEC_OutOfPackets;;12;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0d;IEC_OutOfGlobalObjects;;13;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0e;IEC_OutOfProxies;;14;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0f;IEC_InvalidGlobalId;;15;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a10;IEC_BadStackHook;;16;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a11;IEC_BadAttributes;;17;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a12;IEC_ImplementationKeyCreateInconsistency;;18;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a13;IEC_ImplementationBlockingOperationCancel;;19;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a14;IEC_MutexObtainFromBadState;;20;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a15;IEC_UnlimitedAndMaximumIs0;;21;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2600;FDI_YourFault;;0;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x2601;FDI_MyFault;;1;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x2602;FDI_ConfirmLater;;2;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x1e00;PUS_InvalidPusVersion;;0;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h +0x1e01;PUS_InvalidCrc16;;1;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h +0x0201;OM_InsertionFailed;;1;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0202;OM_NotFound;;2;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0203;OM_ChildInitFailed;;3;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0204;OM_InternalErrReporterUninit;;4;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x2201;TMF_Busy;;1;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2202;TMF_LastPacketFound;;2;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2203;TMF_StopFetch;;3;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2204;TMF_Timeout;;4;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2205;TMF_TmChannelFull;;5;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2206;TMF_NotStored;;6;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2207;TMF_AllDeleted;;7;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2208;TMF_InvalidData;;8;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2209;TMF_NotReady;;9;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2101;TMB_Busy;;1;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2102;TMB_Full;;2;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2103;TMB_Empty;;3;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2104;TMB_NullRequested;;4;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2105;TMB_TooLarge;;5;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2106;TMB_NotReady;;6;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2107;TMB_DumpError;;7;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2108;TMB_CrcError;;8;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2109;TMB_Timeout;;9;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210a;TMB_IdlePacketFound;;10;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210b;TMB_TelecommandFound;;11;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210c;TMB_NoPusATm;;12;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210d;TMB_TooSmall;;13;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210e;TMB_BlockNotFound;;14;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210f;TMB_InvalidRequest;;15;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2d01;PAW_UnknownDatatype;;1;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d02;PAW_DatatypeMissmatch;;2;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d03;PAW_Readonly;;3;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d04;PAW_TooBig;;4;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d05;PAW_SourceNotSet;;5;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d06;PAW_OutOfBounds;;6;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d07;PAW_NotSet;;7;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d08;PAW_ColumnOrRowsZero;;8;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2e01;HPA_InvalidIdentifierId;;1;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e02;HPA_InvalidDomainId;;2;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e03;HPA_InvalidValue;;3;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e05;HPA_ReadOnly;;5;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x3b01;SPH_SemaphoreTimeout;;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3b02;SPH_SemaphoreNotOwned;;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3b03;SPH_SemaphoreInvalid;;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h 0x1a01;TRC_NotEnoughSensors;;1;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h 0x1a02;TRC_LowestValueOol;;2;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h 0x1a03;TRC_HighestValueOol;;3;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h 0x1a04;TRC_BothValuesOol;;4;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h 0x1a05;TRC_DuplexOol;;5;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h -0x3001;LIM_Unchecked;;1;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x3002;LIM_Invalid;;2;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x3003;LIM_Unselected;;3;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x3004;LIM_BelowLowLimit;;4;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x3005;LIM_AboveHighLimit;;5;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x3006;LIM_UnexpectedValue;;6;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x3007;LIM_OutOfRange;;7;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x30a0;LIM_FirstSample;;160;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x30e0;LIM_InvalidSize;;224;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x30e1;LIM_WrongType;;225;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x30e2;LIM_WrongPid;;226;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x30e3;LIM_WrongLimitId;;227;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x30ee;LIM_MonitorNotFound;;238;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x4101;PUS11_InvalidTypeTimeWindow;;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4102;PUS11_TimeshiftingNotPossible;;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4103;PUS11_InvalidRelativeTime;;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x4200;FILS_GenericFileError;;0;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h -0x4201;FILS_IsBusy;;1;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h -0x4202;FILS_InvalidParameters;;2;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h -0x4205;FILS_FileDoesNotExist;;5;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h -0x4206;FILS_FileAlreadyExists;;6;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h -0x4207;FILS_FileLocked;;7;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h -0x420a;FILS_DirectoryDoesNotExist;;10;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h -0x420b;FILS_DirectoryAlreadyExists;;11;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h -0x420c;FILS_DirectoryNotEmpty;;12;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h -0x420f;FILS_SequencePacketMissingWrite;;15;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h -0x4210;FILS_SequencePacketMissingRead;;16;FILE_SYSTEM;fsfw/src/fsfw/memory/HasFileSystemIF.h -0x0601;PP_DoItMyself;;1;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0602;PP_PointsToVariable;;2;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0603;PP_PointsToMemory;;3;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0604;PP_ActivityCompleted;;4;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0605;PP_PointsToVectorUint8;;5;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0606;PP_PointsToVectorUint16;;6;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0607;PP_PointsToVectorUint32;;7;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0608;PP_PointsToVectorFloat;;8;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06a0;PP_DumpNotSupported;;160;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e0;PP_InvalidSize;;224;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e1;PP_InvalidAddress;;225;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e2;PP_InvalidContent;;226;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e3;PP_UnalignedAccess;;227;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e4;PP_WriteProtected;;228;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x13e0;MH_UnknownCmd;;224;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x13e1;MH_InvalidAddress;;225;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x13e2;MH_InvalidSize;;226;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x13e3;MH_StateMismatch;;227;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x1201;AB_NeedSecondStep;;1;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1202;AB_NeedToReconfigure;;2;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1203;AB_ModeFallback;;3;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1204;AB_ChildNotCommandable;;4;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1205;AB_NeedToChangeHealth;;5;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x12a1;AB_NotEnoughChildrenInCorrectState;;161;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x3101;LIM_Unchecked;;1;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3102;LIM_Invalid;;2;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3103;LIM_Unselected;;3;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3104;LIM_BelowLowLimit;;4;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3105;LIM_AboveHighLimit;;5;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3106;LIM_UnexpectedValue;;6;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3107;LIM_OutOfRange;;7;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x31a0;LIM_FirstSample;;160;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x31e0;LIM_InvalidSize;;224;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x31e1;LIM_WrongType;;225;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x31e2;LIM_WrongPid;;226;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x31e3;LIM_WrongLimitId;;227;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x31ee;LIM_MonitorNotFound;;238;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3601;CFDP_InvalidTlvType;;1;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3602;CFDP_InvalidDirectiveFields;;2;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3603;CFDP_InvalidPduDatafieldLen;;3;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3604;CFDP_InvalidAckDirectiveFields;;4;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3605;CFDP_MetadataCantParseOptions;;5;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3606;CFDP_FinishedCantParseFsResponses;;6;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3608;CFDP_FilestoreRequiresSecondFile;;8;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3609;CFDP_FilestoreResponseCantParseFsMessage;;9;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x2c01;CCS_BcIsSetVrCommand;;1;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2c02;CCS_BcIsUnlockCommand;;2;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cb0;CCS_BcIllegalCommand;;176;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cb1;CCS_BoardReadingNotFinished;;177;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf0;CCS_NsPositiveW;;240;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf1;CCS_NsNegativeW;;241;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf2;CCS_NsLockout;;242;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf3;CCS_FarmInLockout;;243;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf4;CCS_FarmInWait;;244;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce0;CCS_WrongSymbol;;224;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce1;CCS_DoubleStart;;225;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce2;CCS_StartSymbolMissed;;226;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce3;CCS_EndWithoutStart;;227;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce4;CCS_TooLarge;;228;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce5;CCS_TooShort;;229;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce6;CCS_WrongTfVersion;;230;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce7;CCS_WrongSpacecraftId;;231;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce8;CCS_NoValidFrameType;;232;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce9;CCS_CrcFailed;;233;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cea;CCS_VcNotFound;;234;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ceb;CCS_ForwardingFailed;;235;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cec;CCS_ContentTooLarge;;236;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ced;CCS_ResidualData;;237;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cee;CCS_DataCorrupted;;238;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cef;CCS_IllegalSegmentationFlag;;239;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd0;CCS_IllegalFlagCombination;;208;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd1;CCS_ShorterThanHeader;;209;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd2;CCS_TooShortBlockedPacket;;210;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd3;CCS_TooShortMapExtraction;;211;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x4201;PUS11_InvalidTypeTimeWindow;;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4202;PUS11_TimeshiftingNotPossible;;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4203;PUS11_InvalidRelativeTime;;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x3401;DC_NoReplyReceived;;1;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3402;DC_ProtocolError;;2;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3403;DC_Nullpointer;;3;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3404;DC_InvalidCookieType;;4;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3405;DC_NotActive;;5;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3406;DC_TooMuchData;;6;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h 0x03a0;DHB_InvalidChannel;;160;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03b0;DHB_AperiodicReply;;176;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03b1;DHB_IgnoreReplyData;;177;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h @@ -402,65 +378,94 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x03d0;DHB_NoSwitch;;208;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03e0;DHB_ChildTimeout;;224;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03e1;DHB_SwitchFailed;;225;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h -0x3301;DC_NoReplyReceived;;1;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3302;DC_ProtocolError;;2;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3303;DC_Nullpointer;;3;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3304;DC_InvalidCookieType;;4;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3305;DC_NotActive;;5;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3306;DC_TooMuchData;;6;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x26a0;DHI_NoCommandData;;160;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26a1;DHI_CommandNotSupported;;161;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26a2;DHI_CommandAlreadySent;;162;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26a3;DHI_CommandWasNotSent;;163;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26a4;DHI_CantSwitchAddress;;164;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26a5;DHI_WrongModeForCommand;;165;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26a6;DHI_Timeout;;166;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26a7;DHI_Busy;;167;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26a8;DHI_NoReplyExpected;;168;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26a9;DHI_NonOpTemperature;;169;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26aa;DHI_CommandNotImplemented;;170;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26b0;DHI_ChecksumError;;176;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26b1;DHI_LengthMissmatch;;177;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26b2;DHI_InvalidData;;178;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26b3;DHI_ProtocolError;;179;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26c0;DHI_DeviceDidNotExecute;;192;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26c1;DHI_DeviceReportedError;;193;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26c2;DHI_UnknownDeviceReply;;194;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26c3;DHI_DeviceReplyInvalid;;195;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26d0;DHI_InvalidCommandParameter;;208;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x26d1;DHI_InvalidNumberOrLengthOfParameters;;209;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x1401;SE_BufferTooShort;;1;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h -0x1402;SE_StreamTooShort;;2;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h -0x1403;SE_TooManyElements;;3;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h -0x4400;HSPI_HalTimeoutRetval;;0;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4401;HSPI_HalBusyRetval;;1;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4402;HSPI_HalErrorRetval;;2;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h -0x4501;HURT_UartReadFailure;;1;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h -0x4502;HURT_UartReadSizeMissmatch;;2;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h -0x4503;HURT_UartRxBufferTooSmall;;3;HAL_UART;fsfw/src/fsfw_hal/linux/uart/UartComIF.h -0x4701;HGIO_UnknownGpioId;;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4702;HGIO_DriveGpioFailure;;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4703;HGIO_GpioTypeFailure;;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4704;HGIO_GpioInvalidInstance;;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4705;HGIO_GpioDuplicateDetected;;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4706;HGIO_GpioInitFailed;;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4707;HGIO_GpioGetValueFailed;;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4300;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4301;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4302;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4303;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4304;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4306;UXOS_PcloseCallError;;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x63a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;160;FILE_SYSTEM_HELPER;bsp_q7s/memory/FilesystemHelper.h -0x63a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;161;FILE_SYSTEM_HELPER;bsp_q7s/memory/FilesystemHelper.h -0x6900;SDMA_OpOngoing;;0;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x6901;SDMA_AlreadyOn;;1;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x6902;SDMA_AlreadyMounted;;2;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x6903;SDMA_AlreadyOff;;3;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x690a;SDMA_StatusFileNexists;;10;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x690b;SDMA_StatusFileFormatInvalid;;11;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x690c;SDMA_MountError;;12;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x690d;SDMA_UnmountError;;13;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x690e;SDMA_SystemCallError;;14;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x690f;SDMA_PopenCallError;;15;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h -0x6a00;SCBU_KeyNotFound;;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h +0x1201;AB_NeedSecondStep;;1;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1202;AB_NeedToReconfigure;;2;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1203;AB_ModeFallback;;3;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1204;AB_ChildNotCommandable;;4;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1205;AB_NeedToChangeHealth;;5;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x12a1;AB_NotEnoughChildrenInCorrectState;;161;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x27a0;DHI_NoCommandData;;160;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a1;DHI_CommandNotSupported;;161;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a2;DHI_CommandAlreadySent;;162;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a3;DHI_CommandWasNotSent;;163;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a4;DHI_CantSwitchAddress;;164;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a5;DHI_WrongModeForCommand;;165;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a6;DHI_Timeout;;166;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a7;DHI_Busy;;167;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a8;DHI_NoReplyExpected;;168;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a9;DHI_NonOpTemperature;;169;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27aa;DHI_CommandNotImplemented;;170;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27b0;DHI_ChecksumError;;176;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27b1;DHI_LengthMissmatch;;177;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27b2;DHI_InvalidData;;178;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27b3;DHI_ProtocolError;;179;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27c0;DHI_DeviceDidNotExecute;;192;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27c1;DHI_DeviceReportedError;;193;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27c2;DHI_UnknownDeviceReply;;194;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27c3;DHI_DeviceReplyInvalid;;195;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27d0;DHI_InvalidCommandParameter;;208;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27d1;DHI_InvalidNumberOrLengthOfParameters;;209;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x2401;MT_TooDetailedRequest;;1;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2402;MT_TooGeneralRequest;;2;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2403;MT_NoMatch;;3;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2404;MT_Full;;4;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2405;MT_NewNodeCreated;;5;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x3f01;DLEE_StreamTooShort;;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x3f02;DLEE_DecodingError;;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x2f01;ASC_TooLongForTargetType;;1;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x2f02;ASC_InvalidCharacters;;2;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x2f03;ASC_BufferTooSmall;;3;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x1701;HHI_ObjectNotHealthy;;1;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h +0x1702;HHI_InvalidHealthState;;2;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h +0x1703;HHI_IsExternallyControlled;;3;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h +0x3201;CF_ObjectHasNoFunctions;;1;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h +0x3202;CF_AlreadyCommanding;;2;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h +0x3301;HF_IsBusy;;1;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3302;HF_InvalidParameters;;2;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3303;HF_ExecutionFinished;;3;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3304;HF_InvalidActionId;;4;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x1000;TIM_UnsupportedTimeFormat;;0;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1001;TIM_NotEnoughInformationForTargetFormat;;1;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1002;TIM_LengthMismatch;;2;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1003;TIM_InvalidTimeFormat;;3;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1004;TIM_InvalidDayOfYear;;4;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1005;TIM_TimeDoesNotFitFormat;;5;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x3701;TSI_BadTimestamp;;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h +0x3c00;LPIF_PoolEntryNotFound;;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h +0x3c01;LPIF_PoolEntryTypeConflict;;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h +0x3e00;HKM_QueueOrDestinationInvalid;;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e01;HKM_WrongHkPacketType;;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e02;HKM_ReportingStatusUnchanged;;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e03;HKM_PeriodicHelperInvalid;;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e04;HKM_PoolobjectNotFound;;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e05;HKM_DatasetNotFound;;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x2901;TC_InvalidTargetState;;1;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x29f1;TC_AboveOperationalLimit;;241;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x29f2;TC_BelowOperationalLimit;;242;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x2001;CSB_ExecutionComplete;;1;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2002;CSB_NoStepMessage;;2;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2003;CSB_ObjectBusy;;3;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2004;CSB_Busy;;4;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2005;CSB_InvalidTc;;5;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2006;CSB_InvalidObject;;6;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2007;CSB_InvalidReply;;7;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x4c00;SPPA_NoPacketFound;;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x4c01;SPPA_SplitPacket;;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x1d01;ATC_ActivityStarted;;1;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d02;ATC_InvalidSubservice;;2;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d03;ATC_IllegalApplicationData;;3;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d04;ATC_SendTmFailed;;4;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d05;ATC_Timeout;;5;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x6b00;SCBU_KeyNotFound;;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h +0x64a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;160;FILE_SYSTEM_HELPER;bsp_q7s/memory/FilesystemHelper.h +0x64a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;161;FILE_SYSTEM_HELPER;bsp_q7s/memory/FilesystemHelper.h +0x6a00;SDMA_OpOngoing;;0;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x6a01;SDMA_AlreadyOn;;1;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x6a02;SDMA_AlreadyMounted;;2;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x6a03;SDMA_AlreadyOff;;3;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x6a0a;SDMA_StatusFileNexists;;10;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x6a0b;SDMA_StatusFileFormatInvalid;;11;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x6a0c;SDMA_MountError;;12;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x6a0d;SDMA_UnmountError;;13;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x6a0e;SDMA_SystemCallError;;14;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h +0x6a0f;SDMA_PopenCallError;;15;SD_CARD_MANAGER;bsp_q7s/memory/SdCardManager.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 91303662..dda8b717 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 210 translations. + * @brief Auto-generated event translation file. Contains 217 translations. * @details - * Generated on: 2022-08-12 13:06:03 + * Generated on: 2022-08-24 16:53:50 */ #include "translateEvents.h" @@ -165,6 +165,8 @@ const char *MPSOC_EXE_FAILURE_REPORT_STRING = "MPSOC_EXE_FAILURE_REPORT"; const char *MPSOC_ACK_INVALID_APID_STRING = "MPSOC_ACK_INVALID_APID"; const char *MPSOC_EXE_INVALID_APID_STRING = "MPSOC_EXE_INVALID_APID"; const char *MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING = "MPSOC_HELPER_SEQ_CNT_MISMATCH"; +const char *MPSOC_TM_SIZE_ERROR_STRING = "MPSOC_TM_SIZE_ERROR"; +const char *MPSOC_TM_CRC_MISSMATCH_STRING = "MPSOC_TM_CRC_MISSMATCH"; const char *TRANSITION_BACK_TO_OFF_STRING = "TRANSITION_BACK_TO_OFF"; const char *NEG_V_OUT_OF_BOUNDS_STRING = "NEG_V_OUT_OF_BOUNDS"; const char *U_DRO_OUT_OF_BOUNDS_STRING = "U_DRO_OUT_OF_BOUNDS"; @@ -194,6 +196,8 @@ const char *TERMINATED_UPDATE_PROCEDURE_STRING = "TERMINATED_UPDATE_PROCEDURE"; const char *SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING = "SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL"; const char *SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING = "SUPV_EVENT_BUFFER_REQUEST_FAILED"; const char *SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING = "SUPV_EVENT_BUFFER_REQUEST_TERMINATED"; +const char *SUPV_MEM_CHECK_OK_STRING = "SUPV_MEM_CHECK_OK"; +const char *SUPV_MEM_CHECK_FAIL_STRING = "SUPV_MEM_CHECK_FAIL"; const char *SUPV_SENDING_COMMAND_FAILED_STRING = "SUPV_SENDING_COMMAND_FAILED"; const char *SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING = "SUPV_HELPER_REQUESTING_REPLY_FAILED"; const char *SUPV_HELPER_READING_REPLY_FAILED_STRING = "SUPV_HELPER_READING_REPLY_FAILED"; @@ -206,6 +210,9 @@ const char *SUPV_EXE_INVALID_APID_STRING = "SUPV_EXE_INVALID_APID"; const char *ACK_RECEPTION_FAILURE_STRING = "ACK_RECEPTION_FAILURE"; const char *EXE_RECEPTION_FAILURE_STRING = "EXE_RECEPTION_FAILURE"; const char *WRITE_MEMORY_FAILED_STRING = "WRITE_MEMORY_FAILED"; +const char *SUPV_REPLY_SIZE_MISSMATCH_STRING = "SUPV_REPLY_SIZE_MISSMATCH"; +const char *SUPV_REPLY_CRC_MISSMATCH_STRING = "SUPV_REPLY_CRC_MISSMATCH"; +const char *SUPV_UPDATE_PROGRESS_STRING = "SUPV_UPDATE_PROGRESS"; const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE"; const char *REBOOT_SW_STRING = "REBOOT_SW"; const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; @@ -534,6 +541,10 @@ const char *translateEvents(Event event) { return MPSOC_EXE_INVALID_APID_STRING; case (12611): return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING; + case (12612): + return MPSOC_TM_SIZE_ERROR_STRING; + case (12613): + return MPSOC_TM_CRC_MISSMATCH_STRING; case (12700): return TRANSITION_BACK_TO_OFF_STRING; case (12701): @@ -593,29 +604,39 @@ const char *translateEvents(Event event) { case (13607): return SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING; case (13608): - return SUPV_SENDING_COMMAND_FAILED_STRING; + return SUPV_MEM_CHECK_OK_STRING; case (13609): - return SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING; - case (13610): - return SUPV_HELPER_READING_REPLY_FAILED_STRING; - case (13611): - return SUPV_MISSING_ACK_STRING; - case (13612): - return SUPV_MISSING_EXE_STRING; - case (13613): - return SUPV_ACK_FAILURE_REPORT_STRING; - case (13614): - return SUPV_EXE_FAILURE_REPORT_STRING; - case (13615): - return SUPV_ACK_INVALID_APID_STRING; + return SUPV_MEM_CHECK_FAIL_STRING; case (13616): - return SUPV_EXE_INVALID_APID_STRING; + return SUPV_SENDING_COMMAND_FAILED_STRING; case (13617): - return ACK_RECEPTION_FAILURE_STRING; + return SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING; case (13618): - return EXE_RECEPTION_FAILURE_STRING; + return SUPV_HELPER_READING_REPLY_FAILED_STRING; case (13619): + return SUPV_MISSING_ACK_STRING; + case (13620): + return SUPV_MISSING_EXE_STRING; + case (13621): + return SUPV_ACK_FAILURE_REPORT_STRING; + case (13622): + return SUPV_EXE_FAILURE_REPORT_STRING; + case (13623): + return SUPV_ACK_INVALID_APID_STRING; + case (13624): + return SUPV_EXE_INVALID_APID_STRING; + case (13625): + return ACK_RECEPTION_FAILURE_STRING; + case (13626): + return EXE_RECEPTION_FAILURE_STRING; + case (13627): return WRITE_MEMORY_FAILED_STRING; + case (13628): + return SUPV_REPLY_SIZE_MISSMATCH_STRING; + case (13629): + return SUPV_REPLY_CRC_MISSMATCH_STRING; + case (13630): + return SUPV_UPDATE_PROGRESS_STRING; case (13700): return ALLOC_FAILURE_STRING; case (13701): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index e3ee0fe4..215d47d8 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -1,14 +1,14 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 134 translations. - * Generated on: 2022-08-12 13:06:03 + * Contains 135 translations. + * Generated on: 2022-08-24 16:53:50 */ #include "translateObjects.h" const char *P60DOCK_TEST_TASK_STRING = "P60DOCK_TEST_TASK"; -const char *CORE_CONTROLLER_STRING = "CORE_CONTROLLER"; const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER"; +const char *CORE_CONTROLLER_STRING = "CORE_CONTROLLER"; const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER"; const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER"; const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER"; @@ -116,6 +116,7 @@ const char *TC_STORE_STRING = "TC_STORE"; const char *TM_STORE_STRING = "TM_STORE"; const char *IPC_STORE_STRING = "IPC_STORE"; const char *TIME_STAMPER_STRING = "TIME_STAMPER"; +const char *VERIFICATION_REPORTER_STRING = "VERIFICATION_REPORTER"; const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; const char *SPI_TEST_STRING = "SPI_TEST"; const char *UART_TEST_STRING = "UART_TEST"; @@ -145,10 +146,10 @@ const char *translateObject(object_id_t object) { switch ((object & 0xFFFFFFFF)) { case 0x00005060: return P60DOCK_TEST_TASK_STRING; + case 0x43000002: + return ACS_CONTROLLER_STRING; case 0x43000003: return CORE_CONTROLLER_STRING; - case 0x43100002: - return ACS_CONTROLLER_STRING; case 0x43400001: return THERMAL_CONTROLLER_STRING; case 0x44120006: @@ -363,6 +364,8 @@ const char *translateObject(object_id_t object) { return IPC_STORE_STRING; case 0x53500010: return TIME_STAMPER_STRING; + case 0x53500020: + return VERIFICATION_REPORTER_STRING; case 0x53ffffff: return FSFW_OBJECTS_END_STRING; case 0x54000010: diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 5d97554a..32e3e40d 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -87,7 +87,7 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool( localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry()); - poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), false, 30.0, false); + poolManager.subscribeForRegularPeriodicPacket({gpsSet.getSid(), 30.0}); return HasReturnvaluesIF::RETURN_OK; } diff --git a/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h b/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h index d64bb863..180ee907 100644 --- a/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h +++ b/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h @@ -6,7 +6,7 @@ #include "eive/definitions.h" #include "fsfw/globalfunctions/CRC.h" #include "fsfw/serialize/SerializeAdapter.h" -#include "fsfw/tmtcpacket/SpacePacket.h" +#include "mission/devices/devicedefinitions/SpBase.h" namespace mpsoc { @@ -73,6 +73,8 @@ static const char NULL_TERMINATOR = '\0'; static const uint8_t MIN_SPACE_PACKET_LENGTH = 7; static const uint8_t SPACE_PACKET_HEADER_SIZE = 6; +static constexpr size_t CRC_SIZE = 2; + /** * The size of payload data which will be forwarded to the requesting object. e.g. PUS Service * 8. @@ -88,8 +90,14 @@ static const size_t MAX_FILENAME_SIZE = 256; 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 = SpacePacket::PACKET_MAX_SIZE * 3; -static const size_t MAX_COMMAND_SIZE = SpacePacket::PACKET_MAX_SIZE; +/** + * Maximum SP packet size as specified in the TAS Supversior ICD. + * https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_TAS-ILH-IRS/ICD-PLOC/TAS&fileid=942896 + * at sheet README + */ +static constexpr size_t SP_MAX_SIZE = 1024; +static const size_t MAX_REPLY_SIZE = SP_MAX_SIZE * 3; +static const size_t MAX_COMMAND_SIZE = SP_MAX_SIZE; static const size_t MAX_DATA_SIZE = 1016; /** @@ -130,10 +138,12 @@ static const uint16_t RESERVED_4 = 0x5F4; /** * @brief Abstract base class for TC space packet of MPSoC. */ -class TcBase : public SpacePacket, public MPSoCReturnValuesIF { +class TcBase : public ploc::SpTcBase, public MPSoCReturnValuesIF { public: + virtual ~TcBase() = default; + // Initial length field of space packet. Will always be updated when packet is created. - static const uint16_t INIT_LENGTH = 1; + static const uint16_t INIT_LENGTH = 2; /** * @brief Constructor @@ -141,8 +151,12 @@ class TcBase : public SpacePacket, public MPSoCReturnValuesIF { * @param sequenceCount Sequence count of space packet which will be incremented with each * sent and received packets. */ - TcBase(uint16_t apid, uint16_t sequenceCount) - : SpacePacket(INIT_LENGTH, true, apid, sequenceCount) {} + TcBase(ploc::SpTcParams params, uint16_t apid, uint16_t sequenceCount) + : ploc::SpTcBase(params, apid, sequenceCount) { + spParams.setDataFieldLen(INIT_LENGTH); + } + + ReturnValue_t buildPacket() { return buildPacket(nullptr, 0); } /** * @brief Function to initialize the space packet @@ -152,17 +166,22 @@ class TcBase : public SpacePacket, public MPSoCReturnValuesIF { * * @return RETURN_OK if packet creation was successful, otherwise error return value */ - virtual ReturnValue_t createPacket(const uint8_t* commandData, size_t commandDataLen) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - result = initPacket(commandData, commandDataLen); - if (result != HasReturnvaluesIF::RETURN_OK) { - return result; + ReturnValue_t buildPacket(const uint8_t* commandData, size_t commandDataLen) { + payloadStart = spParams.buf + ccsds::HEADER_LEN; + ReturnValue_t res; + if (commandData != nullptr and commandDataLen > 0) { + res = initPacket(commandData, commandDataLen); + if (res != result::OK) { + return res; + } } - result = addCrc(); - if (result != HasReturnvaluesIF::RETURN_OK) { - return result; + + updateSpFields(); + res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; } - return result; + return calcCrc(); } protected: @@ -175,45 +194,6 @@ class TcBase : public SpacePacket, public MPSoCReturnValuesIF { virtual ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) { return HasReturnvaluesIF::RETURN_OK; } - - /** - * @brief Calculates and adds the CRC - */ - ReturnValue_t addCrc() { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - size_t serializedSize = 0; - uint32_t full_size = getFullSize(); - uint16_t crc = CRC::crc16ccitt(getWholeData(), full_size - CRC_SIZE); - result = SerializeAdapter::serialize( - &crc, this->localData.byteStream + full_size - CRC_SIZE, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::debug << "TcBase::addCrc: Failed to serialize crc field" << std::endl; - } - return result; - } -}; - -/** - * @brief Class for handling tm replies of the PLOC MPSoC. - */ -class TmPacket : public SpacePacket, public MPSoCReturnValuesIF { - public: - /** - * @brief Constructor creates idle packet and sets length field to maximum allowed size. - */ - TmPacket() : SpacePacket(PACKET_MAX_SIZE) {} - - ReturnValue_t checkCrc() { - uint8_t* crcPtr = this->getPacketData() + this->getPacketDataLength() - 1; - uint16_t receivedCrc = *(crcPtr) << 8 | *(crcPtr + 1); - uint16_t recalculatedCrc = - CRC::crc16ccitt(this->localData.byteStream, this->getFullSize() - CRC_SIZE); - if (recalculatedCrc != receivedCrc) { - return CRC_FAILURE; - } - return HasReturnvaluesIF::RETURN_OK; - } }; /** @@ -224,22 +204,22 @@ class TcMemRead : public TcBase { /** * @brief Constructor */ - TcMemRead(uint16_t sequenceCount) : TcBase(apid::TC_MEM_READ, sequenceCount) { - this->setPacketDataLength(PACKET_LENGTH); + TcMemRead(ploc::SpTcParams params, uint16_t sequenceCount) + : TcBase(params, apid::TC_MEM_READ, sequenceCount) { + spParams.setPayloadLen(COMMAND_LENGTH); } uint16_t getMemLen() const { return memLen; } protected: - ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) { + ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) override { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; result = lengthCheck(commandDataLen); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - std::memcpy(this->localData.fields.buffer, commandData, MEM_ADDRESS_SIZE); - std::memcpy(this->localData.fields.buffer + MEM_ADDRESS_SIZE, commandData + MEM_ADDRESS_SIZE, - MEM_LEN_SIZE); + std::memcpy(payloadStart, commandData, MEM_ADDRESS_SIZE); + std::memcpy(payloadStart + MEM_ADDRESS_SIZE, commandData + MEM_ADDRESS_SIZE, MEM_LEN_SIZE); size_t size = sizeof(memLen); const uint8_t* memLenPtr = commandData + MEM_ADDRESS_SIZE; result = @@ -259,7 +239,7 @@ class TcMemRead : public TcBase { uint16_t memLen = 0; ReturnValue_t lengthCheck(size_t commandDataLen) { - if (commandDataLen != COMMAND_LENGTH) { + if (commandDataLen != COMMAND_LENGTH or checkPayloadLen() != HasReturnvaluesIF::RETURN_OK) { return INVALID_LENGTH; } return HasReturnvaluesIF::RETURN_OK; @@ -275,31 +255,43 @@ class TcMemWrite : public TcBase { /** * @brief Constructor */ - TcMemWrite(uint16_t sequenceCount) : TcBase(apid::TC_MEM_WRITE, sequenceCount) {} + TcMemWrite(ploc::SpTcParams params, uint16_t sequenceCount) + : TcBase(params, apid::TC_MEM_WRITE, sequenceCount) {} protected: - ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) { + ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) override { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; result = lengthCheck(commandDataLen); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - std::memcpy(this->localData.fields.buffer, commandData, commandDataLen); uint16_t memLen = *(commandData + MEM_ADDRESS_SIZE) << 8 | *(commandData + MEM_ADDRESS_SIZE + 1); - this->setPacketDataLength(memLen * 4 + FIX_LENGTH - 1); + spParams.setPayloadLen(MIN_FIXED_PAYLOAD_LENGTH + memLen * 4); + result = checkPayloadLen(); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + std::memcpy(payloadStart, commandData, commandDataLen); return result; } private: - // Min length consists of 4 byte address, 2 byte mem length field, 4 byte data (1 word) - static const size_t MIN_COMMAND_DATA_LENGTH = 10; + // 4 byte address, 2 byte mem length field static const size_t MEM_ADDRESS_SIZE = 4; - static const size_t FIX_LENGTH = 8; + static const size_t MIN_FIXED_PAYLOAD_LENGTH = MEM_ADDRESS_SIZE + 2; + // Min length consists of 4 byte address, 2 byte mem length field, 4 byte data (1 word) + static const size_t MIN_COMMAND_DATA_LENGTH = MIN_FIXED_PAYLOAD_LENGTH + 4; ReturnValue_t lengthCheck(size_t commandDataLen) { if (commandDataLen < MIN_COMMAND_DATA_LENGTH) { - sif::warning << "TcMemWrite: Command has invalid length " << commandDataLen << std::endl; + sif::warning << "TcMemWrite: Length " << commandDataLen << " smaller than minimum " + << MIN_COMMAND_DATA_LENGTH << std::endl; + return INVALID_LENGTH; + } + if (commandDataLen + CRC_SIZE > spParams.maxSize) { + sif::warning << "TcMemWrite: Length " << commandDataLen << " larger than allowed " + << spParams.maxSize - CRC_SIZE << std::endl; return INVALID_LENGTH; } return HasReturnvaluesIF::RETURN_OK; @@ -309,9 +301,10 @@ class TcMemWrite : public TcBase { /** * @brief Class to help creation of flash fopen command. */ -class FlashFopen : public TcBase { +class FlashFopen : public ploc::SpTcBase { public: - FlashFopen(uint16_t sequenceCount) : TcBase(apid::TC_FLASHFOPEN, sequenceCount) {} + FlashFopen(ploc::SpTcParams params, uint16_t sequenceCount) + : ploc::SpTcBase(params, apid::TC_FLASHFOPEN, sequenceCount) {} static const char APPEND = 'a'; static const char WRITE = 'w'; @@ -319,19 +312,17 @@ class FlashFopen : public TcBase { ReturnValue_t createPacket(std::string filename, char accessMode_) { accessMode = accessMode_; - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; size_t nameSize = filename.size(); - std::memcpy(this->getPacketData(), filename.c_str(), nameSize); - *(this->getPacketData() + nameSize) = NULL_TERMINATOR; - std::memcpy(this->getPacketData() + nameSize + sizeof(NULL_TERMINATOR), &accessMode, - sizeof(accessMode)); - this->setPacketDataLength(nameSize + sizeof(NULL_TERMINATOR) + sizeof(accessMode) + CRC_SIZE - - 1); - result = addCrc(); + spParams.setPayloadLen(nameSize + sizeof(NULL_TERMINATOR) + sizeof(accessMode)); + ReturnValue_t result = checkPayloadLen(); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - return result; + std::memcpy(payloadStart, filename.c_str(), nameSize); + *(spParams.buf + nameSize) = NULL_TERMINATOR; + std::memcpy(payloadStart + nameSize + sizeof(NULL_TERMINATOR), &accessMode, sizeof(accessMode)); + updateSpFields(); + return calcCrc(); } private: @@ -341,52 +332,57 @@ class FlashFopen : public TcBase { /** * @brief Class to help creation of flash fclose command. */ -class FlashFclose : public TcBase { +class FlashFclose : public ploc::SpTcBase { public: - FlashFclose(uint16_t sequenceCount) : TcBase(apid::TC_FLASHFCLOSE, sequenceCount) {} + FlashFclose(ploc::SpTcParams params, uint16_t sequenceCount) + : ploc::SpTcBase(params, apid::TC_FLASHFCLOSE, sequenceCount) {} ReturnValue_t createPacket(std::string filename) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; size_t nameSize = filename.size(); - std::memcpy(this->getPacketData(), filename.c_str(), nameSize); - *(this->getPacketData() + nameSize) = NULL_TERMINATOR; - this->setPacketDataLength(nameSize + sizeof(NULL_TERMINATOR) + CRC_SIZE - 1); - result = addCrc(); + spParams.setPayloadLen(nameSize + sizeof(NULL_TERMINATOR)); + ReturnValue_t result = checkPayloadLen(); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - return result; + std::memcpy(payloadStart, filename.c_str(), nameSize); + *(payloadStart + nameSize) = NULL_TERMINATOR; + return calcCrc(); } }; /** * @brief Class to build flash write space packet. */ -class TcFlashWrite : public TcBase { +class TcFlashWrite : public ploc::SpTcBase { public: - TcFlashWrite(uint16_t sequenceCount) : TcBase(apid::TC_FLASHWRITE, sequenceCount) {} + TcFlashWrite(ploc::SpTcParams params, uint16_t sequenceCount) + : ploc::SpTcBase(params, apid::TC_FLASHWRITE, sequenceCount) {} - ReturnValue_t createPacket(const uint8_t* writeData, uint32_t writeLen_) { + ReturnValue_t buildPacket(const uint8_t* writeData, uint32_t writeLen_) { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; writeLen = writeLen_; if (writeLen > MAX_DATA_SIZE) { sif::debug << "FlashWrite::createPacket: Command data too big" << std::endl; return HasReturnvaluesIF::RETURN_FAILED; } - size_t serializedSize = 0; - result = - SerializeAdapter::serialize(&writeLen, this->getPacketData(), &serializedSize, - sizeof(writeLen), SerializeIF::Endianness::BIG); + spParams.setPayloadLen(static_cast(writeLen) + 4); + result = checkPayloadLen(); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - std::memcpy(this->getPacketData() + sizeof(writeLen), writeData, writeLen); - this->setPacketDataLength(static_cast(writeLen + CRC_SIZE - 1)); - result = addCrc(); + size_t serializedSize = ccsds::HEADER_LEN; + result = SerializeAdapter::serialize(&writeLen, payloadStart, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - return HasReturnvaluesIF::RETURN_OK; + std::memcpy(payloadStart + sizeof(writeLen), writeData, writeLen); + updateSpFields(); + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + return calcCrc(); } private: @@ -396,21 +392,27 @@ class TcFlashWrite : public TcBase { /** * @brief Class to help creation of flash delete command. */ -class TcFlashDelete : public TcBase { +class TcFlashDelete : public ploc::SpTcBase { public: - TcFlashDelete(uint16_t sequenceCount) : TcBase(apid::TC_FLASHDELETE, sequenceCount) {} + TcFlashDelete(ploc::SpTcParams params, uint16_t sequenceCount) + : ploc::SpTcBase(params, apid::TC_FLASHDELETE, sequenceCount) {} - ReturnValue_t createPacket(std::string filename) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + ReturnValue_t buildPacket(std::string filename) { size_t nameSize = filename.size(); - std::memcpy(this->getPacketData(), filename.c_str(), nameSize); - *(this->getPacketData() + nameSize) = NULL_TERMINATOR; - this->setPacketDataLength(nameSize + sizeof(NULL_TERMINATOR) + CRC_SIZE - 1); - result = addCrc(); - if (result != HasReturnvaluesIF::RETURN_OK) { - return result; + spParams.setPayloadLen(nameSize + sizeof(NULL_TERMINATOR)); + auto res = checkPayloadLen(); + if (res != HasReturnvaluesIF::RETURN_OK) { + return res; } - return result; + std::memcpy(payloadStart, filename.c_str(), nameSize); + *(payloadStart + nameSize) = NULL_TERMINATOR; + + updateSpFields(); + res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + return calcCrc(); } }; @@ -419,17 +421,8 @@ class TcFlashDelete : public TcBase { */ class TcReplayStop : public TcBase { public: - TcReplayStop(uint16_t sequenceCount) : TcBase(apid::TC_REPLAY_STOP, sequenceCount) {} - - ReturnValue_t createPacket() { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - result = addCrc(); - if (result != HasReturnvaluesIF::RETURN_OK) { - return result; - } - this->setPacketDataLength(static_cast(CRC_SIZE - 1)); - return HasReturnvaluesIF::RETURN_OK; - } + TcReplayStop(ploc::SpTcParams params, uint16_t sequenceCount) + : TcBase(params, apid::TC_REPLAY_STOP, sequenceCount) {} }; /** @@ -440,11 +433,13 @@ class TcReplayStart : public TcBase { /** * @brief Constructor */ - TcReplayStart(uint16_t sequenceCount) : TcBase(apid::TC_REPLAY_START, sequenceCount) {} + TcReplayStart(ploc::SpTcParams params, uint16_t sequenceCount) + : TcBase(params, apid::TC_REPLAY_START, sequenceCount) {} protected: - ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) { + ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) override { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + spParams.setPayloadLen(commandDataLen); result = lengthCheck(commandDataLen); if (result != HasReturnvaluesIF::RETURN_OK) { return result; @@ -453,8 +448,7 @@ class TcReplayStart : public TcBase { if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - std::memcpy(this->localData.fields.buffer, commandData, commandDataLen); - this->setPacketDataLength(commandDataLen + CRC_SIZE - 1); + std::memcpy(payloadStart, commandData, commandDataLen); return result; } @@ -464,7 +458,8 @@ class TcReplayStart : public TcBase { static const uint8_t ONCE = 1; ReturnValue_t lengthCheck(size_t commandDataLen) { - if (commandDataLen != COMMAND_DATA_LENGTH) { + if (commandDataLen != COMMAND_DATA_LENGTH or + checkPayloadLen() != HasReturnvaluesIF::RETURN_OK) { sif::warning << "TcReplayStart: Command has invalid length " << commandDataLen << std::endl; return INVALID_LENGTH; } @@ -488,10 +483,11 @@ class TcDownlinkPwrOn : public TcBase { /** * @brief Constructor */ - TcDownlinkPwrOn(uint16_t sequenceCount) : TcBase(apid::TC_DOWNLINK_PWR_ON, sequenceCount) {} + TcDownlinkPwrOn(ploc::SpTcParams params, uint16_t sequenceCount) + : TcBase(params, apid::TC_DOWNLINK_PWR_ON, sequenceCount) {} protected: - ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) { + ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) override { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; result = lengthCheck(commandDataLen); if (result != HasReturnvaluesIF::RETURN_OK) { @@ -505,10 +501,13 @@ class TcDownlinkPwrOn : public TcBase { if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - std::memcpy(this->localData.fields.buffer, commandData, commandDataLen); - std::memcpy(this->localData.fields.buffer + commandDataLen, &MAX_AMPLITUDE, - sizeof(MAX_AMPLITUDE)); - this->setPacketDataLength(commandDataLen + sizeof(MAX_AMPLITUDE) + CRC_SIZE - 1); + spParams.setPayloadLen(commandDataLen + sizeof(MAX_AMPLITUDE)); + result = checkPayloadLen(); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + std::memcpy(payloadStart, commandData, commandDataLen); + std::memcpy(payloadStart + commandDataLen, &MAX_AMPLITUDE, sizeof(MAX_AMPLITUDE)); return result; } @@ -555,17 +554,8 @@ class TcDownlinkPwrOn : public TcBase { */ class TcDownlinkPwrOff : public TcBase { public: - TcDownlinkPwrOff(uint16_t sequenceCount) : TcBase(apid::TC_DOWNLINK_PWR_OFF, sequenceCount) {} - - ReturnValue_t createPacket() { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - result = addCrc(); - if (result != HasReturnvaluesIF::RETURN_OK) { - return result; - } - this->setPacketDataLength(static_cast(CRC_SIZE - 1)); - return HasReturnvaluesIF::RETURN_OK; - } + TcDownlinkPwrOff(ploc::SpTcParams params, uint16_t sequenceCount) + : TcBase(params, apid::TC_DOWNLINK_PWR_OFF, sequenceCount) {} }; /** @@ -576,19 +566,19 @@ class TcReplayWriteSeq : public TcBase { /** * @brief Constructor */ - TcReplayWriteSeq(uint16_t sequenceCount) - : TcBase(apid::TC_REPLAY_WRITE_SEQUENCE, sequenceCount) {} + TcReplayWriteSeq(ploc::SpTcParams params, uint16_t sequenceCount) + : TcBase(params, apid::TC_REPLAY_WRITE_SEQUENCE, sequenceCount) {} protected: - ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) { + ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) override { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + spParams.setPayloadLen(commandDataLen + sizeof(NULL_TERMINATOR)); result = lengthCheck(commandDataLen); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - std::memcpy(this->localData.fields.buffer, commandData, commandDataLen); - *(this->localData.fields.buffer + commandDataLen) = NULL_TERMINATOR; - this->setPacketDataLength(commandDataLen + sizeof(NULL_TERMINATOR) + CRC_SIZE - 1); + std::memcpy(payloadStart, commandData, commandDataLen); + *(payloadStart + commandDataLen) = NULL_TERMINATOR; return result; } @@ -596,7 +586,8 @@ class TcReplayWriteSeq : public TcBase { static const size_t USE_DECODING_LENGTH = 1; ReturnValue_t lengthCheck(size_t commandDataLen) { - if (commandDataLen > USE_DECODING_LENGTH + MAX_FILENAME_SIZE) { + if (commandDataLen > USE_DECODING_LENGTH + MAX_FILENAME_SIZE or + checkPayloadLen() != HasReturnvaluesIF::RETURN_OK) { sif::warning << "TcReplayWriteSeq: Command has invalid length " << commandDataLen << std::endl; return INVALID_LENGTH; @@ -643,17 +634,8 @@ class FlashWritePusCmd : public MPSoCReturnValuesIF { */ class TcModeReplay : public TcBase { public: - TcModeReplay(uint16_t sequenceCount) : TcBase(apid::TC_MODE_REPLAY, sequenceCount) {} - - ReturnValue_t createPacket() { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - result = addCrc(); - if (result != HasReturnvaluesIF::RETURN_OK) { - return result; - } - this->setPacketDataLength(static_cast(CRC_SIZE - 1)); - return HasReturnvaluesIF::RETURN_OK; - } + TcModeReplay(ploc::SpTcParams params, uint16_t sequenceCount) + : TcBase(params, apid::TC_MODE_REPLAY, sequenceCount) {} }; /** @@ -661,36 +643,32 @@ class TcModeReplay : public TcBase { */ class TcModeIdle : public TcBase { public: - TcModeIdle(uint16_t sequenceCount) : TcBase(apid::TC_MODE_IDLE, sequenceCount) {} - - ReturnValue_t createPacket() { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - result = addCrc(); - if (result != HasReturnvaluesIF::RETURN_OK) { - return result; - } - this->setPacketDataLength(static_cast(CRC_SIZE - 1)); - return HasReturnvaluesIF::RETURN_OK; - } + TcModeIdle(ploc::SpTcParams params, uint16_t sequenceCount) + : TcBase(params, apid::TC_MODE_IDLE, sequenceCount) {} }; class TcCamcmdSend : public TcBase { public: - TcCamcmdSend(uint16_t sequenceCount) : TcBase(apid::TC_CAM_CMD_SEND, sequenceCount) {} + TcCamcmdSend(ploc::SpTcParams params, uint16_t sequenceCount) + : TcBase(params, apid::TC_CAM_CMD_SEND, sequenceCount) {} protected: - ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) { + ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) override { if (commandDataLen > MAX_DATA_LENGTH) { return INVALID_LENGTH; } uint16_t dataLen = static_cast(commandDataLen + sizeof(CARRIAGE_RETURN)); - size_t size = sizeof(dataLen); - SerializeAdapter::serialize(&dataLen, this->getPacketData(), &size, sizeof(dataLen), + spParams.setPayloadLen(sizeof(dataLen) + commandDataLen + sizeof(CARRIAGE_RETURN)); + auto res = checkPayloadLen(); + if (res != HasReturnvaluesIF::RETURN_OK) { + return res; + } + size_t size = ccsds::HEADER_LEN; + SerializeAdapter::serialize(&dataLen, payloadStart, &size, spParams.maxSize, SerializeIF::Endianness::BIG); - std::memcpy(this->getPacketData() + sizeof(dataLen), commandData, commandDataLen); - *(this->getPacketData() + sizeof(dataLen) + commandDataLen) = CARRIAGE_RETURN; - uint16_t trueLength = sizeof(dataLen) + commandDataLen + sizeof(CARRIAGE_RETURN) + CRC_SIZE; - this->setPacketDataLength(trueLength - 1); + std::memcpy(payloadStart + sizeof(dataLen), commandData, commandDataLen); + *(payloadStart + sizeof(dataLen) + commandDataLen) = CARRIAGE_RETURN; + return HasReturnvaluesIF::RETURN_OK; } diff --git a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h index 462ee632..bfe23488 100644 --- a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -6,9 +6,12 @@ #include #include #include -#include +#include +#include +#include #include "linux/devices/devicedefinitions/SupvReturnValuesIF.h" +#include "mission/devices/devicedefinitions/SpBase.h" namespace supv { @@ -57,6 +60,7 @@ static const DeviceCommandId_t REQUEST_ADC_REPORT = 57; static const DeviceCommandId_t RESET_PL = 58; static const DeviceCommandId_t ENABLE_NVMS = 59; static const DeviceCommandId_t CONTINUE_UPDATE = 60; +static const DeviceCommandId_t MEMORY_CHECK_WITH_FILE = 61; /** Reply IDs */ static const DeviceCommandId_t ACK_REPORT = 100; @@ -156,11 +160,13 @@ static const size_t MAX_PACKET_SIZE = 1024; static const uint8_t SPACE_PACKET_HEADER_LENGTH = 6; -enum class SequenceFlags : uint8_t { - CONTINUED_PKT = 0b00, - FIRST_PKT = 0b01, - LAST_PKT = 0b10, - STANDALONE_PKT = 0b11 +struct UpdateParams { + std::string file; + uint8_t memId; + uint32_t startAddr; + uint32_t bytesWritten; + uint16_t seqCount; + bool deleteMemory; }; enum PoolIds : lp_id_t { @@ -256,6 +262,7 @@ enum PoolIds : lp_id_t { ADC_ENG_15 }; +static constexpr uint16_t DEFAULT_SEQUENCE_COUNT = 1; static const uint8_t HK_SET_ENTRIES = 13; static const uint8_t BOOT_REPORT_SET_ENTRIES = 10; static const uint8_t LATCHUP_RPT_SET_ENTRIES = 16; @@ -277,7 +284,7 @@ static const uint32_t UPDATE_STATUS_REPORT = 70000; /** * @brief This class creates a space packet containing only the header data and the CRC. */ -class ApidOnlyPacket : public SpacePacket { +class ApidOnlyPacket : public ploc::SpTcBase { public: /** * @brief Constructor @@ -286,29 +293,27 @@ class ApidOnlyPacket : public SpacePacket { * * @note Sequence count of empty packet is always 1. */ - ApidOnlyPacket(uint16_t apid) : SpacePacket(LENGTH_EMPTY_TC - 1, true, apid, 1) { calcCrc(); } + ApidOnlyPacket(ploc::SpTcParams params, uint16_t apid) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(LENGTH_EMPTY_TC); + spParams.creator.setApid(apid); + } + + ReturnValue_t buildPacket() { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + return calcCrc(); + } private: - /** - * @brief CRC calculation which involves only the header in an empty packet - */ - void calcCrc() { - /* Calculate crc */ - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, sizeof(CCSDSPrimaryHeader)); - - /* Add crc to packet data field of space packet */ - size_t serializedSize = 0; - uint8_t* crcPos = this->localData.fields.buffer; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); - } }; /** * @brief This class can be used to generate the space packet selecting the boot image of * of the MPSoC. */ -class MPSoCBootSelect : public SpacePacket { +class MPSoCBootSelect : public ploc::SpTcBase { public: static const uint8_t NVM0 = 0; static const uint8_t NVM1 = 1; @@ -323,18 +328,23 @@ class MPSoCBootSelect : public SpacePacket { * * @note Selection of partitions is currently not supported. */ - MPSoCBootSelect(uint8_t mem = 0, uint8_t bp0 = 0, uint8_t bp1 = 0, uint8_t bp2 = 0) - : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_SEL_MPSOC_BOOT_IMAGE, DEFAULT_SEQUENCE_COUNT), - mem(mem), - bp0(bp0), - bp1(bp1), - bp2(bp2) { - initPacket(); + MPSoCBootSelect(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setApid(APID_SEL_MPSOC_BOOT_IMAGE); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint8_t mem = 0, uint8_t bp0 = 0, uint8_t bp1 = 0, uint8_t bp2 = 0) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(mem, bp0, bp1, bp2); + return calcCrc(); } private: static const uint16_t DATA_FIELD_LENGTH = 6; - static const uint16_t DEFAULT_SEQUENCE_COUNT = 1; static const uint8_t MEM_OFFSET = 0; static const uint8_t BP0_OFFSET = 1; @@ -342,26 +352,11 @@ class MPSoCBootSelect : public SpacePacket { static const uint8_t BP2_OFFSET = 3; static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2; - uint8_t mem = 0; - uint8_t bp0 = 0; - uint8_t bp1 = 0; - uint8_t bp2 = 0; - - void initPacket() { - uint8_t* data_field_start = this->localData.fields.buffer; - std::memcpy(data_field_start + MEM_OFFSET, &mem, sizeof(mem)); - std::memcpy(data_field_start + BP0_OFFSET, &bp0, sizeof(bp0)); - std::memcpy(data_field_start + BP1_OFFSET, &bp1, sizeof(bp1)); - std::memcpy(data_field_start + BP2_OFFSET, &bp2, sizeof(bp2)); - /* Calculate crc */ - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - - /* Add crc to packet data field of space packet */ - size_t serializedSize = 0; - uint8_t* crcPos = this->localData.fields.buffer + CRC_OFFSET; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); + void initPacket(uint8_t mem = 0, uint8_t bp0 = 0, uint8_t bp1 = 0, uint8_t bp2 = 0) { + std::memcpy(payloadStart + MEM_OFFSET, &mem, sizeof(mem)); + std::memcpy(payloadStart + BP0_OFFSET, &bp0, sizeof(bp0)); + std::memcpy(payloadStart + BP1_OFFSET, &bp1, sizeof(bp1)); + std::memcpy(payloadStart + BP2_OFFSET, &bp2, sizeof(bp2)); } }; @@ -369,7 +364,7 @@ class MPSoCBootSelect : public SpacePacket { * @brief This class creates the command to enable or disable the NVMs connected to the * supervisor. */ -class EnableNvms : public SpacePacket { +class EnableNvms : public ploc::SpTcBase { public: /** * @brief Constructor @@ -379,141 +374,165 @@ class EnableNvms : public SpacePacket { * @param bp1 Partition pin 1 * @param bp2 Partition pin 2 */ - EnableNvms(uint8_t nvm01, uint8_t nvm3) - : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_ENABLE_NVMS, DEFAULT_SEQUENCE_COUNT), - nvm01(nvm01), - nvm3(nvm3) { - initPacket(); + EnableNvms(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setApid(APID_ENABLE_NVMS); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint8_t nvm01, uint8_t nvm3) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(nvm01, nvm3); + return calcCrc(); } private: - static const uint16_t DEFAULT_SEQUENCE_COUNT = 1; static const uint8_t DATA_FIELD_LENGTH = 4; static const uint8_t CRC_OFFSET = 2; - uint8_t nvm01 = 0; - uint8_t nvm3 = 0; - void initPacket() { - *(this->localData.fields.buffer) = nvm01; - *(this->localData.fields.buffer + 1) = nvm3; - - /* Calculate crc */ - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - - /* Add crc to packet data field of space packet */ - size_t serializedSize = 0; - uint8_t* crcPos = this->localData.fields.buffer + CRC_OFFSET; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); + void initPacket(uint8_t nvm01, uint8_t nvm3) { + payloadStart[0] = nvm01; + payloadStart[1] = nvm3; } }; /** * @brief This class generates the space packet to update the time of the PLOC supervisor. */ -class SetTimeRef : public SpacePacket { +class SetTimeRef : public ploc::SpTcBase { public: - SetTimeRef(Clock::TimeOfDay_t* time) - : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_SET_TIME_REF, DEFAULT_SEQUENCE_COUNT) { - initPacket(time); + SetTimeRef(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setApid(APID_SET_TIME_REF); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(Clock::TimeOfDay_t* time) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + res = initPacket(time); + if (res != result::OK) { + return res; + } + return calcCrc(); } private: static const uint16_t DATA_FIELD_LENGTH = 10; - static const uint16_t DEFAULT_SEQUENCE_COUNT = 1; static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2; static const uint16_t SYNC = 0x8000; - void initPacket(Clock::TimeOfDay_t* time) { - size_t serializedSize = 0; - uint8_t* dataFieldPtr = this->localData.fields.buffer; + ReturnValue_t initPacket(Clock::TimeOfDay_t* time) { + size_t serializedSize = 6; + uint8_t* dataFieldPtr = payloadStart; uint16_t milliseconds = static_cast(time->usecond / 1000) | SYNC; - SerializeAdapter::serialize(&milliseconds, &dataFieldPtr, &serializedSize, - sizeof(milliseconds), SerializeIF::Endianness::BIG); + ReturnValue_t result = + SerializeAdapter::serialize(&milliseconds, &dataFieldPtr, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } uint8_t second = static_cast(time->second); - serializedSize = 0; - SerializeAdapter::serialize(&second, &dataFieldPtr, &serializedSize, - sizeof(time->second), SerializeIF::Endianness::BIG); + result = SerializeAdapter::serialize(&second, &dataFieldPtr, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } uint8_t minute = static_cast(time->minute); - serializedSize = 0; - SerializeAdapter::serialize(&minute, &dataFieldPtr, &serializedSize, - sizeof(time->minute), SerializeIF::Endianness::BIG); + result = SerializeAdapter::serialize(&minute, &dataFieldPtr, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } uint8_t hour = static_cast(time->hour); - serializedSize = 0; - SerializeAdapter::serialize(&hour, &dataFieldPtr, &serializedSize, sizeof(time->hour), + result = SerializeAdapter::serialize(&hour, &dataFieldPtr, &serializedSize, spParams.maxSize, SerializeIF::Endianness::BIG); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } uint8_t day = static_cast(time->day); - serializedSize = 0; - SerializeAdapter::serialize(&day, &dataFieldPtr, &serializedSize, sizeof(time->day), + result = SerializeAdapter::serialize(&day, &dataFieldPtr, &serializedSize, spParams.maxSize, SerializeIF::Endianness::BIG); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } uint8_t month = static_cast(time->month); - serializedSize = 0; - SerializeAdapter::serialize(&month, &dataFieldPtr, &serializedSize, - sizeof(time->month), SerializeIF::Endianness::BIG); - uint8_t year = static_cast(time->year - 1900); - serializedSize = 0; - SerializeAdapter::serialize(&year, &dataFieldPtr, &serializedSize, sizeof(time->year), + result = SerializeAdapter::serialize(&month, &dataFieldPtr, &serializedSize, spParams.maxSize, SerializeIF::Endianness::BIG); - serializedSize = 0; - /* Calculate crc */ - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - SerializeAdapter::serialize(&crc, &dataFieldPtr, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + uint8_t year = static_cast(time->year - 1900); + return SerializeAdapter::serialize(&year, &dataFieldPtr, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); } }; /** * @brief This class can be used to generate the set boot timout command. */ -class SetBootTimeout : public SpacePacket { +class SetBootTimeout : public ploc::SpTcBase { public: /** * @brief Constructor * * @param timeout The boot timeout in milliseconds. */ - SetBootTimeout(uint32_t timeout) - : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_SET_BOOT_TIMEOUT, 1), timeout(timeout) { - initPacket(); + SetBootTimeout(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setApid(APID_SET_BOOT_TIMEOUT); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint32_t timeout) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(timeout); + return calcCrc(); } private: - uint32_t timeout = 0; - /** boot timeout value (uint32_t) and crc (uint16_t) */ static const uint16_t DATA_FIELD_LENGTH = 6; - void initPacket() { + void initPacket(uint32_t timeout) { size_t serializedSize = 0; - uint8_t* dataFieldPtr = this->localData.fields.buffer; + uint8_t* dataFieldPtr = payloadStart; SerializeAdapter::serialize(&timeout, &dataFieldPtr, &serializedSize, sizeof(timeout), SerializeIF::Endianness::BIG); - /* Calculate crc */ - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - /* Add crc to packet data field of space packet */ - serializedSize = 0; - SerializeAdapter::serialize(&crc, &dataFieldPtr, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); } }; /** * @brief This class can be used to generate the space packet to set the maximum boot tries. */ -class SetRestartTries : public SpacePacket { +class SetRestartTries : public ploc::SpTcBase { public: /** * @brief Constructor * * @param restartTries Maximum restart tries to set. */ - SetRestartTries(uint8_t restartTries) - : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_SET_MAX_RESTART_TRIES, 1), - restartTries(restartTries) { - initPacket(); + SetRestartTries(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setApid(APID_SET_MAX_RESTART_TRIES); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint8_t restartTries) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(restartTries); + return calcCrc(); } private: @@ -522,16 +541,7 @@ class SetRestartTries : public SpacePacket { /** Restart tries value (uint8_t) and crc (uint16_t) */ static const uint16_t DATA_FIELD_LENGTH = 3; - void initPacket() { - uint8_t* dataFieldPtr = this->localData.fields.buffer; - *dataFieldPtr = restartTries; - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - size_t serializedSize = 0; - uint8_t* crcPtr = dataFieldPtr + 1; - SerializeAdapter::serialize(&crc, &crcPtr, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); - } + void initPacket(uint8_t restartTries) { payloadStart[0] = restartTries; } }; /** @@ -539,31 +549,31 @@ class SetRestartTries : public SpacePacket { * of housekeeping data. Normally, this will be disabled by default. However, adding this * command can be useful for debugging. */ -class DisablePeriodicHkTransmission : public SpacePacket { +class DisablePeriodicHkTransmission : public ploc::SpTcBase { public: /** * @brief Constructor */ - DisablePeriodicHkTransmission() : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_DISABLE_HK, 1) { + DisablePeriodicHkTransmission(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setApid(APID_DISABLE_HK); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket() { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } initPacket(); + return calcCrc(); } private: - uint8_t disableHk = 0; - /** Restart tries value (uint8_t) and crc (uint16_t) */ static const uint16_t DATA_FIELD_LENGTH = 3; - void initPacket() { - uint8_t* dataFieldPtr = this->localData.fields.buffer; - *dataFieldPtr = disableHk; - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - size_t serializedSize = 0; - uint8_t* crcPtr = dataFieldPtr + 1; - SerializeAdapter::serialize(&crc, &crcPtr, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); - } + void initPacket() { payloadStart[0] = false; } }; /** @@ -571,7 +581,7 @@ class DisablePeriodicHkTransmission : public SpacePacket { * * @details There are 7 different latchup alerts. */ -class LatchupAlert : public SpacePacket { +class LatchupAlert : public ploc::SpTcBase { public: /** * @brief Constructor @@ -580,40 +590,36 @@ class LatchupAlert : public SpacePacket { * @param latchupId Identifies the latchup to enable/disable (0 - 0.85V, 1 - 1.8V, 2 - MISC, * 3 - 3.3V, 4 - NVM_4XO, 5 - MISSION, 6 - SAFECOTS) */ - LatchupAlert(bool state, uint8_t latchupId) - : SpacePacket(DATA_FIELD_LENGTH - 1, true), latchupId(latchupId) { + LatchupAlert(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(bool state, uint8_t latchupId) { if (state) { - this->setAPID(APID_ENABLE_LATCHUP_ALERT); + spParams.creator.setApid(APID_ENABLE_LATCHUP_ALERT); } else { - this->setAPID(APID_DISABLE_LATCHUP_ALERT); + spParams.creator.setApid(APID_DISABLE_LATCHUP_ALERT); } - this->setPacketSequenceCount(DEFAULT_SEQUENCE_COUNT); - initPacket(); + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(latchupId); + return calcCrc(); } private: static const uint16_t DATA_FIELD_LENGTH = 3; - static const uint16_t DEFAULT_SEQUENCE_COUNT = 1; static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2; uint8_t latchupId = 0; - void initPacket() { - size_t serializedSize = 0; - uint8_t* data_field_ptr = this->localData.fields.buffer; - SerializeAdapter::serialize(&latchupId, &data_field_ptr, &serializedSize, - sizeof(latchupId), SerializeIF::Endianness::BIG); - serializedSize = 0; - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - uint8_t* crcPos = this->localData.fields.buffer + CRC_OFFSET; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); - } + void initPacket(uint8_t latchupId) { payloadStart[0] = latchupId; } }; -class SetAlertlimit : public SpacePacket { +class SetAlertlimit : public ploc::SpTcBase { public: /** * @brief Constructor @@ -622,75 +628,73 @@ class SetAlertlimit : public SpacePacket { * 3 - 3.3V, 4 - NVM_4XO, 5 - MISSION, 6 - SAFECOTS) * @param dutycycle */ - SetAlertlimit(uint8_t latchupId, uint32_t dutycycle) - : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_SET_ALERT_LIMIT, DEFAULT_SEQUENCE_COUNT), - latchupId(latchupId), - dutycycle(dutycycle) { - initPacket(); + SetAlertlimit(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setApid(APID_SET_ALERT_LIMIT); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint8_t latchupId, uint32_t dutycycle) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + res = initPacket(latchupId, dutycycle); + if (res != result::OK) { + return res; + } + return calcCrc(); } private: static const uint16_t DATA_FIELD_LENGTH = 7; - static const uint16_t DEFAULT_SEQUENCE_COUNT = 1; - static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2; uint8_t latchupId = 0; uint32_t dutycycle = 0; - void initPacket() { - size_t serializedSize = 0; - uint8_t* dataFieldPtr = this->localData.fields.buffer; - SerializeAdapter::serialize(&latchupId, &dataFieldPtr, &serializedSize, - sizeof(latchupId), SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&dutycycle, &dataFieldPtr, &serializedSize, - sizeof(dutycycle), SerializeIF::Endianness::BIG); - serializedSize = 0; - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - uint8_t* crcPos = this->localData.fields.buffer + CRC_OFFSET; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); + ReturnValue_t initPacket(uint8_t latchupId, uint32_t dutycycle) { + payloadStart[0] = latchupId; + size_t serLen = 0; + return SerializeAdapter::serialize(&dutycycle, payloadStart + 1, &serLen, + sizeof(dutycycle), SerializeIF::Endianness::BIG); } }; /** * @brief This class packages the space packet to enable or disable ADC channels. */ -class SetAdcEnabledChannels : public SpacePacket { +class SetAdcEnabledChannels : public ploc::SpTcBase { public: /** * @brief Constructor * * @param ch Defines channels to be enabled or disabled. */ - SetAdcEnabledChannels(uint16_t ch) - : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_SET_ADC_ENABLED_CHANNELS, - DEFAULT_SEQUENCE_COUNT), - ch(ch) { - initPacket(); + SetAdcEnabledChannels(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setApid(APID_SET_ADC_ENABLED_CHANNELS); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint16_t ch) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(ch); + return calcCrc(); } private: static const uint16_t DATA_FIELD_LENGTH = 4; - static const uint16_t DEFAULT_SEQUENCE_COUNT = 1; static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2; - uint16_t ch = 0; - - void initPacket() { + void initPacket(uint16_t ch) { size_t serializedSize = 0; - uint8_t* dataFieldPtr = this->localData.fields.buffer; - SerializeAdapter::serialize(&ch, &dataFieldPtr, &serializedSize, sizeof(ch), - SerializeIF::Endianness::BIG); - serializedSize = 0; - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - uint8_t* crcPos = this->localData.fields.buffer + CRC_OFFSET; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); + SerializeAdapter::serialize(&ch, &payloadStart, &serializedSize, sizeof(ch), + SerializeIF::Endianness::BIG); } }; @@ -698,7 +702,7 @@ class SetAdcEnabledChannels : public SpacePacket { * @brief This class packages the space packet to configures the window size and striding step of * the moving average filter applied to the ADC readings. */ -class SetAdcWindowAndStride : public SpacePacket { +class SetAdcWindowAndStride : public ploc::SpTcBase { public: /** * @brief Constructor @@ -706,54 +710,59 @@ class SetAdcWindowAndStride : public SpacePacket { * @param windowSize * @param stridingStepSize */ - SetAdcWindowAndStride(uint16_t windowSize, uint16_t stridingStepSize) - : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_SET_ADC_WINDOW_AND_STRIDE, - DEFAULT_SEQUENCE_COUNT), - windowSize(windowSize), - stridingStepSize(stridingStepSize) { - initPacket(); + SetAdcWindowAndStride(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setApid(APID_SET_ADC_WINDOW_AND_STRIDE); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint16_t windowSize, uint16_t stridingStepSize) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(windowSize, stridingStepSize); + return calcCrc(); } private: static const uint16_t DATA_FIELD_LENGTH = 6; - static const uint16_t DEFAULT_SEQUENCE_COUNT = 1; static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2; - uint16_t windowSize = 0; - uint16_t stridingStepSize = 0; - - void initPacket() { - size_t serializedSize = 0; - uint8_t* dataFieldPtr = this->localData.fields.buffer; - SerializeAdapter::serialize(&windowSize, &dataFieldPtr, &serializedSize, - sizeof(windowSize), SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&stridingStepSize, &dataFieldPtr, &serializedSize, - sizeof(stridingStepSize), SerializeIF::Endianness::BIG); - serializedSize = 0; - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - uint8_t* crcPos = this->localData.fields.buffer + CRC_OFFSET; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); + void initPacket(uint16_t windowSize, uint16_t stridingStepSize) { + size_t serializedSize = 6; + uint8_t* data = payloadStart; + SerializeAdapter::serialize(&windowSize, &data, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); + SerializeAdapter::serialize(&stridingStepSize, &data, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); } }; /** * @brief This class packages the space packet to set the ADC trigger threshold. */ -class SetAdcThreshold : public SpacePacket { +class SetAdcThreshold : public ploc::SpTcBase { public: /** * @brief Constructor * * @param threshold */ - SetAdcThreshold(uint32_t threshold) - : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_SET_ADC_THRESHOLD, DEFAULT_SEQUENCE_COUNT), - threshold(threshold) { - initPacket(); + SetAdcThreshold(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setApid(APID_SET_ADC_THRESHOLD); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint32_t threshold) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(threshold); + return calcCrc(); } private: @@ -762,36 +771,36 @@ class SetAdcThreshold : public SpacePacket { static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2; - uint32_t threshold = 0; - - void initPacket() { + void initPacket(uint32_t threshold) { size_t serializedSize = 0; - uint8_t* dataFieldPtr = this->localData.fields.buffer; - SerializeAdapter::serialize(&threshold, &dataFieldPtr, &serializedSize, - sizeof(threshold), SerializeIF::Endianness::BIG); - serializedSize = 0; - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - uint8_t* crcPos = this->localData.fields.buffer + CRC_OFFSET; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); + SerializeAdapter::serialize(&threshold, payloadStart, &serializedSize, sizeof(threshold), + SerializeIF::Endianness::BIG); } }; /** * @brief This class packages the space packet to run auto EM tests. */ -class RunAutoEmTests : public SpacePacket { +class RunAutoEmTests : public ploc::SpTcBase { public: /** * @brief Constructor * * @param test 1 - complete EM test, 2 - Short test (only memory readback NVM0,1,3) */ - RunAutoEmTests(uint8_t test) - : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_RUN_AUTO_EM_TESTS, DEFAULT_SEQUENCE_COUNT), - test(test) { - initPacket(); + RunAutoEmTests(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setApid(APID_RUN_AUTO_EM_TESTS); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint8_t test) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(test); + return calcCrc(); } private: @@ -802,24 +811,13 @@ class RunAutoEmTests : public SpacePacket { uint8_t test = 0; - void initPacket() { - size_t serializedSize = 0; - uint8_t* dataFieldPtr = this->localData.fields.buffer; - SerializeAdapter::serialize(&test, &dataFieldPtr, &serializedSize, sizeof(test), - SerializeIF::Endianness::BIG); - serializedSize = 0; - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - uint8_t* crcPos = this->localData.fields.buffer + CRC_OFFSET; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); - } + void initPacket(uint8_t test) { payloadStart[0] = test; } }; /** * @brief This class packages the space packet to wipe or dump parts of the MRAM. */ -class MramCmd : public SpacePacket { +class MramCmd : public ploc::SpTcBase { public: enum class MramAction { WIPE, DUMP }; @@ -832,30 +830,36 @@ class MramCmd : public SpacePacket { * * @note The content at the stop address is excluded from the dump or wipe operation. */ - MramCmd(uint32_t start, uint32_t stop, MramAction action) - : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_IDLE_PACKET, DEFAULT_SEQUENCE_COUNT), - start(start), - stop(stop) { + MramCmd(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint32_t start, uint32_t stop, MramAction action) { if (action == MramAction::WIPE) { - this->setAPID(APID_WIPE_MRAM); + spParams.creator.setApid(APID_WIPE_MRAM); } else if (action == MramAction::DUMP) { - this->setAPID(APID_DUMP_MRAM); + spParams.creator.setApid(APID_DUMP_MRAM); } else { sif::debug << "WipeMram: Invalid action specified"; } - initPacket(); + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(start, stop); + return calcCrc(); } private: static const uint16_t DATA_FIELD_LENGTH = 8; - static const uint16_t DEFAULT_SEQUENCE_COUNT = 1; static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2; uint32_t start = 0; uint32_t stop = 0; - void initPacket() { + void initPacket(uint32_t start, uint32_t stop) { uint8_t concatBuffer[6]; concatBuffer[0] = static_cast(start >> 16); concatBuffer[1] = static_cast(start >> 8); @@ -863,14 +867,7 @@ class MramCmd : public SpacePacket { concatBuffer[3] = static_cast(stop >> 16); concatBuffer[4] = static_cast(stop >> 8); concatBuffer[5] = static_cast(stop); - uint8_t* dataFieldPtr = this->localData.fields.buffer; - std::memcpy(dataFieldPtr, concatBuffer, sizeof(concatBuffer)); - size_t serializedSize = 0; - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - uint8_t* crcPos = this->localData.fields.buffer + CRC_OFFSET; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); + std::memcpy(payloadStart, concatBuffer, sizeof(concatBuffer)); } }; @@ -878,7 +875,7 @@ class MramCmd : public SpacePacket { * @brief This class packages the space packet change the state of a GPIO. This command is only * required for ground testing. */ -class SetGpio : public SpacePacket { +class SetGpio : public ploc::SpTcBase { public: /** * @brief Constructor @@ -887,12 +884,19 @@ class SetGpio : public SpacePacket { * @param pin * @param val */ - SetGpio(uint8_t port, uint8_t pin, uint8_t val) - : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_SET_GPIO, DEFAULT_SEQUENCE_COUNT), - port(port), - pin(pin), - val(val) { - initPacket(); + SetGpio(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setApid(APID_SET_GPIO); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint8_t port, uint8_t pin, uint8_t val) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(port, pin, val); + return calcCrc(); } private: @@ -905,23 +909,10 @@ class SetGpio : public SpacePacket { uint8_t pin = 0; uint8_t val = 0; - void initPacket() { - size_t serializedSize = 0; - uint8_t* dataFieldPtr = this->localData.fields.buffer; - SerializeAdapter::serialize(&port, &dataFieldPtr, &serializedSize, sizeof(port), - SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&pin, &dataFieldPtr, &serializedSize, sizeof(pin), - SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&val, &dataFieldPtr, &serializedSize, sizeof(val), - SerializeIF::Endianness::BIG); - serializedSize = 0; - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - uint8_t* crcPos = this->localData.fields.buffer + CRC_OFFSET; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); + void initPacket(uint8_t port, uint8_t pin, uint8_t val) { + payloadStart[0] = port; + payloadStart[1] = pin; + payloadStart[2] = val; } }; @@ -929,7 +920,7 @@ class SetGpio : public SpacePacket { * @brief This class packages the space packet causing the supervisor print the state of a GPIO * to the debug output. */ -class ReadGpio : public SpacePacket { +class ReadGpio : public ploc::SpTcBase { public: /** * @brief Constructor @@ -937,11 +928,19 @@ class ReadGpio : public SpacePacket { * @param port * @param pin */ - ReadGpio(uint8_t port, uint8_t pin) - : SpacePacket(DATA_FIELD_LENGTH - 1, true, APID_READ_GPIO, DEFAULT_SEQUENCE_COUNT), - port(port), - pin(pin) { - initPacket(); + ReadGpio(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setDataFieldLen(DATA_FIELD_LENGTH); + spParams.creator.setApid(APID_READ_GPIO); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint8_t port, uint8_t pin) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(port, pin); + return calcCrc(); } private: @@ -953,20 +952,9 @@ class ReadGpio : public SpacePacket { uint8_t port = 0; uint8_t pin = 0; - void initPacket() { - size_t serializedSize = 0; - uint8_t* dataFieldPtr = this->localData.fields.buffer; - SerializeAdapter::serialize(&port, &dataFieldPtr, &serializedSize, sizeof(port), - SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&pin, &dataFieldPtr, &serializedSize, sizeof(pin), - SerializeIF::Endianness::BIG); - serializedSize = 0; - uint16_t crc = CRC::crc16ccitt(this->localData.byteStream, - sizeof(CCSDSPrimaryHeader) + DATA_FIELD_LENGTH - 2); - uint8_t* crcPos = this->localData.fields.buffer + CRC_OFFSET; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); + void initPacket(uint8_t port, uint8_t pin) { + payloadStart[0] = port; + payloadStart[1] = pin; } }; @@ -978,7 +966,7 @@ class ReadGpio : public SpacePacket { * OP = 0x01: Only the mirror entries will be wiped. * OP = 0x02: Only the circular entries will be wiped. */ -class FactoryReset : public SpacePacket { +class FactoryReset : public ploc::SpTcBase { public: enum class Op { CLEAR_ALL, MIRROR_ENTRIES, CIRCULAR_ENTRIES }; @@ -987,98 +975,74 @@ class FactoryReset : public SpacePacket { * * @param op */ - FactoryReset(Op op) : SpacePacket(0, true, APID_FACTORY_RESET, DEFAULT_SEQUENCE_COUNT), op(op) { - initPacket(); + FactoryReset(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.creator.setApid(APID_FACTORY_RESET); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(Op op) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(op); + return calcCrc(); } private: - uint16_t packetLen = 1; // only CRC in data field static const uint16_t DEFAULT_SEQUENCE_COUNT = 1; - uint8_t crcOffset = 0; - - Op op = Op::CLEAR_ALL; - - void initPacket() { - uint8_t* dataFieldPtr = this->localData.fields.buffer; - + void initPacket(Op op) { + size_t packetDataLen = 2; switch (op) { case Op::MIRROR_ENTRIES: - *dataFieldPtr = 1; - packetLen = 2; - crcOffset = 1; + payloadStart[0] = 1; + packetDataLen = 3; break; case Op::CIRCULAR_ENTRIES: - *dataFieldPtr = 2; - packetLen = 2; - crcOffset = 1; + payloadStart[0] = 2; + packetDataLen = 3; break; default: break; } - this->setPacketDataLength(packetLen); - size_t serializedSize = 0; - uint16_t crc = - CRC::crc16ccitt(this->localData.byteStream, sizeof(CCSDSPrimaryHeader) + packetLen - 1); - uint8_t* crcPos = this->localData.fields.buffer + crcOffset; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); + spParams.setDataFieldLen(packetDataLen); } }; -class SupvTcSpacePacket : public SpacePacket { +class SetShutdownTimeout : public ploc::SpTcBase { public: - /** - * @brief Constructor - * - * @param payloadDataLen Length of data field without CRC - */ - SupvTcSpacePacket(uint16_t payloadDataLen, uint16_t apid) - : SpacePacket(payloadDataLen + 1, true, apid, DEFAULT_SEQUENCE_COUNT), - payloadDataLen(payloadDataLen) {} + SetShutdownTimeout(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setPayloadLen(PAYLOAD_LEN); + spParams.creator.setApid(APID_SET_SHUTDOWN_TIMEOUT); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } - void makeCrc() { - size_t serializedSize = 0; - uint16_t crc = - CRC::crc16ccitt(this->localData.byteStream, sizeof(CCSDSPrimaryHeader) + payloadDataLen); - uint8_t* crcPos = this->localData.fields.buffer + payloadDataLen; - SerializeAdapter::serialize(&crc, &crcPos, &serializedSize, sizeof(crc), - SerializeIF::Endianness::BIG); + ReturnValue_t buildPacket(uint32_t timeout) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(timeout); + return calcCrc(); } private: - // The sequence count of most of the TC packets for the supervisor is 1. - static const uint16_t DEFAULT_SEQUENCE_COUNT = 1; - - // The size of the payload data (data field without crc size) - size_t payloadDataLen = 0; -}; - -class SetShutdownTimeout : public SupvTcSpacePacket { - public: - SetShutdownTimeout(uint32_t timeout) - : SupvTcSpacePacket(PACKET_LEN, APID_SET_SHUTDOWN_TIMEOUT), timeout(timeout) { - initPacket(); - makeCrc(); - } - - private: - static const uint16_t PACKET_LEN = 4; // uint32_t timeout + static const uint16_t PAYLOAD_LEN = 4; // uint32_t timeout uint32_t timeout = 0; - void initPacket() { - uint8_t* dataFieldPtr = this->localData.fields.buffer; - size_t serializedSize = 0; - SerializeAdapter::serialize(&timeout, dataFieldPtr, &serializedSize, sizeof(timeout), - SerializeIF::Endianness::BIG); + void initPacket(uint32_t timeout) { + size_t serLen = 0; + SerializeAdapter::serialize(&timeout, payloadStart, &serLen, sizeof(timeout), + SerializeIF::Endianness::BIG); } }; /** * @brief Command to request CRC over memory region of the supervisor. */ -class CheckMemory : public SupvTcSpacePacket { +class CheckMemory : public ploc::SpTcBase { public: /** * @brief Constructor @@ -1087,13 +1051,19 @@ class CheckMemory : public SupvTcSpacePacket { * @param startAddress Start address of CRC calculation * @param length Length in bytes of memory region */ - CheckMemory(uint8_t memoryId, uint32_t startAddress, uint32_t length) - : SupvTcSpacePacket(PAYLOAD_LENGTH, APID_CHECK_MEMORY), - memoryId(memoryId), - startAddress(startAddress), - length(length) { - initPacket(); - makeCrc(); + CheckMemory(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setPayloadLen(PAYLOAD_LENGTH); + spParams.creator.setApid(APID_CHECK_MEMORY); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(memoryId, startAddress, length); + return calcCrc(); } private: @@ -1104,27 +1074,23 @@ class CheckMemory : public SupvTcSpacePacket { uint32_t startAddress = 0; uint32_t length = 0; - void initPacket() { - size_t serializedSize = 0; - uint8_t* dataFieldPtr = this->localData.fields.buffer; - SerializeAdapter::serialize(&memoryId, &dataFieldPtr, &serializedSize, - sizeof(memoryId), SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&n, &dataFieldPtr, &serializedSize, sizeof(n), - SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&startAddress, &dataFieldPtr, &serializedSize, - sizeof(startAddress), SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&length, &dataFieldPtr, &serializedSize, sizeof(length), - SerializeIF::Endianness::BIG); + void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) { + uint8_t* data = payloadStart; + size_t serLen = 6; + SerializeAdapter::serialize(&memoryId, &data, &serLen, spParams.maxSize, + SerializeIF::Endianness::BIG); + SerializeAdapter::serialize(&n, &data, &serLen, spParams.maxSize, SerializeIF::Endianness::BIG); + SerializeAdapter::serialize(&startAddress, &data, &serLen, spParams.maxSize, + SerializeIF::Endianness::BIG); + SerializeAdapter::serialize(&length, &data, &serLen, spParams.maxSize, + SerializeIF::Endianness::BIG); } }; /** * @brief This class packages the space packet transporting a part of an MPSoC update. */ -class WriteMemory : public SupvTcSpacePacket { +class WriteMemory : public ploc::SpTcBase { public: /** * @brief Constructor @@ -1133,69 +1099,84 @@ class WriteMemory : public SupvTcSpacePacket { * @param sequenceCount Sequence count (first update packet expects 1 as sequence count) * @param updateData Pointer to buffer containing update data */ - WriteMemory(SequenceFlags seqFlags, uint16_t sequenceCount, uint8_t memoryId, - uint32_t startAddress, uint16_t length, uint8_t* updateData) - : SupvTcSpacePacket(META_DATA_LENGTH + length, APID_WRITE_MEMORY), - memoryId(memoryId), - startAddress(startAddress), - length(length) { - if (this->length > CHUNK_MAX) { - sif::error << "WriteMemory::WriteMemory: Invalid length" << std::endl; - } - initPacket(updateData); - this->setSequenceFlags(static_cast(seqFlags)); - this->setPacketSequenceCount(sequenceCount); - makeCrc(); + WriteMemory(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.creator.setApid(APID_WRITE_MEMORY); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); } + ReturnValue_t buildPacket(ccsds::SequenceFlags seqFlags, uint16_t sequenceCount, uint8_t memoryId, + uint32_t startAddress, uint16_t length, uint8_t* updateData) { + if (length > CHUNK_MAX) { + sif::error << "WriteMemory::WriteMemory: Invalid length" << std::endl; + return SerializeIF::BUFFER_TOO_SHORT; + } + spParams.creator.setSeqFlags(seqFlags); + spParams.creator.setSeqCount(sequenceCount); + initPacket(memoryId, startAddress, length, updateData); + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + return calcCrc(); + } // Although the space packet has space left for 1010 bytes of data to supervisor can only process // update packets with a maximum of 512 bytes. static const uint16_t CHUNK_MAX = 512; private: static const uint16_t META_DATA_LENGTH = 8; - - uint8_t memoryId = 0; uint8_t n = 1; - uint32_t startAddress = 0; - uint16_t length = 0; - void initPacket(uint8_t* updateData) { - size_t serializedSize = 0; - uint8_t* dataFieldPtr = this->localData.fields.buffer; - SerializeAdapter::serialize(&memoryId, &dataFieldPtr, &serializedSize, - sizeof(memoryId), SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&n, &dataFieldPtr, &serializedSize, sizeof(n), - SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&startAddress, &dataFieldPtr, &serializedSize, - sizeof(startAddress), SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&length, &dataFieldPtr, &serializedSize, sizeof(length), - SerializeIF::Endianness::BIG); - std::memcpy(dataFieldPtr, updateData, length); - if (length % 2 != 0) { - this->setPacketDataLength(length + sizeof(CCSDSPrimaryHeader) + CRC_SIZE - 1); + ReturnValue_t initPacket(uint8_t memoryId, uint32_t startAddr, uint16_t updateDataLen, + uint8_t* updateData) { + uint8_t* data = payloadStart; + if (updateDataLen % 2 != 0) { + spParams.setPayloadLen(META_DATA_LENGTH + updateDataLen + 1); + } else { + spParams.setPayloadLen(META_DATA_LENGTH + updateDataLen); + } + // To avoid crashes in this unexpected case + ReturnValue_t result = checkPayloadLen(); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + size_t serializedSize = 6; + SerializeAdapter::serialize(&memoryId, &data, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); + SerializeAdapter::serialize(&n, &data, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); + SerializeAdapter::serialize(&startAddr, &data, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); + SerializeAdapter::serialize(&updateDataLen, &data, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); + std::memcpy(data, updateData, updateDataLen); + if (updateDataLen % 2 != 0) { // The data field must be two bytes aligned. Thus, in case the number of bytes to write is odd // a value of zero is added here - *(dataFieldPtr + length + 1) = 0; + data[updateDataLen + 1] = 0; } + return HasReturnvaluesIF::RETURN_OK; } }; /** - * @brief This class can be used to package the update available or update verify command. + * @brief This class can be used to package erase memory command */ -class EraseMemory : public SupvTcSpacePacket { +class EraseMemory : public ploc::SpTcBase { public: - EraseMemory(uint8_t memoryId, uint32_t startAddress, uint32_t length) - : SupvTcSpacePacket(PAYLOAD_LENGTH, APID_ERASE_MEMORY), - memoryId(memoryId), - startAddress(startAddress), - length(length) { - initPacket(); - makeCrc(); + EraseMemory(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setPayloadLen(PAYLOAD_LENGTH); + spParams.creator.setApid(APID_ERASE_MEMORY); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + initPacket(memoryId, startAddress, length); + return calcCrc(); } private: @@ -1206,31 +1187,38 @@ class EraseMemory : public SupvTcSpacePacket { uint32_t startAddress = 0; uint32_t length = 0; - void initPacket() { - size_t serializedSize = 0; - uint8_t* dataFieldPtr = this->localData.fields.buffer; - SerializeAdapter::serialize(&memoryId, &dataFieldPtr, &serializedSize, - sizeof(memoryId), SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&n, &dataFieldPtr, &serializedSize, sizeof(n), - SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&startAddress, &dataFieldPtr, &serializedSize, - sizeof(startAddress), SerializeIF::Endianness::BIG); - serializedSize = 0; - SerializeAdapter::serialize(&length, &dataFieldPtr, &serializedSize, sizeof(length), - SerializeIF::Endianness::BIG); + void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) { + uint8_t* data = payloadStart; + size_t serializedSize = 6; + SerializeAdapter::serialize(&memoryId, &data, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); + SerializeAdapter::serialize(&n, &data, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); + SerializeAdapter::serialize(&startAddress, &data, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); + SerializeAdapter::serialize(&length, &data, &serializedSize, spParams.maxSize, + SerializeIF::Endianness::BIG); } }; /** * @brief This class creates the space packet to enable the auto TM generation */ -class EnableAutoTm : public SupvTcSpacePacket { +class EnableAutoTm : public ploc::SpTcBase { public: - EnableAutoTm() : SupvTcSpacePacket(PAYLOAD_LENGTH, APID_AUTO_TM) { - *(this->localData.fields.buffer) = ENABLE; - makeCrc(); + EnableAutoTm(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setPayloadLen(PAYLOAD_LENGTH); + spParams.creator.setApid(APID_AUTO_TM); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket() { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + payloadStart[0] = ENABLE; + return calcCrc(); } private: @@ -1241,11 +1229,21 @@ class EnableAutoTm : public SupvTcSpacePacket { /** * @brief This class creates the space packet to disable the auto TM generation */ -class DisableAutoTm : public SupvTcSpacePacket { +class DisableAutoTm : public ploc::SpTcBase { public: - DisableAutoTm() : SupvTcSpacePacket(PAYLOAD_LENGTH, APID_AUTO_TM) { - *(this->localData.fields.buffer) = DISABLE; - makeCrc(); + DisableAutoTm(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setPayloadLen(PAYLOAD_LENGTH); + spParams.creator.setApid(APID_AUTO_TM); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + ReturnValue_t buildPacket() { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + payloadStart[0] = DISABLE; + return calcCrc(); } private: @@ -1256,20 +1254,37 @@ class DisableAutoTm : public SupvTcSpacePacket { /** * @brief This class creates the space packet to request the logging data from the supervisor */ -class RequestLoggingData : public SupvTcSpacePacket { +class RequestLoggingData : public ploc::SpTcBase { public: + /** + * Subapid + */ enum class Sa : uint8_t { - REQUEST_COUNTERS = 1, - REQUEST_EVENT_BUFFERS = 2, - CLEAR_COUNTERS = 3, - SET_LOGGING_TOPIC = 4 + REQUEST_COUNTERS = 1, /**< REQUEST_COUNTERS */ + REQUEST_EVENT_BUFFERS = 2, /**< REQUEST_EVENT_BUFFERS */ + CLEAR_COUNTERS = 3, /**< CLEAR_COUNTERS */ + SET_LOGGING_TOPIC = 4 /**< SET_LOGGING_TOPIC */ }; - RequestLoggingData(Sa sa, uint8_t tpc = 0) - : SupvTcSpacePacket(PAYLOAD_LENGTH, APID_REQUEST_LOGGING_DATA) { - *(this->localData.fields.buffer) = static_cast(sa); - *(this->localData.fields.buffer + TPC_OFFSET) = tpc; - makeCrc(); + RequestLoggingData(ploc::SpTcParams params) : ploc::SpTcBase(params) { + spParams.setPayloadLen(PAYLOAD_LENGTH); + spParams.creator.setApid(APID_REQUEST_LOGGING_DATA); + spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT); + } + + /** + * @param sa + * @param tpc Topic + * @return + */ + ReturnValue_t buildPacket(Sa sa, uint8_t tpc = 0) { + auto res = checkSizeAndSerializeHeader(); + if (res != result::OK) { + return res; + } + payloadStart[0] = static_cast(sa); + payloadStart[1] = tpc; + return calcCrc(); } private: @@ -1277,36 +1292,9 @@ class RequestLoggingData : public SupvTcSpacePacket { static const uint8_t TPC_OFFSET = 1; }; -/** - * @brief Class for handling tm replies of the supervisor. - */ -class TmPacket : public SpacePacket { +class VerificationReport : public ploc::SpTmReader { public: - /** - * @brief Constructor creates idle packet and sets length field to maximum allowed size. - */ - TmPacket() : SpacePacket(PACKET_MAX_SIZE) {} - - /** - * @brief Returns the payload data length (data field length without CRC) - */ - uint16_t getPayloadDataLength() { return this->getPacketDataLength() - 1; } - - ReturnValue_t checkCrc() { - uint8_t* crcPtr = this->getPacketData() + this->getPayloadDataLength(); - uint16_t receivedCrc = *(crcPtr) << 8 | *(crcPtr + 1); - uint16_t recalculatedCrc = - CRC::crc16ccitt(this->localData.byteStream, this->getFullSize() - CRC_SIZE); - if (recalculatedCrc != receivedCrc) { - return SupvReturnValuesIF::CRC_FAILURE; - } - return HasReturnvaluesIF::RETURN_OK; - } -}; - -class VerificationReport : public TmPacket { - public: - VerificationReport() : TmPacket() {} + VerificationReport(const uint8_t* buf, size_t maxSize) : ploc::SpTmReader(buf, maxSize) {} /** * @brief Gets the APID of command which caused the transmission of this verification report. @@ -1314,7 +1302,7 @@ class VerificationReport : public TmPacket { uint16_t getRefApid() { uint16_t refApid = 0; size_t size = 0; - uint8_t* refApidPtr = this->getPacketData(); + const uint8_t* refApidPtr = this->getPacketData(); ReturnValue_t result = SerializeAdapter::deSerialize(&refApid, refApidPtr, &size, SerializeIF::Endianness::BIG); if (result != HasReturnvaluesIF::RETURN_OK) { @@ -1327,7 +1315,7 @@ class VerificationReport : public TmPacket { uint16_t getStatusCode() { uint16_t statusCode = 0; size_t size = 0; - uint8_t* statusCodePtr = this->getPacketData() + OFFSET_STATUS_CODE; + const uint8_t* statusCodePtr = this->getPacketData() + OFFSET_STATUS_CODE; ReturnValue_t result = SerializeAdapter::deSerialize(&statusCode, statusCodePtr, &size, SerializeIF::Endianness::BIG); if (result != HasReturnvaluesIF::RETURN_OK) { @@ -1345,10 +1333,10 @@ class VerificationReport : public TmPacket { class AcknowledgmentReport : public VerificationReport { public: - AcknowledgmentReport() : VerificationReport() {} + AcknowledgmentReport(const uint8_t* buf, size_t maxSize) : VerificationReport(buf, maxSize) {} ReturnValue_t checkApid() { - uint16_t apid = this->getAPID(); + uint16_t apid = this->getApid(); if (apid == APID_ACK_SUCCESS) { return HasReturnvaluesIF::RETURN_OK; } else if (apid == APID_ACK_FAILURE) { @@ -1363,38 +1351,38 @@ class AcknowledgmentReport : public VerificationReport { void printStatusInformation() { StatusCode statusCode = static_cast(getStatusCode()); + const char* prefix = "Supervisor acknowledgment report status: "; switch (statusCode) { case StatusCode::OK: { - sif::warning << "Supervisor acknowledgment report status: Ok" << std::endl; + sif::warning << prefix << "Ok" << std::endl; break; } case StatusCode::BAD_PARAM: { - sif::warning << "Supervisor acknowledgment report status: Bad param" << std::endl; + sif::warning << prefix << "Bad param" << std::endl; break; } case StatusCode::TIMEOUT: { - sif::warning << "Supervisor acknowledgment report status: Timeout" << std::endl; + sif::warning << prefix << "Timeout" << std::endl; break; } case StatusCode::RX_ERROR: { - sif::warning << "Supervisor acknowledgment report status: RX error" << std::endl; + sif::warning << prefix << "RX error" << std::endl; break; } case StatusCode::TX_ERROR: { - sif::warning << "Supervisor acknowledgment report status: TX error" << std::endl; + sif::warning << prefix << "TX error" << std::endl; break; } case StatusCode::HEADER_EMPTY: { - sif::warning << "Supervisor acknowledgment report status: Header empty" << std::endl; + sif::warning << prefix << "Header empty" << std::endl; break; } case StatusCode::DEFAULT_NAK: { - sif::warning << "Supervisor acknowledgment report status: Default code for nak" - << std::endl; + sif::warning << prefix << "Default code for NAK" << std::endl; break; } case StatusCode::ROUTE_PACKET: { - sif::warning << "Supervisor acknowledgment report status: Route packet error" << std::endl; + sif::warning << prefix << "Route packet error" << std::endl; break; } default: @@ -1419,10 +1407,10 @@ class AcknowledgmentReport : public VerificationReport { class ExecutionReport : public VerificationReport { public: - ExecutionReport() : VerificationReport() {} + ExecutionReport(const uint8_t* buf, size_t maxSize) : VerificationReport(buf, maxSize) {} ReturnValue_t checkApid() { - uint16_t apid = this->getAPID(); + uint16_t apid = this->getApid(); if (apid == APID_EXE_SUCCESS) { return HasReturnvaluesIF::RETURN_OK; } else if (apid == APID_EXE_FAILURE) { @@ -1688,7 +1676,8 @@ class ExecutionReport : public VerificationReport { } default: sif::warning << "ExecutionReport::printStatusInformation: Invalid status code: 0x" - << std::hex << static_cast(statusCode) << std::endl; + << std::hex << std::setfill('0') << std::setw(4) + << static_cast(statusCode) << std::dec << std::endl; break; } } @@ -1848,30 +1837,24 @@ class LoggingReport : public StaticLocalDataSet { } }; -class UpdateStatusReport : public TmPacket { +class UpdateStatusReport : public ploc::SpTmReader { public: - UpdateStatusReport() : TmPacket() {} + UpdateStatusReport() = default; + UpdateStatusReport(const uint8_t* buf, size_t maxSize) : ploc::SpTmReader(buf, maxSize) {} ReturnValue_t parseDataField() { ReturnValue_t result = lengthCheck(); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - uint8_t* dataFieldPtr = this->localData.fields.buffer; - size_t size = sizeof(memoryId); - SerializeAdapter::deSerialize(&memoryId, dataFieldPtr, &size, SerializeIF::Endianness::BIG); - dataFieldPtr += size; - size = sizeof(n); - SerializeAdapter::deSerialize(&n, dataFieldPtr, &size, SerializeIF::Endianness::BIG); - dataFieldPtr += size; - size = sizeof(startAddress); - SerializeAdapter::deSerialize(&startAddress, dataFieldPtr, &size, SerializeIF::Endianness::BIG); - dataFieldPtr += size; - size = sizeof(length); - SerializeAdapter::deSerialize(&length, dataFieldPtr, &size, SerializeIF::Endianness::BIG); - dataFieldPtr += size; - size = sizeof(crc); - SerializeAdapter::deSerialize(&crc, dataFieldPtr, &size, SerializeIF::Endianness::BIG); + const uint8_t* dataFieldPtr = getFullData() + ccsds::HEADER_LEN; + size_t size = 12; + SerializeAdapter::deSerialize(&memoryId, &dataFieldPtr, &size, SerializeIF::Endianness::BIG); + SerializeAdapter::deSerialize(&n, &dataFieldPtr, &size, SerializeIF::Endianness::BIG); + SerializeAdapter::deSerialize(&startAddress, &dataFieldPtr, &size, + SerializeIF::Endianness::BIG); + SerializeAdapter::deSerialize(&length, &dataFieldPtr, &size, SerializeIF::Endianness::BIG); + SerializeAdapter::deSerialize(&crc, &dataFieldPtr, &size, SerializeIF::Endianness::BIG); return HasReturnvaluesIF::RETURN_OK; } @@ -1897,7 +1880,7 @@ class UpdateStatusReport : public TmPacket { uint16_t crc = 0; ReturnValue_t lengthCheck() { - if (this->getFullSize() != FULL_SIZE) { + if (getFullPacketLen() != FULL_SIZE) { return SupvReturnValuesIF::UPDATE_STATUS_REPORT_INVALID_LENGTH; } return HasReturnvaluesIF::RETURN_OK; diff --git a/linux/devices/ploc/PlocMPSoCHandler.cpp b/linux/devices/ploc/PlocMPSoCHandler.cpp index 37372b3b..c56ada07 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.cpp +++ b/linux/devices/ploc/PlocMPSoCHandler.cpp @@ -19,6 +19,8 @@ PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid eventQueue = QueueFactory::instance()->createMessageQueue(EventMessage::EVENT_MESSAGE_SIZE * 5); commandActionHelperQueue = QueueFactory::instance()->createMessageQueue(EventMessage::EVENT_MESSAGE_SIZE * 5); + spParams.maxSize = sizeof(commandBuffer); + spParams.buf = commandBuffer; } PlocMPSoCHandler::~PlocMPSoCHandler() {} @@ -206,6 +208,7 @@ ReturnValue_t PlocMPSoCHandler::buildTransitionDeviceCommand(DeviceCommandId_t* ReturnValue_t PlocMPSoCHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData, size_t commandDataLen) { + spParams.buf = commandBuffer; ReturnValue_t result = RETURN_OK; switch (deviceCommand) { case (mpsoc::TC_MEM_WRITE): { @@ -286,16 +289,23 @@ void PlocMPSoCHandler::fillCommandAndReplyMap() { this->insertInReplyMap(mpsoc::ACK_REPORT, 3, nullptr, mpsoc::SIZE_ACK_REPORT); this->insertInReplyMap(mpsoc::EXE_REPORT, 3, nullptr, mpsoc::SIZE_EXE_REPORT); this->insertInReplyMap(mpsoc::TM_MEMORY_READ_REPORT, 2, nullptr, mpsoc::SIZE_TM_MEM_READ_REPORT); - this->insertInReplyMap(mpsoc::TM_CAM_CMD_RPT, 2, nullptr, SpacePacket::PACKET_MAX_SIZE); + this->insertInReplyMap(mpsoc::TM_CAM_CMD_RPT, 2, nullptr, mpsoc::SP_MAX_SIZE); } ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId, size_t* foundLen) { ReturnValue_t result = RETURN_OK; - SpacePacket spacePacket; - std::memcpy(spacePacket.getWholeData(), start, remainingSize); - uint16_t apid = spacePacket.getAPID(); + SpacePacketReader spacePacket; + spacePacket.setReadOnlyData(start, remainingSize); + if (spacePacket.isNull()) { + return RETURN_FAILED; + } + auto res = spacePacket.checkSize(); + if (res != RETURN_OK) { + return res; + } + uint16_t apid = spacePacket.getApid(); switch (apid) { case (mpsoc::apid::ACK_SUCCESS): @@ -311,7 +321,7 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain *foundId = mpsoc::TM_MEMORY_READ_REPORT; break; case (mpsoc::apid::TM_CAM_CMD_RPT): - *foundLen = spacePacket.getFullSize(); + *foundLen = spacePacket.getFullPacketLen(); tmCamCmdRpt.rememberSpacePacketSize = *foundLen; *foundId = mpsoc::TM_CAM_CMD_RPT; break; @@ -394,13 +404,13 @@ ReturnValue_t PlocMPSoCHandler::prepareTcMemWrite(const uint8_t* commandData, size_t commandDataLen) { ReturnValue_t result = RETURN_OK; sequenceCount++; - mpsoc::TcMemWrite tcMemWrite(sequenceCount); - result = tcMemWrite.createPacket(commandData, commandDataLen); + mpsoc::TcMemWrite tcMemWrite(spParams, sequenceCount); + result = tcMemWrite.buildPacket(commandData, commandDataLen); if (result != RETURN_OK) { sequenceCount--; return result; } - copyToCommandBuffer(&tcMemWrite); + finishTcPrep(tcMemWrite.getFullPacketLen()); return RETURN_OK; } @@ -408,13 +418,13 @@ ReturnValue_t PlocMPSoCHandler::prepareTcMemRead(const uint8_t* commandData, size_t commandDataLen) { ReturnValue_t result = RETURN_OK; sequenceCount++; - mpsoc::TcMemRead tcMemRead(sequenceCount); - result = tcMemRead.createPacket(commandData, commandDataLen); + mpsoc::TcMemRead tcMemRead(spParams, sequenceCount); + result = tcMemRead.buildPacket(commandData, commandDataLen); if (result != RETURN_OK) { sequenceCount--; return result; } - copyToCommandBuffer(&tcMemRead); + finishTcPrep(tcMemRead.getFullPacketLen()); tmMemReadReport.rememberRequestedSize = tcMemRead.getMemLen() * 4 + TmMemReadReport::FIX_SIZE; return RETURN_OK; } @@ -426,14 +436,14 @@ ReturnValue_t PlocMPSoCHandler::prepareTcFlashDelete(const uint8_t* commandData, } ReturnValue_t result = RETURN_OK; sequenceCount++; - mpsoc::TcFlashDelete tcFlashDelete(sequenceCount); - result = tcFlashDelete.createPacket( + mpsoc::TcFlashDelete tcFlashDelete(spParams, sequenceCount); + result = tcFlashDelete.buildPacket( std::string(reinterpret_cast(commandData), commandDataLen)); if (result != RETURN_OK) { sequenceCount--; return result; } - copyToCommandBuffer(&tcFlashDelete); + finishTcPrep(tcFlashDelete.getFullPacketLen()); return RETURN_OK; } @@ -441,26 +451,26 @@ ReturnValue_t PlocMPSoCHandler::prepareTcReplayStart(const uint8_t* commandData, size_t commandDataLen) { ReturnValue_t result = RETURN_OK; sequenceCount++; - mpsoc::TcReplayStart tcReplayStart(sequenceCount); - result = tcReplayStart.createPacket(commandData, commandDataLen); + mpsoc::TcReplayStart tcReplayStart(spParams, sequenceCount); + result = tcReplayStart.buildPacket(commandData, commandDataLen); if (result != RETURN_OK) { sequenceCount--; return result; } - copyToCommandBuffer(&tcReplayStart); + finishTcPrep(tcReplayStart.getFullPacketLen()); return RETURN_OK; } ReturnValue_t PlocMPSoCHandler::prepareTcReplayStop() { ReturnValue_t result = RETURN_OK; sequenceCount++; - mpsoc::TcReplayStop tcReplayStop(sequenceCount); - result = tcReplayStop.createPacket(); + mpsoc::TcReplayStop tcReplayStop(spParams, sequenceCount); + result = tcReplayStop.buildPacket(); if (result != RETURN_OK) { sequenceCount--; return result; } - copyToCommandBuffer(&tcReplayStop); + finishTcPrep(tcReplayStop.getFullPacketLen()); return RETURN_OK; } @@ -468,26 +478,26 @@ ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOn(const uint8_t* commandDat size_t commandDataLen) { ReturnValue_t result = RETURN_OK; sequenceCount++; - mpsoc::TcDownlinkPwrOn tcDownlinkPwrOn(sequenceCount); - result = tcDownlinkPwrOn.createPacket(commandData, commandDataLen); + mpsoc::TcDownlinkPwrOn tcDownlinkPwrOn(spParams, sequenceCount); + result = tcDownlinkPwrOn.buildPacket(commandData, commandDataLen); if (result != RETURN_OK) { sequenceCount--; return result; } - copyToCommandBuffer(&tcDownlinkPwrOn); + finishTcPrep(tcDownlinkPwrOn.getFullPacketLen()); return RETURN_OK; } ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOff() { ReturnValue_t result = RETURN_OK; sequenceCount++; - mpsoc::TcDownlinkPwrOff tcDownlinkPwrOff(sequenceCount); - result = tcDownlinkPwrOff.createPacket(); + mpsoc::TcDownlinkPwrOff tcDownlinkPwrOff(spParams, sequenceCount); + result = tcDownlinkPwrOff.buildPacket(); if (result != RETURN_OK) { sequenceCount--; return result; } - copyToCommandBuffer(&tcDownlinkPwrOff); + finishTcPrep(tcDownlinkPwrOff.getFullPacketLen()); return RETURN_OK; } @@ -495,45 +505,39 @@ ReturnValue_t PlocMPSoCHandler::prepareTcReplayWriteSequence(const uint8_t* comm size_t commandDataLen) { ReturnValue_t result = RETURN_OK; sequenceCount++; - mpsoc::TcReplayWriteSeq tcReplayWriteSeq(sequenceCount); - result = tcReplayWriteSeq.createPacket(commandData, commandDataLen); + mpsoc::TcReplayWriteSeq tcReplayWriteSeq(spParams, sequenceCount); + result = tcReplayWriteSeq.buildPacket(commandData, commandDataLen); if (result != RETURN_OK) { sequenceCount--; return result; } - copyToCommandBuffer(&tcReplayWriteSeq); + finishTcPrep(tcReplayWriteSeq.getFullPacketLen()); return RETURN_OK; } ReturnValue_t PlocMPSoCHandler::prepareTcModeReplay() { ReturnValue_t result = RETURN_OK; sequenceCount++; - mpsoc::TcModeReplay tcModeReplay(sequenceCount); - result = tcModeReplay.createPacket(); + mpsoc::TcModeReplay tcModeReplay(spParams, sequenceCount); + result = tcModeReplay.buildPacket(); if (result != RETURN_OK) { sequenceCount--; return result; } - memcpy(commandBuffer, tcModeReplay.getWholeData(), tcModeReplay.getFullSize()); - rawPacket = commandBuffer; - rawPacketLen = tcModeReplay.getFullSize(); - nextReplyId = mpsoc::ACK_REPORT; + finishTcPrep(tcModeReplay.getFullPacketLen()); return RETURN_OK; } ReturnValue_t PlocMPSoCHandler::prepareTcModeIdle() { ReturnValue_t result = RETURN_OK; sequenceCount++; - mpsoc::TcModeIdle tcModeIdle(sequenceCount); - result = tcModeIdle.createPacket(); + mpsoc::TcModeIdle tcModeIdle(spParams, sequenceCount); + result = tcModeIdle.buildPacket(); if (result != RETURN_OK) { sequenceCount--; return result; } - memcpy(commandBuffer, tcModeIdle.getWholeData(), tcModeIdle.getFullSize()); - rawPacket = commandBuffer; - rawPacketLen = tcModeIdle.getFullSize(); - nextReplyId = mpsoc::ACK_REPORT; + finishTcPrep(tcModeIdle.getFullPacketLen()); return RETURN_OK; } @@ -541,31 +545,25 @@ ReturnValue_t PlocMPSoCHandler::prepareTcCamCmdSend(const uint8_t* commandData, size_t commandDataLen) { ReturnValue_t result = RETURN_OK; sequenceCount++; - mpsoc::TcCamcmdSend tcCamCmdSend(sequenceCount); - result = tcCamCmdSend.createPacket(commandData, commandDataLen); + mpsoc::TcCamcmdSend tcCamCmdSend(spParams, sequenceCount); + result = tcCamCmdSend.buildPacket(commandData, commandDataLen); if (result != RETURN_OK) { sequenceCount--; return result; } - copyToCommandBuffer(&tcCamCmdSend); + finishTcPrep(tcCamCmdSend.getFullPacketLen()); nextReplyId = mpsoc::TM_CAM_CMD_RPT; return RETURN_OK; } -void PlocMPSoCHandler::copyToCommandBuffer(mpsoc::TcBase* tc) { - if (tc == nullptr) { - sif::debug << "PlocMPSoCHandler::copyToCommandBuffer: Invalid TC" << std::endl; - } - memcpy(commandBuffer, tc->getWholeData(), tc->getFullSize()); - rawPacket = commandBuffer; - rawPacketLen = tc->getFullSize(); +void PlocMPSoCHandler::finishTcPrep(size_t packetLen) { nextReplyId = mpsoc::ACK_REPORT; + rawPacket = commandBuffer; + rawPacketLen = packetLen; } ReturnValue_t PlocMPSoCHandler::verifyPacket(const uint8_t* start, size_t foundLen) { - uint16_t receivedCrc = *(start + foundLen - 2) << 8 | *(start + foundLen - 1); - uint16_t recalculatedCrc = CRC::crc16ccitt(start, foundLen - 2); - if (receivedCrc != recalculatedCrc) { + if (CRC::crc16ccitt(start, foundLen) != 0) { return MPSoCReturnValuesIF::CRC_FAILURE; } return RETURN_OK; @@ -677,24 +675,23 @@ ReturnValue_t PlocMPSoCHandler::handleMemoryReadReport(const uint8_t* data) { ReturnValue_t PlocMPSoCHandler::handleCamCmdRpt(const uint8_t* data) { ReturnValue_t result = RETURN_OK; - SpacePacket packet; - std::memcpy(packet.getWholeData(), data, tmCamCmdRpt.rememberSpacePacketSize); result = verifyPacket(data, tmCamCmdRpt.rememberSpacePacketSize); if (result == MPSoCReturnValuesIF::CRC_FAILURE) { sif::warning << "PlocMPSoCHandler::handleCamCmdRpt: CRC failure" << std::endl; } + SpacePacketReader packetReader(data, tmCamCmdRpt.rememberSpacePacketSize); const uint8_t* dataFieldPtr = data + mpsoc::SPACE_PACKET_HEADER_SIZE + sizeof(uint16_t); std::string camCmdRptMsg( reinterpret_cast(dataFieldPtr), tmCamCmdRpt.rememberSpacePacketSize - mpsoc::SPACE_PACKET_HEADER_SIZE - sizeof(uint16_t) - 3); #if OBSW_DEBUG_PLOC_MPSOC == 1 - uint8_t ackValue = *(packet.getPacketData() + packet.getPacketDataLength() - 2); + uint8_t ackValue = *(packetReader.getFullData() + packetReader.getFullPacketLen() - 2); sif::info << "PlocMPSoCHandler: CamCmdRpt message: " << camCmdRptMsg << std::endl; sif::info << "PlocMPSoCHandler: CamCmdRpt Ack value: 0x" << std::hex << static_cast(ackValue) << std::endl; #endif /* OBSW_DEBUG_PLOC_MPSOC == 1 */ - handleDeviceTM(packet.getPacketData() + sizeof(uint16_t), packet.getPacketDataLength() - 1, - mpsoc::TM_CAM_CMD_RPT); + handleDeviceTM(packetReader.getPacketData() + sizeof(uint16_t), + packetReader.getPacketDataLen() - 1, mpsoc::TM_CAM_CMD_RPT); return result; } @@ -818,7 +815,7 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) { case mpsoc::TM_CAM_CMD_RPT: // Read acknowledgment, camera and execution report in one go because length of camera // report is not fixed - replyLen = SpacePacket::PACKET_MAX_SIZE; + replyLen = mpsoc::SP_MAX_SIZE; break; default: { replyLen = iter->second.replyLen; diff --git a/linux/devices/ploc/PlocMPSoCHandler.h b/linux/devices/ploc/PlocMPSoCHandler.h index 0d3445d1..05c2e902 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.h +++ b/linux/devices/ploc/PlocMPSoCHandler.h @@ -8,7 +8,6 @@ #include "fsfw/action/CommandsActionsIF.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/ipc/QueueFactory.h" -#include "fsfw/tmtcpacket/SpacePacket.h" #include "fsfw/tmtcservices/SourceSequenceCounter.h" #include "fsfw_hal/linux/gpio/Gpio.h" #include "fsfw_hal/linux/uart/UartComIF.h" @@ -111,10 +110,11 @@ class PlocMPSoCHandler : public DeviceHandlerBase, public CommandsActionsIF { // Initiate the sequence count with the maximum value. It is incremented before // a packet is sent, so the first value will be 0 accordingly using // the wrap around of the counter. - SourceSequenceCounter sequenceCount = - SourceSequenceCounter(SpacePacketBase::LIMIT_SEQUENCE_COUNT - 1); + SourceSequenceCounter sequenceCount = SourceSequenceCounter(ccsds::LIMIT_SEQUENCE_COUNT - 1); uint8_t commandBuffer[mpsoc::MAX_COMMAND_SIZE]; + SpacePacketCreator creator; + ploc::SpTcParams spParams = ploc::SpTcParams(creator); /** * This variable is used to store the id of the next reply to receive. This is necessary @@ -148,7 +148,7 @@ class PlocMPSoCHandler : public DeviceHandlerBase, public CommandsActionsIF { struct TelemetryBuffer { uint16_t length = 0; - uint8_t buffer[SpacePacket::PACKET_MAX_SIZE]; + uint8_t buffer[mpsoc::SP_MAX_SIZE]; }; TelemetryBuffer tmBuffer; @@ -172,10 +172,7 @@ class PlocMPSoCHandler : public DeviceHandlerBase, public CommandsActionsIF { ReturnValue_t prepareTcReplayWriteSequence(const uint8_t* commandData, size_t commandDataLen); ReturnValue_t prepareTcCamCmdSend(const uint8_t* commandData, size_t commandDataLen); ReturnValue_t prepareTcModeIdle(); - /** - * @brief Copies space packet into command buffer - */ - void copyToCommandBuffer(mpsoc::TcBase* tc); + void finishTcPrep(size_t packetLen); /** * @brief This function checks the crc of the received PLOC reply. diff --git a/linux/devices/ploc/PlocMPSoCHelper.cpp b/linux/devices/ploc/PlocMPSoCHelper.cpp index 5e6da78b..e9a65d64 100644 --- a/linux/devices/ploc/PlocMPSoCHelper.cpp +++ b/linux/devices/ploc/PlocMPSoCHelper.cpp @@ -10,7 +10,12 @@ #include "mission/utility/Timestamp.h" -PlocMPSoCHelper::PlocMPSoCHelper(object_id_t objectId) : SystemObject(objectId) {} +using namespace ploc; + +PlocMPSoCHelper::PlocMPSoCHelper(object_id_t objectId) : SystemObject(objectId) { + spParams.buf = commandBuffer; + spParams.maxSize = sizeof(commandBuffer); +} PlocMPSoCHelper::~PlocMPSoCHelper() {} @@ -99,6 +104,7 @@ ReturnValue_t PlocMPSoCHelper::startFlashWrite(std::string obcFile, std::string ReturnValue_t PlocMPSoCHelper::resetHelper() { ReturnValue_t result = RETURN_OK; semaphore.release(); + spParams.buf = commandBuffer; terminate = false; result = uartComIF->flushUartRxBuffer(comCookie); return result; @@ -138,8 +144,11 @@ ReturnValue_t PlocMPSoCHelper::performFlashWrite() { return FILE_CLOSED_ACCIDENTALLY; } (*sequenceCount)++; - mpsoc::TcFlashWrite tc(*sequenceCount); - tc.createPacket(tempData, dataLength); + mpsoc::TcFlashWrite tc(spParams, *sequenceCount); + result = tc.buildPacket(tempData, dataLength); + if (result != RETURN_OK) { + return result; + } result = handlePacketTransmission(tc); if (result != RETURN_OK) { return result; @@ -154,8 +163,9 @@ ReturnValue_t PlocMPSoCHelper::performFlashWrite() { ReturnValue_t PlocMPSoCHelper::flashfopen() { ReturnValue_t result = RETURN_OK; + spParams.buf = commandBuffer; (*sequenceCount)++; - mpsoc::FlashFopen flashFopen(*sequenceCount); + mpsoc::FlashFopen flashFopen(spParams, *sequenceCount); result = flashFopen.createPacket(flashWrite.mpsocFile, mpsoc::FlashFopen::APPEND); if (result != RETURN_OK) { return result; @@ -169,8 +179,9 @@ ReturnValue_t PlocMPSoCHelper::flashfopen() { ReturnValue_t PlocMPSoCHelper::flashfclose() { ReturnValue_t result = RETURN_OK; + spParams.buf = commandBuffer; (*sequenceCount)++; - mpsoc::FlashFclose flashFclose(*sequenceCount); + mpsoc::FlashFclose flashFclose(spParams, *sequenceCount); result = flashFclose.createPacket(flashWrite.mpsocFile); if (result != RETURN_OK) { return result; @@ -182,7 +193,7 @@ ReturnValue_t PlocMPSoCHelper::flashfclose() { return RETURN_OK; } -ReturnValue_t PlocMPSoCHelper::handlePacketTransmission(mpsoc::TcBase& tc) { +ReturnValue_t PlocMPSoCHelper::handlePacketTransmission(ploc::SpTcBase& tc) { ReturnValue_t result = RETURN_OK; result = sendCommand(tc); if (result != RETURN_OK) { @@ -199,9 +210,9 @@ ReturnValue_t PlocMPSoCHelper::handlePacketTransmission(mpsoc::TcBase& tc) { return RETURN_OK; } -ReturnValue_t PlocMPSoCHelper::sendCommand(mpsoc::TcBase& tc) { +ReturnValue_t PlocMPSoCHelper::sendCommand(ploc::SpTcBase& tc) { ReturnValue_t result = RETURN_OK; - result = uartComIF->sendMessage(comCookie, tc.getWholeData(), tc.getFullSize()); + result = uartComIF->sendMessage(comCookie, tc.getFullPacket(), tc.getFullPacketLen()); if (result != RETURN_OK) { sif::warning << "PlocMPSoCHelper::sendCommand: Failed to send command" << std::endl; triggerEvent(MPSOC_SENDING_COMMAND_FAILED, result, static_cast(internalState)); @@ -212,12 +223,16 @@ ReturnValue_t PlocMPSoCHelper::sendCommand(mpsoc::TcBase& tc) { ReturnValue_t PlocMPSoCHelper::handleAck() { ReturnValue_t result = RETURN_OK; - mpsoc::TmPacket tmPacket; - result = handleTmReception(&tmPacket, mpsoc::SIZE_ACK_REPORT); + result = handleTmReception(mpsoc::SIZE_ACK_REPORT); if (result != RETURN_OK) { return result; } - uint16_t apid = tmPacket.getAPID(); + SpTmReader tmPacket(tmBuf.data(), tmBuf.size()); + result = checkReceivedTm(tmPacket); + if (result != RETURN_OK) { + return result; + } + uint16_t apid = tmPacket.getApid(); if (apid != mpsoc::apid::ACK_SUCCESS) { handleAckApidFailure(apid); return RETURN_FAILED; @@ -239,12 +254,17 @@ void PlocMPSoCHelper::handleAckApidFailure(uint16_t apid) { ReturnValue_t PlocMPSoCHelper::handleExe() { ReturnValue_t result = RETURN_OK; - mpsoc::TmPacket tmPacket; - result = handleTmReception(&tmPacket, mpsoc::SIZE_EXE_REPORT); + + result = handleTmReception(mpsoc::SIZE_EXE_REPORT); if (result != RETURN_OK) { return result; } - uint16_t apid = tmPacket.getAPID(); + ploc::SpTmReader tmPacket(tmBuf.data(), tmBuf.size()); + result = checkReceivedTm(tmPacket); + if (result != RETURN_OK) { + return result; + } + uint16_t apid = tmPacket.getApid(); if (apid != mpsoc::apid::EXE_SUCCESS) { handleExeApidFailure(apid); return RETURN_FAILED; @@ -264,12 +284,12 @@ void PlocMPSoCHelper::handleExeApidFailure(uint16_t apid) { } } -ReturnValue_t PlocMPSoCHelper::handleTmReception(mpsoc::TmPacket* tmPacket, size_t remainingBytes) { +ReturnValue_t PlocMPSoCHelper::handleTmReception(size_t remainingBytes) { ReturnValue_t result = RETURN_OK; size_t readBytes = 0; size_t currentBytes = 0; for (int retries = 0; retries < RETRIES; retries++) { - result = receive(tmPacket->getWholeData() + readBytes, ¤tBytes, remainingBytes); + result = receive(tmBuf.data() + readBytes, ¤tBytes, remainingBytes); if (result != RETURN_OK) { return result; } @@ -284,18 +304,30 @@ ReturnValue_t PlocMPSoCHelper::handleTmReception(mpsoc::TmPacket* tmPacket, size triggerEvent(MPSOC_MISSING_EXE, remainingBytes, static_cast(internalState)); return RETURN_FAILED; } - result = tmPacket->checkCrc(); + return result; +} + +ReturnValue_t PlocMPSoCHelper::checkReceivedTm(SpTmReader& reader) { + ReturnValue_t result = reader.checkSize(); + if (result != RETURN_OK) { + sif::error << "PlocMPSoCHelper::handleTmReception: Size check on received TM failed" + << std::endl; + triggerEvent(MPSOC_TM_SIZE_ERROR); + return result; + } + reader.checkCrc(); if (result != RETURN_OK) { sif::warning << "PlocMPSoCHelper::handleTmReception: CRC check failed" << std::endl; + triggerEvent(MPSOC_TM_CRC_MISSMATCH, *sequenceCount); return result; } (*sequenceCount)++; - uint16_t recvSeqCnt = tmPacket->getPacketSequenceCount(); + uint16_t recvSeqCnt = reader.getSequenceCount(); if (recvSeqCnt != *sequenceCount) { triggerEvent(MPSOC_HELPER_SEQ_CNT_MISMATCH, *sequenceCount, recvSeqCnt); *sequenceCount = recvSeqCnt; } - return result; + return RETURN_OK; } ReturnValue_t PlocMPSoCHelper::receive(uint8_t* data, size_t* readBytes, size_t requestBytes) { diff --git a/linux/devices/ploc/PlocMPSoCHelper.h b/linux/devices/ploc/PlocMPSoCHelper.h index 3c011b6a..eb5b4346 100644 --- a/linux/devices/ploc/PlocMPSoCHelper.h +++ b/linux/devices/ploc/PlocMPSoCHelper.h @@ -67,6 +67,8 @@ class PlocMPSoCHelper : public SystemObject, public ExecutableObjectIF, public H //! P1: Expected sequence count //! P2: Received sequence count static const Event MPSOC_HELPER_SEQ_CNT_MISMATCH = MAKE_EVENT(11, severity::LOW); + static const Event MPSOC_TM_SIZE_ERROR = MAKE_EVENT(12, severity::LOW); + static const Event MPSOC_TM_CRC_MISSMATCH = MAKE_EVENT(13, severity::LOW); PlocMPSoCHelper(object_id_t objectId); virtual ~PlocMPSoCHelper(); @@ -123,6 +125,10 @@ class PlocMPSoCHelper : public SystemObject, public ExecutableObjectIF, public H SdCardManager* sdcMan = nullptr; #endif uint8_t commandBuffer[mpsoc::MAX_COMMAND_SIZE]; + SpacePacketCreator creator; + ploc::SpTcParams spParams = ploc::SpTcParams(creator); + + std::array tmBuf; bool terminate = false; @@ -134,20 +140,21 @@ class PlocMPSoCHelper : public SystemObject, public ExecutableObjectIF, public H // Communication cookie. Must be set by the MPSoC Handler CookieIF* comCookie = nullptr; // Sequence count, must be set by Ploc MPSoC Handler - SourceSequenceCounter* sequenceCount; + SourceSequenceCounter* sequenceCount = nullptr; ReturnValue_t resetHelper(); ReturnValue_t performFlashWrite(); ReturnValue_t flashfopen(); ReturnValue_t flashfclose(); - ReturnValue_t handlePacketTransmission(mpsoc::TcBase& tc); - ReturnValue_t sendCommand(mpsoc::TcBase& tc); + ReturnValue_t handlePacketTransmission(ploc::SpTcBase& tc); + ReturnValue_t sendCommand(ploc::SpTcBase& tc); ReturnValue_t receive(uint8_t* data, size_t* readBytes, size_t requestBytes); ReturnValue_t handleAck(); ReturnValue_t handleExe(); void handleAckApidFailure(uint16_t apid); void handleExeApidFailure(uint16_t apid); - ReturnValue_t handleTmReception(mpsoc::TmPacket* tmPacket, size_t remainingBytes); + ReturnValue_t handleTmReception(size_t remainingBytes); + ReturnValue_t checkReceivedTm(ploc::SpTmReader& reader); }; #endif /* BSP_Q7S_DEVICES_PLOCMPSOCHELPER_H_ */ diff --git a/linux/devices/ploc/PlocMemoryDumper.h b/linux/devices/ploc/PlocMemoryDumper.h index 559e7ec8..a1b4f8de 100644 --- a/linux/devices/ploc/PlocMemoryDumper.h +++ b/linux/devices/ploc/PlocMemoryDumper.h @@ -13,7 +13,6 @@ #include "fsfw/objectmanager/SystemObject.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h" #include "fsfw/tasks/ExecutableObjectIF.h" -#include "fsfw/tmtcpacket/SpacePacket.h" #include "linux/fsfwconfig/objects/systemObjectList.h" /** diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 7d38d0c2..040fa1de 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -1,5 +1,7 @@ #include "PlocSupervisorHandler.h" +#include + #include #include #include @@ -28,6 +30,11 @@ PlocSupervisorHandler::PlocSupervisorHandler(object_id_t objectId, object_id_t u if (comCookie == NULL) { sif::error << "PlocSupervisorHandler: Invalid com cookie" << std::endl; } + if (supvHelper == nullptr) { + sif::error << "PlocSupervisorHandler: Invalid PlocSupvHelper object" << std::endl; + } + spParams.buf = commandBuffer; + spParams.maxSize = sizeof(commandBuffer); eventQueue = QueueFactory::instance()->createMessageQueue(EventMessage::EVENT_MESSAGE_SIZE * 5); } @@ -99,19 +106,22 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId, return SupvReturnValuesIF::SUPV_HELPER_EXECUTING; } + result = acceptExternalDeviceCommands(); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + switch (actionId) { case PERFORM_UPDATE: { if (size > config::MAX_PATH_SIZE + config::MAX_FILENAME_SIZE) { return SupvReturnValuesIF::FILENAME_TOO_LONG; } - std::string file = ""; - uint8_t memoryId = 0; - uint32_t startAddress = 0; - result = extractUpdateCommand(data, size, &file, &memoryId, &startAddress); + UpdateParams params; + result = extractUpdateCommand(data, size, params); if (result != RETURN_OK) { return result; } - result = supvHelper->startUpdate(file, memoryId, startAddress); + result = supvHelper->performUpdate(params); if (result != RETURN_OK) { return result; } @@ -123,6 +133,19 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId, plocSupvHelperExecuting = true; return EXECUTION_FINISHED; } + case MEMORY_CHECK_WITH_FILE: { + UpdateParams params; + ReturnValue_t result = extractBaseParams(&data, size, params); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + if (not std::filesystem::exists(params.file)) { + return HasFileSystemIF::FILE_DOES_NOT_EXIST; + } + supvHelper->performMemCheck(params.file, params.memId, params.startAddr); + plocSupvHelperExecuting = true; + return EXECUTION_FINISHED; + } case LOGGING_REQUEST_EVENT_BUFFERS: { if (size > config::MAX_PATH_SIZE) { return SupvReturnValuesIF::FILENAME_TOO_LONG; @@ -154,6 +177,7 @@ void PlocSupervisorHandler::doStartUp() { uartIsolatorSwitch.pullHigh(); startupState = StartupState::SET_TIME; } + break; } case StartupState::SET_TIME_EXECUTING: break; @@ -194,6 +218,7 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d size_t commandDataLen) { using namespace supv; ReturnValue_t result = RETURN_FAILED; + spParams.buf = commandBuffer; switch (deviceCommand) { case GET_HK_REPORT: { prepareEmptyCmd(APID_GET_HK_REPORT); @@ -314,21 +339,30 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d break; } case FACTORY_RESET_CLEAR_ALL: { - FactoryReset packet(FactoryReset::Op::CLEAR_ALL); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); - result = RETURN_OK; + FactoryReset packet(spParams); + result = packet.buildPacket(FactoryReset::Op::CLEAR_ALL); + if (result != RETURN_OK) { + break; + } + finishTcPrep(packet.getFullPacketLen()); break; } case FACTORY_RESET_CLEAR_MIRROR: { - FactoryReset packet(FactoryReset::Op::MIRROR_ENTRIES); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); - result = RETURN_OK; + FactoryReset packet(spParams); + result = packet.buildPacket(FactoryReset::Op::MIRROR_ENTRIES); + if (result != RETURN_OK) { + break; + } + finishTcPrep(packet.getFullPacketLen()); break; } case FACTORY_RESET_CLEAR_CIRCULAR: { - FactoryReset packet(FactoryReset::Op::CIRCULAR_ENTRIES); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); - result = RETURN_OK; + FactoryReset packet(spParams); + result = packet.buildPacket(FactoryReset::Op::CIRCULAR_ENTRIES); + if (result != RETURN_OK) { + break; + } + finishTcPrep(packet.getFullPacketLen()); break; } case START_MPSOC_QUIET: { @@ -347,34 +381,49 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d break; } case ENABLE_AUTO_TM: { - EnableAutoTm packet; - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); - result = RETURN_OK; + EnableAutoTm packet(spParams); + result = packet.buildPacket(); + if (result != RETURN_OK) { + break; + } + finishTcPrep(packet.getFullPacketLen()); break; } case DISABLE_AUTO_TM: { - DisableAutoTm packet; - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); - result = RETURN_OK; + DisableAutoTm packet(spParams); + result = packet.buildPacket(); + if (result != RETURN_OK) { + break; + } + finishTcPrep(packet.getFullPacketLen()); break; } case LOGGING_REQUEST_COUNTERS: { - RequestLoggingData packet(RequestLoggingData::Sa::REQUEST_COUNTERS); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); - result = RETURN_OK; + RequestLoggingData packet(spParams); + result = packet.buildPacket(RequestLoggingData::Sa::REQUEST_COUNTERS); + if (result != RETURN_OK) { + break; + } + finishTcPrep(packet.getFullPacketLen()); break; } case LOGGING_CLEAR_COUNTERS: { - RequestLoggingData packet(RequestLoggingData::Sa::CLEAR_COUNTERS); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); - result = RETURN_OK; + RequestLoggingData packet(spParams); + result = packet.buildPacket(RequestLoggingData::Sa::CLEAR_COUNTERS); + if (result != RETURN_OK) { + break; + } + finishTcPrep(packet.getFullPacketLen()); break; } case LOGGING_SET_TOPIC: { uint8_t tpc = *(commandData); - RequestLoggingData packet(RequestLoggingData::Sa::SET_LOGGING_TOPIC, tpc); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); - result = RETURN_OK; + RequestLoggingData packet(spParams); + result = packet.buildPacket(RequestLoggingData::Sa::SET_LOGGING_TOPIC, tpc); + if (result != RETURN_OK) { + break; + } + finishTcPrep(packet.getFullPacketLen()); break; } case RESET_PL: { @@ -827,7 +876,9 @@ void PlocSupervisorHandler::handleEvent(EventMessage* eventMessage) { if (event == PlocSupvHelper::SUPV_UPDATE_FAILED || event == PlocSupvHelper::SUPV_UPDATE_SUCCESSFUL || event == PlocSupvHelper::SUPV_CONTINUE_UPDATE_FAILED || - event == PlocSupvHelper::SUPV_CONTINUE_UPDATE_SUCCESSFUL) { + event == PlocSupvHelper::SUPV_CONTINUE_UPDATE_SUCCESSFUL || + event == PlocSupvHelper::SUPV_MEM_CHECK_FAIL || + event == PlocSupvHelper::SUPV_MEM_CHECK_OK) { result = this->executeAction(supv::SHUTDOWN_MPSOC, NO_COMMANDER, nullptr, 0); if (result != RETURN_OK) { triggerEvent(SUPV_MPSOC_SHUWDOWN_BUILD_FAILED); @@ -862,9 +913,7 @@ void PlocSupervisorHandler::setExecutionTimeout(DeviceCommandId_t command) { } ReturnValue_t PlocSupervisorHandler::verifyPacket(const uint8_t* start, size_t foundLen) { - uint16_t receivedCrc = *(start + foundLen - 2) << 8 | *(start + foundLen - 1); - uint16_t recalculatedCrc = CRC::crc16ccitt(start, foundLen - 2); - if (receivedCrc != recalculatedCrc) { + if (CRC::crc16ccitt(start, foundLen) != 0) { return SupvReturnValuesIF::CRC_FAILURE; } return RETURN_OK; @@ -874,8 +923,11 @@ ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) { using namespace supv; ReturnValue_t result = RETURN_OK; - AcknowledgmentReport ack; - ack.addWholeData(data, SIZE_ACK_REPORT); + AcknowledgmentReport ack(data, SIZE_ACK_REPORT); + result = ack.checkSize(); + if (result != RETURN_OK) { + return result; + } result = ack.checkCrc(); if (result != RETURN_OK) { @@ -928,8 +980,11 @@ ReturnValue_t PlocSupervisorHandler::handleExecutionReport(const uint8_t* data) using namespace supv; ReturnValue_t result = RETURN_OK; - ExecutionReport exe; - exe.addWholeData(data, SIZE_EXE_REPORT); + ExecutionReport exe(data, SIZE_EXE_REPORT); + result = exe.checkSize(); + if (result != RETURN_OK) { + return result; + } result = exe.checkCrc(); if (result != RETURN_OK) { @@ -1009,6 +1064,7 @@ ReturnValue_t PlocSupervisorHandler::handleHkReport(const uint8_t* data) { offset += 1; nextReplyId = supv::EXE_REPORT; + hkset.setValidity(true, true); #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PLOC_SUPERVISOR == 1 sif::info << "PlocSupervisorHandler::handleHkReport: temp_ps: " << hkset.tempPs << std::endl; @@ -1071,6 +1127,7 @@ ReturnValue_t PlocSupervisorHandler::handleBootStatusReport(const uint8_t* data) bootStatusReport.bootCycles = *(data + offset); nextReplyId = supv::EXE_REPORT; + bootStatusReport.setValidity(true, true); #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PLOC_SUPERVISOR == 1 sif::info << "PlocSupervisorHandler::handleBootStatusReport: SoC State (0 - off, 1 - booting, 2 " @@ -1354,15 +1411,25 @@ void PlocSupervisorHandler::handleDeviceTM(const uint8_t* data, size_t dataSize, } } -void PlocSupervisorHandler::prepareEmptyCmd(uint16_t apid) { - supv::ApidOnlyPacket packet(apid); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); +ReturnValue_t PlocSupervisorHandler::prepareEmptyCmd(uint16_t apid) { + supv::ApidOnlyPacket packet(spParams, apid); + ReturnValue_t result = packet.buildPacket(); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); + return RETURN_OK; } -void PlocSupervisorHandler::prepareSelBootImageCmd(const uint8_t* commandData) { - supv::MPSoCBootSelect packet(*commandData, *(commandData + 1), *(commandData + 2), - *(commandData + 3)); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); +ReturnValue_t PlocSupervisorHandler::prepareSelBootImageCmd(const uint8_t* commandData) { + supv::MPSoCBootSelect packet(spParams); + ReturnValue_t result = + packet.buildPacket(*commandData, *(commandData + 1), *(commandData + 2), *(commandData + 3)); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); + return RETURN_OK; } ReturnValue_t PlocSupervisorHandler::prepareSetTimeRefCmd() { @@ -1373,27 +1440,46 @@ ReturnValue_t PlocSupervisorHandler::prepareSetTimeRefCmd() { << std::endl; return SupvReturnValuesIF::GET_TIME_FAILURE; } - supv::SetTimeRef packet(&time); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + supv::SetTimeRef packet(spParams); + result = packet.buildPacket(&time); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); return RETURN_OK; } -void PlocSupervisorHandler::prepareDisableHk() { - supv::DisablePeriodicHkTransmission packet; - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); +ReturnValue_t PlocSupervisorHandler::prepareDisableHk() { + supv::DisablePeriodicHkTransmission packet(spParams); + ReturnValue_t result = packet.buildPacket(); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); + return RETURN_OK; } -void PlocSupervisorHandler::prepareSetBootTimeoutCmd(const uint8_t* commandData) { +ReturnValue_t PlocSupervisorHandler::prepareSetBootTimeoutCmd(const uint8_t* commandData) { + supv::SetBootTimeout packet(spParams); uint32_t timeout = *(commandData) << 24 | *(commandData + 1) << 16 | *(commandData + 2) << 8 | *(commandData + 3); - supv::SetBootTimeout packet(timeout); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + ReturnValue_t result = packet.buildPacket(timeout); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); + return RETURN_OK; } -void PlocSupervisorHandler::prepareRestartTriesCmd(const uint8_t* commandData) { +ReturnValue_t PlocSupervisorHandler::prepareRestartTriesCmd(const uint8_t* commandData) { uint8_t restartTries = *(commandData); - supv::SetRestartTries packet(restartTries); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + supv::SetRestartTries packet(spParams); + ReturnValue_t result = packet.buildPacket(restartTries); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); + return RETURN_OK; } ReturnValue_t PlocSupervisorHandler::prepareLatchupConfigCmd(const uint8_t* commandData, @@ -1405,13 +1491,21 @@ ReturnValue_t PlocSupervisorHandler::prepareLatchupConfigCmd(const uint8_t* comm } switch (deviceCommand) { case (supv::ENABLE_LATCHUP_ALERT): { - supv::LatchupAlert packet(true, latchupId); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + supv::LatchupAlert packet(spParams); + result = packet.buildPacket(true, latchupId); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); break; } case (supv::DISABLE_LATCHUP_ALERT): { - supv::LatchupAlert packet(false, latchupId); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + supv::LatchupAlert packet(spParams); + result = packet.buildPacket(false, latchupId); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); break; } default: { @@ -1433,31 +1527,50 @@ ReturnValue_t PlocSupervisorHandler::prepareSetAlertLimitCmd(const uint8_t* comm if (latchupId > 6) { return SupvReturnValuesIF::INVALID_LATCHUP_ID; } - supv::SetAlertlimit packet(latchupId, dutycycle); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + supv::SetAlertlimit packet(spParams); + ReturnValue_t result = packet.buildPacket(latchupId, dutycycle); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); return RETURN_OK; } -void PlocSupervisorHandler::prepareSetAdcEnabledChannelsCmd(const uint8_t* commandData) { +ReturnValue_t PlocSupervisorHandler::prepareSetAdcEnabledChannelsCmd(const uint8_t* commandData) { uint16_t ch = *(commandData) << 8 | *(commandData + 1); - supv::SetAdcEnabledChannels packet(ch); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + supv::SetAdcEnabledChannels packet(spParams); + ReturnValue_t result = packet.buildPacket(ch); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); + return RETURN_OK; } -void PlocSupervisorHandler::prepareSetAdcWindowAndStrideCmd(const uint8_t* commandData) { +ReturnValue_t PlocSupervisorHandler::prepareSetAdcWindowAndStrideCmd(const uint8_t* commandData) { uint8_t offset = 0; uint16_t windowSize = *(commandData + offset) << 8 | *(commandData + offset + 1); offset += 2; uint16_t stridingStepSize = *(commandData + offset) << 8 | *(commandData + offset + 1); - supv::SetAdcWindowAndStride packet(windowSize, stridingStepSize); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + supv::SetAdcWindowAndStride packet(spParams); + ReturnValue_t result = packet.buildPacket(windowSize, stridingStepSize); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); + return RETURN_OK; } -void PlocSupervisorHandler::prepareSetAdcThresholdCmd(const uint8_t* commandData) { +ReturnValue_t PlocSupervisorHandler::prepareSetAdcThresholdCmd(const uint8_t* commandData) { uint32_t threshold = *(commandData) << 24 | *(commandData + 1) << 16 | *(commandData + 2) << 8 | *(commandData + 3); - supv::SetAdcThreshold packet(threshold); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + supv::SetAdcThreshold packet(spParams); + ReturnValue_t result = packet.buildPacket(threshold); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); + return RETURN_OK; } ReturnValue_t PlocSupervisorHandler::prepareRunAutoEmTest(const uint8_t* commandData) { @@ -1465,8 +1578,12 @@ ReturnValue_t PlocSupervisorHandler::prepareRunAutoEmTest(const uint8_t* command if (test != 1 && test != 2) { return SupvReturnValuesIF::INVALID_TEST_PARAM; } - supv::RunAutoEmTests packet(test); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + supv::RunAutoEmTests packet(spParams); + ReturnValue_t result = packet.buildPacket(test); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); return RETURN_OK; } @@ -1479,8 +1596,12 @@ ReturnValue_t PlocSupervisorHandler::prepareWipeMramCmd(const uint8_t* commandDa if ((stop - start) <= 0) { return SupvReturnValuesIF::INVALID_MRAM_ADDRESSES; } - supv::MramCmd packet(start, stop, supv::MramCmd::MramAction::WIPE); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + supv::MramCmd packet(spParams); + ReturnValue_t result = packet.buildPacket(start, stop, supv::MramCmd::MramAction::WIPE); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); return RETURN_OK; } @@ -1490,42 +1611,56 @@ ReturnValue_t PlocSupervisorHandler::prepareDumpMramCmd(const uint8_t* commandDa size_t size = sizeof(start) + sizeof(stop); SerializeAdapter::deSerialize(&start, &commandData, &size, SerializeIF::Endianness::BIG); SerializeAdapter::deSerialize(&stop, &commandData, &size, SerializeIF::Endianness::BIG); - supv::MramCmd packet(start, stop, supv::MramCmd::MramAction::DUMP); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); if ((stop - start) <= 0) { return SupvReturnValuesIF::INVALID_MRAM_ADDRESSES; } + supv::MramCmd packet(spParams); + ReturnValue_t result = packet.buildPacket(start, stop, supv::MramCmd::MramAction::DUMP); + if (result != RETURN_OK) { + return result; + } expectedMramDumpPackets = (stop - start) / supv::MAX_DATA_CAPACITY; if ((stop - start) % supv::MAX_DATA_CAPACITY) { expectedMramDumpPackets++; } receivedMramDumpPackets = 0; + + finishTcPrep(packet.getFullPacketLen()); return RETURN_OK; } -void PlocSupervisorHandler::prepareSetGpioCmd(const uint8_t* commandData) { +ReturnValue_t PlocSupervisorHandler::prepareSetGpioCmd(const uint8_t* commandData) { uint8_t port = *commandData; uint8_t pin = *(commandData + 1); uint8_t val = *(commandData + 2); - supv::SetGpio packet(port, pin, val); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + supv::SetGpio packet(spParams); + ReturnValue_t result = packet.buildPacket(port, pin, val); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); + return RETURN_OK; } -void PlocSupervisorHandler::prepareReadGpioCmd(const uint8_t* commandData) { +ReturnValue_t PlocSupervisorHandler::prepareReadGpioCmd(const uint8_t* commandData) { uint8_t port = *commandData; uint8_t pin = *(commandData + 1); - supv::ReadGpio packet(port, pin); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + supv::ReadGpio packet(spParams); + ReturnValue_t result = packet.buildPacket(port, pin); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); + return RETURN_OK; } -void PlocSupervisorHandler::packetToOutBuffer(uint8_t* packetData, size_t fullSize) { - memcpy(commandBuffer, packetData, fullSize); - rawPacket = commandBuffer; - rawPacketLen = fullSize; +void PlocSupervisorHandler::finishTcPrep(size_t packetLen) { nextReplyId = supv::ACK_REPORT; + rawPacket = commandBuffer; + rawPacketLen = packetLen; } -void PlocSupervisorHandler::prepareSetShutdownTimeoutCmd(const uint8_t* commandData) { +ReturnValue_t PlocSupervisorHandler::prepareSetShutdownTimeoutCmd(const uint8_t* commandData) { uint32_t timeout = 0; ReturnValue_t result = RETURN_OK; size_t size = sizeof(timeout); @@ -1536,8 +1671,13 @@ void PlocSupervisorHandler::prepareSetShutdownTimeoutCmd(const uint8_t* commandD << "PlocSupervisorHandler::prepareSetShutdownTimeoutCmd: Failed to deserialize timeout" << std::endl; } - supv::SetShutdownTimeout packet(timeout); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + supv::SetShutdownTimeout packet(spParams); + result = packet.buildPacket(timeout); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); + return RETURN_OK; } ReturnValue_t PlocSupervisorHandler::prepareLoggingRequest(const uint8_t* commandData, @@ -1545,8 +1685,12 @@ ReturnValue_t PlocSupervisorHandler::prepareLoggingRequest(const uint8_t* comman using namespace supv; RequestLoggingData::Sa sa = static_cast(*commandData); uint8_t tpc = *(commandData + 1); - RequestLoggingData packet(sa, tpc); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + RequestLoggingData packet(spParams); + ReturnValue_t result = packet.buildPacket(sa, tpc); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); return RETURN_OK; } @@ -1554,8 +1698,12 @@ ReturnValue_t PlocSupervisorHandler::prepareEnableNvmsCommand(const uint8_t* com using namespace supv; uint8_t nvm01 = *(commandData); uint8_t nvm3 = *(commandData + 1); - EnableNvms packet(nvm01, nvm3); - packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); + EnableNvms packet(spParams); + ReturnValue_t result = packet.buildPacket(nvm01, nvm3); + if (result != RETURN_OK) { + return result; + } + finishTcPrep(packet.getFullPacketLen()); return RETURN_OK; } @@ -1743,8 +1891,8 @@ void PlocSupervisorHandler::increaseExpectedMramReplies(DeviceCommandId_t id) { return; } uint8_t sequenceFlags = spacePacketBuffer[2] >> 6; - if (sequenceFlags != static_cast(supv::SequenceFlags::LAST_PKT) && - (sequenceFlags != static_cast(supv::SequenceFlags::STANDALONE_PKT))) { + if (sequenceFlags != static_cast(ccsds::SequenceFlags::LAST_SEGMENT) && + (sequenceFlags != static_cast(ccsds::SequenceFlags::UNSEGMENTED))) { // Command expects at least one MRAM packet more and the execution report info->expectedReplies = 2; mramReplyInfo->countdown->resetTimer(); @@ -1770,8 +1918,8 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpFile(DeviceCommandId_t id) { uint16_t packetLen = readSpacePacketLength(spacePacketBuffer); uint8_t sequenceFlags = readSequenceFlags(spacePacketBuffer); if (id == supv::FIRST_MRAM_DUMP) { - if (sequenceFlags == static_cast(supv::SequenceFlags::FIRST_PKT) || - (sequenceFlags == static_cast(supv::SequenceFlags::STANDALONE_PKT))) { + if (sequenceFlags == static_cast(ccsds::SequenceFlags::FIRST_SEGMENT) || + (sequenceFlags == static_cast(ccsds::SequenceFlags::UNSEGMENTED))) { result = createMramDumpFile(); if (result != RETURN_OK) { return result; @@ -1843,34 +1991,78 @@ ReturnValue_t PlocSupervisorHandler::getTimeStampString(std::string& timeStamp) } ReturnValue_t PlocSupervisorHandler::extractUpdateCommand(const uint8_t* commandData, size_t size, - std::string* file, uint8_t* memoryId, - uint32_t* startAddress) { - ReturnValue_t result = RETURN_OK; - if (size > (config::MAX_FILENAME_SIZE + config::MAX_PATH_SIZE + sizeof(*memoryId)) + - sizeof(*startAddress)) { + supv::UpdateParams& params) { + size_t remSize = size; + if (size > (config::MAX_FILENAME_SIZE + config::MAX_PATH_SIZE + sizeof(params.memId)) + + sizeof(params.startAddr) + sizeof(params.bytesWritten) + sizeof(params.seqCount) + + sizeof(uint8_t)) { sif::warning << "PlocSupervisorHandler::extractUpdateCommand: Data size too big" << std::endl; return SupvReturnValuesIF::INVALID_LENGTH; } - *file = std::string(reinterpret_cast(commandData)); - if (file->size() > (config::MAX_FILENAME_SIZE + config::MAX_PATH_SIZE)) { - sif::warning << "PlocSupervisorHandler::extractUpdateCommand: Filename too long" << std::endl; - return SupvReturnValuesIF::FILENAME_TOO_LONG; + ReturnValue_t result = RETURN_OK; + result = extractBaseParams(&commandData, size, params); + result = SerializeAdapter::deSerialize(¶ms.bytesWritten, &commandData, &remSize, + SerializeIF::Endianness::BIG); + if (result != RETURN_OK) { + sif::warning << "PlocSupervisorHandler::extractUpdateCommand: Failed to deserialize bytes " + "already written" + << std::endl; + return result; } - *memoryId = *(commandData + file->size() + SIZE_NULL_TERMINATOR); - const uint8_t* startAddressPtr = - commandData + file->size() + SIZE_NULL_TERMINATOR + sizeof(*memoryId); - size_t remainingSize = 4; - result = SerializeAdapter::deSerialize(startAddress, startAddressPtr, &remainingSize, + result = SerializeAdapter::deSerialize(¶ms.seqCount, &commandData, &remSize, SerializeIF::Endianness::BIG); if (result != RETURN_OK) { sif::warning - << "PlocSupervisorHandler::extractUpdateCommand: Failed to deserialize start address" + << "PlocSupervisorHandler::extractUpdateCommand: Failed to deserialize start sequence count" << std::endl; return result; } + uint8_t delMemRaw = 0; + result = SerializeAdapter::deSerialize(&delMemRaw, &commandData, &remSize, + SerializeIF::Endianness::BIG); + if (result != RETURN_OK) { + sif::warning + << "PlocSupervisorHandler::extractUpdateCommand: Failed to deserialize whether to delete " + "memory" + << std::endl; + return result; + } + params.deleteMemory = delMemRaw; return RETURN_OK; } +ReturnValue_t PlocSupervisorHandler::extractBaseParams(const uint8_t** commandData, size_t& remSize, + supv::UpdateParams& params) { + bool nullTermFound = false; + for (size_t idx = 0; idx < remSize; idx++) { + if ((*commandData)[idx] == '\0') { + nullTermFound = true; + break; + } + } + if (not nullTermFound) { + return HasReturnvaluesIF::RETURN_FAILED; + } + params.file = std::string(reinterpret_cast(*commandData)); + if (params.file.size() > (config::MAX_FILENAME_SIZE + config::MAX_PATH_SIZE)) { + sif::warning << "PlocSupervisorHandler::extractUpdateCommand: Filename too long" << std::endl; + return SupvReturnValuesIF::FILENAME_TOO_LONG; + } + *commandData += params.file.size() + SIZE_NULL_TERMINATOR; + remSize -= (params.file.size() + SIZE_NULL_TERMINATOR); + params.memId = **commandData; + *commandData += 1; + remSize -= 1; + ReturnValue_t result = SerializeAdapter::deSerialize(¶ms.startAddr, commandData, &remSize, + SerializeIF::Endianness::BIG); + if (result != RETURN_OK) { + sif::warning << "PlocSupervisorHandler::extractBaseParams: Failed to deserialize start address" + << std::endl; + return result; + } + return result; +} + ReturnValue_t PlocSupervisorHandler::eventSubscription() { ReturnValue_t result = RETURN_OK; EventManagerIF* manager = ObjectManager::instance()->get(objects::EVENT_MANAGER); @@ -1885,9 +2077,9 @@ ReturnValue_t PlocSupervisorHandler::eventSubscription() { if (result != RETURN_OK) { return result; } - result = manager->subscribeToEventRange( - eventQueue->getId(), event::getEventId(PlocSupvHelper::SUPV_UPDATE_FAILED), - event::getEventId(PlocSupvHelper::SUPV_EVENT_BUFFER_REQUEST_TERMINATED)); + result = manager->subscribeToEventRange(eventQueue->getId(), + event::getEventId(PlocSupvHelper::SUPV_UPDATE_FAILED), + event::getEventId(PlocSupvHelper::SUPV_MEM_CHECK_FAIL)); if (result != RETURN_OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "PlocSupervisorHandler::eventSubscritpion: Failed to subscribe to events from " @@ -1899,24 +2091,30 @@ ReturnValue_t PlocSupervisorHandler::eventSubscription() { return result; } -void PlocSupervisorHandler::handleExecutionSuccessReport(const uint8_t* data) { +ReturnValue_t PlocSupervisorHandler::handleExecutionSuccessReport(const uint8_t* data) { DeviceCommandId_t commandId = getPendingCommand(); switch (commandId) { case supv::READ_GPIO: { - supv::ExecutionReport exe; - exe.addWholeData(data, supv::SIZE_EXE_REPORT); + supv::ExecutionReport exe(data, supv::SIZE_EXE_REPORT); + if (exe.isNull()) { + return RETURN_FAILED; + } + ReturnValue_t result = exe.checkSize(); + if (result != RETURN_OK) { + return result; + } uint16_t gpioState = exe.getStatusCode(); #if OBSW_DEBUG_PLOC_SUPERVISOR == 1 sif::info << "PlocSupervisorHandler: Read GPIO TM, State: " << gpioState << std::endl; #endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */ DeviceCommandMap::iterator iter = deviceCommandMap.find(commandId); if (iter->second.sendReplyTo == NO_COMMAND_ID) { - return; + return RETURN_OK; } uint8_t data[sizeof(gpioState)]; size_t size = 0; - ReturnValue_t result = SerializeAdapter::serialize(&gpioState, data, &size, sizeof(gpioState), - SerializeIF::Endianness::BIG); + result = SerializeAdapter::serialize(&gpioState, data, &size, sizeof(gpioState), + SerializeIF::Endianness::BIG); if (result != RETURN_OK) { sif::debug << "PlocSupervisorHandler: Failed to deserialize GPIO state" << std::endl; } @@ -1935,6 +2133,7 @@ void PlocSupervisorHandler::handleExecutionSuccessReport(const uint8_t* data) { default: break; } + return RETURN_OK; } void PlocSupervisorHandler::handleExecutionFailureReport(uint16_t statusCode) { diff --git a/linux/devices/ploc/PlocSupervisorHandler.h b/linux/devices/ploc/PlocSupervisorHandler.h index 9946a1d5..bd4b0b9c 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.h +++ b/linux/devices/ploc/PlocSupervisorHandler.h @@ -100,6 +100,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase { StartupState startupState = StartupState::OFF; uint8_t commandBuffer[supv::MAX_COMMAND_SIZE]; + SpacePacketCreator creator; + ploc::SpTcParams spParams = ploc::SpTcParams(creator); /** * This variable is used to store the id of the next reply to receive. This is necessary @@ -233,14 +235,14 @@ class PlocSupervisorHandler : public DeviceHandlerBase { * @brief This function prepares a space packet which does not transport any data in the * packet data field apart from the crc. */ - void prepareEmptyCmd(uint16_t apid); + ReturnValue_t prepareEmptyCmd(uint16_t apid); /** * @brief This function initializes the space packet to select the boot image of the MPSoC. */ - void prepareSelBootImageCmd(const uint8_t* commandData); + ReturnValue_t prepareSelBootImageCmd(const uint8_t* commandData); - void prepareDisableHk(); + ReturnValue_t prepareDisableHk(); /** * @brief This function fills the commandBuffer with the data to update the time of the @@ -252,9 +254,9 @@ class PlocSupervisorHandler : public DeviceHandlerBase { * @brief This function fills the commandBuffer with the data to change the boot timeout * value in the PLOC supervisor. */ - void prepareSetBootTimeoutCmd(const uint8_t* commandData); + ReturnValue_t prepareSetBootTimeoutCmd(const uint8_t* commandData); - void prepareRestartTriesCmd(const uint8_t* commandData); + ReturnValue_t prepareRestartTriesCmd(const uint8_t* commandData); /** * @brief This function fills the command buffer with the packet to enable or disable the @@ -271,21 +273,21 @@ class PlocSupervisorHandler : public DeviceHandlerBase { ReturnValue_t prepareLatchupConfigCmd(const uint8_t* commandData, DeviceCommandId_t deviceCommand); ReturnValue_t prepareSetAlertLimitCmd(const uint8_t* commandData); - void prepareSetAdcEnabledChannelsCmd(const uint8_t* commandData); - void prepareSetAdcWindowAndStrideCmd(const uint8_t* commandData); - void prepareSetAdcThresholdCmd(const uint8_t* commandData); + ReturnValue_t prepareSetAdcEnabledChannelsCmd(const uint8_t* commandData); + ReturnValue_t prepareSetAdcWindowAndStrideCmd(const uint8_t* commandData); + ReturnValue_t prepareSetAdcThresholdCmd(const uint8_t* commandData); ReturnValue_t prepareRunAutoEmTest(const uint8_t* commandData); ReturnValue_t prepareWipeMramCmd(const uint8_t* commandData); ReturnValue_t prepareDumpMramCmd(const uint8_t* commandData); - void prepareSetGpioCmd(const uint8_t* commandData); - void prepareReadGpioCmd(const uint8_t* commandData); + ReturnValue_t prepareSetGpioCmd(const uint8_t* commandData); + ReturnValue_t prepareReadGpioCmd(const uint8_t* commandData); ReturnValue_t prepareLoggingRequest(const uint8_t* commandData, size_t commandDataLen); ReturnValue_t prepareEnableNvmsCommand(const uint8_t* commandData); /** * @brief Copies the content of a space packet to the command buffer. */ - void packetToOutBuffer(uint8_t* packetData, size_t fullSize); + void finishTcPrep(size_t packetLen); /** * @brief In case an acknowledgment failure reply has been received this function disables @@ -363,13 +365,15 @@ class PlocSupervisorHandler : public DeviceHandlerBase { ReturnValue_t createMramDumpFile(); ReturnValue_t getTimeStampString(std::string& timeStamp); - void prepareSetShutdownTimeoutCmd(const uint8_t* commandData); + ReturnValue_t prepareSetShutdownTimeoutCmd(const uint8_t* commandData); - ReturnValue_t extractUpdateCommand(const uint8_t* commandData, size_t size, std::string* file, - uint8_t* memoryId, uint32_t* startAddress); + ReturnValue_t extractUpdateCommand(const uint8_t* commandData, size_t size, + supv::UpdateParams& params); + ReturnValue_t extractBaseParams(const uint8_t** commandData, size_t& remSize, + supv::UpdateParams& params); ReturnValue_t eventSubscription(); - void handleExecutionSuccessReport(const uint8_t* data); + ReturnValue_t handleExecutionSuccessReport(const uint8_t* data); void handleExecutionFailureReport(uint16_t statusCode); void printAckFailureInfo(uint16_t statusCode, DeviceCommandId_t commandId); diff --git a/linux/devices/ploc/PlocSupvHelper.cpp b/linux/devices/ploc/PlocSupvHelper.cpp index 544a98eb..c6641f6e 100644 --- a/linux/devices/ploc/PlocSupvHelper.cpp +++ b/linux/devices/ploc/PlocSupvHelper.cpp @@ -1,5 +1,8 @@ #include "PlocSupvHelper.h" +#include + +#include #include #include @@ -9,14 +12,16 @@ #include "bsp_q7s/memory/SdCardManager.h" #endif -#include "fsfw/globalfunctions/CRC.h" #include "fsfw/tasks/TaskFactory.h" #include "fsfw/timemanager/Countdown.h" #include "mission/utility/Filenaming.h" #include "mission/utility/ProgressPrinter.h" #include "mission/utility/Timestamp.h" -PlocSupvHelper::PlocSupvHelper(object_id_t objectId) : SystemObject(objectId) {} +PlocSupvHelper::PlocSupvHelper(object_id_t objectId) : SystemObject(objectId) { + spParams.maxSize = sizeof(commandBuffer); + resetSpParams(); +} PlocSupvHelper::~PlocSupvHelper() {} @@ -41,7 +46,7 @@ ReturnValue_t PlocSupvHelper::performOperation(uint8_t operationCode) { break; } case InternalState::UPDATE: { - result = performUpdate(); + result = executeUpdate(); if (result == RETURN_OK) { triggerEvent(SUPV_UPDATE_SUCCESSFUL, result); } else if (result == PROCESS_TERMINATED) { @@ -52,6 +57,11 @@ ReturnValue_t PlocSupvHelper::performOperation(uint8_t operationCode) { internalState = InternalState::IDLE; break; } + case InternalState::CHECK_MEMORY: { + executeFullCheckMemoryCommand(); + internalState = InternalState::IDLE; + break; + } case InternalState::CONTINUE_UPDATE: { result = continueUpdate(); if (result == RETURN_OK) { @@ -97,16 +107,28 @@ void PlocSupvHelper::setComCookie(CookieIF* comCookie_) { comCookie = comCookie_ ReturnValue_t PlocSupvHelper::startUpdate(std::string file, uint8_t memoryId, uint32_t startAddress) { + supv::UpdateParams params; + params.file = file; + params.memId = memoryId; + params.startAddr = startAddress; + params.bytesWritten = 0; + params.seqCount = 1; + params.deleteMemory = true; + return performUpdate(params); +} + +ReturnValue_t PlocSupvHelper::performUpdate(const supv::UpdateParams& params) { ReturnValue_t result = RETURN_OK; #ifdef XIPHOS_Q7S - result = FilesystemHelper::checkPath(file); + result = FilesystemHelper::checkPath(params.file); if (result != RETURN_OK) { - sif::warning << "PlocSupvHelper::startUpdate: File " << file << " does not exist" << std::endl; + sif::warning << "PlocSupvHelper::startUpdate: File " << params.file << " does not exist" + << std::endl; return result; } - result = FilesystemHelper::fileExists(file); + result = FilesystemHelper::fileExists(params.file); if (result != RETURN_OK) { - sif::warning << "PlocSupvHelper::startUpdate: The file " << file << " does not exist" + sif::warning << "PlocSupvHelper::startUpdate: The file " << params.file << " does not exist" << std::endl; return result; } @@ -118,20 +140,47 @@ ReturnValue_t PlocSupvHelper::startUpdate(std::string file, uint8_t memoryId, return RETURN_FAILED; } #endif - update.file = file; - update.length = getFileSize(update.file); - update.memoryId = memoryId; - update.startAddress = startAddress; - update.remainingSize = update.length; - update.bytesWritten = 0; + update.file = params.file; + update.fullFileSize = getFileSize(update.file); + if (params.bytesWritten > update.fullFileSize) { + sif::warning << "Invalid start bytes counter " << params.bytesWritten + << ", smaller than full file length" << update.fullFileSize << std::endl; + return HasReturnvaluesIF::RETURN_FAILED; + } + update.length = update.fullFileSize - params.bytesWritten; + update.memoryId = params.memId; + update.startAddress = params.startAddr; + update.progressPercent = 0; + update.bytesWritten = params.bytesWritten; + update.crcShouldBeChecked = true; update.packetNum = 1; - update.sequenceCount = 1; + update.deleteMemory = params.deleteMemory; + update.sequenceCount = params.seqCount; internalState = InternalState::UPDATE; uartComIF->flushUartTxAndRxBuf(comCookie); semaphore.release(); return result; } +ReturnValue_t PlocSupvHelper::performMemCheck(std::string file, uint8_t memoryId, + uint32_t startAddress) { + update.file = file; + update.fullFileSize = getFileSize(file); + return performMemCheck(memoryId, startAddress, getFileSize(update.file), true); +} + +ReturnValue_t PlocSupvHelper::performMemCheck(uint8_t memoryId, uint32_t startAddress, + size_t sizeToCheck, bool checkCrc) { + update.memoryId = memoryId; + update.startAddress = startAddress; + update.length = sizeToCheck; + update.crcShouldBeChecked = checkCrc; + internalState = InternalState::CHECK_MEMORY; + uartComIF->flushUartTxAndRxBuf(comCookie); + semaphore.release(); + return HasReturnvaluesIF::RETURN_OK; +} + void PlocSupvHelper::initiateUpdateContinuation() { internalState = InternalState::CONTINUE_UPDATE; semaphore.release(); @@ -156,33 +205,62 @@ ReturnValue_t PlocSupvHelper::startEventbBufferRequest(std::string path) { void PlocSupvHelper::stopProcess() { terminate = true; } -ReturnValue_t PlocSupvHelper::performUpdate() { +void PlocSupvHelper::executeFullCheckMemoryCommand() { + ReturnValue_t result; + if (update.crcShouldBeChecked) { + sif::info << "PLOC SUPV Mem Check: Calculating Image CRC" << std::endl; + result = calcImageCrc(); + if (result != RETURN_OK) { + triggerEvent(SUPV_MEM_CHECK_FAIL, result); + return; + } + } + sif::info << "PLOC SUPV Mem Check: Selecting Memory" << std::endl; + result = selectMemory(); + if (result != RETURN_OK) { + triggerEvent(SUPV_MEM_CHECK_FAIL, result); + return; + } + sif::info << "PLOC SUPV Mem Check: Preparing Update" << std::endl; + result = prepareUpdate(); + if (result != RETURN_OK) { + triggerEvent(SUPV_MEM_CHECK_FAIL, result); + return; + } + sif::info << "PLOC SUPV Mem Check: Memory Check" << std::endl; + result = handleCheckMemoryCommand(); + if (result == HasReturnvaluesIF::RETURN_OK) { + triggerEvent(SUPV_MEM_CHECK_OK, result); + } else { + triggerEvent(SUPV_MEM_CHECK_FAIL, result); + } +} + +ReturnValue_t PlocSupvHelper::executeUpdate() { ReturnValue_t result = RETURN_OK; + sif::info << "PLOC SUPV Update MPSoC: Calculating Image CRC" << std::endl; result = calcImageCrc(); if (result != RETURN_OK) { return result; } + sif::info << "PLOC SUPV Update MPSoC: Selecting Memory" << std::endl; result = selectMemory(); if (result != RETURN_OK) { return result; } + sif::info << "PLOC SUPV Update MPSoC: Preparing Update" << std::endl; result = prepareUpdate(); if (result != RETURN_OK) { return result; } - result = eraseMemory(); - if (result != RETURN_OK) { - return result; + if (update.deleteMemory) { + sif::info << "PLOC SUPV Update MPSoC: Erasing Memory" << std::endl; + result = eraseMemory(); + if (result != RETURN_OK) { + return result; + } } - result = writeUpdatePackets(); - if (result != RETURN_OK) { - return result; - } - result = handleCheckMemoryCommand(); - if (result != RETURN_OK) { - return result; - } - return result; + return updateOperation(); } ReturnValue_t PlocSupvHelper::continueUpdate() { @@ -190,40 +268,45 @@ ReturnValue_t PlocSupvHelper::continueUpdate() { if (result != RETURN_OK) { return result; } - result = writeUpdatePackets(); + return updateOperation(); +} + +ReturnValue_t PlocSupvHelper::updateOperation() { + sif::info << "PlocSupvHelper::performUpdate: Writing Update Packets" << std::endl; + auto result = writeUpdatePackets(); if (result != RETURN_OK) { return result; } - result = handleCheckMemoryCommand(); - if (result != RETURN_OK) { - return result; - } - return result; + sif::info << "PlocSupvHelper::performUpdate: Memory Check" << std::endl; + return handleCheckMemoryCommand(); } ReturnValue_t PlocSupvHelper::writeUpdatePackets() { ReturnValue_t result = RETURN_OK; #if OBSW_DEBUG_PLOC_SUPERVISOR == 1 - ProgressPrinter progressPrinter("Supervisor update", update.length, + ProgressPrinter progressPrinter("Supervisor update", update.fullFileSize, ProgressPrinter::HALF_PERCENT); #endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */ - uint8_t tempData[supv::WriteMemory::CHUNK_MAX]; + uint8_t tempData[supv::WriteMemory::CHUNK_MAX + 1]{}; std::ifstream file(update.file, std::ifstream::binary); uint16_t dataLength = 0; - supv::SequenceFlags seqFlags; - while (update.remainingSize > 0) { + ccsds::SequenceFlags seqFlags; + while (update.bytesWritten < update.fullFileSize) { if (terminate) { terminate = false; triggerEvent(TERMINATED_UPDATE_PROCEDURE); return PROCESS_TERMINATED; } - if (update.remainingSize > supv::WriteMemory::CHUNK_MAX) { + size_t remainingSize = update.fullFileSize - update.bytesWritten; + bool lastSegment = false; + if (remainingSize > supv::WriteMemory::CHUNK_MAX) { dataLength = supv::WriteMemory::CHUNK_MAX; } else { - dataLength = static_cast(update.remainingSize); + lastSegment = true; + dataLength = static_cast(remainingSize); } if (file.is_open()) { - file.seekg(update.bytesWritten, file.beg); + file.seekg(update.bytesWritten, std::ios::beg); file.read(reinterpret_cast(tempData), dataLength); if (!file) { sif::warning << "PlocSupvHelper::performUpdate: Read only " << file.gcount() << " of " @@ -235,23 +318,41 @@ ReturnValue_t PlocSupvHelper::writeUpdatePackets() { return FILE_CLOSED_ACCIDENTALLY; } if (update.bytesWritten == 0) { - seqFlags = supv::SequenceFlags::FIRST_PKT; - } else if (update.remainingSize == 0) { - seqFlags = supv::SequenceFlags::LAST_PKT; + seqFlags = ccsds::SequenceFlags::FIRST_SEGMENT; + } else if (lastSegment) { + seqFlags = ccsds::SequenceFlags::LAST_SEGMENT; } else { - seqFlags = supv::SequenceFlags::CONTINUED_PKT; + seqFlags = ccsds::SequenceFlags::CONTINUATION; } - supv::WriteMemory packet(seqFlags, update.sequenceCount++, update.memoryId, - update.startAddress + update.bytesWritten, dataLength, tempData); - result = handlePacketTransmission(packet); + resetSpParams(); + float progress = static_cast(update.bytesWritten) / update.fullFileSize; + uint8_t progPercent = std::floor(progress * 100); + if (progPercent > update.progressPercent) { + update.progressPercent = progPercent; + if (progPercent % 5 == 0) { + // Useful to allow restarting the update + triggerEvent(SUPV_UPDATE_PROGRESS, buildProgParams1(progPercent, update.sequenceCount), + update.bytesWritten); + } + } + supv::WriteMemory packet(spParams); + result = packet.buildPacket(seqFlags, update.sequenceCount, update.memoryId, + update.startAddress + update.bytesWritten, dataLength, tempData); if (result != RETURN_OK) { - update.sequenceCount--; - triggerEvent(WRITE_MEMORY_FAILED, update.packetNum); + triggerEvent(WRITE_MEMORY_FAILED, buildProgParams1(progPercent, update.sequenceCount), + update.bytesWritten); return result; } - update.remainingSize -= dataLength; + result = handlePacketTransmission(packet); + if (result != RETURN_OK) { + triggerEvent(WRITE_MEMORY_FAILED, buildProgParams1(progPercent, update.sequenceCount), + update.bytesWritten); + return result; + } + update.sequenceCount++; update.packetNum += 1; update.bytesWritten += dataLength; + #if OBSW_DEBUG_PLOC_SUPERVISOR == 1 progressPrinter.print(update.bytesWritten); #endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */ @@ -259,10 +360,19 @@ ReturnValue_t PlocSupvHelper::writeUpdatePackets() { return result; } +uint32_t PlocSupvHelper::buildProgParams1(uint8_t percent, uint16_t seqCount) { + return (static_cast(percent) << 24) | static_cast(seqCount); +} + ReturnValue_t PlocSupvHelper::performEventBufferRequest() { using namespace supv; ReturnValue_t result = RETURN_OK; - RequestLoggingData packet(RequestLoggingData::Sa::REQUEST_EVENT_BUFFERS); + resetSpParams(); + RequestLoggingData packet(spParams); + result = packet.buildPacket(RequestLoggingData::Sa::REQUEST_EVENT_BUFFERS); + if (result != RETURN_OK) { + return result; + } result = sendCommand(packet); if (result != RETURN_OK) { return result; @@ -271,20 +381,50 @@ ReturnValue_t PlocSupvHelper::performEventBufferRequest() { if (result != RETURN_OK) { return result; } - result = handleEventBufferReception(); + result = + handleTmReception(ccsds::HEADER_LEN, tmBuf.data(), supv::recv_timeout::UPDATE_STATUS_REPORT); if (result != RETURN_OK) { return result; } - result = handleExe(); - if (result != RETURN_OK) { - return result; + ploc::SpTmReader spReader(tmBuf.data(), tmBuf.size()); + bool exeAlreadyReceived = false; + if (spReader.getApid() == supv::APID_EXE_FAILURE) { + exeAlreadyReceived = true; + result = handleRemainingExeReport(spReader); + } else if (spReader.getApid() == supv::APID_MRAM_DUMP_TM) { + result = handleEventBufferReception(spReader); + } + + if (not exeAlreadyReceived) { + result = handleExe(); + if (result != RETURN_OK) { + return result; + } + } + return result; +} + +ReturnValue_t PlocSupvHelper::handleRemainingExeReport(ploc::SpTmReader& reader) { + size_t remBytes = reader.getPacketDataLen() + 1; + ReturnValue_t result = handleTmReception(remBytes, tmBuf.data() + ccsds::HEADER_LEN); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Reading exe failure report failed" << std::endl; + } + result = exeReportHandling(); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Handling exe report failed" << std::endl; } return result; } ReturnValue_t PlocSupvHelper::selectMemory() { ReturnValue_t result = RETURN_OK; - supv::MPSoCBootSelect packet(update.memoryId); + resetSpParams(); + supv::MPSoCBootSelect packet(spParams); + result = packet.buildPacket(update.memoryId); + if (result != RETURN_OK) { + return result; + } result = handlePacketTransmission(packet); if (result != RETURN_OK) { return result; @@ -294,7 +434,12 @@ ReturnValue_t PlocSupvHelper::selectMemory() { ReturnValue_t PlocSupvHelper::prepareUpdate() { ReturnValue_t result = RETURN_OK; - supv::ApidOnlyPacket packet(supv::APID_PREPARE_UPDATE); + resetSpParams(); + supv::ApidOnlyPacket packet(spParams, supv::APID_PREPARE_UPDATE); + result = packet.buildPacket(); + if (result != RETURN_OK) { + return result; + } result = handlePacketTransmission(packet, PREPARE_UPDATE_EXECUTION_REPORT); if (result != RETURN_OK) { return result; @@ -304,7 +449,13 @@ ReturnValue_t PlocSupvHelper::prepareUpdate() { ReturnValue_t PlocSupvHelper::eraseMemory() { ReturnValue_t result = RETURN_OK; - supv::EraseMemory eraseMemory(update.memoryId, update.startAddress, update.length); + resetSpParams(); + supv::EraseMemory eraseMemory(spParams); + result = eraseMemory.buildPacket(update.memoryId, update.startAddress + update.bytesWritten, + update.length); + if (result != RETURN_OK) { + return result; + } result = handlePacketTransmission(eraseMemory, supv::recv_timeout::ERASE_MEMORY); if (result != RETURN_OK) { return result; @@ -312,7 +463,7 @@ ReturnValue_t PlocSupvHelper::eraseMemory() { return RETURN_OK; } -ReturnValue_t PlocSupvHelper::handlePacketTransmission(SpacePacket& packet, +ReturnValue_t PlocSupvHelper::handlePacketTransmission(ploc::SpTcBase& packet, uint32_t timeoutExecutionReport) { ReturnValue_t result = RETURN_OK; result = sendCommand(packet); @@ -330,10 +481,10 @@ ReturnValue_t PlocSupvHelper::handlePacketTransmission(SpacePacket& packet, return RETURN_OK; } -ReturnValue_t PlocSupvHelper::sendCommand(SpacePacket& packet) { +ReturnValue_t PlocSupvHelper::sendCommand(ploc::SpTcBase& packet) { ReturnValue_t result = RETURN_OK; - rememberApid = packet.getAPID(); - result = uartComIF->sendMessage(comCookie, packet.getWholeData(), packet.getFullSize()); + rememberApid = packet.getApid(); + result = uartComIF->sendMessage(comCookie, packet.getFullPacket(), packet.getFullPacketLen()); if (result != RETURN_OK) { sif::warning << "PlocSupvHelper::sendCommand: Failed to send command" << std::endl; triggerEvent(SUPV_SENDING_COMMAND_FAILED, result, static_cast(internalState)); @@ -344,14 +495,19 @@ ReturnValue_t PlocSupvHelper::sendCommand(SpacePacket& packet) { ReturnValue_t PlocSupvHelper::handleAck() { ReturnValue_t result = RETURN_OK; - supv::AcknowledgmentReport ackReport; - result = handleTmReception(&ackReport, supv::SIZE_ACK_REPORT); + + result = handleTmReception(supv::SIZE_ACK_REPORT); if (result != RETURN_OK) { triggerEvent(ACK_RECEPTION_FAILURE, result, static_cast(rememberApid)); sif::warning << "PlocSupvHelper::handleAck: Error in reception of acknowledgment report" << std::endl; return result; } + supv::AcknowledgmentReport ackReport(tmBuf.data(), tmBuf.size()); + result = checkReceivedTm(ackReport); + if (result != RETURN_OK) { + return result; + } result = ackReport.checkApid(); if (result != RETURN_OK) { if (result == SupvReturnValuesIF::RECEIVED_ACK_FAILURE) { @@ -366,14 +522,25 @@ ReturnValue_t PlocSupvHelper::handleAck() { ReturnValue_t PlocSupvHelper::handleExe(uint32_t timeout) { ReturnValue_t result = RETURN_OK; - supv::ExecutionReport exeReport; - result = handleTmReception(&exeReport, supv::SIZE_EXE_REPORT, timeout); + + result = handleTmReception(supv::SIZE_EXE_REPORT, tmBuf.data(), timeout); if (result != RETURN_OK) { triggerEvent(EXE_RECEPTION_FAILURE, result, static_cast(rememberApid)); sif::warning << "PlocSupvHelper::handleExe: Error in reception of execution report" << std::endl; return result; } + + return exeReportHandling(); +} + +ReturnValue_t PlocSupvHelper::exeReportHandling() { + supv::ExecutionReport exeReport(tmBuf.data(), tmBuf.size()); + + ReturnValue_t result = checkReceivedTm(exeReport); + if (result != RETURN_OK) { + return result; + } result = exeReport.checkApid(); if (result != RETURN_OK) { if (result == SupvReturnValuesIF::RECEIVED_EXE_FAILURE) { @@ -383,17 +550,20 @@ ReturnValue_t PlocSupvHelper::handleExe(uint32_t timeout) { } return result; } - return RETURN_OK; + return result; } -ReturnValue_t PlocSupvHelper::handleTmReception(supv::TmPacket* tmPacket, size_t remainingBytes, +ReturnValue_t PlocSupvHelper::handleTmReception(size_t remainingBytes, uint8_t* readBuf, uint32_t timeout) { ReturnValue_t result = RETURN_OK; size_t readBytes = 0; size_t currentBytes = 0; Countdown countdown(timeout); + if (readBuf == nullptr) { + readBuf = tmBuf.data(); + } while (!countdown.hasTimedOut()) { - result = receive(tmPacket->getWholeData() + readBytes, ¤tBytes, remainingBytes); + result = receive(readBuf + readBytes, ¤tBytes, remainingBytes); if (result != RETURN_OK) { return result; } @@ -405,12 +575,21 @@ ReturnValue_t PlocSupvHelper::handleTmReception(supv::TmPacket* tmPacket, size_t } if (remainingBytes != 0) { sif::warning << "PlocSupvHelper::handleTmReception: Failed to read " << std::dec - << remainingBytes << " bytes" << std::endl; + << remainingBytes << " remaining bytes" << std::endl; return RETURN_FAILED; } - result = tmPacket->checkCrc(); + return result; +} + +ReturnValue_t PlocSupvHelper::checkReceivedTm(ploc::SpTmReader& reader) { + ReturnValue_t result = reader.checkSize(); if (result != RETURN_OK) { - sif::warning << "PlocSupvHelper::handleTmReception: CRC check failed" << std::endl; + triggerEvent(SUPV_REPLY_SIZE_MISSMATCH, rememberApid); + return result; + } + result = reader.checkCrc(); + if (result != RETURN_OK) { + triggerEvent(SUPV_REPLY_CRC_MISSMATCH, rememberApid); return result; } return result; @@ -442,42 +621,62 @@ ReturnValue_t PlocSupvHelper::receive(uint8_t* data, size_t* readBytes, size_t r ReturnValue_t PlocSupvHelper::calcImageCrc() { ReturnValue_t result = RETURN_OK; + if (update.fullFileSize == 0) { + return HasReturnvaluesIF::RETURN_FAILED; + } #ifdef XIPHOS_Q7S result = FilesystemHelper::checkPath(update.file); -#endif if (result != RETURN_OK) { sif::warning << "PlocSupvHelper::calcImageCrc: File " << update.file << " does not exist" << std::endl; return result; } +#endif + + auto crc16Calcer = etl::crc16_ccitt(); std::ifstream file(update.file, std::ifstream::binary); - uint16_t remainder = CRC16_INIT; - uint8_t input; + std::array crcBuf{}; #if OBSW_DEBUG_PLOC_SUPERVISOR == 1 - ProgressPrinter progress("Supervisor update crc calculation", update.length, + ProgressPrinter progress("Supervisor update crc calculation", update.fullFileSize, ProgressPrinter::ONE_PERCENT); #endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */ uint32_t byteCount = 0; - for (byteCount = 0; byteCount < update.length; byteCount++) { + size_t bytesToRead = 1024; + while (byteCount < update.fullFileSize) { + size_t remLen = update.fullFileSize - byteCount; + if (remLen < 1024) { + bytesToRead = remLen; + } else { + bytesToRead = 1024; + } file.seekg(byteCount, file.beg); - file.read(reinterpret_cast(&input), 1); - remainder = CRC::crc16ccitt(&input, sizeof(input), remainder); + file.read(reinterpret_cast(crcBuf.data()), bytesToRead); + crc16Calcer.add(crcBuf.begin(), crcBuf.begin() + bytesToRead); + #if OBSW_DEBUG_PLOC_SUPERVISOR == 1 progress.print(byteCount); #endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */ + byteCount += bytesToRead; } #if OBSW_DEBUG_PLOC_SUPERVISOR == 1 progress.print(byteCount); #endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */ - file.close(); - update.crc = remainder; + update.crc = crc16Calcer.value(); return result; } ReturnValue_t PlocSupvHelper::handleCheckMemoryCommand() { ReturnValue_t result = RETURN_OK; + resetSpParams(); + // Will hold status report for later processing + std::array statusReportBuf{}; + supv::UpdateStatusReport updateStatusReport(tmBuf.data(), tmBuf.size()); // Verification of update write procedure - supv::CheckMemory packet(update.memoryId, update.startAddress, update.length); + supv::CheckMemory packet(spParams); + result = packet.buildPacket(update.memoryId, update.startAddress, update.fullFileSize); + if (result != RETURN_OK) { + return result; + } result = sendCommand(packet); if (result != RETURN_OK) { return result; @@ -486,30 +685,55 @@ ReturnValue_t PlocSupvHelper::handleCheckMemoryCommand() { if (result != RETURN_OK) { return result; } - supv::UpdateStatusReport updateStatusReport; - result = handleTmReception(&updateStatusReport, - static_cast(updateStatusReport.getNominalSize()), - supv::recv_timeout::UPDATE_STATUS_REPORT); - if (result != RETURN_OK) { - sif::warning - << "PlocSupvHelper::handleCheckMemoryCommand: Failed to receive update status report" - << std::endl; - return result; + + bool exeAlreadyHandled = false; + uint32_t timeout = std::max(CRC_EXECUTION_TIMEOUT, supv::recv_timeout::UPDATE_STATUS_REPORT); + result = handleTmReception(ccsds::HEADER_LEN, tmBuf.data(), timeout); + ploc::SpTmReader spReader(tmBuf.data(), tmBuf.size()); + if (spReader.getApid() == supv::APID_EXE_FAILURE) { + exeAlreadyHandled = true; + result = handleRemainingExeReport(spReader); + } else if (spReader.getApid() == supv::APID_UPDATE_STATUS_REPORT) { + size_t remBytes = spReader.getPacketDataLen() + 1; + result = handleTmReception(remBytes, tmBuf.data() + ccsds::HEADER_LEN, + supv::recv_timeout::UPDATE_STATUS_REPORT); + if (result != RETURN_OK) { + sif::warning + << "PlocSupvHelper::handleCheckMemoryCommand: Failed to receive update status report" + << std::endl; + return result; + } + result = updateStatusReport.checkCrc(); + if (result != RETURN_OK) { + sif::warning << "PlocSupvHelper::handleCheckMemoryCommand: CRC check failed" << std::endl; + return result; + } + // Copy into other buffer because data will be overwritten when reading execution report + std::memcpy(statusReportBuf.data(), tmBuf.data(), updateStatusReport.getNominalSize()); } - result = handleExe(CRC_EXECUTION_TIMEOUT); - if (result != RETURN_OK) { - return result; + + if (not exeAlreadyHandled) { + result = handleExe(CRC_EXECUTION_TIMEOUT); + if (result != RETURN_OK) { + return result; + } } + + // Now process the status report + updateStatusReport.setData(statusReportBuf.data(), statusReportBuf.size()); result = updateStatusReport.parseDataField(); if (result != RETURN_OK) { return result; } - result = updateStatusReport.verifycrc(update.crc); - if (result != RETURN_OK) { - sif::warning << "PlocSupvHelper::handleCheckMemoryCommand: CRC failure. Expected CRC 0x" - << std::hex << update.crc << " but received CRC 0x" << updateStatusReport.getCrc() - << std::endl; - return result; + if (update.crcShouldBeChecked) { + result = updateStatusReport.verifycrc(update.crc); + if (result != RETURN_OK) { + sif::warning << "PlocSupvHelper::handleCheckMemoryCommand: CRC failure. Expected CRC 0x" + << std::setfill('0') << std::hex << std::setw(4) + << static_cast(update.crc) << " but received CRC 0x" << std::setw(4) + << updateStatusReport.getCrc() << std::dec << std::endl; + return result; + } } return result; } @@ -522,14 +746,14 @@ uint32_t PlocSupvHelper::getFileSize(std::string filename) { return size; } -ReturnValue_t PlocSupvHelper::handleEventBufferReception() { +ReturnValue_t PlocSupvHelper::handleEventBufferReception(ploc::SpTmReader& reader) { ReturnValue_t result = RETURN_OK; std::string filename = Filenaming::generateAbsoluteFilename( eventBufferReq.path, eventBufferReq.filename, timestamping); std::ofstream file(filename, std::ios_base::app | std::ios_base::out); uint32_t packetsRead = 0; size_t requestLen = 0; - supv::TmPacket tmPacket; + bool firstPacket = true; for (packetsRead = 0; packetsRead < NUM_EVENT_BUFFER_PACKETS; packetsRead++) { if (terminate) { triggerEvent(SUPV_EVENT_BUFFER_REQUEST_TERMINATED, packetsRead - 1); @@ -541,22 +765,33 @@ ReturnValue_t PlocSupvHelper::handleEventBufferReception() { } else { requestLen = SIZE_EVENT_BUFFER_FULL_PACKET; } - result = handleTmReception(&tmPacket, requestLen); + if (firstPacket) { + firstPacket = false; + requestLen -= 6; + } + result = handleTmReception(requestLen); if (result != RETURN_OK) { sif::debug << "PlocSupvHelper::handleEventBufferReception: Failed while trying to read packet" << " " << packetsRead + 1 << std::endl; file.close(); return result; } - uint16_t apid = tmPacket.getAPID(); + ReturnValue_t result = reader.checkCrc(); + if (result != RETURN_OK) { + triggerEvent(SUPV_REPLY_CRC_MISSMATCH, rememberApid); + return result; + } + uint16_t apid = reader.getApid(); if (apid != supv::APID_MRAM_DUMP_TM) { sif::warning << "PlocSupvHelper::handleEventBufferReception: Did not expect space packet " << "with APID 0x" << std::hex << apid << std::endl; file.close(); return EVENT_BUFFER_REPLY_INVALID_APID; } - file.write(reinterpret_cast(tmPacket.getPacketData()), - tmPacket.getPayloadDataLength()); + file.write(reinterpret_cast(reader.getPacketData()), + reader.getPayloadDataLength()); } return result; } + +void PlocSupvHelper::resetSpParams() { spParams.buf = commandBuffer; } diff --git a/linux/devices/ploc/PlocSupvHelper.h b/linux/devices/ploc/PlocSupvHelper.h index 69d26264..fb585e12 100644 --- a/linux/devices/ploc/PlocSupvHelper.h +++ b/linux/devices/ploc/PlocSupvHelper.h @@ -11,6 +11,7 @@ #include "fsfw/tasks/ExecutableObjectIF.h" #include "fsfw_hal/linux/uart/UartComIF.h" #include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" + #ifdef XIPHOS_Q7S #include "bsp_q7s/memory/SdCardManager.h" #endif @@ -41,50 +42,61 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha //! [EXPORT] : [COMMENT] Terminated event buffer request by command //! P1: Number of packets read before process was terminated static const Event SUPV_EVENT_BUFFER_REQUEST_TERMINATED = MAKE_EVENT(7, severity::LOW); + //! Status of memory check command + //! P1: Returncode, 0 for success, other value with returncode for failure + static constexpr Event SUPV_MEM_CHECK_OK = MAKE_EVENT(8, severity::INFO); + static constexpr Event SUPV_MEM_CHECK_FAIL = MAKE_EVENT(9, severity::INFO); + //! [EXPORT] : [COMMENT] Communication interface returned failure when trying to send the command //! to the supervisor //! P1: Return value returned by the communication interface sendMessage function //! P2: Internal state of supervisor helper - static const Event SUPV_SENDING_COMMAND_FAILED = MAKE_EVENT(8, severity::LOW); + static const Event SUPV_SENDING_COMMAND_FAILED = MAKE_EVENT(16, severity::LOW); //! [EXPORT] : [COMMENT] Request receive message of communication interface failed //! P1: Return value returned by the communication interface requestReceiveMessage function //! P2: Internal state of supervisor helper - static const Event SUPV_HELPER_REQUESTING_REPLY_FAILED = MAKE_EVENT(9, severity::LOW); + static const Event SUPV_HELPER_REQUESTING_REPLY_FAILED = MAKE_EVENT(17, severity::LOW); //! [EXPORT] : [COMMENT] Reading receive message of communication interface failed //! P1: Return value returned by the communication interface readingReceivedMessage function //! P2: Internal state of supervisor helper - static const Event SUPV_HELPER_READING_REPLY_FAILED = MAKE_EVENT(10, severity::LOW); + static const Event SUPV_HELPER_READING_REPLY_FAILED = MAKE_EVENT(18, severity::LOW); //! [EXPORT] : [COMMENT] Did not receive acknowledgement report //! P1: Number of bytes missing //! P2: Internal state of MPSoC helper - static const Event SUPV_MISSING_ACK = MAKE_EVENT(11, severity::LOW); + static const Event SUPV_MISSING_ACK = MAKE_EVENT(19, severity::LOW); //! [EXPORT] : [COMMENT] Supervisor did not receive execution report //! P1: Number of bytes missing //! P2: Internal state of supervisor helper - static const Event SUPV_MISSING_EXE = MAKE_EVENT(12, severity::LOW); + static const Event SUPV_MISSING_EXE = MAKE_EVENT(20, severity::LOW); //! [EXPORT] : [COMMENT] Supervisor received acknowledgment failure report //! P1: Internal state of supervisor helper - static const Event SUPV_ACK_FAILURE_REPORT = MAKE_EVENT(13, severity::LOW); + static const Event SUPV_ACK_FAILURE_REPORT = MAKE_EVENT(21, severity::LOW); //! [EXPORT] : [COMMENT] Execution report failure //! P1: - static const Event SUPV_EXE_FAILURE_REPORT = MAKE_EVENT(14, severity::LOW); + static const Event SUPV_EXE_FAILURE_REPORT = MAKE_EVENT(22, severity::LOW); //! [EXPORT] : [COMMENT] Supervisor expected acknowledgment report but received space packet with //! other apid P1: Apid of received space packet P2: Internal state of supervisor helper - static const Event SUPV_ACK_INVALID_APID = MAKE_EVENT(15, severity::LOW); + static const Event SUPV_ACK_INVALID_APID = MAKE_EVENT(23, severity::LOW); //! [EXPORT] : [COMMENT] Supervisor helper expected execution report but received space packet //! with other apid P1: Apid of received space packet P2: Internal state of supervisor helper - static const Event SUPV_EXE_INVALID_APID = MAKE_EVENT(16, severity::LOW); + static const Event SUPV_EXE_INVALID_APID = MAKE_EVENT(24, severity::LOW); //! [EXPORT] : [COMMENT] Failed to receive acknowledgment report //! P1: Return value //! P2: Apid of command for which the reception of the acknowledgment report failed - static const Event ACK_RECEPTION_FAILURE = MAKE_EVENT(17, severity::LOW); + static const Event ACK_RECEPTION_FAILURE = MAKE_EVENT(25, severity::LOW); //! [EXPORT] : [COMMENT] Failed to receive execution report //! P1: Return value //! P2: Apid of command for which the reception of the execution report failed - static const Event EXE_RECEPTION_FAILURE = MAKE_EVENT(18, severity::LOW); - //! [EXPORT] : [COMMENT] Update procedure failed when sending packet with number P1 - //! P1: Packet number for which the memory write command fails - static const Event WRITE_MEMORY_FAILED = MAKE_EVENT(19, severity::LOW); + static const Event EXE_RECEPTION_FAILURE = MAKE_EVENT(26, severity::LOW); + //! [EXPORT] : [COMMENT] Update procedure failed when sending packet. + //! P1: First byte percent, third and fourth byte Sequence Count, P2: Bytes written + static const Event WRITE_MEMORY_FAILED = MAKE_EVENT(27, severity::LOW); + static const Event SUPV_REPLY_SIZE_MISSMATCH = MAKE_EVENT(28, severity::LOW); + static const Event SUPV_REPLY_CRC_MISSMATCH = MAKE_EVENT(29, severity::LOW); + + //! [EXPORT] : [COMMENT] Will be triggered every 5 percent of the update progress. + //! P1: First byte percent, third and fourth byte Sequence Count, P2: Bytes written + static constexpr Event SUPV_UPDATE_PROGRESS = MAKE_EVENT(30, severity::INFO); PlocSupvHelper(object_id_t objectId); virtual ~PlocSupvHelper(); @@ -104,8 +116,13 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha * * @return RETURN_OK if successful, otherwise error return value */ + ReturnValue_t performUpdate(const supv::UpdateParams& params); ReturnValue_t startUpdate(std::string file, uint8_t memoryId, uint32_t startAddress); + ReturnValue_t performMemCheck(uint8_t memoryId, uint32_t startAddress, size_t sizeToCheck, + bool checkCrc); + ReturnValue_t performMemCheck(std::string file, uint8_t memoryId, uint32_t startAddress); + /** * @brief This initiate the continuation of a failed update. */ @@ -121,6 +138,8 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha */ void stopProcess(); + static uint32_t buildProgParams1(uint8_t percent, uint16_t seqCount); + private: static const uint8_t INTERFACE_ID = CLASS_ID::PLOC_SUPV_HELPER; @@ -147,13 +166,17 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha uint32_t startAddress; // Absolute name of file containing update data std::string file; + // Length of full file + size_t fullFileSize; // Size of update uint32_t length; uint32_t crc; - size_t remainingSize; + bool crcShouldBeChecked = true; size_t bytesWritten; uint32_t packetNum; uint16_t sequenceCount; + uint8_t progressPercent; + bool deleteMemory = false; }; struct Update update; @@ -167,7 +190,7 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha EventBufferRequest eventBufferReq; - enum class InternalState { IDLE, UPDATE, CONTINUE_UPDATE, REQUEST_EVENT_BUFFER }; + enum class InternalState { IDLE, UPDATE, CONTINUE_UPDATE, REQUEST_EVENT_BUFFER, CHECK_MEMORY }; InternalState internalState = InternalState::IDLE; @@ -175,7 +198,11 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha #ifdef XIPHOS_Q7S SdCardManager* sdcMan = nullptr; #endif - uint8_t commandBuffer[supv::MAX_COMMAND_SIZE]; + uint8_t commandBuffer[supv::MAX_COMMAND_SIZE]{}; + SpacePacketCreator creator; + ploc::SpTcParams spParams = ploc::SpTcParams(creator); + + std::array tmBuf{}; bool terminate = false; @@ -191,13 +218,16 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha // Remembers APID to know at which command a procedure failed uint16_t rememberApid = 0; - ReturnValue_t performUpdate(); + void executeFullCheckMemoryCommand(); + + ReturnValue_t executeUpdate(); ReturnValue_t continueUpdate(); + ReturnValue_t updateOperation(); ReturnValue_t writeUpdatePackets(); ReturnValue_t performEventBufferRequest(); - ReturnValue_t handlePacketTransmission(SpacePacket& packet, + ReturnValue_t handlePacketTransmission(ploc::SpTcBase& packet, uint32_t timeoutExecutionReport = 60000); - ReturnValue_t sendCommand(SpacePacket& packet); + ReturnValue_t sendCommand(ploc::SpTcBase& packet); /** * @brief Function which reads form the communication interface * @@ -218,8 +248,10 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha * @note It can take up to 70 seconds until the supervisor replies with an acknowledgment * failure report. */ - ReturnValue_t handleTmReception(supv::TmPacket* tmPacket, size_t remainingBytes, + ReturnValue_t handleTmReception(size_t remainingBytes, uint8_t* readBuf = nullptr, uint32_t timeout = 70000); + ReturnValue_t checkReceivedTm(ploc::SpTmReader& reader); + ReturnValue_t selectMemory(); ReturnValue_t prepareUpdate(); ReturnValue_t eraseMemory(); @@ -227,6 +259,7 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha // finished. ReturnValue_t calcImageCrc(); ReturnValue_t handleCheckMemoryCommand(); + ReturnValue_t exeReportHandling(); /** * @brief Return size of file with name filename * @@ -235,7 +268,10 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha * @return The size of the file */ uint32_t getFileSize(std::string filename); - ReturnValue_t handleEventBufferReception(); + ReturnValue_t handleEventBufferReception(ploc::SpTmReader& reader); + ReturnValue_t handleRemainingExeReport(ploc::SpTmReader& reader); + + void resetSpParams(); }; #endif /* BSP_Q7S_DEVICES_PLOCSUPVHELPER_H_ */ diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 91303662..dda8b717 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 210 translations. + * @brief Auto-generated event translation file. Contains 217 translations. * @details - * Generated on: 2022-08-12 13:06:03 + * Generated on: 2022-08-24 16:53:50 */ #include "translateEvents.h" @@ -165,6 +165,8 @@ const char *MPSOC_EXE_FAILURE_REPORT_STRING = "MPSOC_EXE_FAILURE_REPORT"; const char *MPSOC_ACK_INVALID_APID_STRING = "MPSOC_ACK_INVALID_APID"; const char *MPSOC_EXE_INVALID_APID_STRING = "MPSOC_EXE_INVALID_APID"; const char *MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING = "MPSOC_HELPER_SEQ_CNT_MISMATCH"; +const char *MPSOC_TM_SIZE_ERROR_STRING = "MPSOC_TM_SIZE_ERROR"; +const char *MPSOC_TM_CRC_MISSMATCH_STRING = "MPSOC_TM_CRC_MISSMATCH"; const char *TRANSITION_BACK_TO_OFF_STRING = "TRANSITION_BACK_TO_OFF"; const char *NEG_V_OUT_OF_BOUNDS_STRING = "NEG_V_OUT_OF_BOUNDS"; const char *U_DRO_OUT_OF_BOUNDS_STRING = "U_DRO_OUT_OF_BOUNDS"; @@ -194,6 +196,8 @@ const char *TERMINATED_UPDATE_PROCEDURE_STRING = "TERMINATED_UPDATE_PROCEDURE"; const char *SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING = "SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL"; const char *SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING = "SUPV_EVENT_BUFFER_REQUEST_FAILED"; const char *SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING = "SUPV_EVENT_BUFFER_REQUEST_TERMINATED"; +const char *SUPV_MEM_CHECK_OK_STRING = "SUPV_MEM_CHECK_OK"; +const char *SUPV_MEM_CHECK_FAIL_STRING = "SUPV_MEM_CHECK_FAIL"; const char *SUPV_SENDING_COMMAND_FAILED_STRING = "SUPV_SENDING_COMMAND_FAILED"; const char *SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING = "SUPV_HELPER_REQUESTING_REPLY_FAILED"; const char *SUPV_HELPER_READING_REPLY_FAILED_STRING = "SUPV_HELPER_READING_REPLY_FAILED"; @@ -206,6 +210,9 @@ const char *SUPV_EXE_INVALID_APID_STRING = "SUPV_EXE_INVALID_APID"; const char *ACK_RECEPTION_FAILURE_STRING = "ACK_RECEPTION_FAILURE"; const char *EXE_RECEPTION_FAILURE_STRING = "EXE_RECEPTION_FAILURE"; const char *WRITE_MEMORY_FAILED_STRING = "WRITE_MEMORY_FAILED"; +const char *SUPV_REPLY_SIZE_MISSMATCH_STRING = "SUPV_REPLY_SIZE_MISSMATCH"; +const char *SUPV_REPLY_CRC_MISSMATCH_STRING = "SUPV_REPLY_CRC_MISSMATCH"; +const char *SUPV_UPDATE_PROGRESS_STRING = "SUPV_UPDATE_PROGRESS"; const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE"; const char *REBOOT_SW_STRING = "REBOOT_SW"; const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; @@ -534,6 +541,10 @@ const char *translateEvents(Event event) { return MPSOC_EXE_INVALID_APID_STRING; case (12611): return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING; + case (12612): + return MPSOC_TM_SIZE_ERROR_STRING; + case (12613): + return MPSOC_TM_CRC_MISSMATCH_STRING; case (12700): return TRANSITION_BACK_TO_OFF_STRING; case (12701): @@ -593,29 +604,39 @@ const char *translateEvents(Event event) { case (13607): return SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING; case (13608): - return SUPV_SENDING_COMMAND_FAILED_STRING; + return SUPV_MEM_CHECK_OK_STRING; case (13609): - return SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING; - case (13610): - return SUPV_HELPER_READING_REPLY_FAILED_STRING; - case (13611): - return SUPV_MISSING_ACK_STRING; - case (13612): - return SUPV_MISSING_EXE_STRING; - case (13613): - return SUPV_ACK_FAILURE_REPORT_STRING; - case (13614): - return SUPV_EXE_FAILURE_REPORT_STRING; - case (13615): - return SUPV_ACK_INVALID_APID_STRING; + return SUPV_MEM_CHECK_FAIL_STRING; case (13616): - return SUPV_EXE_INVALID_APID_STRING; + return SUPV_SENDING_COMMAND_FAILED_STRING; case (13617): - return ACK_RECEPTION_FAILURE_STRING; + return SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING; case (13618): - return EXE_RECEPTION_FAILURE_STRING; + return SUPV_HELPER_READING_REPLY_FAILED_STRING; case (13619): + return SUPV_MISSING_ACK_STRING; + case (13620): + return SUPV_MISSING_EXE_STRING; + case (13621): + return SUPV_ACK_FAILURE_REPORT_STRING; + case (13622): + return SUPV_EXE_FAILURE_REPORT_STRING; + case (13623): + return SUPV_ACK_INVALID_APID_STRING; + case (13624): + return SUPV_EXE_INVALID_APID_STRING; + case (13625): + return ACK_RECEPTION_FAILURE_STRING; + case (13626): + return EXE_RECEPTION_FAILURE_STRING; + case (13627): return WRITE_MEMORY_FAILED_STRING; + case (13628): + return SUPV_REPLY_SIZE_MISSMATCH_STRING; + case (13629): + return SUPV_REPLY_CRC_MISSMATCH_STRING; + case (13630): + return SUPV_UPDATE_PROGRESS_STRING; case (13700): return ALLOC_FAILURE_STRING; case (13701): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index e3ee0fe4..215d47d8 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -1,14 +1,14 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 134 translations. - * Generated on: 2022-08-12 13:06:03 + * Contains 135 translations. + * Generated on: 2022-08-24 16:53:50 */ #include "translateObjects.h" const char *P60DOCK_TEST_TASK_STRING = "P60DOCK_TEST_TASK"; -const char *CORE_CONTROLLER_STRING = "CORE_CONTROLLER"; const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER"; +const char *CORE_CONTROLLER_STRING = "CORE_CONTROLLER"; const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER"; const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER"; const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER"; @@ -116,6 +116,7 @@ const char *TC_STORE_STRING = "TC_STORE"; const char *TM_STORE_STRING = "TM_STORE"; const char *IPC_STORE_STRING = "IPC_STORE"; const char *TIME_STAMPER_STRING = "TIME_STAMPER"; +const char *VERIFICATION_REPORTER_STRING = "VERIFICATION_REPORTER"; const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; const char *SPI_TEST_STRING = "SPI_TEST"; const char *UART_TEST_STRING = "UART_TEST"; @@ -145,10 +146,10 @@ const char *translateObject(object_id_t object) { switch ((object & 0xFFFFFFFF)) { case 0x00005060: return P60DOCK_TEST_TASK_STRING; + case 0x43000002: + return ACS_CONTROLLER_STRING; case 0x43000003: return CORE_CONTROLLER_STRING; - case 0x43100002: - return ACS_CONTROLLER_STRING; case 0x43400001: return THERMAL_CONTROLLER_STRING; case 0x44120006: @@ -363,6 +364,8 @@ const char *translateObject(object_id_t object) { return IPC_STORE_STRING; case 0x53500010: return TIME_STAMPER_STRING; + case 0x53500020: + return VERIFICATION_REPORTER_STRING; case 0x53ffffff: return FSFW_OBJECTS_END_STRING; case 0x54000010: diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 4aea53a0..48c6f521 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -1,9 +1,9 @@ -#include #include "AcsController.h" +#include + AcsController::AcsController(object_id_t objectId) - : ExtendedControllerBase(objectId, objects::NO_OBJECT), - mgmData(this) {} + : ExtendedControllerBase(objectId, objects::NO_OBJECT), mgmData(this) {} ReturnValue_t AcsController::handleCommandMessage(CommandMessage *message) { return HasReturnvaluesIF::RETURN_OK; @@ -32,7 +32,7 @@ void AcsController::performControlOperation() { { PoolReadGuard pg(&mgmData); if (pg.getReadResult() == RETURN_OK) { - copyMgmData(); + copyMgmData(); } } } @@ -45,7 +45,7 @@ ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localD localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_RM3100_UT, &mgm3PoolVec); localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_NT, &imtqMgmPoolVec); localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_ACT_STATUS, &imtqCalActStatus); - poolManager.subscribeForPeriodicPacket(mgmData.getSid(), false, 5.0, false); + poolManager.subscribeForRegularPeriodicPacket({mgmData.getSid(), 5.0}); return HasReturnvaluesIF::RETURN_OK; } @@ -64,31 +64,31 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, void AcsController::copyMgmData() { { PoolReadGuard pg(&mgm0Lis3Set); - if(pg.getReadResult() == RETURN_OK) { + if (pg.getReadResult() == RETURN_OK) { std::memcpy(mgmData.mgm0Lis3.value, mgm0Lis3Set.fieldStrengths.value, 3 * sizeof(float)); } } { PoolReadGuard pg(&mgm1Rm3100Set); - if(pg.getReadResult() == RETURN_OK) { + if (pg.getReadResult() == RETURN_OK) { std::memcpy(mgmData.mgm1Rm3100.value, mgm1Rm3100Set.fieldStrengths.value, 3 * sizeof(float)); } } { PoolReadGuard pg(&mgm2Lis3Set); - if(pg.getReadResult() == RETURN_OK) { + if (pg.getReadResult() == RETURN_OK) { std::memcpy(mgmData.mgm2Lis3.value, mgm2Lis3Set.fieldStrengths.value, 3 * sizeof(float)); } } { PoolReadGuard pg(&mgm3Rm3100Set); - if(pg.getReadResult() == RETURN_OK) { + if (pg.getReadResult() == RETURN_OK) { std::memcpy(mgmData.mgm3Rm3100.value, mgm3Rm3100Set.fieldStrengths.value, 3 * sizeof(float)); } } { PoolReadGuard pg(&imtqMgmSet); - if(pg.getReadResult() == RETURN_OK) { + if (pg.getReadResult() == RETURN_OK) { std::memcpy(mgmData.imtqCal.value, imtqMgmSet.mgmXyz.value, 3 * sizeof(int32_t)); mgmData.actuationCalStatus.value = imtqMgmSet.coilActuationStatus.value; } diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 8dbe38aa..358b1871 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -2,11 +2,13 @@ #define MISSION_CONTROLLER_ACSCONTROLLER_H_ #include -#include "controllerdefinitions/AcsCtrlDefinitions.h" #include + +#include "controllerdefinitions/AcsCtrlDefinitions.h" #include "fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h" #include "fsfw_hal/devicehandlers/MgmRM3100Handler.h" #include "mission/devices/devicedefinitions/IMTQHandlerDefinitions.h" +#include "mission/devices/devicedefinitions/SusDefinitions.h" class AcsController : public ExtendedControllerBase { public: @@ -33,11 +35,16 @@ class AcsController : public ExtendedControllerBase { // MGMs acsctrl::MgmData mgmData; - MGMLIS3MDL::MgmPrimaryDataset mgm0Lis3Set = MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_0_LIS3_HANDLER); - RM3100::Rm3100PrimaryDataset mgm1Rm3100Set = RM3100::Rm3100PrimaryDataset(objects::MGM_1_RM3100_HANDLER); - MGMLIS3MDL::MgmPrimaryDataset mgm2Lis3Set = MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_2_LIS3_HANDLER); - RM3100::Rm3100PrimaryDataset mgm3Rm3100Set = RM3100::Rm3100PrimaryDataset(objects::MGM_3_RM3100_HANDLER); - IMTQ::CalibratedMtmMeasurementSet imtqMgmSet = IMTQ::CalibratedMtmMeasurementSet(objects::IMTQ_HANDLER); + MGMLIS3MDL::MgmPrimaryDataset mgm0Lis3Set = + MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_0_LIS3_HANDLER); + RM3100::Rm3100PrimaryDataset mgm1Rm3100Set = + RM3100::Rm3100PrimaryDataset(objects::MGM_1_RM3100_HANDLER); + MGMLIS3MDL::MgmPrimaryDataset mgm2Lis3Set = + MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_2_LIS3_HANDLER); + RM3100::Rm3100PrimaryDataset mgm3Rm3100Set = + RM3100::Rm3100PrimaryDataset(objects::MGM_3_RM3100_HANDLER); + IMTQ::CalibratedMtmMeasurementSet imtqMgmSet = + IMTQ::CalibratedMtmMeasurementSet(objects::IMTQ_HANDLER); PoolEntry mgm0PoolVec = PoolEntry(3); PoolEntry mgm1PoolVec = PoolEntry(3); @@ -45,11 +52,27 @@ class AcsController : public ExtendedControllerBase { PoolEntry mgm3PoolVec = PoolEntry(3); PoolEntry imtqMgmPoolVec = PoolEntry(3); PoolEntry imtqCalActStatus = PoolEntry(); + void copyMgmData(); + // Sun Sensors + std::array susSets{ + SUS::SusDataset(objects::SUS_0_N_LOC_XFYFZM_PT_XF), + SUS::SusDataset(objects::SUS_1_N_LOC_XBYFZM_PT_XB), + SUS::SusDataset(objects::SUS_2_N_LOC_XFYBZB_PT_YB), + SUS::SusDataset(objects::SUS_3_N_LOC_XFYBZF_PT_YF), + SUS::SusDataset(objects::SUS_4_N_LOC_XMYFZF_PT_ZF), + SUS::SusDataset(objects::SUS_5_N_LOC_XFYMZB_PT_ZB), + SUS::SusDataset(objects::SUS_6_R_LOC_XFYBZM_PT_XF), + SUS::SusDataset(objects::SUS_7_R_LOC_XBYBZM_PT_XB), + SUS::SusDataset(objects::SUS_8_R_LOC_XBYBZB_PT_YB), + SUS::SusDataset(objects::SUS_9_R_LOC_XBYBZB_PT_YF), + SUS::SusDataset(objects::SUS_10_N_LOC_XMYBZF_PT_ZF), + SUS::SusDataset(objects::SUS_11_R_LOC_XBYMZB_PT_ZB), + }; + // Initial delay to make sure all pool variables have been initialized their owners Countdown initialCountdown = Countdown(INIT_DELAY); - // Sun Sensors }; #endif /* MISSION_CONTROLLER_ACSCONTROLLER_H_ */ diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 9e0fbd5a..abb46f48 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -200,10 +200,12 @@ ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& lo localDataPoolMap.emplace(thermalControllerDefinitions::TEMP_ADC_PAYLOAD_PCDU, new PoolEntry({0.0})); - poolManager.subscribeForPeriodicPacket(sensorTemperatures.getSid(), false, 1.0, false); - poolManager.subscribeForPeriodicPacket(susTemperatures.getSid(), false, 1.0, false); - poolManager.subscribeForPeriodicPacket(deviceTemperatures.getSid(), false, 1.0, false); - + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(sensorTemperatures.getSid(), false, 10.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(susTemperatures.getSid(), false, 10.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(deviceTemperatures.getSid(), false, 10.0)); return RETURN_OK; } diff --git a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h index f2913943..bafe778f 100644 --- a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h @@ -1,15 +1,14 @@ #ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCTRLDEFINITIONS_H_ #define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCTRLDEFINITIONS_H_ -#include #include +#include + #include namespace acsctrl { -enum SetIds : uint32_t { - MGM_SENSOR_DATA -}; +enum SetIds : uint32_t { MGM_SENSOR_DATA, SUS_SENSOR_DATA }; enum PoolIds : lp_id_t { MGM_0_LIS3_UT, @@ -17,17 +16,35 @@ enum PoolIds : lp_id_t { MGM_2_LIS3_UT, MGM_3_RM3100_UT, MGM_IMTQ_CAL_NT, - MGM_IMTQ_CAL_ACT_STATUS + MGM_IMTQ_CAL_ACT_STATUS, + + SUS_0_N_LOC_XFYFZM_PT_XF, + SUS_6_R_LOC_XFYBZM_PT_XF, + + SUS_1_N_LOC_XBYFZM_PT_XB, + SUS_7_R_LOC_XBYBZM_PT_XB, + + SUS_2_N_LOC_XFYBZB_PT_YB, + SUS_8_R_LOC_XBYBZB_PT_YB, + + SUS_3_N_LOC_XFYBZF_PT_YF, + SUS_9_R_LOC_XBYBZB_PT_YF, + + SUS_4_N_LOC_XMYFZF_PT_ZF, + SUS_10_N_LOC_XMYBZF_PT_ZF, + + SUS_5_N_LOC_XFYMZB_PT_ZB, + SUS_11_R_LOC_XBYMZB_PT_ZB, }; - static constexpr uint8_t MGM_SET_ENTRIES = 10; +static constexpr uint8_t SUS_SET_ENTRIES = 12; /** * @brief This dataset can be used to store the collected temperatures of all temperature sensors */ class MgmData : public StaticLocalDataSet { -public: + public: MgmData(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, MGM_SENSOR_DATA) {} // The ACS board measurement are in floating point uT @@ -37,12 +54,19 @@ public: lp_vec_t mgm3Rm3100 = lp_vec_t(sid.objectId, MGM_3_RM3100_UT, this); // The IMTQ measurements are in integer nT lp_vec_t imtqCal = lp_vec_t(sid.objectId, MGM_IMTQ_CAL_NT, this); - lp_var_t actuationCalStatus = lp_var_t(sid.objectId, - MGM_IMTQ_CAL_ACT_STATUS, this); -private: + lp_var_t actuationCalStatus = + lp_var_t(sid.objectId, MGM_IMTQ_CAL_ACT_STATUS, this); + private: }; -} +class SusData : public StaticLocalDataSet { + public: + SusData(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, SUS_SENSOR_DATA) {} + + private: +}; + +} // namespace acsctrl #endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCTRLDEFINITIONS_H_ */ diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 1be91594..0a9be3f9 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -15,8 +15,8 @@ #include #include #include -#include -#include +#include +#include #include #include "OBSWConfig.h" @@ -54,7 +54,8 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { *healthTable_ = healthTable; } new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER); - new TimeStamper(objects::TIME_STAMPER); + new VerificationReporter(); + auto* timeStamper = new CdsShortTimeStamper(objects::TIME_STAMPER); { PoolManager::LocalPoolConfig poolCfg = {{300, 16}, {300, 32}, {200, 64}, @@ -75,15 +76,14 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { } auto* ccsdsDistrib = new CCSDSDistributor(apid::EIVE_OBSW, objects::CCSDS_PACKET_DISTRIBUTOR); - new PUSDistributor(apid::EIVE_OBSW, objects::PUS_PACKET_DISTRIBUTOR, - objects::CCSDS_PACKET_DISTRIBUTOR); + new PusDistributor(apid::EIVE_OBSW, objects::PUS_PACKET_DISTRIBUTOR, ccsdsDistrib); uint8_t vc = 0; #if OBSW_TM_TO_PTME == 1 vc = config::LIVE_TM; #endif // Every TM packet goes through this funnel - new TmFunnel(objects::TM_FUNNEL, 50, vc); + new TmFunnel(objects::TM_FUNNEL, *timeStamper, 50, vc); // PUS service stack new Service1TelecommandVerification(objects::PUS_SERVICE_1_VERIFICATION, apid::EIVE_OBSW, @@ -92,15 +92,18 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { pus::PUS_SERVICE_2, 3, 10); new Service3Housekeeping(objects::PUS_SERVICE_3_HOUSEKEEPING, apid::EIVE_OBSW, pus::PUS_SERVICE_3); - new Service5EventReporting(objects::PUS_SERVICE_5_EVENT_REPORTING, apid::EIVE_OBSW, - pus::PUS_SERVICE_5, 15, 45); + new Service5EventReporting( + PsbParams(objects::PUS_SERVICE_5_EVENT_REPORTING, apid::EIVE_OBSW, pus::PUS_SERVICE_5), 15, + 45); new Service8FunctionManagement(objects::PUS_SERVICE_8_FUNCTION_MGMT, apid::EIVE_OBSW, pus::PUS_SERVICE_8, 3, 60); - new Service9TimeManagement(objects::PUS_SERVICE_9_TIME_MGMT, apid::EIVE_OBSW, pus::PUS_SERVICE_9); + new Service9TimeManagement( + PsbParams(objects::PUS_SERVICE_9_TIME_MGMT, apid::EIVE_OBSW, pus::PUS_SERVICE_9)); new Service11TelecommandScheduling( - objects::PUS_SERVICE_11_TC_SCHEDULER, apid::EIVE_OBSW, pus::PUS_SERVICE_11, ccsdsDistrib); - new Service17Test(objects::PUS_SERVICE_17_TEST, apid::EIVE_OBSW, pus::PUS_SERVICE_17); + PsbParams(objects::PUS_SERVICE_11_TC_SCHEDULER, apid::EIVE_OBSW, pus::PUS_SERVICE_11), + ccsdsDistrib); + new Service17Test(PsbParams(objects::PUS_SERVICE_17_TEST, apid::EIVE_OBSW, pus::PUS_SERVICE_17)); new Service20ParameterManagement(objects::PUS_SERVICE_20_PARAMETERS, apid::EIVE_OBSW, pus::PUS_SERVICE_20); new CService200ModeCommanding(objects::PUS_SERVICE_200_MODE_MGMT, apid::EIVE_OBSW, diff --git a/mission/devices/ACUHandler.cpp b/mission/devices/ACUHandler.cpp index c62b7b0d..35f8e2dd 100644 --- a/mission/devices/ACUHandler.cpp +++ b/mission/devices/ACUHandler.cpp @@ -170,8 +170,10 @@ ReturnValue_t ACUHandler::initializeLocalDataPool(localpool::DataPool &localData localDataPoolMap.emplace(pool::ACU_WDT_CNT_GND, new PoolEntry({0})); localDataPoolMap.emplace(pool::ACU_WDT_GND_LEFT, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(coreHk.getSid(), false, 10.0, true); - poolManager.subscribeForPeriodicPacket(auxHk.getSid(), false, 30.0, false); + poolManager.subscribeForDiagPeriodicPacket( + subdp::DiagnosticsHkPeriodicParams(coreHk.getSid(), false, 10.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(auxHk.getSid(), false, 30.0)); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/BpxBatteryHandler.cpp b/mission/devices/BpxBatteryHandler.cpp index 4ae7b962..d121fc8c 100644 --- a/mission/devices/BpxBatteryHandler.cpp +++ b/mission/devices/BpxBatteryHandler.cpp @@ -270,7 +270,8 @@ ReturnValue_t BpxBatteryHandler::initializeLocalDataPool(localpool::DataPool& lo localDataPoolMap.emplace(BpxBattery::BATTERY_HEATER_MODE, &battheatMode); localDataPoolMap.emplace(BpxBattery::BATTHEAT_LOW_LIMIT, &battheatLow); localDataPoolMap.emplace(BpxBattery::BATTHEAT_HIGH_LIMIT, &battheatHigh); - poolManager.subscribeForPeriodicPacket(hkSet.getSid(), false, 30.0, false); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(hkSet.getSid(), false, 30.0)); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/GyroADIS1650XHandler.cpp b/mission/devices/GyroADIS1650XHandler.cpp index 77862bfb..3e798f04 100644 --- a/mission/devices/GyroADIS1650XHandler.cpp +++ b/mission/devices/GyroADIS1650XHandler.cpp @@ -363,7 +363,8 @@ ReturnValue_t GyroADIS1650XHandler::initializeLocalDataPool(localpool::DataPool localDataPoolMap.emplace(ADIS1650X::FILTER_SETTINGS, new PoolEntry()); localDataPoolMap.emplace(ADIS1650X::MSC_CTRL_REGISTER, new PoolEntry()); localDataPoolMap.emplace(ADIS1650X::DEC_RATE_REGISTER, new PoolEntry()); - poolManager.subscribeForPeriodicPacket(primaryDataset.getSid(), false, 5.0, true); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(primaryDataset.getSid(), false, 5.0)); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/IMTQHandler.cpp b/mission/devices/IMTQHandler.cpp index dc5ca33c..e0de184c 100644 --- a/mission/devices/IMTQHandler.cpp +++ b/mission/devices/IMTQHandler.cpp @@ -604,9 +604,12 @@ ReturnValue_t IMTQHandler::initializeLocalDataPool(localpool::DataPool& localDat localDataPoolMap.emplace(IMTQ::FINA_NEG_Z_COIL_Y_TEMPERATURE, new PoolEntry({0})); localDataPoolMap.emplace(IMTQ::FINA_NEG_Z_COIL_Z_TEMPERATURE, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(engHkDataset.getSid(), false, 10.0, true); - poolManager.subscribeForPeriodicPacket(calMtmMeasurementSet.getSid(), false, 10.0, true); - poolManager.subscribeForPeriodicPacket(rawMtmMeasurementSet.getSid(), false, 10.0, true); + poolManager.subscribeForDiagPeriodicPacket( + subdp::DiagnosticsHkPeriodicParams(engHkDataset.getSid(), false, 10.0)); + poolManager.subscribeForDiagPeriodicPacket( + subdp::DiagnosticsHkPeriodicParams(calMtmMeasurementSet.getSid(), false, 10.0)); + poolManager.subscribeForDiagPeriodicPacket( + subdp::DiagnosticsHkPeriodicParams(rawMtmMeasurementSet.getSid(), false, 10.0)); return HasReturnvaluesIF::RETURN_OK; } @@ -750,13 +753,13 @@ void IMTQHandler::fillCalibratedMtmDataset(const uint8_t* packet) { calMtmMeasurementSet.setValidity(true, true); int8_t offset = 2; calMtmMeasurementSet.mgmXyz[0] = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | - *(packet + offset + 1) << 8 | *(packet + offset); + *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; calMtmMeasurementSet.mgmXyz[1] = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | - *(packet + offset + 1) << 8 | *(packet + offset); + *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; calMtmMeasurementSet.mgmXyz[2] = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 | - *(packet + offset + 1) << 8 | *(packet + offset); + *(packet + offset + 1) << 8 | *(packet + offset); offset += 4; calMtmMeasurementSet.coilActuationStatus = (*(packet + offset + 3) << 24) | (*(packet + offset + 2) << 16) | diff --git a/mission/devices/Max31865EiveHandler.cpp b/mission/devices/Max31865EiveHandler.cpp index 6f6760ad..7ad15670 100644 --- a/mission/devices/Max31865EiveHandler.cpp +++ b/mission/devices/Max31865EiveHandler.cpp @@ -184,7 +184,8 @@ ReturnValue_t Max31865EiveHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap.emplace(static_cast(PoolIds::LAST_FAULT_BYTE), new PoolEntry({0})); localDataPoolMap.emplace(static_cast(PoolIds::FAULT_BYTE), new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(sensorDataset.getSid(), false, 30.0, false); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(sensorDataset.getSid(), false, 30.0)); return RETURN_OK; } diff --git a/mission/devices/Max31865PT1000Handler.cpp b/mission/devices/Max31865PT1000Handler.cpp index 354fe1c5..a5f6aa4f 100644 --- a/mission/devices/Max31865PT1000Handler.cpp +++ b/mission/devices/Max31865PT1000Handler.cpp @@ -514,7 +514,8 @@ ReturnValue_t Max31865PT1000Handler::initializeLocalDataPool(localpool::DataPool localDataPoolMap.emplace(static_cast(PoolIds::LAST_FAULT_BYTE), new PoolEntry({0})); localDataPoolMap.emplace(static_cast(PoolIds::FAULT_BYTE), new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(sensorDataset.getSid(), false, 30.0, false); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(sensorDataset.getSid(), false, 30.0)); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 975e069d..f059a1d7 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -225,8 +225,10 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local localDataPoolMap.emplace(pool::P60DOCK_ANT6_DEPL, new PoolEntry({0})); localDataPoolMap.emplace(pool::P60DOCK_AR6_DEPL, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(coreHk.getSid(), false, 10.0, false); - poolManager.subscribeForPeriodicPacket(auxHk.getSid(), false, 30.0, false); + poolManager.subscribeForDiagPeriodicPacket( + subdp::DiagnosticsHkPeriodicParams(coreHk.getSid(), false, 10.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(auxHk.getSid(), false, 30.0)); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index 8e9f1918..70952cea 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -394,7 +394,8 @@ ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool& localDat using namespace pcdu; localDataPoolMap.emplace(PoolIds::PDU1_SWITCHES, &pdu1Switches); localDataPoolMap.emplace(PoolIds::PDU2_SWITCHES, &pdu2Switches); - poolManager.subscribeForPeriodicPacket(switcherSet.getSid(), false, 5.0, true); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(switcherSet.getSid(), false, 5.0)); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/PCDUHandler.h b/mission/devices/PCDUHandler.h index 8f589751..21bb869d 100644 --- a/mission/devices/PCDUHandler.h +++ b/mission/devices/PCDUHandler.h @@ -30,8 +30,7 @@ class PCDUHandler : public PowerSwitchIF, virtual ReturnValue_t initialize() override; virtual ReturnValue_t performOperation(uint8_t counter) override; - virtual void handleChangedDataset(sid_t sid, - store_address_t storeId = storeId::INVALID_STORE_ADDRESS, + virtual void handleChangedDataset(sid_t sid, store_address_t storeId = store_address_t::invalid(), bool* clearMessage = nullptr) override; virtual ReturnValue_t sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) override; diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index fca0fbeb..9c2f845c 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -86,8 +86,10 @@ void PDU1Handler::parseHkTableReply(const uint8_t *packet) { ReturnValue_t PDU1Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { initializePduPool(localDataPoolMap, poolManager, pcdu::INIT_SWITCHES_PDU1); - poolManager.subscribeForPeriodicPacket(coreHk.getSid(), false, 10.0, true); - poolManager.subscribeForPeriodicPacket(auxHk.getSid(), false, 30.0, false); + poolManager.subscribeForDiagPeriodicPacket( + subdp::DiagnosticsHkPeriodicParams(coreHk.getSid(), false, 10.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(auxHk.getSid(), false, 30.0)); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index d0cef3f5..073ccb23 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -49,8 +49,10 @@ void PDU2Handler::parseHkTableReply(const uint8_t *packet) { ReturnValue_t PDU2Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { initializePduPool(localDataPoolMap, poolManager, pcdu::INIT_SWITCHES_PDU2); - poolManager.subscribeForPeriodicPacket(coreHk.getSid(), false, 10.0, true); - poolManager.subscribeForPeriodicPacket(auxHk.getSid(), false, 30.0, false); + poolManager.subscribeForDiagPeriodicPacket( + subdp::DiagnosticsHkPeriodicParams(coreHk.getSid(), false, 10.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(auxHk.getSid(), false, 30.0)); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/PayloadPcduHandler.cpp b/mission/devices/PayloadPcduHandler.cpp index 3e18a94e..d45b2c95 100644 --- a/mission/devices/PayloadPcduHandler.cpp +++ b/mission/devices/PayloadPcduHandler.cpp @@ -295,7 +295,8 @@ ReturnValue_t PayloadPcduHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::CHANNEL_VEC, &channelValues); localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::PROCESSED_VEC, &processedValues); localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::TEMP, &tempC); - poolManager.subscribeForPeriodicPacket(adcSet.getSid(), false, 5.0, true); + poolManager.subscribeForDiagPeriodicPacket( + subdp::DiagnosticsHkPeriodicParams(adcSet.getSid(), false, 5.0)); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/RadiationSensorHandler.cpp b/mission/devices/RadiationSensorHandler.cpp index d94e9197..716b54a5 100644 --- a/mission/devices/RadiationSensorHandler.cpp +++ b/mission/devices/RadiationSensorHandler.cpp @@ -204,7 +204,8 @@ ReturnValue_t RadiationSensorHandler::initializeLocalDataPool(localpool::DataPoo localDataPoolMap.emplace(RAD_SENSOR::AIN5, new PoolEntry({0})); localDataPoolMap.emplace(RAD_SENSOR::AIN6, new PoolEntry({0})); localDataPoolMap.emplace(RAD_SENSOR::AIN7, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(dataset.getSid(), false, 20.0, false); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(dataset.getSid(), false, 20.0)); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index e8e04932..44dbac0d 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -277,9 +277,12 @@ ReturnValue_t RwHandler::initializeLocalDataPool(localpool::DataPool& localDataP localDataPoolMap.emplace(RwDefinitions::SPI_BYTES_READ, new PoolEntry({0})); localDataPoolMap.emplace(RwDefinitions::SPI_REG_OVERRUN_ERRORS, new PoolEntry({0})); localDataPoolMap.emplace(RwDefinitions::SPI_TOTAL_ERRORS, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(statusSet.getSid(), false, 5.0, true); - poolManager.subscribeForPeriodicPacket(tmDataset.getSid(), false, 30.0, false); - poolManager.subscribeForPeriodicPacket(lastResetStatusSet.getSid(), false, 30.0, false); + poolManager.subscribeForDiagPeriodicPacket( + subdp::DiagnosticsHkPeriodicParams(statusSet.getSid(), false, 5.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(tmDataset.getSid(), false, 30.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(lastResetStatusSet.getSid(), false, 30.0)); return RETURN_OK; } diff --git a/mission/devices/SusHandler.cpp b/mission/devices/SusHandler.cpp index 3cc10339..102613c7 100644 --- a/mission/devices/SusHandler.cpp +++ b/mission/devices/SusHandler.cpp @@ -202,7 +202,8 @@ ReturnValue_t SusHandler::initializeLocalDataPool(localpool::DataPool &localData LocalDataPoolManager &poolManager) { localDataPoolMap.emplace(SUS::TEMPERATURE_C, &tempC); localDataPoolMap.emplace(SUS::CHANNEL_VEC, &channelVec); - poolManager.subscribeForPeriodicPacket(dataset.getSid(), false, 5.0, true); + poolManager.subscribeForDiagPeriodicPacket( + subdp::DiagnosticsHkPeriodicParams(dataset.getSid(), false, 5.0)); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 20d72995..67a015ec 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -621,9 +621,12 @@ ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& lo localDataPoolMap.emplace(syrlinks::TEMP_BASEBAND_BOARD, new PoolEntry({0})); localDataPoolMap.emplace(syrlinks::TEMP_POWER_AMPLIFIER, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(txDataset.getSid(), false, 5.0, true); - poolManager.subscribeForPeriodicPacket(rxDataset.getSid(), false, 5.0, true); - poolManager.subscribeForPeriodicPacket(temperatureSet.getSid(), false, 10.0, false); + poolManager.subscribeForDiagPeriodicPacket( + subdp::DiagnosticsHkPeriodicParams(txDataset.getSid(), false, 5.0)); + poolManager.subscribeForDiagPeriodicPacket( + subdp::DiagnosticsHkPeriodicParams(rxDataset.getSid(), false, 5.0)); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(temperatureSet.getSid(), false, 10.0)); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/Tmp1075Handler.cpp b/mission/devices/Tmp1075Handler.cpp index 8cc99ee6..995b4f81 100644 --- a/mission/devices/Tmp1075Handler.cpp +++ b/mission/devices/Tmp1075Handler.cpp @@ -123,6 +123,7 @@ uint32_t Tmp1075Handler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { ReturnValue_t Tmp1075Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { localDataPoolMap.emplace(TMP1075::TEMPERATURE_C_TMP1075, new PoolEntry({0.0})); - poolManager.subscribeForPeriodicPacket(dataset.getSid(), false, 30.0, false); + poolManager.subscribeForRegularPeriodicPacket( + subdp::RegularHkPeriodicParams(dataset.getSid(), false, 30.0)); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/devicedefinitions/SpBase.h b/mission/devices/devicedefinitions/SpBase.h new file mode 100644 index 00000000..ef1f70b8 --- /dev/null +++ b/mission/devices/devicedefinitions/SpBase.h @@ -0,0 +1,119 @@ +#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SPBASE_H_ +#define MISSION_DEVICES_DEVICEDEFINITIONS_SPBASE_H_ + +#include +#include + +#include + +namespace ploc { + +struct SpTcParams { + SpTcParams(SpacePacketCreator& creator) : creator(creator) {} + + SpTcParams(SpacePacketCreator& creator, uint8_t* buf, size_t maxSize) + : creator(creator), buf(buf), maxSize(maxSize) {} + + void setPayloadLen(size_t payloadLen_) { dataFieldLen = payloadLen_ + 2; } + + void setDataFieldLen(size_t dataFieldLen_) { dataFieldLen = dataFieldLen_; } + + SpacePacketCreator& creator; + uint8_t* buf = nullptr; + size_t maxSize = 0; + size_t dataFieldLen = 0; +}; + +class SpTcBase { + public: + SpTcBase(SpTcParams params) : spParams(params) { + payloadStart = spParams.buf + ccsds::HEADER_LEN; + updateSpFields(); + } + + SpTcBase(SpTcParams params, uint16_t apid, uint16_t seqCount) : spParams(params) { + spParams.creator.setApid(apid); + spParams.creator.setSeqCount(seqCount); + payloadStart = spParams.buf + ccsds::HEADER_LEN; + updateSpFields(); + } + + void updateSpFields() { + spParams.creator.setDataLen(spParams.dataFieldLen - 1); + spParams.creator.setPacketType(ccsds::PacketType::TC); + } + + const uint8_t* getFullPacket() const { return spParams.buf; } + + size_t getFullPacketLen() const { return spParams.creator.getFullPacketLen(); } + + uint16_t getApid() const { return spParams.creator.getApid(); } + + ReturnValue_t checkPayloadLen() { + if (ccsds::HEADER_LEN + spParams.dataFieldLen > spParams.maxSize) { + return SerializeIF::BUFFER_TOO_SHORT; + } + + return result::OK; + } + + ReturnValue_t serializeHeader() { + updateSpFields(); + size_t serLen = 0; + return spParams.creator.serializeBe(spParams.buf, serLen, spParams.maxSize); + } + + ReturnValue_t checkSizeAndSerializeHeader() { + ReturnValue_t result = checkPayloadLen(); + if (result != result::OK) { + return result; + } + return serializeHeader(); + } + + ReturnValue_t calcCrc() { + /* Calculate crc */ + uint16_t crc = CRC::crc16ccitt(spParams.buf, getFullPacketLen() - 2); + + /* Add crc to packet data field of space packet */ + size_t serializedSize = 0; + return SerializeAdapter::serialize(&crc, spParams.buf + getFullPacketLen() - 2, &serializedSize, + spParams.maxSize, SerializeIF::Endianness::BIG); + } + + protected: + ploc::SpTcParams spParams; + uint8_t* payloadStart; +}; + +/** + * @brief Class for handling tm replies of the supervisor. + */ +class SpTmReader : public SpacePacketReader { + public: + SpTmReader() = default; + /** + * @brief Constructor creates idle packet and sets length field to maximum allowed size. + */ + SpTmReader(const uint8_t* buf, size_t maxSize) : SpacePacketReader(buf, maxSize) {} + + ReturnValue_t setData(const uint8_t* buf, size_t maxSize) { + return setReadOnlyData(buf, maxSize); + } + + /** + * @brief Returns the payload data length (data field length without CRC) + */ + uint16_t getPayloadDataLength() { return getPacketDataLen() - 2; } + + ReturnValue_t checkCrc() { + if (CRC::crc16ccitt(getFullData(), getFullPacketLen()) != 0) { + return HasReturnvaluesIF::RETURN_FAILED; + } + return HasReturnvaluesIF::RETURN_OK; + } +}; + +} // namespace ploc + +#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_SPBASE_H_ */ diff --git a/mission/tmtc/TmFunnel.cpp b/mission/tmtc/TmFunnel.cpp index 2eada527..c23da16d 100644 --- a/mission/tmtc/TmFunnel.cpp +++ b/mission/tmtc/TmFunnel.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -9,8 +10,12 @@ object_id_t TmFunnel::downlinkDestination = objects::NO_OBJECT; object_id_t TmFunnel::storageDestination = objects::NO_OBJECT; -TmFunnel::TmFunnel(object_id_t objectId, uint32_t messageDepth, uint8_t reportReceptionVc) - : SystemObject(objectId), messageDepth(messageDepth), reportReceptionVc(reportReceptionVc) { +TmFunnel::TmFunnel(object_id_t objectId, CdsShortTimeStamper& timeReader, uint32_t messageDepth, + uint8_t reportReceptionVc) + : SystemObject(objectId), + timeReader(timeReader), + messageDepth(messageDepth), + reportReceptionVc(reportReceptionVc) { auto mqArgs = MqArgs(objectId, static_cast(this)); tmQueue = QueueFactory::instance()->createMessageQueue( messageDepth, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs); @@ -49,11 +54,15 @@ ReturnValue_t TmFunnel::handlePacket(TmTcMessage* message) { if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - TmPacketPusC packet(packetData); - packet.setPacketSequenceCount(this->sourceSequenceCount); - sourceSequenceCount++; - sourceSequenceCount = sourceSequenceCount % SpacePacketBase::LIMIT_SEQUENCE_COUNT; - packet.setErrorControl(); + + PusTmZeroCopyWriter packet(timeReader, packetData, size); + result = packet.parseDataWithoutCrcCheck(); + if (result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + packet.setSequenceCount(sourceSequenceCount++); + sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT; + packet.updateErrorControl(); result = tmQueue->sendToDefault(message); if (result != HasReturnvaluesIF::RETURN_OK) { @@ -107,7 +116,7 @@ ReturnValue_t TmFunnel::initialize() { AcceptsTelemetryIF* storageTarget = ObjectManager::instance()->get(storageDestination); if (storageTarget != nullptr) { - storageQueue->setDefaultDestination(storageTarget->getReportReceptionQueue()); + storageQueue->setDefaultDestination(storageTarget->getReportReceptionQueue(0)); } return SystemObject::initialize(); diff --git a/mission/tmtc/TmFunnel.h b/mission/tmtc/TmFunnel.h index f11dce63..f4c9d14e 100644 --- a/mission/tmtc/TmFunnel.h +++ b/mission/tmtc/TmFunnel.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -23,7 +24,8 @@ class TmFunnel : public AcceptsTelemetryIF, public ExecutableObjectIF, public Sy friend void(Factory::setStaticFrameworkObjectIds)(); public: - TmFunnel(object_id_t objectId, uint32_t messageDepth = 20, uint8_t reportReceptionVc = 0); + TmFunnel(object_id_t objectId, CdsShortTimeStamper& timeReader, uint32_t messageDepth = 20, + uint8_t reportReceptionVc = 0); virtual ~TmFunnel(); virtual MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) override; @@ -35,6 +37,7 @@ class TmFunnel : public AcceptsTelemetryIF, public ExecutableObjectIF, public Sy static object_id_t storageDestination; private: + CdsShortTimeStamper& timeReader; uint32_t messageDepth = 0; uint8_t reportReceptionVc = 0; uint16_t sourceSequenceCount = 0; diff --git a/scripts/q7s-env-em.sh b/scripts/q7s-env-em.sh index 895648a2..e8be1467 100755 --- a/scripts/q7s-env-em.sh +++ b/scripts/q7s-env-em.sh @@ -4,7 +4,7 @@ # custom cross-compiler and sysroot path setups # Adapt the following two entries to your need -CROSS_COMPILE_BIN_PATH="$HOME/EIVE/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" +CROSS_COMPILE_BIN_PATH="/opt/q7s-gcc/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" export ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi" export PATH=$PATH:${CROSS_COMPILE_BIN_PATH} diff --git a/scripts/q7s-env.sh b/scripts/q7s-env.sh index c5638323..5cf608a0 100755 --- a/scripts/q7s-env.sh +++ b/scripts/q7s-env.sh @@ -4,7 +4,7 @@ # custom cross-compiler and sysroot path setups # Adapt the following two entries to your need -CROSS_COMPILE_BIN_PATH="$HOME/EIVE/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" +CROSS_COMPILE_BIN_PATH="/opt/q7s-gcc/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin" export ZYNQ_7020_SYSROOT="/opt/xiphos/sdk/ark/sysroots/cortexa9hf-neon-xiphos-linux-gnueabi" export PATH=$PATH:${CROSS_COMPILE_BIN_PATH} diff --git a/tmtc b/tmtc index 631dc9ea..6b5c005b 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 631dc9ea9c179485aaece8e3437dfe6216e12493 +Subproject commit 6b5c005b7395ababebc78f0403db0d8b09b5fcf1 diff --git a/unittest/testEnvironment.cpp b/unittest/testEnvironment.cpp index e4d5bed2..72726f39 100644 --- a/unittest/testEnvironment.cpp +++ b/unittest/testEnvironment.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #ifdef LINUX ServiceInterfaceStream sif::debug("DEBUG "); @@ -28,7 +28,7 @@ void factory(void* args) { eventManager = new EventManagerMock(); new HealthTable(objects::HEALTH_TABLE); new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER); - new TimeStamper(objects::TIME_STAMPER); + new CdsShortTimeStamper(objects::TIME_STAMPER); { PoolManager::LocalPoolConfig poolCfg = {{300, 16}, {200, 32}, {150, 64}, {150, 128},