Access TLV.length directly.
This commit is contained in:
parent
121522ced7
commit
81e69b8bea
@ -35,7 +35,7 @@ class Gcd:
|
||||
if tlv.type_id == 0xFFFF:
|
||||
# End of file reached
|
||||
break
|
||||
tlength = tlv.get_length()
|
||||
tlength = tlv.length
|
||||
payload = f.read(tlength)
|
||||
tlv.set_value(payload)
|
||||
if tlv.type_id == 0x0006:
|
||||
@ -57,5 +57,5 @@ class Gcd:
|
||||
print("#{:03d}: {}".format(i, tlv))
|
||||
else:
|
||||
tlv_count += 1
|
||||
tlv_length += tlv.get_length()
|
||||
tlv_length += tlv.length
|
||||
last_tlv = tlv.type_id
|
||||
|
@ -51,9 +51,6 @@ class TLV:
|
||||
def set_value(self, new_value: bytes):
|
||||
self.value = new_value
|
||||
|
||||
def get_length(self):
|
||||
return self.length
|
||||
|
||||
def get_actual_length(self):
|
||||
if self.value is None:
|
||||
return 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user