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

probe CDC devices by USB interface types instead of fixed VID+PID

- no more custom prober required for standard CDC devices
- legacy (singleInterface) CDC devices still have to be added by VID+PID
- for autostart VID+PID still have to be added to device_filter.xml
This commit is contained in:
kai-morich
2023-03-11 19:12:42 +01:00
parent 85f64aff96
commit 5db45548ba
13 changed files with 169 additions and 119 deletions
@@ -1,6 +1,6 @@
package com.hoho.android.usbserial.examples;
import com.hoho.android.usbserial.driver.CdcAcmSerialDriver;
import com.hoho.android.usbserial.driver.FtdiSerialDriver;
import com.hoho.android.usbserial.driver.ProbeTable;
import com.hoho.android.usbserial.driver.UsbSerialProber;
@@ -14,7 +14,8 @@ class CustomProber {
static UsbSerialProber getCustomProber() {
ProbeTable customTable = new ProbeTable();
customTable.addProduct(0x16d0, 0x087e, CdcAcmSerialDriver.class); // e.g. Digispark CDC
customTable.addProduct(0x1234, 0x0001, FtdiSerialDriver.class); // e.g. device with custom VID+PID
customTable.addProduct(0x1234, 0x0002, FtdiSerialDriver.class); // e.g. device with custom VID+PID
return new UsbSerialProber(customTable);
}