dexter has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9969 )

Change subject: pySim-read: read contents of PLMN related files.
......................................................................

pySim-read: read contents of PLMN related files.

The files EF.PLMNsel, EF.PLMNwAcT, EF.OPLMNwAcT, EF.HPLMNAcT are not
yet printed by pysim-read. Lets add support for those files.

Change-Id: Ice802033adfa6fc1bccc76da47495eb29c3aef6c
Related: SYS#4245
---
M pySim-read.py
1 file changed, 40 insertions(+), 8 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  dexter: Verified



diff --git a/pySim-read.py b/pySim-read.py
index f55b256..e807e3e 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -28,6 +28,7 @@
 import random
 import re
 import sys
+from pySim.ts_51_011 import EF, DF

 try:
        import json
@@ -107,14 +108,45 @@
        else:
                print("SMSP: Can't read, response code = %s" % (sw,))

-       # EF.HPLMN
-#      (res, sw) = scc.read_binary(['3f00', '7f20', '6f30'])
-#      if sw == '9000':
-#              print("HPLMN: %s" % (res))
-#              print("HPLMN: %s" % (dec_hplmn(res),))
-#      else:
-#              print("HPLMN: Can't read, response code = %s" % (sw,))
-       # FIXME
+       # EF.PLMNsel
+       try:
+               (res, sw) = scc.read_binary(EF['PLMNsel'])
+               if sw == '9000':
+                       print("PLMNsel: %s" % (res))
+               else:
+                       print("PLMNsel: Can't read, response code = %s" % (sw,))
+       except Exception as e:
+               print "HPLMNAcT: Can't read file -- " + str(e)
+
+       # EF.PLMNwAcT
+        try:
+               (res, sw) = scc.read_binary(EF['PLMNwAcT'])
+               if sw == '9000':
+                       print("PLMNwAcT: %s" % (res))
+               else:
+                       print("PLMNwAcT: Can't read, response code = %s" % 
(sw,))
+       except Exception as e:
+               print "PLMNwAcT: Can't read file -- " + str(e)
+
+       # EF.OPLMNwAcT
+        try:
+               (res, sw) = scc.read_binary(EF['OPLMNwAcT'])
+               if sw == '9000':
+                       print("OPLMNwAcT: %s" % (res))
+               else:
+                       print("OPLMNwAcT: Can't read, response code = %s" % 
(sw,))
+       except Exception as e:
+               print "OPLMNwAcT: Can't read file -- " + str(e)
+
+       # EF.HPLMNAcT
+        try:
+               (res, sw) = scc.read_binary(EF['HPLMNAcT'])
+               if sw == '9000':
+                       print("HPLMNAcT: %s" % (res))
+               else:
+                       print("HPLMNAcT: Can't read, response code = %s" % 
(sw,))
+       except Exception as e:
+               print "HPLMNAcT: Can't read file -- " + str(e)

        # EF.ACC
        (res, sw) = scc.read_binary(['3f00', '7f20', '6f78'])

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ice802033adfa6fc1bccc76da47495eb29c3aef6c
Gerrit-Change-Number: 9969
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: dexter <[email protected]>

Reply via email to