Android - How to know which USB interface to use? -


the goal connect guitar usb host capable android device, processing on signal , play through device.

problem i'm not finding documentation on it. device shows can contains 6 interfaces.

however, in examples see, first interface used..

usbinterface intf = device.getinterface(0); 

my device contains 6 interfaces first interface, i.e. getinterface(0) has no endpoints. 3/6 have no endpoints other 3 have 1 end point.

i read need find correct interface , endpoint. in case, want in endpoint receive data.

any advice on how appreciated.

cheers

this how got down bottom of it.

the last interface, believe 1 looking for.

  • it has direction value of usb_dir_in (3)
  • it has endpoint type value usb_endpoint_xfer_isoc (1) signifying regular isochronous connection looking for

    // cycle through interfaces , print out endpoint info stringbuilder builder = new stringbuilder();  (int i=0; i<device.getinterfacecount(); i++) {     string epdirstring = "no endpoints";     string eptypestring = "no endpoints";      if (device.getinterface(i).getendpointcount() > 0)     {         epdirstring = string.valueof(device.getinterface(i).getendpoint(0).getdirection());         eptypestring = string.valueof(device.getinterface(i).getendpoint(0).gettype());     }      builder.append("int. " + + " ep count: " + device.getinterface(i).getendpointcount() +                     " || ep direction: " + epdirstring + " || ep type: " + eptypestring + "\n"); }  // show results in dialog builder dbuilder = new alertdialog.builder(usbactivity.this);        dbuilder.setmessage(builder.tostring()).show(); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -