Detect device for component firmwares.

This commit is contained in:
2018-12-10 16:57:55 +01:00
parent 0eb98341e6
commit a2d0d622e6
2 changed files with 8 additions and 2 deletions
+4 -2
View File
@@ -343,8 +343,10 @@ class TLVbinary0401(TLVbinary):
if hdr == 0xffff:
version = unpack("<H", self.value[4:6])[0]
sku = self.value[10:20].decode("utf-8")
txt += "\n - SKU: {}-{}-{}".format(sku[0:3], sku[3:8], sku[8:10])
txt += "\n - Version: {}".format(version)
hwid = int(sku[4:8])
txt += "\n - SKU: {}-{}-{}".format(sku[0:3], sku[3:8], sku[8:10])
txt += "\n - hw_id: 0x{:04x} / {:d} ({})".format(hwid, hwid, devices.DEVICES.get(hwid, "Unknown device"))
txt += "\n - Version: 0x{:04x} / {:d}".format(version, version)
#if not self.is_parsed:
# self.parse()
return txt