If it is a HID device, you'll need to read and understand the HID spec to
talk to it.

On Tue, Sep 15, 2009 at 8:53 PM, Ruperto Durano <rupertsoft...@yahoo.com>wrote:

> Greetings!
>
> Thank you very much for your immediate response.
>
> I'm so sorry for I'm not able to provide you ample information about what
> I'm doing.  I'm not so sure about it myself.  What I'm sure is, I'm trying
> to communicate to a barcode scanner.  I don't know how to get the
> information for the CLASS and PROTOCOL.  All I know that it is using the USB
> protocol.
>
> And I guess you are right about the HID device. If that is so, is there a
> possibility that we could ommit the reportID number for its reply? so that I
> could get the exact 64 bytes reply from the scanner? because according to
> javax, syncSubmit has no limit except that it should not exceed the
> wMaxPacketSize(). and
> usbPipe.getUsbEndpoint().getUsbEndpointDescriptor().wMaxPacketSize() is
> always equal to 64 for the scanner.  And for every command that I sent,
> there are different first byte as well but the same first byte for a
> particular command.
>
> If you need some more information, please guide me on what to do so that I
> could provide you with the right information.
>
> Thank you very much again.
>
> Thanks,
> Ruperts
>
> ------------------------------
> *From:* Dan Streetman <ddstr...@ieee.org>
> *To:* Ruperto Durano <rupertsoft...@yahoo.com>
> *Cc:* javax.usb development <javax-usb-devel@lists.sourceforge.net>
> *Sent:* Wednesday, September 16, 2009 12:26:39 AM
> *Subject:* Re: Help on JAVAX
>
> Considering you are sending a CLASS request but have not mentioned what
> your device is nor what its class is nor what the protocol may be, why would
> you expect me to be able to help?
>
> If I had to take a completely wild guess, obviously without knowing
> anything about your device, its class or protocol, or what the specific
> response you are looking for or getting back is, I would *assume* you have a
> HID device and you don't realize that HID reports have the report ID number
> as the first byte, with the actual report data following.  But again that is
> *completely* a guess made with *no* actual information about your situation.
>
> On Tue, Sep 15, 2009 at 2:14 AM, Ruperto Durano 
> <rupertsoft...@yahoo.com>wrote:
>
>> Hello Dan,
>>
>> This is with regards to Java USB API --- javax.
>>
>> I had a hard time figuring out why there is an extra data acquired during
>> the usbPipe.syncSubmit(byte[]).  The first byte of the array shouldn't be
>> there. Do you have any idea what happened?
>>
>> I opened a the pipe then send a command through
>> device.asyncSubmit(usbControlIrp);
>> with these settings for the usbControlIrp:
>>     byte bmRequestType = UsbConst.REQUESTTYPE_TYPE_CLASS | UsbConst.
>> REQUESTTYPE_RECIPIENT_INTERFACE;
>>     byte bRequest = 0x09;
>>     short wValue = 2 << 8;
>>     short wIndex = UsbUtil.unsignedShort(usbInterface.
>> getUsbInterfaceDescriptor().bInterfaceNumber());
>>
>> Then get the reply from the device through usbPipe.syncSubmit(byte[]).
>>
>> I am not getting the exact data since the first byte is unexpected the
>> rest are ok except that the last, expected, byte of the array is missing
>> due to the occurrence of the unexpected first byte.
>>
>> I can tell that it is unexpected because I know what the device should
>> have replied.
>>
>> Please help. I know I'm missing something like sending a controlled IRP
>> instead during getting of the reply, if so, settings for the controlled IRP
>> is another problem for me. Or could it be the settings of the usbControlIrp
>> during the sending of the command?
>>
>> Please Help.
>>
>> Thanks,
>> Ruperts
>>
>>
>
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
javax-usb-devel mailing list
javax-usb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel

Reply via email to