8 if HardwareInfo.device_name is not None:
9 # print "using cached result"
12 HardwareInfo.device_name = "unknown"
14 file = open("/proc/stb/info/model", "r")
15 HardwareInfo.device_name = file.readline().strip()
18 print "----------------"
19 print "you should upgrade to new drivers for the hardware detection to work properly"
20 print "----------------"
21 print "fallback to detect hardware via /proc/cpuinfo!!"
23 rd = open("/proc/cpuinfo", "r").read()
24 if rd.find("Brcm4380 V4.2") != -1:
25 HardwareInfo.device_name = "dm8000"
26 print "dm8000 detected!"
27 elif rd.find("Brcm7401 V0.0") != -1:
28 HardwareInfo.device_name = "dm800"
29 print "dm800 detected!"
30 elif rd.find("MIPS 4KEc V4.8") != -1:
31 HardwareInfo.device_name = "dm7025"
32 print "dm7025 detected!"
36 HardwareInfo.vu_device_name = "unknown"
37 vumodel_path = "/proc/stb/info/vumodel"
38 if os.access(vumodel_path, os.F_OK):
39 HardwareInfo.vu_device_name = open(vumodel_path, "r").read().strip()
41 def get_device_name(self):
42 return HardwareInfo.device_name
44 def get_vu_device_name(self):
45 return HardwareInfo.vu_device_name