aboutsummaryrefslogtreecommitdiffstats
path: root/pySim-read.py
diff options
context:
space:
mode:
authorDaniel Laszlo Sitzer <dlsitzer@gmail.com>2018-12-04 19:40:08 +0100
committerHarald Welte <laforge@gnumonks.org>2019-05-10 17:03:58 +0200
commit851e9c0f4c92f2336faa5f5b9b4e3aa7c963608e (patch)
tree617063ad1c44ac014ef847fdaa54b932e515d247 /pySim-read.py
parent91d4ec7e7baa0e67e63890a962bca937bc3fab10 (diff)
utils: add EF [H|O]PLMNwAcT decoding.
Allow decoding and pretty printing of PLMNwAcT, HPLMNwAcT and OPLMNwAct. Includes unit tests for the added functions. Change-Id: I9b8ca6ffd98f665690b84239d9a228e2c72c6ff9
Diffstat (limited to 'pySim-read.py')
-rwxr-xr-xpySim-read.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pySim-read.py b/pySim-read.py
index bcdbca6..16607cf 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -37,7 +37,7 @@ except ImportError:
import simplejson as json
from pySim.commands import SimCardCommands
-from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid
+from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid, format_xplmn_w_act
def parse_options():
@@ -129,7 +129,7 @@ if __name__ == '__main__':
try:
(res, sw) = scc.read_binary(EF['PLMNwAcT'])
if sw == '9000':
- print("PLMNwAcT: %s" % (res))
+ print("PLMNwAcT:\n%s" % (format_xplmn_w_act(res)))
else:
print("PLMNwAcT: Can't read, response code = %s" % (sw,))
except Exception as e:
@@ -139,7 +139,7 @@ if __name__ == '__main__':
try:
(res, sw) = scc.read_binary(EF['OPLMNwAcT'])
if sw == '9000':
- print("OPLMNwAcT: %s" % (res))
+ print("OPLMNwAcT:\n%s" % (format_xplmn_w_act(res)))
else:
print("OPLMNwAcT: Can't read, response code = %s" % (sw,))
except Exception as e:
@@ -149,7 +149,7 @@ if __name__ == '__main__':
try:
(res, sw) = scc.read_binary(EF['HPLMNAcT'])
if sw == '9000':
- print("HPLMNAcT: %s" % (res))
+ print("HPLMNAcT:\n%s" % (format_xplmn_w_act(res)))
else:
print("HPLMNAcT: Can't read, response code = %s" % (sw,))
except Exception as e: