From 17efdaf1d81528b499e4124797ec6e677a073c77 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 11 Dec 2012 20:26:47 +0100 Subject: [PATCH] Update the example application for the new sample types. The example application is updated to support the new setpoint, ppO2, CNS and decompression samples that have been introduced. The NDL event is removed again. --- examples/universal.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/examples/universal.c b/examples/universal.c index aacd730..9818e43 100644 --- a/examples/universal.c +++ b/examples/universal.c @@ -240,7 +240,9 @@ sample_cb (dc_sample_type_t type, dc_sample_value_t value, void *userdata) "safety stop (voluntary)", "safety stop (mandatory)", "deepstop", "ceiling (safety stop)", "unknown", "divetime", "maxdepth", "OLF", "PO2", "airtime", "rgbm", "heading", "tissue level warning", - "gaschange2", "ndl"}; + "gaschange2"}; + static const char *decostop[] = { + "ndl", "deco", "deep", "safety"}; sample_data_t *sampledata = (sample_data_t *) userdata; @@ -279,6 +281,19 @@ sample_cb (dc_sample_type_t type, dc_sample_value_t value, void *userdata) fprintf (sampledata->fp, "%02X", ((unsigned char *) value.vendor.data)[i]); fprintf (sampledata->fp, "\n"); break; + case DC_SAMPLE_SETPOINT: + fprintf (sampledata->fp, " %.2f\n", value.setpoint); + break; + case DC_SAMPLE_PPO2: + fprintf (sampledata->fp, " %.2f\n", value.ppo2); + break; + case DC_SAMPLE_CNS: + fprintf (sampledata->fp, " %.2f\n", value.cns); + break; + case DC_SAMPLE_DECO: + fprintf (sampledata->fp, " %s\n", + value.deco.time, value.deco.depth, decostop[value.deco.type]); + break; default: break; }