Forgot to cc the list.

On Tue, Aug 12, 2008 at 11:07 AM, Dan Streetman <[EMAIL PROTECTED]> wrote:
> You really need to know the protocol of your device - that is the only
> way to tell why it's returning a stall.  It's likely that you are not
> talking to it correctly.
>
> On Mon, Aug 11, 2008 at 10:54 AM, Bourothu Rahul
> <[EMAIL PROTECTED]> wrote:
>> Hello,
>>
>> Following is a part of my code for sending SET_ and GET_REPORT's to the USB
>> Device. When I try to send the GET_REPORT request after having sent the
>> SET_REPORT to the DCP, i get a DCP Submission failed error: Error submitting
>> IRP: UsbStallException .... Could anyone tell me where the problem is?
>>
>> UsbConfiguration config = usbDevice.getActiveUsbConfiguration();
>> List interfaces = new ArrayList();
>> interfaces = config.getUsbInterfaces();
>> UsbInterface interface0 = (UsbInterface)interfaces.get(0);      // my device
>> has only one interface, i.e, 0
>> try{
>>       interface.claim(new UsbInterfacePolicy() {
>>                                    public boolean forceClaim(UsbInterface
>> usbInterface){
>>                                           return true;
>>                                    }
>>                            });
>>       UsbInterfaceDescriptor interfaceDescriptor =
>> interface0.getUsbInterfaceDescriptor();
>>       Byte iClass = new Byte(interfaceDescriptor.bInterfaceClass());
>>       System.out.println("Interface Class is: " + iClass.toString());     //
>> It gives me 3, meaning a HID class device
>> }catch(Exception e){
>>       System.out.println("Interface not claimed! Exception! " +
>> e.getMessage());
>> }
>>
>> //SET_REPORT
>> byte bmRequestType = 0x21;   <request type for SET_REPORT>
>> byte bRequest = 0x09;       <SET_REPORT: 0x09>
>> short wValue = 0x0201;      <i/o type: OUT, 02><report number:01>
>> short wIndex = 0;          <Interface number :0>
>> byte[] sendBuffer = {0x01,0x00,0x06,0x22,(byte)0xA0,(byte)0x85,0x00};
>> <ByteStream command to be sent to the device>
>> UsbControlIrp controlIrp1 = usbDevice.createUsbControlIrp(bmRequestType,
>> bRequest,wValue,wValue,wIndex);
>> controlIrp1.setData( sendBuffer);
>>
>> if(!sendUsbControlIrp(usbDevice, controlIrp1)){
>>       System.out.println("SET_REPORT Not sent successfully");
>> }
>> System.out.println("Bytes sent to the device for SET_REPORT: " +
>> controlIrp1.getActualLength());
>>
>> //GET_REPORT
>> byte bmRequestType = 0xA1;   <request type for GET_REPORT>
>> byte bRequest = 0x01;       <GET_REPORT: 0x01>
>> short wValue = 0x0101;      <i/o type: IN, 01><report number:01>
>> short wIndex = 0;          <Interface number :0>
>> byte[] recieveBuffer = new byte[22];   <I Assume this is the buffer where
>> our requested data would come into, it is of 22 bytes>
>> UsbControlIrp controlIrp2 = usbDevice.createUsbControlIrp(bmRequestType,
>> bRequest,wValue,wValue,wIndex);
>> controlIrp2.setData(sendBuffer);
>>
>> if(!sendUsbControlIrp(usbDevice, controlIrp2)){
>>       System.out.println("SET_REPORT Not sent successfully");
>> }
>> System.out.println("Bytes sent to the device for GET_REPORT: " +
>> controlIrp2.getActualLength());
>>
>>
>> I am not able to find out why i am not able to make the GET_REPORT request
>> to the device after having sent the SET_REPORT request. Could anyone help me
>> on this please!
>>
>> Also, my USB RFID Reader has just 1 IN_Interrupt pipe from where the data
>> originates. When i issue the GET_REPORT to the DCP, do I get the report via
>> the DCP or do I have to use the UsbPipe of the In_Interrupt pipe to read the
>> tag information?
>> Please help needed! I am stuck!
>>
>> Regards and thanks in advance!
>> --
>> Rahul Bourothu
>> School of Engineering and Applied Science,
>> University of Pennsylvania,
>> Philadelphia, PA - 19104
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
javax-usb-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel

Reply via email to