mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use libdc information about supported transports
For example, even on platforms that support libusb, libdivecomputer might be compiled without such support. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1dfac4cb74
commit
0cacb06d80
1 changed files with 8 additions and 9 deletions
|
@ -109,21 +109,20 @@ void fill_computer_list()
|
||||||
dc_iterator_t *iterator = NULL;
|
dc_iterator_t *iterator = NULL;
|
||||||
dc_descriptor_t *descriptor = NULL;
|
dc_descriptor_t *descriptor = NULL;
|
||||||
|
|
||||||
int transportMask = 0;
|
// start out with the list of transports that libdivecomputer claims to support
|
||||||
|
// dc_context_get_transports ignores its context argument...
|
||||||
|
int transportMask = dc_context_get_transports(NULL);
|
||||||
|
|
||||||
|
// then add the ones that we have our own implementations for
|
||||||
#if defined(BT_SUPPORT)
|
#if defined(BT_SUPPORT)
|
||||||
transportMask |= DC_TRANSPORT_BLUETOOTH;
|
transportMask |= DC_TRANSPORT_BLUETOOTH;
|
||||||
#endif
|
#endif
|
||||||
#if defined(BLE_SUPPORT)
|
#if defined(BLE_SUPPORT)
|
||||||
transportMask |= DC_TRANSPORT_BLE;
|
transportMask |= DC_TRANSPORT_BLE;
|
||||||
#endif
|
#endif
|
||||||
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) && !defined(Q_OS_MAC)
|
#if defined(Q_OS_IOS)
|
||||||
transportMask |= DC_TRANSPORT_IRDA;
|
// libdivecomputer always claims to support serial, but on iOS we actually don't support that
|
||||||
#endif
|
transportMask &= ~DC_TRANSPORT_SERIAL;
|
||||||
#if !defined(Q_OS_IOS)
|
|
||||||
transportMask |= DC_TRANSPORT_USB | DC_TRANSPORT_USBHID;
|
|
||||||
#endif
|
|
||||||
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
|
||||||
transportMask |= DC_TRANSPORT_SERIAL;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fill_supported_mobile_list();
|
fill_supported_mobile_list();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue