mirror of
https://github.com/nasa/fprime.git
synced 2025-12-11 13:54:34 -06:00
* Format Svc and add to CI * Fix comlogger include * fix assert UTs * Fix static analysis warning * formatting
26 lines
672 B
C++
26 lines
672 B
C++
/*
|
|
* TestCommand1Impl.cpp
|
|
*
|
|
* Created on: Mar 28, 2014
|
|
* Author: tcanham
|
|
*/
|
|
|
|
#include <Fw/Time/Time.hpp>
|
|
#include <Svc/PosixTime/PosixTime.hpp>
|
|
#include <ctime>
|
|
|
|
namespace Svc {
|
|
|
|
PosixTime::PosixTime(const char* name) : PosixTimeComponentBase(name) {}
|
|
|
|
PosixTime::~PosixTime() {}
|
|
|
|
void PosixTime::timeGetPort_handler(FwIndexType portNum, /*!< The port number*/
|
|
Fw::Time& time /*!< The U32 cmd argument*/
|
|
) {
|
|
timespec stime;
|
|
(void)clock_gettime(CLOCK_REALTIME, &stime);
|
|
time.set(TimeBase::TB_WORKSTATION_TIME, 0, static_cast<U32>(stime.tv_sec), static_cast<U32>(stime.tv_nsec / 1000));
|
|
}
|
|
} // namespace Svc
|