From c809ec26d182125cd5b573e6336ff4be48c47dae Mon Sep 17 00:00:00 2001 From: Jerome Hue Date: Sat, 11 Nov 2023 17:47:27 +0100 Subject: [PATCH] Fix Outcome bug when returning a ResultInfo structure --- Sts1CobcSw/Edu/Edu.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Sts1CobcSw/Edu/Edu.cpp b/Sts1CobcSw/Edu/Edu.cpp index 8be62df6..14126434 100644 --- a/Sts1CobcSw/Edu/Edu.cpp +++ b/Sts1CobcSw/Edu/Edu.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -393,7 +394,7 @@ auto ReturnResult() -> Result if(resultInfo.value().reachedEof) { RODOS::PRINTF(" ResultResultRetry() reached EOF\n"); - return {/*reachedEof*/ true, totalResultSize}; + return ResultInfo{.reachedEof = true, .resultSize = totalResultSize}; } // END DEBUG @@ -403,7 +404,7 @@ auto ReturnResult() -> Result totalResultSize += resultInfo.value().resultSize; packets++; } - return {false, totalResultSize}; + return ResultInfo{.reachedEof = false, .resultSize = totalResultSize}; } @@ -479,7 +480,7 @@ auto ReturnResultCommunication() -> Result } if(command == cmdEof) { - return {/*reachedEof*/ true, 0_usize}; + return ResultInfo{.reachedEof = true, .resultSize = 0_usize}; } if(command != cmdData) { @@ -532,7 +533,7 @@ auto ReturnResultCommunication() -> Result RODOS::PRINTF("\nSuccess\n"); // END DEBUG - return {false, actualDataLength}; + return ResultInfo{.reachedEof = false, .resultSize = actualDataLength}; } @@ -698,6 +699,7 @@ auto UartReceive(void * destination) -> Result { return ErrorCode::timeout; } + return outcome_v2::success(); }