From a34a81d120fa2c66522bfcd450003e58dae62d3b Mon Sep 17 00:00:00 2001 From: Christof Arnosti Date: Wed, 11 Mar 2020 11:33:52 +0100 Subject: android usb serial: Prepare device / driver select This commit contains the serial_android_usb part of the changes proposed in issue #2657. What's implemented: - A data structure that contains all the data that can be used to describe an usb device (including user-facing string). - A function to get a list of all attached usb devices (optionally with selectable driver class). - Changes in the serial_android_usb_open-function and in the Java part to use the information about the usb device and optionally selected driver when connecting. This commit keeps compatibility with the current UI-Code in the case that only one USB-Device is connected. If two devices are connected, only the first one is tried. There are still some small things to do: - Change the user-facing string to something more descriptive. - Parts which aren't uesd anymore when the UI-Part is implemented are simply marked as obsolete (to keep compatibility for now). But generally it seems to work. [Dirk Hohndel: some white space / coding style adjustments] Signed-off-by: Christof Arnosti Signed-off-by: Dirk Hohndel --- subsurface-mobile-main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'subsurface-mobile-main.cpp') diff --git a/subsurface-mobile-main.cpp b/subsurface-mobile-main.cpp index 9529682df..d1c371a40 100644 --- a/subsurface-mobile-main.cpp +++ b/subsurface-mobile-main.cpp @@ -89,7 +89,7 @@ int main(int argc, char **argv) void set_non_bt_addresses() { #if defined(Q_OS_ANDROID) - connectionListModel.addAddress("usb-serial"); + connectionListModel.addAddress("usb-serial"); /* obsolete, can be removed when the new USB device selection is implemented. */ #elif defined(Q_OS_LINUX) // since this is in the else, it does NOT include Android connectionListModel.addAddress("/dev/ttyS0"); connectionListModel.addAddress("/dev/ttyS1"); -- cgit v1.2.3-70-g09d2