From debc7ae1f28c52d7234a96a0fef2c60e3b93b4ef Mon Sep 17 00:00:00 2001 From: Christof Arnosti Date: Fri, 6 Mar 2020 15:03:13 +0100 Subject: usb-serial-for-android: add PID/VIDs Signed-off-by: Christof Arnosti Signed-off-by: Dirk Hohndel --- android-mobile/res/xml/device_filter.xml | 36 ++++++++++++++++++++-- .../subsurfacedivelog/mobile/AndroidSerial.java | 16 +++++++--- 2 files changed, 44 insertions(+), 8 deletions(-) (limited to 'android-mobile') diff --git a/android-mobile/res/xml/device_filter.xml b/android-mobile/res/xml/device_filter.xml index 59742610d..54445c997 100644 --- a/android-mobile/res/xml/device_filter.xml +++ b/android-mobile/res/xml/device_filter.xml @@ -1,11 +1,15 @@ - + + + - + + + @@ -13,6 +17,8 @@ + + @@ -27,4 +33,28 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android-mobile/src/org/subsurfacedivelog/mobile/AndroidSerial.java b/android-mobile/src/org/subsurfacedivelog/mobile/AndroidSerial.java index 88b167fda..59b8dc9e9 100644 --- a/android-mobile/src/org/subsurfacedivelog/mobile/AndroidSerial.java +++ b/android-mobile/src/org/subsurfacedivelog/mobile/AndroidSerial.java @@ -1,8 +1,6 @@ package org.subsurfacedivelog.mobile; -import com.hoho.android.usbserial.driver.UsbSerialDriver; -import com.hoho.android.usbserial.driver.UsbSerialPort; -import com.hoho.android.usbserial.driver.UsbSerialProber; +import com.hoho.android.usbserial.driver.*; import android.hardware.usb.UsbDeviceConnection; import android.hardware.usb.UsbManager; @@ -91,9 +89,17 @@ public class AndroidSerial { // Find all available drivers from attached devices. Context context = SubsurfaceMobileActivity.getAppContext(); UsbManager manager = (UsbManager) context.getSystemService(Context.USB_SERVICE); - UsbSerialProber usbSerialProber = UsbSerialProber.getDefaultProber(); + ProbeTable usbSerialProbetable = UsbSerialProber.getDefaultProbeTable(); - // TODO attach custom VID / PID / Drivers + usbSerialProbetable.addProduct(0x0403, 0xf460, FtdiSerialDriver.class); // Oceanic Custom PID + usbSerialProbetable.addProduct(0x0403, 0xf680, FtdiSerialDriver.class); // Suunto Custom PID + usbSerialProbetable.addProduct(0x0403, 0x87d0, FtdiSerialDriver.class); // Cressi (Leonardo) Custom PID + + usbSerialProbetable.addProduct(0x04B8, 0x0521, ProlificSerialDriver.class); // Mares (Nemo Sport) / Cressi Custom PID + usbSerialProbetable.addProduct(0x04B8, 0x0521, ProlificSerialDriver.class); // Zeagle Custom PID + usbSerialProbetable.addProduct(0xFFFF, 0x0005, CdcAcmSerialDriver.class); // Mares Icon HD Custom PID + + UsbSerialProber usbSerialProber = new UsbSerialProber(usbSerialProbetable); List availableDrivers = usbSerialProber.findAllDrivers(manager); if (availableDrivers.isEmpty()) { -- cgit v1.2.3-70-g09d2