diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-27 10:32:14 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-27 22:10:38 -0700 |
commit | 270e9eccad8644352f5ae07df8b6acb55b115361 (patch) | |
tree | 0b6aaee8221fc2c12d9b084e42179e1a2d9633f0 /core/macos.c | |
parent | bb067b6ee4828fc2444395d4cfda80831c4721bb (diff) | |
download | subsurface-270e9eccad8644352f5ae07df8b6acb55b115361.tar.gz |
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>
Diffstat (limited to 'core/macos.c')
-rw-r--r-- | core/macos.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/macos.c b/core/macos.c index e9ab7b8a8..05353b5ba 100644 --- a/core/macos.c +++ b/core/macos.c @@ -97,13 +97,13 @@ 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, entries = 0; DIR *dp = NULL; struct dirent *ep = NULL; size_t i; - if (dc_type != DC_TYPE_UEMIS) { + if (transport & DC_TRANSPORT_SERIAL) { const char *dirname = "/dev"; const char *patterns[] = { "tty.*", @@ -135,7 +135,7 @@ int enumerate_devices(device_callback_t callback, void *userdata, int dc_type) } closedir(dp); } - if (dc_type != DC_TYPE_SERIAL) { + if (transport & DC_TRANSPORT_USBSTORAGE) { const char *dirname = "/Volumes"; int num_uemis = 0; dp = opendir(dirname); |