1#![doc = include_str!("../README.md")]
2
3pub mod bindings;
4pub mod board_sidecar;
5pub mod camera_probe;
6pub mod daemon;
7pub mod host_facts;
8pub mod probe;
9pub mod runner;
10pub mod sensor_hub;
11
12pub use ados_protocol::hwcaps::{
13 AbsenceReason, CoreCluster, EncoderDevice, Evidence, HardwareCapabilities, Midr, ProbePhase,
14 Probed, SerialPort, SocCompatible, UsbId, V4l2Node,
15};
16
17pub use probe::{
18 cpu::probe_cores, serial::probe_serial_ports, soc::probe_soc, usb::probe_usb_ids,
19 video::probe_h264_encoder,
20};
21
22pub use runner::{run_probe_sandboxed, ProbeOutcome};
23
24pub fn probe_all(phase: ProbePhase, crsf_pin: Option<&str>) -> HardwareCapabilities {
36 HardwareCapabilities {
37 cpu: probe_cores(),
38 soc: probe_soc(),
39 h264_encoder: probe_h264_encoder(phase),
40 usb: probe_usb_ids(),
41 serial: probe_serial_ports(crsf_pin),
42 }
43}
44
45#[cfg(test)]
46mod tests {
47 use super::*;
48
49 #[test]
50 fn probe_all_runtime_defers_destructive_encoder_probe() {
51 let caps = probe_all(ProbePhase::Runtime, None);
54 assert!(matches!(caps.h264_encoder, Probed::NotProbed));
55 }
56}