From fe0c5de7cf049cc953fab2c82b93e82588549ce8 Mon Sep 17 00:00:00 2001 From: kos Date: Wed, 8 May 2013 18:14:21 +0900 Subject: [PATCH] [blindscan] fixed a bug that failed to scan on the uno and ultimo. --- .../Plugins/SystemPlugins/Blindscan/plugin.py | 59 ++++++++++++++-------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/lib/python/Plugins/SystemPlugins/Blindscan/plugin.py b/lib/python/Plugins/SystemPlugins/Blindscan/plugin.py index b25d890..faeb9d9 100644 --- a/lib/python/Plugins/SystemPlugins/Blindscan/plugin.py +++ b/lib/python/Plugins/SystemPlugins/Blindscan/plugin.py @@ -86,9 +86,39 @@ class Blindscan(ConfigListScreen, Screen): self.i2c_mapping_table = None self.makeNimSocket() - - def makeNimSocket(self): - self.i2c_mapping_table = {0:2, 1:3, 2:1, 3:0} + self.nimSockets = self.ScanNimsocket() + + def ScanNimsocket(self): + _nimSocket = {} + fp = file('/proc/bus/nim_sockets') + + sNo, sName = -1, "" + for line in fp: + line = line.strip() + if line.startswith('NIM Socket'): + sNo = line.split()[2][:-1] + elif line.startswith('Name:'): + sName = line.split()[3][4:-1] + if sNo >= 0 and sName != "": + _nimSocket[sNo] = sName + sNo = -1 + sName = '' + fp.close() + return _nimSocket + + def makeNimSocket(self, nimname=""): + self.i2c_mapping_table = {} + + if nimname == "AVL6222": + model = file('/proc/stb/info/vumodel').read().strip() + if model == "uno": + self.i2c_mapping_table = {0:3, 1:3, 2:1, 3:0} + elif model == "duo2": + if self.nimSockets['0'] == "AVL6222": + self.i2c_mapping_table = {0:2, 1:2, 2:4, 3:4} + else: self.i2c_mapping_table = {0:2, 1:4, 2:4, 3:0} + else: self.i2c_mapping_table = {0:2, 1:4, 2:0, 3:0} + else: self.i2c_mapping_table = {0:2, 1:3, 2:1, 3:0} def getNimSocket(self, slot_number): if slot_number < 0 or slot_number > 3: @@ -334,29 +364,16 @@ class Blindscan(ConfigListScreen, Screen): def doRun(self, tmp_list, tmp_pol, tmp_band): def GetCommand(nimIdx): - _nimSocket = {} - fp = file('/proc/bus/nim_sockets') - - sNo, sName = -1, "" - for line in fp: - line = line.strip() - if line.startswith('NIM Socket'): - sNo = line.split()[2][:-1] - elif line.startswith('Name:'): - sName = line.split()[3][4:-1] - if sNo >= 0 and sName != "": - _nimSocket[sNo] = sName - sNo = -1 - sName = '' - fp.close() - + _nimSocket = self.nimSockets try: sName = _nimSocket[str(nimIdx)] sType = _supportNimType[sName] - return "vuplus_%(TYPE)sblindscan"%{'TYPE':sType}, None + return "vuplus_%(TYPE)sblindscan"%{'TYPE':sType}, sName except: pass - return "vuplus_blindscan", None + return "vuplus_blindscan", "" self.binName,nimName = GetCommand(self.scan_nims.value) + + self.makeNimSocket(nimName) if self.binName is None: self.session.open(MessageBox, "Blindscan is not supported in " + nimName + " tuner.", MessageBox.TYPE_ERROR) print nimName + " is not support blindscan." -- 2.7.4