summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-19 14:58:26 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-19 19:26:56 -0700
commit780cb4fce75b0014485e62d628f9b94bcaae4f8f (patch)
treea6544ec68202b58fb299120c2f7663d7f8926464
parente1befbea0aaa537945741ae9d14e590f4ca5171b (diff)
downloadsubsurface-780cb4fce75b0014485e62d628f9b94bcaae4f8f.tar.gz
core/bluetooth: only Linux / Windows are supported by libdc rfcomm
For Android the Qt Bluetooth code seems to work just fine. And for macOS nothing appears to work right now, but at least the Qt implementation compiles and links. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--core/libdivecomputer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c
index 47b261b7b..a35c0f908 100644
--- a/core/libdivecomputer.c
+++ b/core/libdivecomputer.c
@@ -1383,7 +1383,12 @@ dc_status_t divecomputer_device_open(device_data_t *data)
#ifdef BT_SUPPORT
if (transports & DC_TRANSPORT_BLUETOOTH) {
dev_info(data, "Opening rfcomm stream %s", data->devname);
+#if defined(__ANDROID__) || defined(__APPLE__)
+ // we don't have BT on iOS in the first place, so this is for Android and macOS
+ rc = rfcomm_stream_open(&data->iostream, context, data->devname);
+#else
rc = bluetooth_device_open(&data->iostream, context, data);
+#endif
if (rc == DC_STATUS_SUCCESS)
return rc;
}