From 81e69b8bea85d5bfdb8fe8059cce34cba02d21b2 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Thu, 18 Oct 2018 00:56:13 +0200 Subject: [PATCH] Access TLV.length directly. --- grmn/gcd.py | 4 ++-- grmn/tlv.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/grmn/gcd.py b/grmn/gcd.py index 9374dcf..8fbb4a6 100644 --- a/grmn/gcd.py +++ b/grmn/gcd.py @@ -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 diff --git a/grmn/tlv.py b/grmn/tlv.py index b634acc..cb6e7c1 100644 --- a/grmn/tlv.py +++ b/grmn/tlv.py @@ -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