Merge remote-tracking branch 'upstream/development' into mueller/master
This commit is contained in:
@ -31,7 +31,7 @@
|
||||
#endif /* FSFW_VERBOSE_LEVEL */
|
||||
|
||||
#ifndef FSFW_DISABLE_PRINTOUT
|
||||
#define FSFW_DISABLE_PRINTOUT 0
|
||||
#define FSFW_DISABLE_PRINTOUT 0
|
||||
#endif
|
||||
|
||||
#ifndef FSFW_USE_REALTIME_FOR_LINUX
|
||||
|
@ -8,16 +8,11 @@
|
||||
#include <events/subsystemIdRanges.h>
|
||||
|
||||
using EventId_t = uint16_t;
|
||||
using EventSeverity_t = uint8_t ;
|
||||
using EventSeverity_t = uint8_t;
|
||||
using UniqueEventId_t = uint8_t;
|
||||
|
||||
namespace severity {
|
||||
enum Severity: EventSeverity_t {
|
||||
INFO = 1,
|
||||
LOW = 2,
|
||||
MEDIUM = 3,
|
||||
HIGH = 4
|
||||
};
|
||||
enum Severity : EventSeverity_t { INFO = 1, LOW = 2, MEDIUM = 3, HIGH = 4 };
|
||||
|
||||
} // namespace severity
|
||||
|
||||
|
@ -150,17 +150,14 @@ ReturnValue_t Clock::convertTimeOfDayToTimeval(const TimeOfDay_t* from, timeval*
|
||||
time_tm.tm_hour = from->hour;
|
||||
time_tm.tm_min = from->minute;
|
||||
time_tm.tm_sec = from->second;
|
||||
time_tm.tm_isdst = 0;
|
||||
|
||||
time_t seconds = mktime(&time_tm);
|
||||
time_t seconds = timegm(&time_tm);
|
||||
|
||||
to->tv_sec = seconds;
|
||||
to->tv_usec = from->usecond;
|
||||
// Fails in 2038..
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::warning << "Clock::convertTimeBla: not implemented yet" << std::endl;
|
||||
#endif
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t Clock::convertTimevalToJD2000(timeval time, double* JD2000) {
|
||||
|
@ -140,8 +140,9 @@ ReturnValue_t Clock::convertTimeOfDayToTimeval(const TimeOfDay_t* from, timeval*
|
||||
fromTm.tm_hour = from->hour;
|
||||
fromTm.tm_min = from->minute;
|
||||
fromTm.tm_sec = from->second;
|
||||
fromTm.tm_isdst = 0;
|
||||
|
||||
to->tv_sec = mktime(&fromTm);
|
||||
to->tv_sec = timegm(&fromTm);
|
||||
to->tv_usec = from->usecond;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
@ -557,6 +557,35 @@ ReturnValue_t CCSDSTime::convertFromCDS(timeval* to, const uint8_t* from, size_t
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCDS(timeval* to, const CCSDSTime::CDS_short* from) {
|
||||
if (to == nullptr or from == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
uint16_t days = (from->dayMSB << 8) + from->dayLSB;
|
||||
if (days <= DAYS_CCSDS_TO_UNIX_EPOCH) {
|
||||
return INVALID_TIME_FORMAT;
|
||||
}
|
||||
days -= DAYS_CCSDS_TO_UNIX_EPOCH;
|
||||
to->tv_sec = days * SECONDS_PER_DAY;
|
||||
uint32_t msDay =
|
||||
(from->msDay_hh << 24) + (from->msDay_h << 16) + (from->msDay_l << 8) + from->msDay_ll;
|
||||
to->tv_sec += (msDay / 1000);
|
||||
to->tv_usec = (msDay % 1000) * 1000;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCDS(Clock::TimeOfDay_t* to, const CCSDSTime::CDS_short* from) {
|
||||
if (to == nullptr or from == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
timeval tempTimeval;
|
||||
ReturnValue_t result = convertFromCDS(&tempTimeval, from);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
return CCSDSTime::convertTimevalToTimeOfDay(to, &tempTimeval);
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCUC(timeval* to, uint8_t pField, const uint8_t* from,
|
||||
size_t* foundLength, size_t maxLength) {
|
||||
uint32_t secs = 0;
|
||||
|
@ -180,6 +180,8 @@ class CCSDSTime : public HasReturnvaluesIF {
|
||||
|
||||
static ReturnValue_t convertFromCDS(timeval *to, uint8_t const *from, size_t *foundLength,
|
||||
size_t maxLength);
|
||||
static ReturnValue_t convertFromCDS(timeval *to, const CCSDSTime::CDS_short *from);
|
||||
static ReturnValue_t convertFromCDS(Clock::TimeOfDay_t *to, const CCSDSTime::CDS_short *from);
|
||||
|
||||
static ReturnValue_t convertFromCCS(Clock::TimeOfDay_t *to, uint8_t const *from,
|
||||
size_t *foundLength, size_t maxLength);
|
||||
|
@ -28,7 +28,9 @@ class Version {
|
||||
(v1.major == v2.major and v1.minor == v2.minor and v1.revision < v2.revision));
|
||||
}
|
||||
|
||||
friend bool operator>(const Version& v1, const Version& v2) { return not(v1 < v2); }
|
||||
friend bool operator>(const Version& v1, const Version& v2) {
|
||||
return not (v1 < v2) and not (v1 == v2);
|
||||
}
|
||||
|
||||
friend bool operator<=(const Version& v1, const Version& v2) { return ((v1 == v2) or (v1 < v2)); }
|
||||
|
||||
|
Reference in New Issue
Block a user