<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/pysim/+/23585">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">51.011: Define some more files within DF_TELECOM<br><br>Add some more minimal definitions for various DF_TELECOM files<br><br>Change-Id: I155729b4d62969cde2af00fc9fb9901299fe5c25<br>---<br>M pySim/ts_51_011.py<br>1 file changed, 39 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/85/23585/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 1455d8f..a671f31 100644</span><br><span>--- a/pySim/ts_51_011.py</span><br><span>+++ b/pySim/ts_51_011.py</span><br><span>@@ -352,8 +352,38 @@</span><br><span>                 'dialing_nr': u[2], 'cap_conf_id': u[3], 'ext1_record_id': u[4]}</span><br><span> </span><br><span> # TS 51.011 Section 10.5.5</span><br><span style="color: hsl(120, 100%, 40%);">+class EF_SMS(LinFixedEF):</span><br><span style="color: hsl(120, 100%, 40%);">+    def __init__(self, fid='6f3c', sfid=None, name='EF.SMS', desc='Short messages'):</span><br><span style="color: hsl(120, 100%, 40%);">+        super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len={176,176})</span><br><span style="color: hsl(120, 100%, 40%);">+    def _decode_record_bin(self, raw_bin_data):</span><br><span style="color: hsl(120, 100%, 40%);">+        def decode_status(status):</span><br><span style="color: hsl(120, 100%, 40%);">+            if status & 0x01 == 0x00:</span><br><span style="color: hsl(120, 100%, 40%);">+                return (None, 'free_space')</span><br><span style="color: hsl(120, 100%, 40%);">+            elif status & 0x07 == 0x01:</span><br><span style="color: hsl(120, 100%, 40%);">+                return ('mt', 'message_read')</span><br><span style="color: hsl(120, 100%, 40%);">+            elif status & 0x07 == 0x03:</span><br><span style="color: hsl(120, 100%, 40%);">+                return ('mt', 'message_to_be_read')</span><br><span style="color: hsl(120, 100%, 40%);">+            elif status & 0x07 == 0x07:</span><br><span style="color: hsl(120, 100%, 40%);">+                return ('mo', 'message_to_be_sent')</span><br><span style="color: hsl(120, 100%, 40%);">+            elif status & 0x1f == 0x05:</span><br><span style="color: hsl(120, 100%, 40%);">+                return ('mo', 'sent_status_not_requested')</span><br><span style="color: hsl(120, 100%, 40%);">+            elif status & 0x1f == 0x0d:</span><br><span style="color: hsl(120, 100%, 40%);">+                return ('mo', 'sent_status_req_but_not_received')</span><br><span style="color: hsl(120, 100%, 40%);">+            elif status & 0x1f == 0x15:</span><br><span style="color: hsl(120, 100%, 40%);">+                return ('mo', 'sent_status_req_rx_not_stored_smsr')</span><br><span style="color: hsl(120, 100%, 40%);">+            elif status & 0x1f == 0x1d:</span><br><span style="color: hsl(120, 100%, 40%);">+                return ('mo', 'sent_status_req_rx_stored_smsr')</span><br><span style="color: hsl(120, 100%, 40%);">+            else:</span><br><span style="color: hsl(120, 100%, 40%);">+                return (None, 'rfu')</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        status = decode_status(raw_bin_data[0])</span><br><span style="color: hsl(120, 100%, 40%);">+        remainder = raw_bin_data[1:]</span><br><span style="color: hsl(120, 100%, 40%);">+        return {'direction': status[0], 'status': status[1], 'remainder': b2h(remainder)}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# TS 51.011 Section 10.5.5</span><br><span> class EF_MSISDN(LinFixedEF):</span><br><span style="color: hsl(0, 100%, 40%);">-    def __init__(self, fid='6f4f', sfid=None, name='EF.MSISDN', desc='MSISDN'):</span><br><span style="color: hsl(120, 100%, 40%);">+    def __init__(self, fid='6f40', sfid=None, name='EF.MSISDN', desc='MSISDN'):</span><br><span>         super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len={15, None})</span><br><span>     def _decode_record_hex(self, raw_hex_data):</span><br><span>         return {'msisdn': dec_msisdn(raw_hex_data)}</span><br><span>@@ -370,10 +400,16 @@</span><br><span>         super().__init__(fid=fid, name=name, desc=desc)</span><br><span>         files = [</span><br><span>           EF_ADN(),</span><br><span style="color: hsl(0, 100%, 40%);">-          # FDN, SMS, CCP, ECCP</span><br><span style="color: hsl(120, 100%, 40%);">+          EF_ADN(fid='6f3b', name='EF_FDN', desc='Fixed dialling numbers'),</span><br><span style="color: hsl(120, 100%, 40%);">+          EF_SMS(),</span><br><span style="color: hsl(120, 100%, 40%);">+          LinFixedEF(fid='6f3d', name='EF.CCP', desc='Capability Configuration Parameters', rec_len={14,14}),</span><br><span style="color: hsl(120, 100%, 40%);">+          LinFixedEF(fid='6f4f', name='EF.ECCP', desc='Extended Capability Configuration Parameters', rec_len={15,32}),</span><br><span>           EF_MSISDN(),</span><br><span>           EF_SMSP(),</span><br><span style="color: hsl(0, 100%, 40%);">-          # SMSS, LND, SDN, EXT1, EXT2, EXT3, BDN, EXT4, SMSR, CMI</span><br><span style="color: hsl(120, 100%, 40%);">+          TransparentEF(fid='6f43', name='EF.SMSS', desc='SMS status', size={2,8}),</span><br><span style="color: hsl(120, 100%, 40%);">+          # LND, SDN, EXT1, EXT2, EXT3, BDN, EXT4</span><br><span style="color: hsl(120, 100%, 40%);">+          LinFixedEF(fid='6f47', name='EF.SMSR', desc='SMS status reports', rec_len={30,30}),</span><br><span style="color: hsl(120, 100%, 40%);">+          # CMI</span><br><span>           ]</span><br><span>         self.add_files(files)</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/23585">change 23585</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/+/23585"/><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: I155729b4d62969cde2af00fc9fb9901299fe5c25 </div>
<div style="display:none"> Gerrit-Change-Number: 23585 </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>