|
BlueSync - BLE Time Sync for Zephyr
High-precision time synchronization for BLE Mesh networks
|

Go to the source code of this file.
Functions | |
| void | print_bitfield_as_binary (uint8_t *bitfield, size_t size) |
| void | set_bit (uint8_t *bitfield, size_t bit_index) |
| Set a specific bit in the bitfield. | |
| bool | is_bit_set (uint8_t *bitfield, size_t bit_index) |
| Check if a specific bit is set in the bitfield. | |
| void | bitwise_and_bitfields (uint8_t *result, const bluesync_timestamps_t *rcv, const bluesync_timestamps_t *local, size_t num_bytes) |
| Perform a bitwise AND between two bitfields and store the result. | |
| static uint8_t | count_bits_in_byte (uint8_t byte) |
| size_t | count_set_bits (uint8_t *bitfield, size_t num_bytes) |
| Count the number of bits set to 1 in a bitfield. | |
| void bitwise_and_bitfields | ( | uint8_t * | result, |
| const bluesync_timestamps_t * | rcv, | ||
| const bluesync_timestamps_t * | local, | ||
| size_t | num_bytes | ||
| ) |
Perform a bitwise AND between two bitfields and store the result.
This is typically used to find common timestamps (slots) between received and local sets.
| result | Output buffer where the result will be stored. |
| rcv | Pointer to the bitfield from received timestamps. |
| local | Pointer to the bitfield from local timestamps. |
| num_bytes | Number of bytes in each bitfield. |
Definition at line 45 of file bluesync_bitfields.c.
|
inlinestatic |
Definition at line 52 of file bluesync_bitfields.c.
| size_t count_set_bits | ( | uint8_t * | bitfield, |
| size_t | num_bytes | ||
| ) |
Count the number of bits set to 1 in a bitfield.
Useful for determining how many timeslots have been received.
| bitfield | Pointer to the bitfield array. |
| num_bytes | Number of bytes in the bitfield. |
Definition at line 68 of file bluesync_bitfields.c.
| bool is_bit_set | ( | uint8_t * | bitfield, |
| size_t | bit_index | ||
| ) |
Check if a specific bit is set in the bitfield.
| bitfield | Pointer to the bitfield array. |
| bit_index | Index of the bit to check. |
Definition at line 41 of file bluesync_bitfields.c.
| void print_bitfield_as_binary | ( | uint8_t * | bitfield, |
| size_t | size | ||
| ) |
Definition at line 29 of file bluesync_bitfields.c.
| void set_bit | ( | uint8_t * | bitfield, |
| size_t | bit_index | ||
| ) |
Set a specific bit in the bitfield.
| bitfield | Pointer to the bitfield array. |
| bit_index | Index of the bit to set. |
Definition at line 37 of file bluesync_bitfields.c.