From 78d33b2cfff80ad7c32776c04f1652f7340b8344 Mon Sep 17 00:00:00 2001 From: will Date: Thu, 17 Oct 2024 17:32:03 -0700 Subject: [PATCH] serial: claim USB interface 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. --- serial/src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/serial/src/main.rs b/serial/src/main.rs index f8d49da..02f32b3 100644 --- a/serial/src/main.rs +++ b/serial/src/main.rs @@ -113,12 +113,16 @@ fn enable_command_mode(context: &mut T) { /// Get a handle and contet for the orbic device fn open_orbic(context: &mut T) -> Option> { // 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); }