> First off - newbie alert. I am just beginning to work with USB devices and > quite frankly haven't really grasped them yet. I would RTFM if only I knew > where it was. > > I am looking for some instructions/pseudocode on talking to an HID device. > The > device is a PowerLincv2 controller from Smarthome. It functions as a > controller for controlling X10 and insteon devices.
PowerLinc V2 (and older powerlink for that matter) is just a regular usb device. The fact that it's HID doesn't make any difference. So you can just use any generic USB code with 8 byte buffer size. Therefore, RTFM <g> javax.usb API and samples. But to start you off a bit: 1. To send. Get to outbound endpoint, then UsbPipe pipe = ep.getUsbPipe(); UsbIrp irp = pipe.createUsbIrp(); irp.setData(_buf); irp.setUsbException(null); irp.setComplete(false); pipe.syncSubmit(irp); 2. To read the data, get to the inbound endpoint, then UsbPipe pipe = ep.getUsbPipe(); UsbIrp irp = pipe.createUsbIrp(); byte buf[] = new byte[8]; while (true) { try { irp.setData(buf); irp.setComplete(false); pipe.syncSubmit(_inIRP); } catch (UsbException e) { System.err.println(e.toString()); } } > Based on the dev docs one sends an 8 byte HID packet (0x02, 0x02 > 0x48,0x00,0x00,0x00,0x00,0x00) where the first byte is Count and the > remaining 7 are data. The device then responds with 5 8 byte packets again > with the first byte for Count and the next 7 for data. > > So far I've been able to find the device on the bus and query it. I can > access > the configurations, interface and endpoints. What I can't figure out is the > general process/flow for sending data to the device and then reading the > response. > > I've looked over the examples, but only the Mouse driver comes close to what > I > am trying to do, and I don't fully understand it. > > Could someone provide some basic info on how to accomplish this. Mostly what > I > need is pseudocode ro a set of general instructions - do this, then do this, > > then do this. > > Thanks! > > -steve > > > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. > Get Certified Today * Register for a JBoss Training Course > Free Certification Exam for All Training Attendees Through End of 2005 > Visit http://www.jboss.com/services/certification for more information > _______________________________________________ > javax-usb-devel mailing list > javax-usb-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/javax-usb-devel > ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information _______________________________________________ javax-usb-devel mailing list javax-usb-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/javax-usb-devel