From 4a43392c78fff403f281ea8d0fe7f7d6f82d1ff2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 2 Sep 2018 13:31:51 -0700 Subject: [PATCH] Garmin: add DC_SAMPLE_CNS reporting The code to parse it was already there, we just didn't report it. Signed-off-by: Linus Torvalds --- src/garmin_parser.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/garmin_parser.c b/src/garmin_parser.c index c6c6990..cdb2da8 100644 --- a/src/garmin_parser.c +++ b/src/garmin_parser.c @@ -416,7 +416,14 @@ DECLARE_FIELD(RECORD, ndl, UINT32) // s garmin->callback(DC_SAMPLE_DECO, sample, garmin->userdata); } } -DECLARE_FIELD(RECORD, cns_load, UINT8) { } // percent +DECLARE_FIELD(RECORD, cns_load, UINT8) +{ + if (garmin->callback) { + dc_sample_value_t sample = {0}; + sample.cns = data / 100.0; + garmin->callback(DC_SAMPLE_CNS, sample, garmin->userdata); + } +} DECLARE_FIELD(RECORD, n2_load, UINT16) { } // percent // DEVICE_SETTINGS