summaryrefslogtreecommitdiffstats
path: root/configuredivecomputerthreads.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'configuredivecomputerthreads.cpp')
-rw-r--r--configuredivecomputerthreads.cpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/configuredivecomputerthreads.cpp b/configuredivecomputerthreads.cpp
index 2c6583e04..00ab07f53 100644
--- a/configuredivecomputerthreads.cpp
+++ b/configuredivecomputerthreads.cpp
@@ -55,6 +55,13 @@
#define OSTC3_GRAPHICAL_SPEED_INDICATOR 0x40
#define OSTC3_ALWAYS_SHOW_PPO2 0x41
+#define OSTC3_HW_OSTC_3 0x0A
+#define OSTC3_HW_OSTC_3P 0x1A
+#define OSTC3_HW_OSTC_CR 0x05
+#define OSTC3_HW_OSTC_SPORT 0x12
+#define OSTC3_HW_OSTC_2 0x11
+
+
#define SUUNTO_VYPER_MAXDEPTH 0x1e
#define SUUNTO_VYPER_TOTAL_TIME 0x20
#define SUUNTO_VYPER_NUMBEROFDIVES 0x22
@@ -401,7 +408,34 @@ static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_dev
dc_status_t rc;
dc_event_progress_t progress;
progress.current = 0;
- progress.maximum = 51;
+ progress.maximum = 52;
+ unsigned char hardware[1];
+
+ //Read hardware type
+ rc = hw_ostc3_device_hardware (device, hardware, sizeof (hardware));
+ if (rc != DC_STATUS_SUCCESS)
+ return rc;
+ EMIT_PROGRESS();
+
+ // FIXME: can we grab this info from libdivecomputer descriptor
+ // instead of hard coded here?
+ switch(hardware[0]) {
+ case OSTC3_HW_OSTC_3:
+ m_deviceDetails->model = "3";
+ break;
+ case OSTC3_HW_OSTC_3P:
+ m_deviceDetails->model = "3+";
+ break;
+ case OSTC3_HW_OSTC_CR:
+ m_deviceDetails->model = "CR";
+ break;
+ case OSTC3_HW_OSTC_SPORT:
+ m_deviceDetails->model = "Sport";
+ break;
+ case OSTC3_HW_OSTC_2:
+ m_deviceDetails->model = "2";
+ break;
+ }
//Read gas mixes
gas gas1;