我的应用程序与Arduino一起使用。
谢谢 马库斯
protected void onResume() {
super.onResume();
//Markus K hinzugefügt um device zu finden
mUsbManager.getDeviceList();
HashMap<String, UsbDevice> deviceList = mUsbManager.getDeviceList();
Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
mTitleTextView.setText(mTitleTextView.getText()+""+ deviceList.size()+"Geräte gefunden");
UsbDevice device=null;
while(deviceIterator.hasNext()){
device = deviceIterator.next();
mTitleTextView.setText(mTitleTextView.getText()+ device.getDeviceName()+" vendorid: "+device.getVendorId()+" productid"+device.getProductId());
//abfrage auf richtige vendor id!!
}
mSerialDevice = UsbSerialProber.acquire(mUsbManager, device);
mTitleTextView.setText(mTitleTextView.getText()+ "Resumed, mSerialDevice=" + mSerialDevice);
if (mSerialDevice == null) {
mTitleTextView.setText(mTitleTextView.getText()+ "No serial device.");
} else {