clock update, definitions file
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
#include "../timemanager/CCSDSTime.h"
|
||||
#include "CCSDSTime.h"
|
||||
#include <FSFWConfig.h>
|
||||
#include <cstdio>
|
||||
#include <cinttypes>
|
||||
@ -12,7 +12,7 @@ CCSDSTime::~CCSDSTime() {
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertToCcsds(Ccs_seconds* to,
|
||||
const Clock::TimeOfDay_t* from) {
|
||||
const TimeOfDay_t* from) {
|
||||
ReturnValue_t result = checkTimeOfDay(from);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
@ -32,7 +32,7 @@ ReturnValue_t CCSDSTime::convertToCcsds(Ccs_seconds* to,
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertToCcsds(Ccs_mseconds* to,
|
||||
const Clock::TimeOfDay_t* from) {
|
||||
const TimeOfDay_t* from) {
|
||||
ReturnValue_t result = checkTimeOfDay(from);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
@ -53,7 +53,7 @@ ReturnValue_t CCSDSTime::convertToCcsds(Ccs_mseconds* to,
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCcsds(Clock::TimeOfDay_t* to, const uint8_t* from,
|
||||
ReturnValue_t CCSDSTime::convertFromCcsds(TimeOfDay_t* to, const uint8_t* from,
|
||||
uint32_t length) {
|
||||
ReturnValue_t result;
|
||||
if (length > 0xFF) {
|
||||
@ -81,12 +81,12 @@ ReturnValue_t CCSDSTime::convertFromCcsds(Clock::TimeOfDay_t* to, const uint8_t*
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCUC(Clock::TimeOfDay_t* to, const uint8_t* from,
|
||||
ReturnValue_t CCSDSTime::convertFromCUC(TimeOfDay_t* to, const uint8_t* from,
|
||||
uint8_t length) {
|
||||
return UNSUPPORTED_TIME_FORMAT;
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCDS(Clock::TimeOfDay_t* to, const uint8_t* from,
|
||||
ReturnValue_t CCSDSTime::convertFromCDS(TimeOfDay_t* to, const uint8_t* from,
|
||||
uint8_t length) {
|
||||
timeval time;
|
||||
ReturnValue_t result = convertFromCDS(&time, from, NULL, length);
|
||||
@ -96,7 +96,7 @@ ReturnValue_t CCSDSTime::convertFromCDS(Clock::TimeOfDay_t* to, const uint8_t* f
|
||||
return convertTimevalToTimeOfDay(to, &time);
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCCS(Clock::TimeOfDay_t* to, const uint8_t* from,
|
||||
ReturnValue_t CCSDSTime::convertFromCCS(TimeOfDay_t* to, const uint8_t* from,
|
||||
uint32_t* foundLength, uint32_t maxLength) {
|
||||
uint8_t subsecondsLength = *from & 0b111;
|
||||
uint32_t totalLength = subsecondsLength + 8;
|
||||
@ -152,7 +152,7 @@ ReturnValue_t CCSDSTime::convertFromCCS(Clock::TimeOfDay_t* to, const uint8_t* f
|
||||
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t* from,
|
||||
ReturnValue_t CCSDSTime::convertFromASCII(TimeOfDay_t* to, const uint8_t* from,
|
||||
uint8_t length) {
|
||||
if (length < 19) {
|
||||
return RETURN_FAILED;
|
||||
@ -427,7 +427,7 @@ ReturnValue_t CCSDSTime::convertFromCUC(timeval* to, const uint8_t* from,
|
||||
return result;
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::checkTimeOfDay(const Clock::TimeOfDay_t* time) {
|
||||
ReturnValue_t CCSDSTime::checkTimeOfDay(const TimeOfDay_t* time) {
|
||||
if ((time->month > 12) || (time->month == 0)) {
|
||||
return INVALID_TIME_FORMAT;
|
||||
}
|
||||
@ -482,7 +482,7 @@ ReturnValue_t CCSDSTime::checkTimeOfDay(const Clock::TimeOfDay_t* time) {
|
||||
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertTimevalToTimeOfDay(Clock::TimeOfDay_t* to,
|
||||
ReturnValue_t CCSDSTime::convertTimevalToTimeOfDay(TimeOfDay_t* to,
|
||||
timeval* from) {
|
||||
//This is rather tricky. Implement only if needed. Also, if so, move to OSAL.
|
||||
return UNSUPPORTED_TIME_FORMAT;
|
||||
@ -592,7 +592,7 @@ uint32_t CCSDSTime::subsecondsToMicroseconds(uint16_t subseconds) {
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCCS(timeval* to, const uint8_t* from,
|
||||
uint32_t* foundLength, uint32_t maxLength) {
|
||||
Clock::TimeOfDay_t tempTime;
|
||||
TimeOfDay_t tempTime;
|
||||
ReturnValue_t result = convertFromCCS(&tempTime, from, foundLength,
|
||||
maxLength);
|
||||
if (result != RETURN_OK) {
|
||||
|
Reference in New Issue
Block a user