mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 02:41:35 +08:00
libuavcan documentation
This commit is contained in:
@@ -13,7 +13,15 @@
|
||||
namespace uavcan
|
||||
{
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
class UAVCAN_EXPORT GlobalTimeSyncMaster : protected LoopbackFrameListenerBase
|
||||
@@ -57,10 +65,29 @@ public:
|
||||
, initialized_(false)
|
||||
{ }
|
||||
|
||||
/**
|
||||
* Merely prepares the class to work, doesn't do anything else.
|
||||
* Must be called before the master can be used.
|
||||
* Returns negative error code.
|
||||
*/
|
||||
int init();
|
||||
|
||||
/**
|
||||
* Whether the master instance has been initialized.
|
||||
*/
|
||||
bool isInitialized() const { return initialized_; }
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
int publish();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user