OpenCyphal / libcanard

A compact implementation of the Cyphal/CAN protocol in C for high-integrity real-time embedded systems
http://opencyphal.org
MIT License
326 stars 192 forks source link

How to process global time sync on libcanard #128

Closed Cherish-forever closed 5 years ago

Cherish-forever commented 5 years ago

How can I use libcanard as time sync slave to update local timer? Is there have any example?

pavel-kirienko commented 5 years ago

I am not aware of any, but it's not hard. The algorithm is described here: https://uavcan.org/Specification/6._Application_level_functions/#slave and implementation is available in libuavcan: https://github.com/UAVCAN/libuavcan/blob/master/libuavcan/include/uavcan/protocol/global_time_sync_slave.hpp