BlueSync - BLE Time Sync for Zephyr
High-precision time synchronization for BLE Mesh networks
Loading...
Searching...
No Matches
bluesync.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 Tobias Moullet
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * Project: BlueSync - BLE Time Sync for Zephyr
17 * Repository: https://github.com/Tobi15/zephyr-bluesync-ble
18 */
19
36#ifndef BLUESYNC_H
37#define BLUESYNC_H
38
39#include <zephyr/kernel.h>
40
49
57void bluesync_init(void);
58
72
80
89void bluesync_start_net_sync_with_unix_epoch_us(uint64_t unix_epoch_us);
90
99uint64_t get_current_unix_time_us(void);
100
101#endif /* BLUESYNC_H */
102
// end of bluesync_api
void bluesync_set_role(bluesync_role_t role)
Sets the operational role of the BlueSync node.
Definition bluesync.c:656
uint64_t get_current_unix_time_us(void)
Gets the current synchronized UNIX time.
Definition local_time.c:138
void bluesync_start_net_sync_with_unix_epoch_us(uint64_t unix_epoch_us)
Starts a synchronization round using a known UNIX epoch time.
Definition bluesync.c:678
void bluesync_start_net_sync(void)
Starts a BlueSync synchronization round as the time authority.
Definition bluesync.c:667
bluesync_role_t
Defines the operational roles for a BlueSync node.
Definition bluesync.h:44
void bluesync_init(void)
Initializes the BlueSync time synchronization module.
Definition bluesync.c:646
@ BLUESYNC_CLIENT_ROLE
Definition bluesync.h:47
@ BLUESYNC_NONE_ROLE
Definition bluesync.h:45
@ BLUESYNC_AUTHORITY_ROLE
Definition bluesync.h:46