laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/26965 
)

Change subject: ts_102_221: decode/encode EF.PL
......................................................................

ts_102_221: decode/encode EF.PL

pySIM-shell (MF/EF.PL)> read_binary_decoded
[
    "en",
    null,
    null,
    null,
    null
]

Change-Id: I4e879ef34acee461adb8137a6315d064370b1b10
---
M pySim/ts_102_221.py
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/pySim/ts_102_221.py b/pySim/ts_102_221.py
index f145d19..7cc3025 100644
--- a/pySim/ts_102_221.py
+++ b/pySim/ts_102_221.py
@@ -503,6 +503,17 @@
 class EF_PL(TransRecEF):
     def __init__(self, fid='2f05', sfid=0x05, name='EF.PL', desc='Preferred 
Languages'):
         super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=2, 
size={2,None})
+    def _decode_record_bin(self, bin_data):
+        if bin_data == b'\xff\xff':
+            return None
+        else:
+            return bin_data.decode('ascii')
+    def _encode_record_bin(self, in_json):
+        if in_json is None:
+            return b'\xff\xff'
+        else:
+            return in_json.encode('ascii')
+

 # TS 102 221 Section 13.4
 class EF_ARR(LinFixedEF):

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I4e879ef34acee461adb8137a6315d064370b1b10
Gerrit-Change-Number: 26965
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-MessageType: merged

Reply via email to