Bootstrap DD3 Rust port workspace with host-first compatibility tests

This commit is contained in:
2026-02-21 00:59:03 +01:00
parent d3f9a2e62d
commit d0212f4e38
63 changed files with 3914 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
use std::vec::Vec;
pub trait Clock {
fn now_ms(&self) -> u64;
fn now_utc(&self) -> u32;
fn is_time_synced(&self) -> bool;
}
pub trait Radio {
fn send_frame(&mut self, frame: &[u8]) -> bool;
fn recv_frame(&mut self, window_ms: u32, now_ms: u64) -> Option<Vec<u8>>;
}
pub trait Publisher {
fn publish_state(&mut self, device_id: &str, payload: &str);
fn publish_faults(&mut self, device_id: &str, payload: &str);
fn publish_discovery(&mut self, device_id: &str, payload: &str);
}
pub trait Storage {
fn append_csv(&mut self, device_id: &str, line: &str);
}
pub trait StatusSink {
fn sender_phase(&mut self, _phase: &str) {}
fn receiver_status(&mut self, _status: &str) {}
}