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.
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const override
Serialize the contents of the RawTimeInterface object into a buffer.
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
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)
SerializeStatus
forward declaration for string
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
Status now() override
Get the current time.
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
RawTimeHandle * getHandle() override
return the underlying RawTime handle (implementation specific)
RawTime::Status errno_to_rawtime_status(PlatformIntType errno_input)
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer) override
Deserialize the contents of the RawTimeInterface object from a buffer.