[PATCH v2] Identify event 0x07 on Suunto d9-style computers as Below Floor.

Michael Andreen harv at ruin.nu
Mon Aug 5 07:03:59 UTC 2013


This event is on when accumulating deco time. Once you reach the floor
deco time will start decreasing and the event will stop. Going below the
floor again will re-activate the event.

Signed-off-by: Michael Andreen <harv at ruin.nu>
---

I picked "below floor" instead of just "floor" for the string in the array,
"floor" seems a bit too ambigious for user-visible text. It's not consistent
with "ceiling" though.

 examples/universal.c             | 2 +-
 include/libdivecomputer/parser.h | 5 ++++-
 src/suunto_d9_parser.c           | 4 ++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/examples/universal.c b/examples/universal.c
index 4eef0c5..52fd96c 100644
--- a/examples/universal.c
+++ b/examples/universal.c
@@ -241,7 +241,7 @@ sample_cb (dc_sample_type_t type, dc_sample_value_t value, void *userdata)
 		"none", "deco", "rbt", "ascent", "ceiling", "workload", "transmitter",
 		"violation", "bookmark", "surface", "safety stop", "gaschange",
 		"safety stop (voluntary)", "safety stop (mandatory)", "deepstop",
-		"ceiling (safety stop)", "unknown", "divetime", "maxdepth",
+		"ceiling (safety stop)", "below floor", "divetime", "maxdepth",
 		"OLF", "PO2", "airtime", "rgbm", "heading", "tissue level warning",
 		"gaschange2"};
 	static const char *decostop[] = {
diff --git a/include/libdivecomputer/parser.h b/include/libdivecomputer/parser.h
index a92e653..16ca2b3 100644
--- a/include/libdivecomputer/parser.h
+++ b/include/libdivecomputer/parser.h
@@ -73,7 +73,7 @@ typedef enum parser_sample_event_t {
 	SAMPLE_EVENT_SAFETYSTOP_MANDATORY,
 	SAMPLE_EVENT_DEEPSTOP,
 	SAMPLE_EVENT_CEILING_SAFETYSTOP,
-	SAMPLE_EVENT_UNKNOWN,
+	SAMPLE_EVENT_FLOOR,
 	SAMPLE_EVENT_DIVETIME,
 	SAMPLE_EVENT_MAXDEPTH,
 	SAMPLE_EVENT_OLF,
@@ -87,6 +87,9 @@ typedef enum parser_sample_event_t {
 	                            respectively the low and high part. */
 } parser_sample_event_t;
 
+/* For backwards compatibility */
+#define SAMPLE_EVENT_UNKNOWN SAMPLE_EVENT_FLOOR
+
 typedef enum parser_sample_flags_t {
 	SAMPLE_FLAGS_NONE = 0,
 	SAMPLE_FLAGS_BEGIN = (1 << 0),
diff --git a/src/suunto_d9_parser.c b/src/suunto_d9_parser.c
index 11c7d0f..65e7e87 100644
--- a/src/suunto_d9_parser.c
+++ b/src/suunto_d9_parser.c
@@ -482,8 +482,8 @@ suunto_d9_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t ca
 					case 0x06: // Mandatory Safety Stop Ceiling Error
 						sample.event.type = SAMPLE_EVENT_CEILING_SAFETYSTOP;
 						break;
-					case 0x07: // Unknown (Deco related)
-						sample.event.type = SAMPLE_EVENT_UNKNOWN;
+					case 0x07: // Below Deco Floor
+						sample.event.type = SAMPLE_EVENT_FLOOR;
 						break;
 					case 0x08: // Dive Time
 						sample.event.type = SAMPLE_EVENT_DIVETIME;
-- 
1.8.1.5




More information about the subsurface mailing list