Make device enumeration use the device transport data

This removes some special-case code for Uemis, replacing it with simply
passing in the device transport information.

This makes device enumeration work for the Garmin Descent (if it is
listed by libdivecomputer as a USB storage device, that is).

I don't actually do any of the libdivecomputer parsing yet, and only
have a stub for the Garmin Descent, but now the directory selection
works with that stub. The actual download obviously does not.

[Dirk Hohndel: removed obsolete FIXME from code]

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2018-08-27 10:32:14 -07:00 committed by Dirk Hohndel
parent bb067b6ee4
commit 270e9eccad
13 changed files with 40 additions and 33 deletions

View file

@ -158,6 +158,7 @@ void fill_computer_list()
mydescriptor->product = "Zurich";
mydescriptor->type = DC_FAMILY_NULL;
mydescriptor->model = 0;
mydescriptor->transports = DC_TRANSPORT_USBSTORAGE;
if (!vendorList.contains("Uemis"))
vendorList.append("Uemis");
@ -171,14 +172,15 @@ void fill_computer_list()
qSort(vendorList);
}
#define NUMTRANSPORTS 6
#define NUMTRANSPORTS 7
static QString transportStringTable[NUMTRANSPORTS] = {
QStringLiteral("SERIAL"),
QStringLiteral("USB"),
QStringLiteral("USBHID"),
QStringLiteral("IRDA"),
QStringLiteral("BT"),
QStringLiteral("BLE")
QStringLiteral("BLE"),
QStringLiteral("USBSTORAGE"),
};
static QString getTransportString(unsigned int transport)