Expand description
CRDT (Conflict-free Replicated Data Types) for Peat-Lite
Provides lightweight CRDT implementations optimized for BLE sync:
- LWW-Register: Last-Writer-Wins for single values
- G-Counter: Grow-only counter for metrics
These are designed for minimal memory footprint and efficient serialization over constrained BLE connections.
Structs§
- Emergency
Event - An emergency event with acknowledgment tracking (CRDT)
- GCounter
- A Grow-only Counter (G-Counter)
- Health
Status - Health status data with LWW semantics
- LwwRegister
- A Last-Writer-Wins Register
- Peripheral
- A peripheral device attached to a Node (soldier)
- Peripheral
Event - An event emitted by a peripheral (e.g., tap on Core2)
- Position
- Position data with LWW semantics
Enums§
- Crdt
Operation - CRDT operation types for sync
- Event
Type - Event types that a peripheral can emit (e.g., from tap input)
- Peripheral
Type - Type of peripheral device
Constants§
- MAX_
BATTERY_ PERCENT - Maximum valid battery percentage (100%)
- MAX_
COUNTER_ ENTRIES - Maximum number of counter entries (prevents DoS)
- MAX_
EMERGENCY_ ACKS - Maximum number of ACK entries in an emergency event (prevents DoS)
- MAX_
HEART_ RATE - Maximum valid heart rate (BPM) - anything above is likely garbage
- MIN_
HEART_ RATE - Minimum valid heart rate (BPM) - anything below is likely garbage
- MIN_
VALID_ TIMESTAMP - Minimum valid timestamp: 2020-01-01 00:00:00 UTC (milliseconds) Any timestamp before this is rejected as invalid/spoofed.
Type Aliases§
- Timestamp
- Timestamp for CRDT operations (milliseconds since epoch or monotonic)