1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

Signalstrength conversion dBµV to dBm

This commit is contained in:
mvoelkel 2016-06-29 17:20:28 +02:00
parent 16c0834b78
commit c929aea04d

View File

@ -1335,15 +1335,18 @@ static int get_stats(struct dvb_frontend *fe)
{ {
struct dtv_frontend_properties *p = &fe->dtv_property_cache; struct dtv_frontend_properties *p = &fe->dtv_property_cache;
u16 val; u16 val;
s64 str;
if (fe->ops.tuner_ops.get_rf_strength) if (fe->ops.tuner_ops.get_rf_strength)
fe->ops.tuner_ops.get_rf_strength(fe, &val); fe->ops.tuner_ops.get_rf_strength(fe, &val);
else else
val = 0; val = 0;
str = 1000 * (s64) (s16) val;
str -= 108750;
p->strength.len = 1; p->strength.len = 1;
p->strength.stat[0].scale = FE_SCALE_DECIBEL; 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); read_snr(fe, &val);
p->cnr.len = 1; p->cnr.len = 1;