<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/pysim/+/23211">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ts_102_221: fix fixup_fcp_proprietary_tlv_map()<br><br>According to its description, the function<br>fixup_fcp_proprietary_tlv_map() is supposed to add propritary TLV tags<br>to satisfy the pyTlv parser, which can't handle unexpected tags.<br>However, the function adds tags but it does only fill up the gaps from<br>0xd0 onwards. This makes no sense, lets extended it so that it adds a<br>propritary tag for each tag that it is not already in the dictionary so<br>that we get a continious dictionary that starts at 0x00 and ends at 0xff<br><br>Change-Id: Ib06041361851f05dd990576fff47048dc1aa6290<br>Related: OS#4963<br>---<br>M pySim/ts_102_221.py<br>1 file changed, 4 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/11/23211/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/pySim/ts_102_221.py b/pySim/ts_102_221.py</span><br><span>index 256a697..e3e7052 100644</span><br><span>--- a/pySim/ts_102_221.py</span><br><span>+++ b/pySim/ts_102_221.py</span><br><span>@@ -126,13 +126,12 @@</span><br><span> # accept unknown tags.  It also doesn't raise a specific exception type but</span><br><span> # just the generic ValueError, so we cannot ignore those either.  Instead,</span><br><span> # we insert a dict entry for every possible proprietary tag permitted</span><br><span style="color: hsl(120, 100%, 40%);">+#def fixup_fcp_proprietary_tlv_map(tlv_map):</span><br><span> def fixup_fcp_proprietary_tlv_map(tlv_map):</span><br><span style="color: hsl(0, 100%, 40%);">-    if 'D0' in tlv_map:</span><br><span style="color: hsl(0, 100%, 40%);">-        return</span><br><span style="color: hsl(0, 100%, 40%);">-    for i in range(0xd0, 0xff):</span><br><span style="color: hsl(120, 100%, 40%);">+    for i in range(0x00, 0xff):</span><br><span>         i_hex = i2h([i]).upper()</span><br><span style="color: hsl(0, 100%, 40%);">-        tlv_map[i_hex] = 'proprietary_' + i_hex</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(120, 100%, 40%);">+        if i_hex not in tlv_map:</span><br><span style="color: hsl(120, 100%, 40%);">+                tlv_map[i_hex] = 'proprietary_' + i_hex</span><br><span> </span><br><span> def tlv_key_replace(inmap, indata):</span><br><span>     def newkey(inmap, key):</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/23211">change 23211</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/pysim/+/23211"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: pysim </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ib06041361851f05dd990576fff47048dc1aa6290 </div>
<div style="display:none"> Gerrit-Change-Number: 23211 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>