update docs + agents
This commit is contained in:
@@ -133,6 +133,23 @@ impl SensorBus for GenericLinuxSal {
|
||||
Err(anyhow!("Could not determine CPU frequency"))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_throttling_status(&self) -> Result<bool> {
|
||||
// Fallback: check if any cooling device is active (cur_state > 0)
|
||||
let cooling_base = self.ctx.sysfs_base.join("sys/class/thermal");
|
||||
if let Ok(entries) = fs::read_dir(cooling_base) {
|
||||
for entry in entries.flatten() {
|
||||
if entry.file_name().to_string_lossy().starts_with("cooling_device") {
|
||||
if let Ok(state) = fs::read_to_string(entry.path().join("cur_state")) {
|
||||
if state.trim().parse::<u32>().unwrap_or(0) > 0 {
|
||||
return Ok(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(false)
|
||||
}
|
||||
}
|
||||
|
||||
impl ActuatorBus for GenericLinuxSal {
|
||||
|
||||
Reference in New Issue
Block a user