Hello everybody!
I am trying to drive a CM15 component (X10 peripheric) with Java et I want
to use javax.usb to do this.
These are my first tentatives to use this API. I read the JSR80
specification but actually all is not clear for me.
For the moment, I installed suscessfully the CM15 driver on a Debian system
and create a simple test class in Java following the javax.usb examples I
found on SourceForge.
The CM15 is detected by my code and I can work with his UsbDevice
representation.
The next step I would like to realize is communicating with my CM15.
In a first time, for a very simple test, I need to send to my CM15 device
this data : 0x62. This should light a lamp in a room. For information, I
found a perl script example to drive CM15, test it with this data and it
works great.
Here is my code (as you can see I used the examples) :
Unfortunately, nothing happen...
byte bmRequestType =
UsbConst.REQUESTTYPE_DIRECTION_IN |
UsbConst.REQUESTTYPE_TYPE_STANDARD | UsbConst.REQUESTTYPE_RECIPIENT_DEVICE;
byte bRequest = UsbConst.REQUEST_GET_CONFIGURATION;
short wValue = 0;
short wIndex = 0;
byte[] buffer = new byte[256];
buffer[0] = (byte) 0x62;
UsbControlIrp usbControlIrp =
usbDev.createUsbControlIrp(bmRequestType, bRequest, wValue, wIndex);
usbControlIrp.setData(buffer);
usbDev.syncSubmit(usbControlIrp);
usbDev is the UsbDevice representing my CM15 component.
I guess that bmRequest and/or bRequest are not corrects but I don't know
what values used in replacement.
Thanks in advance for your help and advices,
Regards,
Pascal VERRECCHIA
N.B : Sorry for my very bad english...
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
javax-usb-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel