| 
    BlueSync - BLE Time Sync for Zephyr
    
   High-precision time synchronization for BLE Mesh networks 
   | 
 
Functions and definitions to use the BlueSync time synchronization system. More...
Enumerations | |
| enum | bluesync_role_t { BLUESYNC_NONE_ROLE = 0 , BLUESYNC_AUTHORITY_ROLE = 1 , BLUESYNC_CLIENT_ROLE = 2 } | 
| Defines the operational roles for a BlueSync node.  More... | |
Functions | |
| void | bluesync_init (void) | 
| Initializes the BlueSync time synchronization module.   | |
| void | bluesync_set_role (bluesync_role_t role) | 
| Sets the operational role of the BlueSync node.   | |
| void | bluesync_start_net_sync (void) | 
| Starts a BlueSync synchronization round as the time authority.   | |
| void | bluesync_start_net_sync_with_unix_epoch_us (uint64_t unix_epoch_us) | 
| Starts a synchronization round using a known UNIX epoch time.   | |
| uint64_t | get_current_unix_time_us (void) | 
| Gets the current synchronized UNIX time.   | |
Functions and definitions to use the BlueSync time synchronization system.
This group contains the public interface of the BlueSync module.
| enum bluesync_role_t | 
Defines the operational roles for a BlueSync node.
| Enumerator | |
|---|---|
| BLUESYNC_NONE_ROLE | No role assigned.  | 
| BLUESYNC_AUTHORITY_ROLE | Acts as the time authority (reference clock).  | 
| BLUESYNC_CLIENT_ROLE | Acts as a time-synchronized client.  | 
Definition at line 44 of file bluesync.h.
| void bluesync_init | ( | void | ) | 
Initializes the BlueSync time synchronization module.
This function sets up internal data structures, mutexes, and state variables required for BlueSync to operate. It should be called once at startup before any synchronization or logical time queries are made.
Definition at line 646 of file bluesync.c.
| void bluesync_set_role | ( | bluesync_role_t | role | ) | 
Sets the operational role of the BlueSync node.
This function configures the role of the device within the BlueSync synchronization system. Roles define whether the device acts as a time authority or as a client.
| role | Role to assign to the device. Must be one of bluesync_role_t:
  | 
Definition at line 656 of file bluesync.c.
| void bluesync_start_net_sync | ( | void | ) | 
Starts a BlueSync synchronization round as the time authority.
This should be called by the device with the BLUESYNC_AUTHORITY_ROLE to broadcast synchronization data to clients.
Definition at line 667 of file bluesync.c.
| void bluesync_start_net_sync_with_unix_epoch_us | ( | uint64_t | unix_epoch_us | ) | 
Starts a synchronization round using a known UNIX epoch time.
This function is used by the authority node to synchronize the network based on an external UNIX time reference.
| unix_epoch_us | UNIX epoch timestamp in microseconds. | 
Definition at line 678 of file bluesync.c.
| uint64_t get_current_unix_time_us | ( | void | ) | 
Gets the current synchronized UNIX time.
This returns the current time as synchronized with the authority node, expressed in microseconds since the UNIX epoch.
Definition at line 138 of file local_time.c.