summaryrefslogtreecommitdiffstats
path: root/configuredivecomputerthreads.cpp
diff options
context:
space:
mode:
authorGravatar Claudiu Olteanu <olteanu.claudiu@ymail.com>2015-07-06 17:07:34 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-06 08:37:42 -0700
commit198cc419596dbd17f65124d0495e98fb7acf81c2 (patch)
treea0bb99131eb82932f6f0894c95b85310a25e6ac5 /configuredivecomputerthreads.cpp
parentdff4e5f33eee0ba112ddd2265410a5e858d6c98f (diff)
downloadsubsurface-198cc419596dbd17f65124d0495e98fb7acf81c2.tar.gz
Implement the custom Bluetooth serial communication and use it
Create a custom Bluetooth serial communication using the QTBluetooth API and use it when the Bluetooth download mode is enabled. First try to connect on RFCOMM channel 1 because this is the default RFCOMM channel of SPP service for most devices. If this doesn't work try again on RFCOMM channel number 5 because it could be a Petrel2 device. Add a fake open function for the custom implementation. This is used when the selected device is HW OSTC 2N and the Bluetooth mode is activated, then fake the open call of the serial device. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'configuredivecomputerthreads.cpp')
-rw-r--r--configuredivecomputerthreads.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/configuredivecomputerthreads.cpp b/configuredivecomputerthreads.cpp
index 5c610db96..e07466018 100644
--- a/configuredivecomputerthreads.cpp
+++ b/configuredivecomputerthreads.cpp
@@ -82,6 +82,16 @@ static dc_status_t local_dc_device_open(dc_device_t **out, dc_context_t *context
}
#define dc_device_open local_dc_device_open
+// Fake the custom open function
+static dc_status_t local_dc_device_custom_open(dc_device_t **out, dc_context_t *context, dc_descriptor_t *descriptor, dc_serial_t *serial)
+{
+ if (strcmp(dc_descriptor_get_vendor(descriptor), "Heinrichs Weikamp") == 0 &&strcmp(dc_descriptor_get_product(descriptor), "OSTC 2N") == 0)
+ return DC_STATUS_SUCCESS;
+ else
+ return dc_device_custom_open(out, context, descriptor, serial);
+}
+#define dc_device_custom_open local_dc_device_custom_open
+
static dc_status_t local_hw_ostc_device_eeprom_read(void *ignored, unsigned char bank, unsigned char data[], unsigned int data_size)
{
FILE *f;