From 270e9eccad8644352f5ae07df8b6acb55b115361 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 27 Aug 2018 10:32:14 -0700 Subject: 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 Signed-off-by: Dirk Hohndel --- core/windows.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/windows.c') diff --git a/core/windows.c b/core/windows.c index cb031e261..6feb3f740 100644 --- a/core/windows.c +++ b/core/windows.c @@ -117,11 +117,11 @@ const char *system_default_filename(void) return path; } -int enumerate_devices(device_callback_t callback, void *userdata, int dc_type) +int enumerate_devices(device_callback_t callback, void *userdata, unsigned int transport) { int index = -1; DWORD i; - if (dc_type != DC_TYPE_UEMIS) { + if (transport & DC_TRANSPORT_SERIAL) { // Open the registry key. HKEY hKey; LONG rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM", 0, KEY_QUERY_VALUE, &hKey); @@ -169,7 +169,7 @@ int enumerate_devices(device_callback_t callback, void *userdata, int dc_type) RegCloseKey(hKey); } - if (dc_type != DC_TYPE_SERIAL) { + if (transport & DC_TRANSPORT_USBSTORAGE) { int i; int count_drives = 0; const int bufdef = 512; -- cgit v1.2.3-70-g09d2