usb-serial-for-android: Implementation

Implement the libdivecomputer API in Java and create C/JNI translation
layer.

[Dirk Hohndel: whitespace harmonization - yes, some of this is Java,
               this still makes it much easier to read for me;
               also changed the FTDI conditional compilation to make
               sure we can still use that for mobile-on-desktop if
               necessary]

Signed-off-by: Christof Arnosti <charno@charno.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Christof Arnosti 2020-03-05 22:38:33 +01:00 committed by Dirk Hohndel
parent 6ffb1e3129
commit 6e38f85ba7
7 changed files with 512 additions and 9 deletions

View file

@ -1318,6 +1318,10 @@ dc_status_t divecomputer_device_open(device_data_t *data)
#ifdef SERIAL_FTDI
if (!strcasecmp(data->devname, "ftdi"))
return ftdi_open(&data->iostream, context);
#endif
#ifdef __ANDROID__
if (!strcasecmp(data->devname, "usb-serial"))
return serial_usb_android_open(&data->iostream, context);
#endif
rc = dc_serial_open(&data->iostream, context, data->devname);
if (rc == DC_STATUS_SUCCESS)