16 int status = clock_gettime(CLOCK_REALTIME, &this->m_handle.
m_timespec);
28 if ((t1.tv_sec < t2.tv_sec) or (t1.tv_sec == t2.tv_sec and t1.tv_nsec < t2.tv_nsec)) {
34 U32 sec =
static_cast<U32
>(t1.tv_sec - t2.tv_sec);
36 if (t1.tv_nsec < t2.tv_nsec) {
38 nanosec =
static_cast<U32
>(t1.tv_nsec + (1000000000 - t2.tv_nsec));
40 nanosec =
static_cast<U32
>(t1.tv_nsec - t2.tv_nsec);
43 interval.
set(sec, nanosec / 1000);
49 "PosixRawTime implementation requires at least 2*sizeof(U32) serialization size");
59 "PosixRawTime implementation requires at least 2*sizeof(U32) serialization size");
70 this->m_handle.
m_timespec = {
static_cast<time_t
>(sec), static_cast<long>(nsec)};
75 return &this->m_handle;
Serialization/Deserialization operation was successful.
RawTime::Status errno_to_rawtime_status(int errno_input)
static const FwSizeType SERIALIZED_SIZE
Status getTimeInterval(const Os::RawTime &other, Fw::TimeInterval &interval) const override
Calculate the time interval between this and another raw time.
void set(U32 seconds, U32 useconds)
Fw::SerializeStatus serializeTo(Fw::SerializeBufferBase &buffer) const override
Serialize the contents of the RawTimeInterface object into a buffer.
SerializeStatus
forward declaration for string
Fw::SerializeStatus deserializeFrom(Fw::SerializeBufferBase &buffer) override
Deserialize the contents of the RawTimeInterface object from a buffer.
Status now() override
Get the current time.
SerializeStatus serializeFrom(U8 val)
serialize 8-bit unsigned int
RawTimeHandle * getHandle() override
return the underlying RawTime handle (implementation specific)
SerializeStatus deserializeTo(U8 &val)
deserialize 8-bit unsigned int