Skip to content

Commit

Permalink
Update upc and usb-gadget dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
surban committed Apr 29, 2024
1 parent ad91fc6 commit 51b5f0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions aggligator-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ tokio-tungstenite = { version = "0.21", features = [
], optional = true }
url = { version = "2", optional = true }
axum-server = { version = "0.6", optional = true }
upc = { version = "0.4", optional = true }
usb-gadget = { version = "0.6", optional = true }
upc = { version = "0.5", optional = true }
usb-gadget = { version = "0.7", optional = true }
rusb = { version = "0.9", optional = true }
gethostname = { version = "0.4", optional = true }
socket2 = { version = "0.5", optional = true }
Expand Down
4 changes: 3 additions & 1 deletion aggligator-util/src/transport/usb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mod host {
fmt,
hash::{Hash, Hasher},
io::{Error, ErrorKind, Result},
sync::Arc,
time::Duration,
};
use tokio::{
Expand Down Expand Up @@ -297,7 +298,8 @@ mod host {
}
let Some(dev) = dev else { return Err(Error::new(ErrorKind::NotFound, "USB device gone")) };

let (tx, rx) = upc::host::connect(&dev, tag.interface, &[]).await?;
let hnd = Arc::new(dev.open().map_err(|err| Error::new(ErrorKind::Other, err))?);
let (tx, rx) = upc::host::connect(hnd, tag.interface, &[]).await?;

Ok(TxRxBox::new(tx.into_sink(), rx.into_stream().map_ok(|p| p.freeze())).into())
}
Expand Down

0 comments on commit 51b5f0a

Please sign in to comment.