Function actuate_ventilation

Source
fn actuate_ventilation(
    command: InternalCommand,
    mutex_device_scheduler_ventilation: &Arc<Mutex<i32>>,
    mutex_blocked_during_actuation: &mut bool,
    ventilation_channels: &mut VentilationChannels,
)
Expand description

Sends a command to the relay manager to actuate the ventilation and waits for a response.

This private helper function encapsulates the logic for sending a command (either SwitchOn or SwitchOff) to the relay manager. It handles channel communication, error logging, and updates the shared actuation mutex.

ยงArguments

  • command - The InternalCommand to send (SwitchOn or SwitchOff).
  • mutex_device_scheduler_ventilation - A reference to the shared actuation mutex.
  • mutex_blocked_during_actuation - A mutable flag to track if the actuation mutex was blocked.
  • ventilation_channels - A mutable reference to the struct containing the channels.