Hi,

I am working on a code which requires communication of java code with usb 
device. For that I am using javax.usb api

I was successfully able to send vendor specific commands that control the 
usbDevice. Please find below snippet of code

byte bmRequestType =  UsbConst.REQUESTTYPE_DIRECTION_OUT | 
UsbConst.REQUESTTYPE_TYPE_CLASS | UsbConst.REQUESTTYPE_RECIPIENT_INTERFACE;
                                byte bRequest = 0x09;
                                short wValue = 0x0300
                                short wIndex = 0;
                                byte[] buffer = {};// propertiary command to be 
send to usbDevice
                                UsbControlIrp usbControlIrp = 
usbDevice.createUsbControlIrp(bmRequestType, bRequest, wValue, wIndex);
                                usbControlIrp.setData(buffer);
                                usbDevice.syncSubmit(usbControlIrp);

However I come across a situation where I need to get some information back 
from usbDevice (i.e. I will send some command and device will return the some 
specific information). In other words, I need to  write some command to the 
device  and read response for the same. How can I achieve this..?.   A code 
snippet or  working example  will be helpful.

Please find endpoint information

                if (t == UsbConst.ENDPOINT_TYPE_INTERRUPT && ep.getDirection() 
== UsbConst.ENDPOINT_DIRECTION_IN
                                                                                
&& ep.getUsbEndpointDescriptor().bEndpointAddress() == SCHOMAKER_ENDPOINT_ADDR 
) {
                                                                endptIn = ep;
                                                                
System.out.println("DEBUG AbstractCardReader endpoint is selected " );
                                                                foundEp = true;
                                                                break;

Thanks
Shah

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
javax-usb-devel mailing list
javax-usb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel

Reply via email to