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