File tree Expand file tree Collapse file tree 3 files changed +32
-33
lines changed Expand file tree Collapse file tree 3 files changed +32
-33
lines changed Original file line number Diff line number Diff line change @@ -9,5 +9,5 @@ description = "Utility to switch Huion tablets into tablet mode"
9
9
10
10
[dependencies ]
11
11
anyhow = " 1.0.86"
12
- libusb = " 0.3.0 "
12
+ rusb = " 0.9.4 "
13
13
udev = " 0.8.0"
Original file line number Diff line number Diff line change 1
1
use anyhow:: { Context , Result } ;
2
- use libusb;
2
+ use rusb;
3
+ use rusb:: UsbContext ;
3
4
use std:: path:: { Path , PathBuf } ;
4
5
5
- fn send_usb_request ( device : & libusb :: Device ) -> Result < ( ) > {
6
+ fn send_usb_request ( device : & rusb :: Device < rusb :: Context > ) -> Result < ( ) > {
6
7
let timeout = std:: time:: Duration :: from_millis ( 100 ) ;
7
8
let handle = device. open ( ) ?;
8
9
// See the uclogic driver
@@ -38,7 +39,7 @@ fn send_usb_request(device: &libusb::Device) -> Result<()> {
38
39
}
39
40
40
41
fn send_usb_to_all ( ) -> Result < ( ) > {
41
- let ctx = libusb :: Context :: new ( ) . unwrap ( ) ;
42
+ let ctx = rusb :: Context :: new ( ) . unwrap ( ) ;
42
43
43
44
const HUION_VENDOR_ID : u16 = 0x256C ;
44
45
@@ -79,7 +80,7 @@ fn send_usb_to_device(path: &Path) -> Result<()> {
79
80
let bus = str:: parse ( & busnum. to_string_lossy ( ) ) ?;
80
81
let addr = str:: parse ( & devnum. to_string_lossy ( ) ) ?;
81
82
82
- let ctx = libusb :: Context :: new ( ) . unwrap ( ) ;
83
+ let ctx = rusb :: Context :: new ( ) . unwrap ( ) ;
83
84
let rc = ctx
84
85
. devices ( )
85
86
. unwrap ( )
You can’t perform that action at this time.
0 commit comments