Indeed it does. It says:
| All commands are passed to the USB device in a command packet.
| The command is filled and sent to the USB device using the
| DeviceIOControl WindowsTM command. All command packets are at
| least 8 byte long, maximum of 16 bytes and all receive data is 8 bytes
| long.
| Direct Command Packet Format:
| Recipient Byte Always 8 for the USB IO device.
| Device Model Byte Always 18 for the USB IO device
| Major Command Byte See Below
| Minor Command Byte See Below
| Data LSB Byte See Below
| Data MSB Byte See Below
| Length Short (2 Bytes) Length of DataExtension.
| DataExtension 0-8 Bytes – (Only use by certain commands).
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.
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?
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