| 6 | /// 或者作为 FrameMetadata 的扩展。 |
| 7 | #[derive(Clone, Default, PartialEq)] |
| 8 | pub struct DeviceTelemetry { |
| 9 | /// 芯片核心温度 (摄氏度) |
| 10 | /// 如果过高,意味着可能发生了热节流 (Thermal Throttling) |
| 11 | pub temperature_c: Option<f32>, |
| 12 | |
| 13 | /// 当前 USB/网络链路的实际吞吐量 (Mbps) |
| 14 | pub link_throughput_mbps: Option<u32>, |
| 15 | |
| 16 | /// 传输层丢包/误码计数 |
| 17 | /// 比如 USB 的 Isochronous Packet Errors 或 GigE 的 Packet Resend |
| 18 | pub transmission_errors: u64, |
| 19 | |
| 20 | /// 丢帧计数器 (因缓冲区溢出或 CPU 处理慢) |
| 21 | pub dropped_frames: u64, |
| 22 | |
| 23 | /// 损坏帧计数器 (因 Payload 校验失败) |
| 24 | pub corrupted_frames: u64, |
| 25 | |
| 26 | /// 当前功耗估算 (毫瓦/mW) |
| 27 | pub power_consumption_mw: Option<u32>, |
| 28 | } |
| 29 | |
| 30 | impl fmt::Debug for DeviceTelemetry { |
| 31 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
nothing calls this directly
no outgoing calls
no test coverage detected