If you do have a driver already driving your device, and you need to
remove that driver, you can use a UsbInterfacePolicy while claiming the
UsbInterface, and make the "forceClaim" method in the policy return true.
You will need a kernel with USBDEVFS_DISCONNECT support in it. While
building the javax-usb-ri-linux package, the JNI code will display a
warning if you do not have this support in your kernel (header files).
Your code indicates that you are doing a SET_REPORT (not set descriptor)
to a HID device. All HID devices are claimed by the HID driver and so you
will need to do the forceClaim to remove HID from your interface. Your
interface is interface 0 (according to your code) so you need to
forceClaim interface 0 on your device. Then you should be able to do the
SET_REPORT.
On Thu, 15 Jul 2004, Tomaz Hutter wrote:
>Hello,
>
>I am trying to submit a control IRP packet to an USB device (UsbDevice.
>asyncSubmit(UsbControlIrp irp)) and I get the following Exception:
>
>javax.usb.UsbException: Error submitting IRP : Device or resource busy
> at
>com.ibm.jusb.os.linux.LinuxPipeRequest.completeUsbIrp(LinuxPipeRequest.j
>ava:84)
> at
>com.ibm.jusb.os.linux.LinuxPipeRequest.setCompleted(LinuxPipeRequest.jav
>a:74)
> at com.ibm.jusb.os.linux.JavaxUsb.nativeDeviceProxy(Native
>Method)
> at
>com.ibm.jusb.os.linux.LinuxDeviceProxy$1.run(LinuxDeviceProxy.java:87)
> at java.lang.Thread.run(Thread.java:536)
>
>My question:
>I assume the problem is because Linux loads an USB driver for this
>device (keyboard driver). Is that true or is there some other issue to
>this problem? If it is true, how can I remove the driver?
>
>Thank you very much and kind regards,
>Tomaz
>
>
>My code:
>//I search for my USB device and put it into this.m_udDevice
>//create control IRP
>UsbControlIrp uciSetDescriptorRequest =
>this.m_udDevice.createUsbControlIrp(
> (byte) 0x21,
> (byte) 0x09,
> (short) 0x0300,
> (short) 0x0000);
>uciSetDescriptorRequest.setData(new byte[] {0x02});
>//submit control IRP
> try
> {
> this.m_udDevice.syncSubmit(uciSetDescriptorRequest);
> //exception is thrown in above method
> }
> catch (IllegalArgumentException ex)
> {
> ex.printStackTrace();
> }
> catch (UsbException ex)
> {
> ex.printStackTrace();
> }
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by BEA Weblogic Workshop
>FREE Java Enterprise J2EE developer tools!
>Get your free copy of BEA WebLogic Workshop 8.1 today.
>http://ads.osdn.com/?ad_idG21&alloc_id040&op�k
>_______________________________________________
>javax-usb-devel mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
>
--
Dan Streetman
[EMAIL PROTECTED]
---------------------
186,272 miles per second:
It isn't just a good idea, it's the law!
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_idG21&alloc_id040&op=click
_______________________________________________
javax-usb-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel