|
BlueSync - BLE Time Sync for Zephyr
High-precision time synchronization for BLE Mesh networks
|
#include <stdint.h>

Go to the source code of this file.
Functions | |
| uint64_t | get_logical_time_us (void) |
| Get the logical time us value. This is the corrected us value after synchronisation. This represents the unix epoch timestamp in us of the overall mesh network. Basically, it converts logical ticks into us. | |
| uint64_t | get_logical_time_ticks (void) |
| Get the logical time ticks value. This is the corrected ticks value after synchronisation. This represents the unix epoch timestamp in ticks of the overall mesh network. | |
| uint64_t | convert_uptime_ticks_to_est_master_ticks (uint64_t uptime_ticks) |
| Convert a ticks value into an estimation in ticks of the overall unix epoch timestamp. | |
| double | get_current_slope_ticks () |
| Get the current slope ticks value. | |
| double | get_current_offset_ticks () |
| Get the current offset ticks value. | |
| int64_t | get_uptime_ticks_with_epoch () |
| Get the uptime ticks with epoch value. This method concerns only the authority Role. This method will return the unix epoch timestamp based on the elapsed time (uptime - ref) and add the overall reference. | |
| void | set_new_epoch_unix_ref (uint64_t epoch_ref_us) |
| Set the new epoch unix ref value. Before the authority node starts a new network synchronisation, it should update the epoch reference. | |
| void | apply_timer_sync (double slope_timer, double offset_timer_us) |
| Apply the synchronisation parameters. Once the LR is made, The result of it gives a drift value (slope) and the difference between itself and the reference (offset). This method permits to set these parameters in order to have the proper correction when getting timestamps values. | |
| uint64_t | uncompress_time (uint32_t compress_32bit_timestamp) |
| Convert a uint32_t timestamps into a uint64_t values. This should be used in the sink node. In the Mesh network, pakcet payload is limited. Therefore only uint32_t timestamp can be used. When the sink received this kind of value, it can reconstruct the correct timestamps value. | |
| void apply_timer_sync | ( | double | slope_timer, |
| double | offset_timer_us | ||
| ) |
Apply the synchronisation parameters. Once the LR is made, The result of it gives a drift value (slope) and the difference between itself and the reference (offset). This method permits to set these parameters in order to have the proper correction when getting timestamps values.
| slope_timer | |
| offset_timer_us |
Definition at line 101 of file local_time.c.
| uint64_t convert_uptime_ticks_to_est_master_ticks | ( | uint64_t | uptime_ticks | ) |
Convert a ticks value into an estimation in ticks of the overall unix epoch timestamp.
| uptime_ticks | : value that should be concerted |
| double get_current_offset_ticks | ( | ) |
| double get_current_slope_ticks | ( | ) |
| uint64_t get_logical_time_ticks | ( | void | ) |
Get the logical time ticks value. This is the corrected ticks value after synchronisation. This represents the unix epoch timestamp in ticks of the overall mesh network.
Definition at line 97 of file local_time.c.
| uint64_t get_logical_time_us | ( | void | ) |
Get the logical time us value. This is the corrected us value after synchronisation. This represents the unix epoch timestamp in us of the overall mesh network. Basically, it converts logical ticks into us.
Definition at line 92 of file local_time.c.
| int64_t get_uptime_ticks_with_epoch | ( | ) |
Get the uptime ticks with epoch value. This method concerns only the authority Role. This method will return the unix epoch timestamp based on the elapsed time (uptime - ref) and add the overall reference.
Definition at line 143 of file local_time.c.
| void set_new_epoch_unix_ref | ( | uint64_t | epoch_ref_us | ) |
Set the new epoch unix ref value. Before the authority node starts a new network synchronisation, it should update the epoch reference.
| epoch_ref_ms |
Definition at line 112 of file local_time.c.
| uint64_t uncompress_time | ( | uint32_t | compress_32bit_timestamp | ) |
Convert a uint32_t timestamps into a uint64_t values. This should be used in the sink node. In the Mesh network, pakcet payload is limited. Therefore only uint32_t timestamp can be used. When the sink received this kind of value, it can reconstruct the correct timestamps value.
| compress_32bit_timestamp |
Definition at line 163 of file local_time.c.