Skip to content

Commit

Permalink
catch case where device may not allow write in VISA
Browse files Browse the repository at this point in the history
  • Loading branch information
esarver committed Sep 24, 2024
1 parent 16aa1eb commit 9dbe2ed
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion kic-discover-visa/src/visa.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::{collections::HashSet, ffi::CString, time::Duration};

use async_std::fs::write;
use serde::{Deserialize, Serialize};
use tracing::trace;
use tsp_toolkit_kic_lib::{
Expand Down Expand Up @@ -39,7 +40,14 @@ pub async fn visa_discover(timeout: Option<Duration>) -> anyhow::Result<HashSet<
};

trace!("Getting info from {connected:?}");
let mut info = get_info(&mut connected)?;
let mut info = match get_info(&mut connected) {
Ok(i) => i,
Err(_) => {
trace!("Unable to write to {i}, skipping");
drop(connected);
continue;
}
};
info.address = Some(ConnectionAddr::Visa(i.clone()));
trace!("Got info: {info:?}");
let res = model_check(info.clone().model.unwrap_or("".to_string()).as_str());
Expand Down

0 comments on commit 9dbe2ed

Please sign in to comment.