Hi,
I have ported pre-built android ICS on BeagleboardXM.I m working on android application to enumerate the devices connected to Beagleboard thro' USB.
I am using UsbManager class in order to enumerate the android devices connected to the same but unable to get the devices list. I checked logs, its UsbDevice.getDeviceList returns empty list. Is there anything i need to change in the init.rc or elsewhere in order to get the device list? thnks!!
private void enumerate() {
l("enumerating"); //prints enumerating
UsbManager usbman = (UsbManager) getSystemService(USB_SERVICE);
HashMap<String, UsbDevice> devlist = usbman.getDeviceList();
Iterator<UsbDevice> deviter = devlist.values().iterator();
PendingIntent pi = PendingIntent.getBroadcast(this, 0, new Intent(
ACTION_USB_PERMISSION), 0);
while (deviter.hasNext()) {
UsbDevice d = deviter.next();
l("Found device: "
+ String.format("%04X:%04X", d.getVendorId(),
d.getProductId()));
if (String.format("%04X:%04X", d.getVendorId(), d.getProductId())
.equals(VID_PID)) {
// we need to upload the hex file, first request permission
l("Device under: " + d.getDeviceName());
registerReceiver(mPermissionReceiver, new IntentFilter(
ACTION_USB_PERMISSION));
if (!usbman.hasPermission(d))
usbman.requestPermission(d, pi);
else
mainloop(d);
break;
}
}
l("no more devices found");
}