+ def GetCommand(nimIdx):
+ _supportNimType = { 'SSH108':'ssh108' }
+ _nimSocket = {}
+ fp = file('/proc/bus/nim_sockets')
+
+ sNo, sName = -1, ""
+ for line in fp:
+ line = line.strip()
+ if line.startswith('NIM Socket'):
+ try: sNo = line.split()[2][:-1]
+ except: sNo = -1
+ elif line.startswith('Name:'):
+ try: sName = line.split()[3][4:-1]
+ except: sName = ""
+ if sNo >= 0 and sName != "":
+ _nimSocket[sNo] = sName
+ sNo, sName = -1, ''
+ fp.close()
+ print 'parsed nim_sockets :', _nimSocket
+
+ try:
+ sName = _nimSocket[str(nimIdx)]
+ sType = _supportNimType[sName]
+ return sType
+ except: pass
+ return 'tda1002x'
+