Skip to content

Commit

Permalink
serial: claim USB interface
Browse files Browse the repository at this point in the history
Without doing this, it seems macOS can't use any interface endpoints.
Also disconnect any kernel extensions that're using the interface,
since that can cause issues on macOS as well.
  • Loading branch information
will authored and cooperq committed Oct 18, 2024
1 parent 6c237e8 commit 78d33b2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions serial/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,16 @@ fn enable_command_mode<T: UsbContext>(context: &mut T) {
/// Get a handle and contet for the orbic device
fn open_orbic<T: UsbContext>(context: &mut T) -> Option<DeviceHandle<T>> {
// Device after initial mode switch
if let Some(handle) = open_device(context, 0x05c6, 0xf601) {
if let Some(mut handle) = open_device(context, 0x05c6, 0xf601) {
handle.set_auto_detach_kernel_driver(true).expect("set_auto_detach_kernel_driver failed");
handle.claim_interface(1).expect("claim_interface(1) failed");
return Some(handle);
}

// Device with rndis enabled as well
if let Some(handle) = open_device(context, 0x05c6, 0xf622) {
if let Some(mut handle) = open_device(context, 0x05c6, 0xf622) {
handle.set_auto_detach_kernel_driver(true).expect("set_auto_detach_kernel_driver failed");
handle.claim_interface(1).expect("claim_interface(1) failed");
return Some(handle);
}

Expand Down

0 comments on commit 78d33b2

Please sign in to comment.