From c929aea04dd2c2f41618904216a36ae430a7ea5b Mon Sep 17 00:00:00 2001 From: mvoelkel Date: Wed, 29 Jun 2016 17:20:28 +0200 Subject: [PATCH] =?UTF-8?q?Signalstrength=20conversion=20dB=C2=B5V=20to=20?= =?UTF-8?q?dBm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontends/cxd2843.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontends/cxd2843.c b/frontends/cxd2843.c index 9d3971d..10e8a3b 100644 --- a/frontends/cxd2843.c +++ b/frontends/cxd2843.c @@ -1335,15 +1335,18 @@ static int get_stats(struct dvb_frontend *fe) { struct dtv_frontend_properties *p = &fe->dtv_property_cache; u16 val; + s64 str; if (fe->ops.tuner_ops.get_rf_strength) fe->ops.tuner_ops.get_rf_strength(fe, &val); else val = 0; + str = 1000 * (s64) (s16) val; + str -= 108750; p->strength.len = 1; p->strength.stat[0].scale = FE_SCALE_DECIBEL; - p->strength.stat[0].uvalue = 1000 * (s64) (s16) val; + p->strength.stat[0].uvalue = str; read_snr(fe, &val); p->cnr.len = 1;