Skip to content

Commit

Permalink
Create kic-discover-visa
Browse files Browse the repository at this point in the history
  • Loading branch information
esarver committed Sep 4, 2024
1 parent 8edebd8 commit cc2e202
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 54 deletions.
93 changes: 47 additions & 46 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@ clap = { version = "4.5.9", features = ["derive", "cargo", "string"] }
colored = "2.1.0"
exitcode = "1.1.2"
instrument-repl = { path = "instrument-repl" }
jsonrpsee = { version = "0.22.3", features = [
"tokio",
"tracing",
"server",
] }
jsonrpsee = { version = "0.22.3", features = ["tokio", "tracing", "server"] }
local-ip-address = "0.6.1"
mdns = { git = "https://github.com/jaime-sense/mdns", rev = "498cf7cceaf7e2683a2e352b7e8a15dfc1c29037" } # until https://github.com/dylanmckay/mdns/pull/27 is closed
mdns = { git = "https://github.com/jaime-sense/mdns", rev = "498cf7cceaf7e2683a2e352b7e8a15dfc1c29037" } # until https://github.com/dylanmckay/mdns/pull/27 is closed
minidom = "0.15.2"
mockall = { version = "0.12.1", features = ["nightly"] }
phf = { version = "0.11.2", features = ["macros"] }
Expand All @@ -44,7 +40,7 @@ thiserror = "1.0.58"
tmc = { git = "https://github.com/esarver/rusb-usbtmc" }
tracing = { version = "0.1.40", features = ["async-await"] }
tracing-subscriber = { version = "0.3.18", features = ["json"] }
tsp-toolkit-kic-lib = { git = "https://github.com/tektronix/tsp-toolkit-kic-lib.git", tag = "v0.17.2-0" }
tsp-toolkit-kic-lib = { git = "https://github.com/tektronix/tsp-toolkit-kic-lib.git", branch = "task/discover-visa" }


[workspace.lints.rust]
Expand All @@ -59,4 +55,3 @@ arithmetic_side_effects = "deny"
[workspace.lints.rustdoc]
all = "warn"
missing_doc_code_examples = "warn"

1 change: 1 addition & 0 deletions kic-discover-visa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ tokio = { version = "1.36.0", features = ["full"] }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
tsp-toolkit-kic-lib = { workspace = true, features = ["visa"] }
visa-rs = "0.6.2"

5 changes: 5 additions & 0 deletions kic-discover-visa/src/instrument_discovery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use tsp_toolkit_kic_lib::instrument::info::{ConnectionAddr, InstrumentInfo};

use crate::ethernet::{LxiDeviceInfo, COMM_PORT};
use crate::usbtmc::Usbtmc;
use crate::visa::visa_discover;

#[derive(Debug)]
pub struct InstrumentDiscovery {
Expand Down Expand Up @@ -79,6 +80,10 @@ impl InstrumentDiscovery {
}
Ok(discovery_results)
}

pub async fn visa_discover(&self) -> anyhow::Result<HashSet<InstrumentInfo>> {
visa_discover(self.timeout).await
}
}

impl From<LxiDeviceInfo> for InstrumentInfo {
Expand Down
1 change: 1 addition & 0 deletions kic-discover-visa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::{collections::HashSet, hash::Hash, io::Error, sync::Mutex};
pub mod ethernet;
pub mod instrument_discovery;
pub mod usbtmc;
pub mod visa;

#[macro_use]
extern crate lazy_static;
Expand Down
Loading

0 comments on commit cc2e202

Please sign in to comment.