Public Member Functions | List of all members
uavcan::ISystemClock Class Referenceabstract

#include <system_clock.hpp>

Inheritance diagram for uavcan::ISystemClock:
Inheritance graph
[legend]

Public Member Functions

virtual void adjustUtc (UtcDuration adjustment)=0
 
virtual MonotonicTime getMonotonic () const =0
 
virtual UtcTime getUtc () const =0
 
virtual ~ISystemClock ()
 

Detailed Description

System clock interface - monotonic and UTC.

Definition at line 19 of file system_clock.hpp.

Constructor & Destructor Documentation

◆ ~ISystemClock()

virtual uavcan::ISystemClock::~ISystemClock ( )
inlinevirtual

Definition at line 22 of file system_clock.hpp.

Member Function Documentation

◆ adjustUtc()

virtual void uavcan::ISystemClock::adjustUtc ( UtcDuration  adjustment)
pure virtual

Adjust the network-synchronized clock. Refer to getUtc() for details.

For POSIX refer to adjtime(), settimeofday().

Parameters
[in]adjustmentAmount of time to add to the clock value.

Implemented in uavcan_lpc11c24::SystemClock, uavcan_kinetis::SystemClock, uavcan_stm32::SystemClock, SystemClockDriver, SystemClockMock, and uavcan_linux::SystemClock.

◆ getMonotonic()

virtual MonotonicTime uavcan::ISystemClock::getMonotonic ( ) const
pure virtual

Monototic system clock.

This clock shall never jump or change rate; the base time is irrelevant. This clock is mandatory and must remain functional at all times.

On POSIX systems use clock_gettime() with CLOCK_MONOTONIC.

Implemented in uavcan_linux::SystemClock, uavcan_lpc11c24::SystemClock, uavcan_kinetis::SystemClock, uavcan_stm32::SystemClock, SystemClockDriver, and SystemClockMock.

◆ getUtc()

virtual UtcTime uavcan::ISystemClock::getUtc ( ) const
pure virtual

Global network clock. It doesn't have to be UTC, the name is a bit misleading - actual time base doesn't matter.

This clock can be synchronized with other nodes on the bus, hence it can jump and/or change rate occasionally. This clock is optional; if it is not supported, return zero. Also return zero if the UTC time is not available yet (e.g. the device has just started up with no battery clock).

For POSIX refer to clock_gettime(), gettimeofday().

Implemented in uavcan_linux::SystemClock, uavcan_lpc11c24::SystemClock, uavcan_kinetis::SystemClock, uavcan_stm32::SystemClock, SystemClockDriver, and SystemClockMock.


The documentation for this class was generated from the following file:


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:04