summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2017-04-26 20:49:12 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-05-04 10:50:15 -0700
commit4cbf64bf99c7b47a9368f9f03399164b397c2ec8 (patch)
tree9745e798408aa5bf8df8ed0db73ffc24e51ed8d0 /core
parent0c276403ac1b080829b2169d84d42ebdbff2f875 (diff)
downloadsubsurface-4cbf64bf99c7b47a9368f9f03399164b397c2ec8.tar.gz
Wire up a skeleton for configure OSTC 4
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Diffstat (limited to 'core')
-rw-r--r--core/configuredivecomputerthreads.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/core/configuredivecomputerthreads.cpp b/core/configuredivecomputerthreads.cpp
index 1c445f02a..cbd16611b 100644
--- a/core/configuredivecomputerthreads.cpp
+++ b/core/configuredivecomputerthreads.cpp
@@ -361,6 +361,32 @@ static dc_status_t write_suunto_vyper_settings(dc_device_t *device, DeviceDetail
return rc;
}
+static dc_status_t read_ostc4_settings(dc_device_t *device, DeviceDetails *m_deviceDetails, dc_event_callback_t progress_cb, void *userdata)
+{
+ dc_status_t rc = DC_STATUS_SUCCESS;
+ dc_event_progress_t progress;
+ progress.current = 0;
+ progress.maximum = 1;
+ unsigned char hardware[1];
+
+ EMIT_PROGRESS();
+
+ return rc;
+}
+
+static dc_status_t write_ostc4_settings(dc_device_t *device, DeviceDetails *m_deviceDetails, dc_event_callback_t progress_cb, void *userdata)
+{
+ dc_status_t rc = DC_STATUS_SUCCESS;
+ dc_event_progress_t progress;
+ progress.current = 0;
+ progress.maximum = 1;
+
+ EMIT_PROGRESS();
+
+ return rc;
+}
+
+
#if DC_VERSION_CHECK(0, 5, 0)
static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_deviceDetails, dc_event_callback_t progress_cb, void *userdata)
{
@@ -374,7 +400,6 @@ static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_dev
rc = hw_ostc3_device_hardware (device, hardware, sizeof (hardware));
if (rc != DC_STATUS_SUCCESS)
return rc;
- EMIT_PROGRESS();
dc_descriptor_t *desc = get_descriptor(DC_FAMILY_HW_OSTC3, hardware[0]);
if (desc) {
@@ -384,6 +409,11 @@ static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_dev
return DC_STATUS_UNSUPPORTED;
}
+ if (m_deviceDetails->model == "OSTC 4")
+ return read_ostc4_settings(device, m_deviceDetails, progress_cb, userdata);
+
+ EMIT_PROGRESS();
+
//Read gas mixes
gas gas1;
gas gas2;
@@ -1647,7 +1677,11 @@ void WriteSettingsThread::run()
break;
#if DC_VERSION_CHECK(0, 5, 0)
case DC_FAMILY_HW_OSTC3:
- rc = write_ostc3_settings(m_data->device, m_deviceDetails, DeviceThread::event_cb, this);
+ // FIXME: Is this the best way?
+ if (m_deviceDetails->model == "OSTC 4")
+ rc = write_ostc4_settings(m_data->device, m_deviceDetails, DeviceThread::event_cb, this);
+ else
+ rc = write_ostc3_settings(m_data->device, m_deviceDetails, DeviceThread::event_cb, this);
if (rc != DC_STATUS_SUCCESS)
emit error(tr("Failed!"));
break;