filesystem: Introduce support for TLV parser
This adds an easy way for files to make use of the pySim.tlv parser.
All a file has to do is to specify a _tlv member which points to
either a TLV_IE or a TLV_IE_Collection instance.
Change-Id: I59f456b4223ec88081e91cee168b654c69bcb5f4
diff --git a/pySim/tlv.py b/pySim/tlv.py
index 3b27b5e..05f824e 100644
--- a/pySim/tlv.py
+++ b/pySim/tlv.py
@@ -338,6 +338,8 @@
while len(remainder):
# obtain the tag at the start of the remainder
tag, r = first._parse_tag_raw(remainder)
+ if tag == None:
+ return res
if tag in self.members_by_tag:
cls = self.members_by_tag[tag]
# create an instance and parse accordingly