diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index b98926e5..ff9e0a2c 100644 --- a/bsp_hosted/fsfwconfig/events/translateEvents.cpp +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 299 translations. + * @brief Auto-generated event translation file. Contains 300 translations. * @details - * Generated on: 2023-07-07 12:06:06 + * Generated on: 2023-07-13 21:09:02 */ #include "translateEvents.h" @@ -139,6 +139,7 @@ const char *ERROR_STATE_STRING = "ERROR_STATE"; const char *RESET_OCCURED_STRING = "RESET_OCCURED"; const char *BOOTING_FIRMWARE_FAILED_EVENT_STRING = "BOOTING_FIRMWARE_FAILED_EVENT"; const char *BOOTING_BOOTLOADER_FAILED_EVENT_STRING = "BOOTING_BOOTLOADER_FAILED_EVENT"; +const char *COM_ERROR_REPLY_RECEIVED_STRING = "COM_ERROR_REPLY_RECEIVED"; const char *SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING = "SUPV_MEMORY_READ_RPT_CRC_FAILURE"; const char *SUPV_UNKNOWN_TM_STRING = "SUPV_UNKNOWN_TM"; const char *SUPV_UNINIMPLEMENTED_TM_STRING = "SUPV_UNINIMPLEMENTED_TM"; @@ -575,6 +576,8 @@ const char *translateEvents(Event event) { return BOOTING_FIRMWARE_FAILED_EVENT_STRING; case (11902): return BOOTING_BOOTLOADER_FAILED_EVENT_STRING; + case (11903): + return COM_ERROR_REPLY_RECEIVED_STRING; case (12001): return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; case (12002): diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 458081f9..97b912f9 100644 --- a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 171 translations. - * Generated on: 2023-07-07 12:06:06 + * Generated on: 2023-07-13 21:09:02 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index 3f1bbb77..228b75bd 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -133,6 +133,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11802;0x2e1a;RESET_OCCURED;LOW;No description;mission/acs/rwHelpers.h 11901;0x2e7d;BOOTING_FIRMWARE_FAILED_EVENT;LOW;Failed to boot firmware;mission/acs/str/StarTrackerHandler.h 11902;0x2e7e;BOOTING_BOOTLOADER_FAILED_EVENT;LOW;Failed to boot star tracker into bootloader mode;mission/acs/str/StarTrackerHandler.h +11903;0x2e7f;COM_ERROR_REPLY_RECEIVED;LOW;Received COM error. P1: Communication Error ID (datasheet p32);mission/acs/str/StarTrackerHandler.h 12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/payload/PlocSupervisorHandler.h 12002;0x2ee2;SUPV_UNKNOWN_TM;LOW;Unhandled event. P1: APID, P2: Service ID;linux/payload/PlocSupervisorHandler.h 12003;0x2ee3;SUPV_UNINIMPLEMENTED_TM;LOW;No description;linux/payload/PlocSupervisorHandler.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 3f1bbb77..228b75bd 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -133,6 +133,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 11802;0x2e1a;RESET_OCCURED;LOW;No description;mission/acs/rwHelpers.h 11901;0x2e7d;BOOTING_FIRMWARE_FAILED_EVENT;LOW;Failed to boot firmware;mission/acs/str/StarTrackerHandler.h 11902;0x2e7e;BOOTING_BOOTLOADER_FAILED_EVENT;LOW;Failed to boot star tracker into bootloader mode;mission/acs/str/StarTrackerHandler.h +11903;0x2e7f;COM_ERROR_REPLY_RECEIVED;LOW;Received COM error. P1: Communication Error ID (datasheet p32);mission/acs/str/StarTrackerHandler.h 12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/payload/PlocSupervisorHandler.h 12002;0x2ee2;SUPV_UNKNOWN_TM;LOW;Unhandled event. P1: APID, P2: Service ID;linux/payload/PlocSupervisorHandler.h 12003;0x2ee3;SUPV_UNINIMPLEMENTED_TM;LOW;No description;linux/payload/PlocSupervisorHandler.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index b98926e5..ff9e0a2c 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 299 translations. + * @brief Auto-generated event translation file. Contains 300 translations. * @details - * Generated on: 2023-07-07 12:06:06 + * Generated on: 2023-07-13 21:09:02 */ #include "translateEvents.h" @@ -139,6 +139,7 @@ const char *ERROR_STATE_STRING = "ERROR_STATE"; const char *RESET_OCCURED_STRING = "RESET_OCCURED"; const char *BOOTING_FIRMWARE_FAILED_EVENT_STRING = "BOOTING_FIRMWARE_FAILED_EVENT"; const char *BOOTING_BOOTLOADER_FAILED_EVENT_STRING = "BOOTING_BOOTLOADER_FAILED_EVENT"; +const char *COM_ERROR_REPLY_RECEIVED_STRING = "COM_ERROR_REPLY_RECEIVED"; const char *SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING = "SUPV_MEMORY_READ_RPT_CRC_FAILURE"; const char *SUPV_UNKNOWN_TM_STRING = "SUPV_UNKNOWN_TM"; const char *SUPV_UNINIMPLEMENTED_TM_STRING = "SUPV_UNINIMPLEMENTED_TM"; @@ -575,6 +576,8 @@ const char *translateEvents(Event event) { return BOOTING_FIRMWARE_FAILED_EVENT_STRING; case (11902): return BOOTING_BOOTLOADER_FAILED_EVENT_STRING; + case (11903): + return COM_ERROR_REPLY_RECEIVED_STRING; case (12001): return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; case (12002): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 5a9af4d7..f4124f28 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 175 translations. - * Generated on: 2023-07-07 12:06:06 + * Generated on: 2023-07-13 21:09:02 */ #include "translateObjects.h" diff --git a/linux/acs/StrComHandler.cpp b/linux/acs/StrComHandler.cpp index 2db73f35..50e890d5 100644 --- a/linux/acs/StrComHandler.cpp +++ b/linux/acs/StrComHandler.cpp @@ -24,7 +24,7 @@ extern "C" { using namespace returnvalue; -static constexpr bool PACKET_WIRETAPPING = false; +static constexpr bool PACKET_WIRETAPPING = true; StrComHandler::StrComHandler(object_id_t objectId) : SystemObject(objectId) { lock = MutexFactory::instance()->createMutex(); diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index b98926e5..ff9e0a2c 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 299 translations. + * @brief Auto-generated event translation file. Contains 300 translations. * @details - * Generated on: 2023-07-07 12:06:06 + * Generated on: 2023-07-13 21:09:02 */ #include "translateEvents.h" @@ -139,6 +139,7 @@ const char *ERROR_STATE_STRING = "ERROR_STATE"; const char *RESET_OCCURED_STRING = "RESET_OCCURED"; const char *BOOTING_FIRMWARE_FAILED_EVENT_STRING = "BOOTING_FIRMWARE_FAILED_EVENT"; const char *BOOTING_BOOTLOADER_FAILED_EVENT_STRING = "BOOTING_BOOTLOADER_FAILED_EVENT"; +const char *COM_ERROR_REPLY_RECEIVED_STRING = "COM_ERROR_REPLY_RECEIVED"; const char *SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING = "SUPV_MEMORY_READ_RPT_CRC_FAILURE"; const char *SUPV_UNKNOWN_TM_STRING = "SUPV_UNKNOWN_TM"; const char *SUPV_UNINIMPLEMENTED_TM_STRING = "SUPV_UNINIMPLEMENTED_TM"; @@ -575,6 +576,8 @@ const char *translateEvents(Event event) { return BOOTING_FIRMWARE_FAILED_EVENT_STRING; case (11902): return BOOTING_BOOTLOADER_FAILED_EVENT_STRING; + case (11903): + return COM_ERROR_REPLY_RECEIVED_STRING; case (12001): return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; case (12002): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 5a9af4d7..f4124f28 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 175 translations. - * Generated on: 2023-07-07 12:06:06 + * Generated on: 2023-07-13 21:09:02 */ #include "translateObjects.h" diff --git a/mission/acs/str/StarTrackerHandler.cpp b/mission/acs/str/StarTrackerHandler.cpp index 04b5b103..a6091d7c 100644 --- a/mission/acs/str/StarTrackerHandler.cpp +++ b/mission/acs/str/StarTrackerHandler.cpp @@ -880,13 +880,20 @@ ReturnValue_t StarTrackerHandler::scanForReply(const uint8_t* start, size_t rema *foundLen = remainingSize; return returnvalue::OK; } - if (remainingSize < 3) { - sif::error << "StarTrackerHandler: Reply packet with length less than 3 is invalid" + if (remainingSize < 2) { + sif::error << "StarTrackerHandler: Reply packet with length " << remainingSize + << " less than " + "2 is invalid" << std::endl; return returnvalue::FAILED; } switch (startracker::getReplyFrameType(start)) { + case TMTC_COMM_ERROR: { + *foundLen = remainingSize; + triggerEvent(COM_ERROR_REPLY_RECEIVED, start[1]); + break; + } case TMTC_ACTIONREPLY: { *foundLen = remainingSize; return scanForActionReply(startracker::getId(start), foundId); diff --git a/mission/acs/str/StarTrackerHandler.h b/mission/acs/str/StarTrackerHandler.h index 57553286..1e790695 100644 --- a/mission/acs/str/StarTrackerHandler.h +++ b/mission/acs/str/StarTrackerHandler.h @@ -144,6 +144,8 @@ class StarTrackerHandler : public DeviceHandlerBase { static const Event BOOTING_FIRMWARE_FAILED_EVENT = MAKE_EVENT(1, severity::LOW); //! [EXPORT] : [COMMENT] Failed to boot star tracker into bootloader mode static const Event BOOTING_BOOTLOADER_FAILED_EVENT = MAKE_EVENT(2, severity::LOW); + //! [EXPORT] : [COMMENT] Received COM error. P1: Communication Error ID (datasheet p32) + static constexpr Event COM_ERROR_REPLY_RECEIVED = MAKE_EVENT(3, severity::LOW); static const uint8_t STATUS_OFFSET = 2; static const uint8_t PARAMS_OFFSET = 2; diff --git a/mission/acs/str/strHelpers.h b/mission/acs/str/strHelpers.h index 1c4b37cf..c6336186 100644 --- a/mission/acs/str/strHelpers.h +++ b/mission/acs/str/strHelpers.h @@ -443,6 +443,21 @@ static const uint32_t secret[16]{ REGION_12_SECRET, REGION_13_SECRET, REGION_14_SECRET, REGION_15_SECRET}; } // namespace region_secrets +namespace comError { +enum Id { + BAD_CRC = 1, + UNKNOWN_TM_ID = 2, + UNKNOWN_PARAM_ID = 3, + UNKNOWN_ACTION_REQ = 4, + INVALID_TM_SIZE = 5, + INVALID_PARAM_SIZE = 6, + INVALID_ACTION_REQ_SIZE = 7, + FRAME_TOO_SHORT = 8, + INVALID_FRAME_TYPE = 9, + UNKNOWN_ERROR = 10 +}; +} + enum class FlashSections : uint8_t { BOOTLOADER_SECTION = 0, MAIN_FIRMWARE_SECTION = 1, diff --git a/mission/acs/str/strJsonCommands.cpp b/mission/acs/str/strJsonCommands.cpp index 522bb040..81c2fa5c 100644 --- a/mission/acs/str/strJsonCommands.cpp +++ b/mission/acs/str/strJsonCommands.cpp @@ -957,6 +957,5 @@ ReturnValue_t AutoThreshold::createCommand(uint8_t* buffer) { return result; } addfloat(param, buffer + offset); - offset += 4; return returnvalue::OK; } diff --git a/tmtc b/tmtc index c6e2e2de..380a02ee 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit c6e2e2de49e3d49fed1b5a43a94528c0c4aceafe +Subproject commit 380a02ee94b0413744ba82f08397c1f354bd0c0e