Skip to content

Commit

Permalink
Merge pull request #22 from DeflateAwning/privacy-sw-1
Browse files Browse the repository at this point in the history
Clarify meaning of privacy switch statuses
  • Loading branch information
JohnAZoidberg authored Apr 8, 2024
2 parents 491a587 + bf996a9 commit 053d6ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion framework_lib/src/chromium_ec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ impl CrosEc {
))
}

/// Get current status of Framework Laptop's privacy switches (microphone and camera)
/// Get current status of Framework Laptop's microphone and camera privacy switches
/// [true = device enabled/connected, false = device disabled]
pub fn get_privacy_info(&self) -> EcResult<(bool, bool)> {
let status = EcRequestPrivacySwitches {}.send_command(self)?;

Expand Down
11 changes: 7 additions & 4 deletions framework_lib/src/commandline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,12 +512,15 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
} else if args.privacy {
if let Some((mic, cam)) = print_err(ec.get_privacy_info()) {
println!(
"Microphone privacy switch: {}",
if mic { "Open" } else { "Closed" }
"Privacy Slider (Black = Device Connected; Red = Device Disconnected)"
);
println!(
"Camera privacy switch: {}",
if cam { "Open" } else { "Closed" }
" Microphone: {}",
if mic { "Connected" } else { "Disconnected" }
);
println!(
" Camera: {}",
if cam { "Connected" } else { "Disconnected" }
);
} else {
println!("Not all EC versions support this comand.")
Expand Down

0 comments on commit 053d6ef

Please sign in to comment.