From 79e2e3b0b5c122d057b5be91969371b1a5f1278e Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 20 Jul 2016 11:46:44 +0900 Subject: [PATCH] Add 'string' event type The event numbers are an indecipherable mess, and Suunto EON Steel has notifications, events and warnings that just don't fit. Plus they really come as strings from the EON Steel anyway. So add a "SAMPLE_EVENT_STRING" type, and for that type the event has a "const char *name" instead of the odd and meaningless flags/value pair. Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- include/libdivecomputer/parser.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/libdivecomputer/parser.h b/include/libdivecomputer/parser.h index 111de48..4f16e87 100644 --- a/include/libdivecomputer/parser.h +++ b/include/libdivecomputer/parser.h @@ -94,8 +94,12 @@ typedef enum parser_sample_event_t { SAMPLE_EVENT_HEADING, SAMPLE_EVENT_TISSUELEVEL, SAMPLE_EVENT_GASCHANGE2, /* Deprecated: replaced by DC_SAMPLE_GASMIX. */ + SAMPLE_EVENT_STRING, } parser_sample_event_t; +/* To let the compile know we have this */ +#define SAMPLE_EVENT_STRING SAMPLE_EVENT_STRING + /* For backwards compatibility */ #define SAMPLE_EVENT_UNKNOWN SAMPLE_EVENT_FLOOR @@ -206,6 +210,7 @@ typedef union dc_sample_value_t { struct { unsigned int type; unsigned int time; + const char *name; unsigned int flags; unsigned int value; } event;