Skip to content

Commit

Permalink
Rename UpdateTimeData.timestamp to UpdateTimeData.currentTime
Browse files Browse the repository at this point in the history
  • Loading branch information
Elena Jochum committed Dec 10, 2023
1 parent 9455b35 commit f7ce5b2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Sts1CobcSw/Edu/Edu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,14 +537,14 @@ auto ReturnResultCommunication() -> ResultInfo
//! Update Time:
//! -> [DATA]
//! -> [Command Header]
//! -> [Timestamp]
//! -> [Current Time]
//! <- [N/ACK]
//! <- [N/ACK]
//!
//! The first N/ACK confirms a valid data packet,
//! the second N/ACK confirms the time update.
//!
//! @param timestamp A unix timestamp
//! @param currentTime A unix timestamp
//!
//! @returns A relevant error code
auto UpdateTime(UpdateTimeData const & data) -> ErrorCode
Expand Down
2 changes: 1 addition & 1 deletion Sts1CobcSw/Edu/EduMock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ auto GetStatus() -> Status
auto UpdateTime(UpdateTimeData const & data) -> ErrorCode
{
PrintFormattedSystemUtc();
PRINTF("Call to UpdateTime(timestamp = %" PRIi32 ")\n", data.timestamp);
PRINTF("Call to UpdateTime(currentTime = %" PRIi32 ")\n", data.currentTime);
return ErrorCode::success;
}

Expand Down
4 changes: 2 additions & 2 deletions Sts1CobcSw/Edu/Structs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct ExecuteProgramData
struct UpdateTimeData
{
static constexpr auto id = updateTimeId;
std::int32_t timestamp;
std::int32_t currentTime;
};


Expand Down Expand Up @@ -112,7 +112,7 @@ inline constexpr std::size_t serialSize<edu::ExecuteProgramData> =

template<>
inline constexpr std::size_t serialSize<edu::UpdateTimeData> =
totalSerialSize<decltype(edu::UpdateTimeData::id), decltype(edu::UpdateTimeData::timestamp)>;
totalSerialSize<decltype(edu::UpdateTimeData::id), decltype(edu::UpdateTimeData::currentTime)>;


namespace edu
Expand Down
2 changes: 1 addition & 1 deletion Sts1CobcSw/Edu/Structs.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ template<std::endian endianness>
auto SerializeTo(void * destination, UpdateTimeData const & data) -> void *
{
destination = SerializeTo<endianness>(destination, UpdateTimeData::id);
destination = SerializeTo<endianness>(destination, data.timestamp);
destination = SerializeTo<endianness>(destination, data.currentTime);
return destination;
}
}
2 changes: 1 addition & 1 deletion Sts1CobcSw/EduProgramQueueThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class EduProgramQueueThread : public RODOS::StaticThread<stackSize>
utility::PrintFormattedSystemUtc();

auto errorCode =
edu::UpdateTime(edu::UpdateTimeData{.timestamp = utility::GetUnixUtc()});
edu::UpdateTime(edu::UpdateTimeData{.currentTime = utility::GetUnixUtc()});
if(errorCode != edu::ErrorCode::success)
{
RODOS::PRINTF("UpdateTime error code : %d\n", static_cast<int>(errorCode));
Expand Down
6 changes: 3 additions & 3 deletions Tests/HardwareTests/EduCommandTests/EduCommands.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class EduCommandsTest : public RODOS::StaticThread<>
{
case 'u':
{
auto timestamp = utility::GetUnixUtc();
PRINTF("Sending UpdateTime(timestamp = %d)\n", static_cast<int>(timestamp));
auto errorCode = edu::UpdateTime({.timestamp = timestamp});
auto currentTime = utility::GetUnixUtc();
PRINTF("Sending UpdateTime(currentTime = %d)\n", static_cast<int>(currentTime));
auto errorCode = edu::UpdateTime({.currentTime = currentTime});
PRINTF("Returned error code: %d\n", static_cast<int>(errorCode));
break;
}
Expand Down

0 comments on commit f7ce5b2

Please sign in to comment.