EIVE upstream #29
@ -247,16 +247,14 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t*
|
||||
}
|
||||
|
||||
ReturnValue_t CCSDSTime::convertToAsciiWithSecs(int8_t* to, const Clock::TimeOfDay_t* from,
|
||||
uint8_t length) {
|
||||
if(from == nullptr or to == nullptr) {
|
||||
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) {
|
||||
"%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;
|
||||
|
@ -207,7 +207,8 @@ class CCSDSTime {
|
||||
|
||||
static ReturnValue_t convertFromASCII(Clock::TimeOfDay_t *to, uint8_t const *from,
|
||||
uint8_t length);
|
||||
static ReturnValue_t convertToAsciiWithSecs(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);
|
||||
|
||||
private:
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <fsfw/serviceinterface.h>
|
||||
|
||||
SerialCookie::SerialCookie(object_id_t handlerId, std::string deviceFile, UartBaudRate baudrate,
|
||||
size_t maxReplyLen, UartModes uartMode)
|
||||
size_t maxReplyLen, UartModes uartMode)
|
||||
: handlerId(handlerId),
|
||||
deviceFile(deviceFile),
|
||||
uartMode(uartMode),
|
||||
|
@ -30,7 +30,7 @@ class SerialCookie : public CookieIF {
|
||||
* One stop bit
|
||||
*/
|
||||
SerialCookie(object_id_t handlerId, std::string deviceFile, UartBaudRate baudrate,
|
||||
size_t maxReplyLen, UartModes uartMode = UartModes::NON_CANONICAL);
|
||||
size_t maxReplyLen, UartModes uartMode = UartModes::NON_CANONICAL);
|
||||
|
||||
virtual ~SerialCookie();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user