EIVE upstream #29

Merged
muellerr merged 693 commits from use-eive-upstream into develop 2023-06-30 15:44:39 +02:00
2 changed files with 14 additions and 3 deletions
Showing only changes of commit 61fd5d1b62 - Show all commits

View File

@ -246,8 +246,19 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t*
return UNSUPPORTED_TIME_FORMAT; return UNSUPPORTED_TIME_FORMAT;
} }
ReturnValue_t CCSDSTime::convertToASCII(int8_t* to, const Clock::TimeOfDay_t* from, ReturnValue_t CCSDSTime::convertToAsciiWithSecs(int8_t* to, const Clock::TimeOfDay_t* from,
uint8_t length) { uint8_t length) {
if(from == nullptr or to == nullptr) {
return returnvalue::FAILED;
}
int count = snprintf(reinterpret_cast<char*>(to), length,
"%4" SCNu32 "-%2" SCNu32 "-%2" SCNu32
"T%"
"2" SCNu32 ":%2" SCNu32 ":%2" SCNu32,
from->year, from->month, from->day, from->hour, from->minute, from->second);
if(count >= length) {
return returnvalue::FAILED;
}
return returnvalue::OK; return returnvalue::OK;
} }

View File

@ -207,7 +207,7 @@ class CCSDSTime {
static ReturnValue_t convertFromASCII(Clock::TimeOfDay_t *to, uint8_t const *from, static ReturnValue_t convertFromASCII(Clock::TimeOfDay_t *to, uint8_t const *from,
uint8_t length); uint8_t length);
static ReturnValue_t convertToASCII(int8_t *to, const Clock::TimeOfDay_t *from, uint8_t length); static ReturnValue_t convertToAsciiWithSecs(int8_t *to, const Clock::TimeOfDay_t *from, uint8_t length);
static uint32_t subsecondsToMicroseconds(uint16_t subseconds); static uint32_t subsecondsToMicroseconds(uint16_t subseconds);
private: private: