#include <clock.hpp>
Public Member Functions | |
void | adjustUtc (const uavcan::UtcDuration adjustment) override |
std::uint64_t | getAdjustmentCount () const |
ClockAdjustmentMode | getAdjustmentMode () const |
std::uint64_t | getGradualAdjustmentCount () const |
uavcan::UtcDuration | getGradualAdjustmentLimit () const |
uavcan::MonotonicTime | getMonotonic () const override |
uavcan::UtcDuration | getPrivateAdjustment () const |
std::uint64_t | getStepAdjustmentCount () const |
uavcan::UtcTime | getUtc () const override |
void | setGradualAdjustmentLimit (uavcan::UtcDuration limit) |
SystemClock (ClockAdjustmentMode adj_mode=detectPreferredClockAdjustmentMode()) | |
![]() | |
virtual | ~ISystemClock () |
Static Public Member Functions | |
static ClockAdjustmentMode | detectPreferredClockAdjustmentMode () |
Private Member Functions | |
bool | performGradualAdjustment (const uavcan::UtcDuration adjustment) |
bool | performStepAdjustment (const uavcan::UtcDuration adjustment) |
Private Attributes | |
const ClockAdjustmentMode | adj_mode_ |
std::uint64_t | gradual_adj_cnt_ |
uavcan::UtcDuration | gradual_adj_limit_ |
uavcan::UtcDuration | private_adj_ |
std::uint64_t | step_adj_cnt_ |
Static Private Attributes | |
static constexpr std::int64_t | Int1e6 = 1000000 |
static constexpr std::uint64_t | UInt1e6 = 1000000 |
Linux system clock driver. Requires librt.
Definition at line 33 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inlineexplicit |
By default, the clock adjustment mode will be selected automatically - global if root, private otherwise.
Definition at line 72 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inlineoverridevirtual |
Adjusts the wall clock. Behavior depends on the selected clock adjustment mode - ClockAdjustmentMode. Clock adjustment mode can be set only once via constructor.
If the system wide adjustment mode is selected, two ways for performing adjustment exist:
uavcan_linux::Exception. |
Implements uavcan::ISystemClock.
Definition at line 124 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inlinestatic |
This static method decides what is the optimal clock sync adjustment mode for the current configuration. It selects system wide mode if the application is running as root; otherwise it prefers the private adjustment mode because the system wide mode requires root privileges.
Definition at line 189 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inline |
Definition at line 179 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inline |
Definition at line 166 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inline |
Definition at line 178 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inline |
Definition at line 164 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inlineoverridevirtual |
Returns monotonic timestamp from librt.
uavcan_linux::Exception. |
Implements uavcan::ISystemClock.
Definition at line 83 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inline |
This is only applicable if the selected clock adjustment mode is private. In system wide mode this method will always return zero duration.
Definition at line 172 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inline |
Statistics that allows to evaluate clock sync preformance.
Definition at line 177 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inlineoverridevirtual |
Returns wall time from gettimeofday().
uavcan_linux::Exception. |
Implements uavcan::ISystemClock.
Definition at line 97 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inlineprivate |
Definition at line 58 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inlineprivate |
Definition at line 44 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
inline |
Sets the maximum phase error to use adjtime(). If the phase error exceeds this value, settimeofday() will be used instead.
Definition at line 155 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
private |
Definition at line 37 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
private |
Definition at line 39 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
private |
Definition at line 36 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
staticconstexprprivate |
Definition at line 41 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
private |
Definition at line 35 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
private |
Definition at line 38 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.
|
staticconstexprprivate |
Definition at line 42 of file platform_specific_components/linux/libuavcan/include/uavcan_linux/clock.hpp.