Sorry, I forgot to cc the mailing list.
Also, you should be able to use asyncSubmit() in a sync manner with:
usbScannerPipe.asyncSubmit(currentDui);
currentDui.waitUntilComplete();
On Tue, Nov 30, 2010 at 11:34 AM, Dan Streetman <ddstr...@ieee.org> wrote:
> You need to use asyncSubmit() instead of syncSubmit().
>
> On Thu, Nov 4, 2010 at 9:53 AM, Klaus Gradinger <klaus.gradin...@gmail.com
> > wrote:
>
>> Hello,
>>
>> I've been running into the following Problem: I'm communicating using a
>> USB Handheld Barcode Scanner (USB HID Keyboard Device). Everything is fine,
>> i've opened the IN Endpoint using the UsbPipe and access it the following
>> way:
>>
>> currentDui = new DefaultUsbIrp(buffer);
>> currentDui = new DefaultUsbIrp(buffer);
>> currentDui.setAcceptShortPacket(true);
>>
>> usbScannerPipe.syncSubmit(currentDui);
>>
>> I receive the data i'm expecting and everything works fine UNTIL i want to
>> abort and cancel everything:
>>
>> usbScannerPipe.abortAllSubmissions();
>> usbScannerPipe.close();
>> usbScannerPipe = null;
>> usbScannerInterface.release();
>> usbScannerInterface = null;
>>
>> The problem is that syncSubmit immediately synchronizes using
>> "submitLock" (UsbPipeImp). After that the whole thing just keeps blocking
>> while waiting for data. When i call abortAllSubmissions from another Thread,
>> it too locks on "submitLock", waiting for the submitSync method to release
>> this lock. IF i scan another Barcode, the syncSubmit method returns and
>> everything is fine, otherwise it's a perfect deadlock.
>>
>> What's the correct work-flow here? how can i cancel everything pending and
>> close the pipe and interface?
>>
>> i'm using Ubuntu 10.04, and java-usb 1.0.1
>>
>> Thanks in advance
>> Klaus Gradinger
>>
>>
>>
>> ------------------------------------------------------------------------------
>> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
>> David G. Thomson, author of the best-selling book "Blueprint to a
>> Billion" shares his insights and actions to help propel your
>> business during the next growth cycle. Listen Now!
>> http://p.sf.net/sfu/SAP-dev2dev
>> _______________________________________________
>> javax-usb-devel mailing list
>> javax-usb-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
>>
>>
>
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
javax-usb-devel mailing list
javax-usb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel