timemanager update
This commit is contained in:
+19
-19
@@ -1,9 +1,9 @@
|
||||
#include "CCSDSTime.h"
|
||||
|
||||
#include <FSFWConfig.h>
|
||||
#include <cstdio>
|
||||
#include <cinttypes>
|
||||
#include <cmath>
|
||||
#include <FSFWConfig.h>
|
||||
|
||||
|
||||
CCSDSTime::CCSDSTime() {
|
||||
}
|
||||
@@ -53,8 +53,8 @@ ReturnValue_t CCSDSTime::convertToCcsds(Ccs_mseconds* to,
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCcsds(Clock::TimeOfDay_t* to, const uint8_t* from,
|
||||
uint32_t length) {
|
||||
ReturnValue_t CCSDSTime::convertFromCcsds(Clock::TimeOfDay_t* to,
|
||||
const uint8_t* from, size_t length) {
|
||||
ReturnValue_t result;
|
||||
if (length > 0xFF) {
|
||||
return LENGTH_MISMATCH;
|
||||
@@ -72,7 +72,7 @@ ReturnValue_t CCSDSTime::convertFromCcsds(Clock::TimeOfDay_t* to, const uint8_t*
|
||||
case CDS:
|
||||
return convertFromCDS(to, from, length);
|
||||
case CCS: {
|
||||
uint32_t temp = 0;
|
||||
size_t temp = 0;
|
||||
return convertFromCCS(to, from, &temp, length);
|
||||
}
|
||||
|
||||
@@ -81,13 +81,13 @@ ReturnValue_t CCSDSTime::convertFromCcsds(Clock::TimeOfDay_t* to, const uint8_t*
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCUC(Clock::TimeOfDay_t* to, const uint8_t* from,
|
||||
uint8_t length) {
|
||||
ReturnValue_t CCSDSTime::convertFromCUC(Clock::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,
|
||||
uint8_t length) {
|
||||
ReturnValue_t CCSDSTime::convertFromCDS(Clock::TimeOfDay_t* to,
|
||||
const uint8_t* from, uint8_t length) {
|
||||
timeval time;
|
||||
ReturnValue_t result = convertFromCDS(&time, from, NULL, length);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
@@ -96,8 +96,8 @@ 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,
|
||||
uint32_t* foundLength, uint32_t maxLength) {
|
||||
ReturnValue_t CCSDSTime::convertFromCCS(Clock::TimeOfDay_t* to,
|
||||
const uint8_t* from, size_t* foundLength, size_t maxLength) {
|
||||
uint8_t subsecondsLength = *from & 0b111;
|
||||
uint32_t totalLength = subsecondsLength + 8;
|
||||
if (maxLength < totalLength) {
|
||||
@@ -152,8 +152,8 @@ ReturnValue_t CCSDSTime::convertFromCCS(Clock::TimeOfDay_t* to, const uint8_t* f
|
||||
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t* from,
|
||||
uint8_t length) {
|
||||
ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to,
|
||||
const uint8_t* from, uint8_t length) {
|
||||
if (length < 19) {
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
@@ -395,7 +395,7 @@ ReturnValue_t CCSDSTime::convertToCcsds(OBT_FLP* to, const timeval* from) {
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCcsds(timeval* to, const uint8_t* from,
|
||||
uint32_t* foundLength, uint32_t maxLength) {
|
||||
size_t* foundLength, size_t maxLength) {
|
||||
//We don't expect ascii here. SHOULDDO
|
||||
uint8_t codeIdentification = (*from >> 4);
|
||||
switch (codeIdentification) {
|
||||
@@ -413,7 +413,7 @@ ReturnValue_t CCSDSTime::convertFromCcsds(timeval* to, const uint8_t* from,
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCUC(timeval* to, const uint8_t* from,
|
||||
uint32_t* foundLength, uint32_t maxLength) {
|
||||
size_t* foundLength, size_t maxLength) {
|
||||
if (maxLength < 1) {
|
||||
return INVALID_TIME_FORMAT;
|
||||
}
|
||||
@@ -491,7 +491,7 @@ ReturnValue_t CCSDSTime::convertTimevalToTimeOfDay(Clock::TimeOfDay_t* to,
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCDS(timeval* to, const uint8_t* from,
|
||||
uint32_t* foundLength, uint32_t maxLength) {
|
||||
size_t* foundLength, size_t maxLength) {
|
||||
uint8_t pField = *from;
|
||||
from++;
|
||||
//Check epoch
|
||||
@@ -556,12 +556,12 @@ ReturnValue_t CCSDSTime::convertFromCDS(timeval* to, const uint8_t* from,
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCUC(timeval* to, uint8_t pField,
|
||||
const uint8_t* from, uint32_t* foundLength, uint32_t maxLength) {
|
||||
const uint8_t* from, size_t* foundLength, size_t maxLength) {
|
||||
uint32_t secs = 0;
|
||||
uint32_t subSeconds = 0;
|
||||
uint8_t nCoarse = ((pField & 0b1100) >> 2) + 1;
|
||||
uint8_t nFine = (pField & 0b11);
|
||||
uint32_t totalLength = nCoarse + nFine;
|
||||
size_t totalLength = nCoarse + nFine;
|
||||
if (foundLength != NULL) {
|
||||
*foundLength = totalLength;
|
||||
}
|
||||
@@ -593,7 +593,7 @@ uint32_t CCSDSTime::subsecondsToMicroseconds(uint16_t subseconds) {
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertFromCCS(timeval* to, const uint8_t* from,
|
||||
uint32_t* foundLength, uint32_t maxLength) {
|
||||
size_t* foundLength, size_t maxLength) {
|
||||
Clock::TimeOfDay_t tempTime;
|
||||
ReturnValue_t result = convertFromCCS(&tempTime, from, foundLength,
|
||||
maxLength);
|
||||
|
||||
Reference in New Issue
Block a user