<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/pysim/+/24004">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ts_51_011, utils: fix Access Technology Identifier coding<br><br>When the Access Technology Identifier encoder sets the bits for E-UTRAN<br>it does not respect that bit "100" is also a valid bit combination that<br>encodes E-UTRAN WB-S1 and E-UTRAN NB-S1. Lets encode this bit<br>combination if the user is just specifying "E-UTRAN" without further<br>spefication of WB or NB.<br><br>The decoder only looks at bit 14 and decodes "1xx" always to "E-UTRAN".<br>This is not specific enough. Lets make sure that the decoder is<br>complementary to the encoder.<br><br>Change-Id: Ibfe8883a05f9ad6988d8e212cb9a598229954296<br>Related: OS#4963<br>---<br>M pySim/ts_51_011.py<br>M pySim/utils.py<br>M tests/test_utils.py<br>3 files changed, 17 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/04/24004/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py</span><br><span>index 14be6dc..1675aaf 100644</span><br><span>--- a/pySim/ts_51_011.py</span><br><span>+++ b/pySim/ts_51_011.py</span><br><span>@@ -704,6 +704,8 @@</span><br><span> if 'cdma2000 1xRTT' in in_list:</span><br><span> u16 |= 0x0010</span><br><span> # E-UTRAN</span><br><span style="color: hsl(120, 100%, 40%);">+ if 'E-UTRAN' in in_list:</span><br><span style="color: hsl(120, 100%, 40%);">+ u16 |= 0x4000</span><br><span> if 'E-UTRAN WB-S1' in in_list:</span><br><span> u16 |= 0x6000</span><br><span> if 'E-UTRAN NB-S1' in in_list:</span><br><span>diff --git a/pySim/utils.py b/pySim/utils.py</span><br><span>index 00cbb5d..78058fc 100644</span><br><span>--- a/pySim/utils.py</span><br><span>+++ b/pySim/utils.py</span><br><span>@@ -230,7 +230,20 @@</span><br><span> sel = []</span><br><span> for a in act_list:</span><br><span> if u16t & (1 << a['bit']):</span><br><span style="color: hsl(0, 100%, 40%);">- sel.append(a['name'])</span><br><span style="color: hsl(120, 100%, 40%);">+ if a['name'] == "E-UTRAN":</span><br><span style="color: hsl(120, 100%, 40%);">+ # The Access technology identifier of E-UTRAN</span><br><span style="color: hsl(120, 100%, 40%);">+ # allows a more detailed specification:</span><br><span style="color: hsl(120, 100%, 40%);">+ if u16t & (1 << 13) and u16t & (1 << 12):</span><br><span style="color: hsl(120, 100%, 40%);">+ sel.append("E-UTRAN WB-S1")</span><br><span style="color: hsl(120, 100%, 40%);">+ sel.append("E-UTRAN NB-S1")</span><br><span style="color: hsl(120, 100%, 40%);">+ elif u16t & (1 << 13):</span><br><span style="color: hsl(120, 100%, 40%);">+ sel.append("E-UTRAN WB-S1")</span><br><span style="color: hsl(120, 100%, 40%);">+ elif u16t & (1 << 12):</span><br><span style="color: hsl(120, 100%, 40%);">+ sel.append("E-UTRAN NB-S1")</span><br><span style="color: hsl(120, 100%, 40%);">+ else:</span><br><span style="color: hsl(120, 100%, 40%);">+ sel.append("E-UTRAN")</span><br><span style="color: hsl(120, 100%, 40%);">+ else:</span><br><span style="color: hsl(120, 100%, 40%);">+ sel.append(a['name'])</span><br><span> return sel</span><br><span> </span><br><span> def dec_xplmn_w_act(fivehexbytes:Hexstr) -> Dict[str,Any]:</span><br><span>diff --git a/tests/test_utils.py b/tests/test_utils.py</span><br><span>index 558b5e7..0fb502c 100755</span><br><span>--- a/tests/test_utils.py</span><br><span>+++ b/tests/test_utils.py</span><br><span>@@ -93,7 +93,7 @@</span><br><span> self.assertEqual(utils.dec_act("0010"), ["cdma2000 1xRTT"])</span><br><span> </span><br><span> def testDecAct_allSet(self):</span><br><span style="color: hsl(0, 100%, 40%);">- self.assertEqual(utils.dec_act("ffff"), ["UTRAN", "E-UTRAN", "GSM", "GSM COMPACT", "cdma2000 HRPD", "cdma2000 1xRTT"])</span><br><span style="color: hsl(120, 100%, 40%);">+ self.assertEqual(utils.dec_act("ffff"), ["UTRAN", "E-UTRAN WB-S1", "E-UTRAN NB-S1", "GSM", "GSM COMPACT", "cdma2000 HRPD", "cdma2000 1xRTT"])</span><br><span> </span><br><span> def testDecxPlmn_w_act(self):</span><br><span> expected = {'mcc': '295', 'mnc': '10', 'act': ["UTRAN"]}</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/24004">change 24004</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/+/24004"/><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: Ibfe8883a05f9ad6988d8e212cb9a598229954296 </div>
<div style="display:none"> Gerrit-Change-Number: 24004 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>