mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
android/usb: pass in the UsbDevice when downloading
This finally allows us to download from not just the first device, but specifically the device that the user picks. Passing the object through a void pointer is not nice - but since this traverses C code other solutions (like passing an index into the list) seemed even worse. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1495aa2dbf
commit
ec3a968df9
8 changed files with 38 additions and 11 deletions
|
@ -1336,8 +1336,8 @@ dc_status_t divecomputer_device_open(device_data_t *data)
|
|||
return ftdi_open(&data->iostream, context);
|
||||
#endif
|
||||
#ifdef __ANDROID__
|
||||
if (!strcasecmp(data->devname, "usb-serial"))
|
||||
return serial_usb_android_open(&data->iostream, context);
|
||||
if (data->androidUsbDeviceDescriptor)
|
||||
return serial_usb_android_open(&data->iostream, context, data->androidUsbDeviceDescriptor);
|
||||
#endif
|
||||
rc = dc_serial_open(&data->iostream, context, data->devname);
|
||||
if (rc == DC_STATUS_SUCCESS)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue