tks for your great help. After carefully review your feedback, could i ask you the further question? a. your answer ....Probably the device doesn't send you any data my question: does my program capture/read data in correct way ? any thing wrong for my provided code (speciallly inside the loop...)? as my expection, no matter device receive the data from pipe or not, the loop should print 2...but hang after first time.. b.your answer for my question of 'HID devive'....You might be able to read your device's HID report descriptors (which you have not printed below) to find out how to talk to your device ... my question: how can i access device's HID report descriptors? i check all the classes of javax-usb, but no class/interface refer to HID report descriptors.. tks in advance again. john --- On Wed, 3/25/09, Dan Streetman <ddstr...@ieee.org> wrote:
From: Dan Streetman <ddstr...@ieee.org> Subject: Re: [javax-usb-devel] USB pipe read hang To: chicagoshw...@yahoo.com Cc: javax-usb-devel@lists.sourceforge.net Date: Wednesday, March 25, 2009, 3:50 PM Probably the device doesn't send you any data... 2009/3/24 wind sh <chicagoshw...@yahoo.com>: > > I get stuck at reading data from USB pipe. > > my program can correctly locate the attached USB device, and print its info > as well. > but, when try to read data from the pipe, nothing happen, what wrong could > be..? > how can i debug to see the device received the data from remote wireless > device? > > tks in advance > > john > > > the output of my program: > ---------------------------------------------------------------------------------------- > Device endpoint info > Device's getDirection->-128 > Device's getType->3 > Device's getUsbEndpointDescriptor->bLength : 7 > bDescriptorType : 0x05 > bEndpointAddress : 0x81 > bmAttributes : 0x03 > wMaxPacketSize : 64 > bInterval : 1 > > pipe read start > loop= 1 > > ***** but nothing happen after that, just hang. > > > > the partial source code of my program > ---------------------------------------------------------------------------------- > > /* probe=an attached USB interface that is defined and located */ > > UsbConfiguration config=probe.getActiveUsbConfiguration(); > UsbInterface theInterface=config.getUsbInterface((byte)0); > theInterface.claim(new UsbInterfacePolicy(){ public boolean > forceClaim(UsbInterface usbInterface) { return true;} }); > UsbEndpoint endpoint=(UsbEndpoint) > theInterface.getUsbEndpoints().get(0); > System.out.println("Device endpoint info\n"); > System.out.println("Device's > getDirection->"+endpoint.getDirection()); > System.out.println("Device's getType->"+endpoint.getType()); > System.out.println("Device's > getUsbEndpointDescriptor->"+endpoint.getUsbEndpointDescriptor()); > UsbPipe pipe=endpoint.getUsbPipe(); > UsbIrp irp=pipe.createUsbIrp(); > byte[] input=new byte[64]; > irp.setData(input); > pipe.open(); > System.out.println("pipe read start\n"); > int loop=0; > outer:while (true) { > loop++; > System.out.println("loop= "+loop); > pipe.syncSubmit(irp); > System.out.println("input 0= "+input[0]); > System.out.println("input 1= "+input[1]); > if (loop==10) > break outer; > irp.setComplete(false); > } > System.out.println("pipe read end\n"); > pipe.abortAllSubmissions(); > pipe.close(); > theInterface.release(); > ------------------------------------------------------------------------------------------------------------------------ > > > > > > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > javax-usb-devel mailing list > javax-usb-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/javax-usb-devel > >
------------------------------------------------------------------------------
_______________________________________________ javax-usb-devel mailing list javax-usb-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/javax-usb-devel