aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/sec.cpp
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-02-21 20:52:20 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-02-21 20:52:20 +0000
commit40929bedeb3ac67d8f8205cb0009562d13e05d0a (patch)
treeb27052b096333e95264cffe4ce9b10b973a1cd78 /lib/dvb/sec.cpp
parent958251e457e49c86366beff69662d36f052d4cc7 (diff)
downloadenigma2-40929bedeb3ac67d8f8205cb0009562d13e05d0a.tar.gz
enigma2-40929bedeb3ac67d8f8205cb0009562d13e05d0a.zip
add frequency possibility test to detect the correct lnb
(for example on tunerA a C-Band LNB is used and on tunerB a ku-Band but for both tuners the same satellites are configured)
Diffstat (limited to 'lib/dvb/sec.cpp')
-rw-r--r--lib/dvb/sec.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp
index aa00062a..47240043 100644
--- a/lib/dvb/sec.cpp
+++ b/lib/dvb/sec.cpp
@@ -209,6 +209,60 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
// else
// eDebug("OK .. can tune this transponder satpos is correct :)");
}
+ if (ret)
+ {
+ static int lofs[] = { 3650000, 5150000, 9750000, 10600000 };
+ int lof = sat.frequency > lnb_param.m_lof_threshold ?
+ lnb_param.m_lof_hi : lnb_param.m_lof_lo;
+ int diff = 0x7FFFFFFF;
+ unsigned int num_lofs = sizeof(lofs) / sizeof(int);
+ int used_band = -1;
+ for (int i=0; i < num_lofs; ++i)
+ {
+ int lof_diff = abs(lof - lofs[i]);
+ if ( lof_diff < diff )
+ {
+ diff = lof_diff;
+ used_band = i;
+ }
+ }
+ if ( used_band != -1 )
+ {
+ if ( diff > 50000 )
+ {
+ eDebug("could not detect used lnb freq range .. disable range check !!!");
+ used_band = -1;
+ }
+ }
+ if ( used_band != -1 )
+ {
+ int range[2];
+ switch(used_band)
+ {
+ case 0: // s-band
+ range[0] = 2500000;
+ range[1] = 2700000;
+ break;
+ case 1: // c-band
+ range[0] = 3400000;
+ range[1] = 4200000;
+ break;
+ case 2: // ku-band low
+ range[0] = 10700000;
+ range[1] = 11750000;
+ break;
+ case 3: // ku-band high
+ range[0] = 11750000;
+ range[1] = 12750000;
+ break;
+ }
+ // check frequency in range ( +/- 50Mhz )
+ if ( (sat.frequency+75000) < range[0] )
+ ret=0;
+ if ( (sat.frequency-75000) > range[1] )
+ ret=0;
+ }
+ }
}
}
}