Change in pysim[master]: ts_102_221: fix fixup_fcp_proprietary_tlv_map()

laforge gerrit-no-reply at lists.osmocom.org
Wed Mar 3 07:51:45 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/23211 )


Change subject: ts_102_221: fix fixup_fcp_proprietary_tlv_map()
......................................................................

ts_102_221: fix fixup_fcp_proprietary_tlv_map()

According to its description, the function
fixup_fcp_proprietary_tlv_map() is supposed to add propritary TLV tags
to satisfy the pyTlv parser, which can't handle unexpected tags.
However, the function adds tags but it does only fill up the gaps from
0xd0 onwards. This makes no sense, lets extended it so that it adds a
propritary tag for each tag that it is not already in the dictionary so
that we get a continious dictionary that starts at 0x00 and ends at 0xff

Change-Id: Ib06041361851f05dd990576fff47048dc1aa6290
Related: OS#4963
---
M pySim/ts_102_221.py
1 file changed, 4 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/11/23211/1

diff --git a/pySim/ts_102_221.py b/pySim/ts_102_221.py
index 256a697..e3e7052 100644
--- a/pySim/ts_102_221.py
+++ b/pySim/ts_102_221.py
@@ -126,13 +126,12 @@
 # accept unknown tags.  It also doesn't raise a specific exception type but
 # just the generic ValueError, so we cannot ignore those either.  Instead,
 # we insert a dict entry for every possible proprietary tag permitted
+#def fixup_fcp_proprietary_tlv_map(tlv_map):
 def fixup_fcp_proprietary_tlv_map(tlv_map):
-    if 'D0' in tlv_map:
-        return
-    for i in range(0xd0, 0xff):
+    for i in range(0x00, 0xff):
         i_hex = i2h([i]).upper()
-        tlv_map[i_hex] = 'proprietary_' + i_hex
-
+        if i_hex not in tlv_map:
+                tlv_map[i_hex] = 'proprietary_' + i_hex
 
 def tlv_key_replace(inmap, indata):
     def newkey(inmap, key):

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/23211
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ib06041361851f05dd990576fff47048dc1aa6290
Gerrit-Change-Number: 23211
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210303/946ec7ea/attachment.htm>


More information about the gerrit-log mailing list