On Fri, Aug 15, 2008 at 6:03 PM, Jeremy Mawson <[EMAIL PROTECTED]> wrote:
> Indeed it does. It says:
>
> So the command is easy to construct, but how to transmit it? As far as I
> can see, there's no concept of a USB command in the javax.usb API.
No, you misunderstand - you doc needs to tell you what endpoint/pipe
to send the "command" to (there are no "commands" in the USB spec).
If that endpoint/pipe is a control endpoint/pipe, then your spec also
needs to tell you what to fill in the control-specific fields with.
The section you listed regards ONLY the data portion of the "command".
> The only method in StandardRequest that will accommodate a freeform
> byte[] is setDescriptor, but that doesn't sound right.
>
> I've tried the UsbControlIrp strategy without success. It may be that
> I'm setting the constructor params incorrectly.
>
> Once I've constructed the command, which method transmits it?
Again, *your spec needs to tell you this*.
>
>
>
>
> Dan Streetman wrote:
>> You need to figure out how to format those fields into a USB command.
>> I would expect your manual to have that info somewhere in it.
>>
>> On Fri, Aug 15, 2008 at 9:37 AM, Jem <[EMAIL PROTECTED]> wrote:
>>> Hi
>>>
>>> I have a manual for the USB device I'm trying to control that describes the
>>> bytes I need to transmit to the device in order to perform functions.
>>>
>>> For example if I wish to turn it green (it's a light) I'd transmit:
>>>
>>> Recipient Byte: 8
>>> Device Model Byte: 18
>>> Major Command Byte: 10
>>> Minor Command Byte: 34
>>> Data LSB: 0
>>> Data MSB: 80
>>> Length Short: 0, 0
>>>
>>> I'm not sure how I translate this to methods in the API. Can I use a method
>>> on StandardRequest?
>>>
>>> Alternatively, I tried the following, which resulted in a usbStallException:
>>>
>>> byte bmRequestType =
>>> UsbConst.REQUESTTYPE_DIRECTION_OUT |
>>> UsbConst.REQUESTTYPE_TYPE_STANDARD | UsbConst.REQUESTTYPE_RECIPIENT_DEVICE;
>>> byte bRequest = UsbConst.REQUEST_SET_FEATURE;
>>> short wValue = UsbConst.DESCRIPTOR_TYPE_DEVICE << 8;
>>> short wIndex = 0;
>>>
>>> byte[] buffer = new byte[]{8,18,10,34,0,80,0,0};
>>> UsbControlIrp usbControlIrp =
>>> usbDevice.createUsbControlIrp(bmRequestType, bRequest, wValue, wIndex);
>>> usbControlIrp.setData(buffer);
>>> usbDevice.syncSubmit(usbControlIrp);
>>>
>>> Am I on the right track?
>>>
>>> Thanks for any help
>>> Jeremy
>
>
> -------------------------------------------------------------------------
> 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
>
-------------------------------------------------------------------------
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