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

Reply via email to