|
From: Xiaofan C. <xia...@gm...> - 2021-08-06 01:18:32
|
On Thu, Aug 5, 2021 at 9:04 PM 俊哲 via libusb-devel
<lib...@li...> wrote:
>
> libusb_set_auto_detach_kernel_driver(dev_handle[1], true);
> libusb_claim_interface(dev_handle[1],3);
> unsigned char buffer[3]={0x02,0x01,0x01};
> rc= libusb_control_transfer(dev_handle[1],0x21,0x09, 0x0200,0x0300,buffer, 0x0300,0);
> qDebug()<<rc;
>
> Hi, I am using the above codes snippet to send instructions to my device so that it
> can enter DFU mode, but this function returns -1 errorno 16 through libusb debugging
> function, So I am not quite sure where the problem, I am using linux os to run my
> application, however,I also used bus hound(an powerful usb app only for windows OS)
> to send these instructions, the device successfully get into its DFU mode. The interface
> number I want to send data to is 3 by the way
Did you set up udev rule correctly? Or you can run your application
with sudo first
to see if that helps. If that helps, you need to set up udev rules to
have the right
permission to detach the kernel driver.
If that is not the problem, you need to post the debug log.
--
Xiaofan
|