Linux clock driver

This commit is contained in:
Pavel Kirienko
2014-03-29 19:44:16 +04:00
parent 68a91d888d
commit af14b4efec
4 changed files with 183 additions and 2 deletions
@@ -3,12 +3,28 @@
*/
#include <iostream>
#include <cerrno>
#include <uavcan/uavcan.hpp>
#include <uavcan_linux/socketcan.hpp>
#include <uavcan_linux/clock.hpp>
int main()
{
std::cout << "Hello owl." << std::endl;
double sec = 0;
std::cout << "Enter system time adjustment in seconds: " << std::endl;
std::cin >> sec;
uavcan_linux::SystemClockDriver clock;
try
{
clock.adjustUtc(uavcan::UtcDuration::fromUSec(sec * 1e6));
}
catch (const uavcan_linux::Exception& ex)
{
std::cout << ex.what() << std::endl;
std::cout << strerror(ex.getErrno()) << std::endl;
}
return 0;
}