#include <global_time_sync_master.hpp>
Classes | |
class | IfaceMaster |
Public Member Functions | |
GlobalTimeSyncMaster (INode &node) | |
int | init (const TransferPriority priority=TransferPriority::OneLowerThanHighest) |
bool | isInitialized () const |
int | publish () |
Private Member Functions | |
int | getNextTransferID (TransferID &tid) |
virtual void | handleLoopbackFrame (const RxFrame &frame) |
Private Attributes | |
DataTypeID | dtid_ |
LazyConstructor< IfaceMaster > | iface_masters_ [MaxCanIfaces] |
bool | initialized_ |
INode & | node_ |
MonotonicTime | prev_pub_mono_ |
Additional Inherited Members | |
![]() | |
Dispatcher & | getDispatcher () |
bool | isListening () const |
LoopbackFrameListenerBase (Dispatcher &dispatcher) | |
void | startListening () |
void | stopListening () |
virtual | ~LoopbackFrameListenerBase () |
![]() | |
LinkedListNode () | |
~LinkedListNode () | |
LoopbackFrameListenerBase * | getNextListNode () const |
void | setNextListNode (LoopbackFrameListenerBase *node) |
Please read the specs to learn how the time synchronization works.
No more than one object of this class is allowed per node; otherwise a disaster is bound to happen.
NOTE: In order for this class to work, the platform driver must implement CAN bus TX loopback with both UTC and monotonic timestamping.
Ref. M. Gergeleit, H. Streich - "Implementing a Distributed High-Resolution Real-Time Clock using the CAN-Bus"
TODO: Enforce max one master per node
Definition at line 32 of file global_time_sync_master.hpp.
|
inlineexplicit |
Definition at line 143 of file global_time_sync_master.hpp.
|
inlineprivate |
Definition at line 123 of file global_time_sync_master.hpp.
|
inlineprivatevirtual |
Implements uavcan::LoopbackFrameListenerBase.
Definition at line 104 of file global_time_sync_master.hpp.
|
inline |
Merely prepares the class to work, doesn't do anything else. Must be called before the master can be used. Returns negative error code.
Definition at line 154 of file global_time_sync_master.hpp.
|
inline |
Whether the master instance has been initialized.
Definition at line 197 of file global_time_sync_master.hpp.
|
inline |
Publishes one sync message.
Every call to this method hints the master to publish the next sync message once. Exact time will be obtained from the TX loopback timestamp field.
This method shall be called with a proper interval - refer to the time sync message definition for min/max interval values.
Returns negative error code.
Definition at line 210 of file global_time_sync_master.hpp.
|
private |
Definition at line 101 of file global_time_sync_master.hpp.
|
private |
Definition at line 99 of file global_time_sync_master.hpp.
|
private |
Definition at line 102 of file global_time_sync_master.hpp.
|
private |
Definition at line 98 of file global_time_sync_master.hpp.
|
private |
Definition at line 100 of file global_time_sync_master.hpp.