1
0
mirror of https://github.com/mik3y/usb-serial-for-android.git synced 2026-08-11 16:32:53 +00:00

UsbSerialProber: API cleanup; support multi-port devices.

acquire() is renamed and deprecated in favor of findFirstDevice().

findAllDevices() is added as new functionality.

Internally, probe() now returns a list, allow a (future) multi-port
device to return multiple drivers, one for each port (googlecode
issue #14).
This commit is contained in:
mike wakerly
2013-05-22 11:28:30 -07:00
parent 3991b2c7c7
commit 386b98ac46
2 changed files with 118 additions and 47 deletions
@@ -110,7 +110,7 @@ public class DemoActivity extends Activity {
@Override
protected void onResume() {
super.onResume();
mSerialDevice = UsbSerialProber.acquire(mUsbManager);
mSerialDevice = UsbSerialProber.findFirstDevice(mUsbManager);
Log.d(TAG, "Resumed, mSerialDevice=" + mSerialDevice);
if (mSerialDevice == null) {
mTitleTextView.setText("No serial device.");