diff options
author | Supreeth Herle <herlesupreeth@gmail.com> | 2020-04-20 13:30:34 +0200 |
---|---|---|
committer | Supreeth Herle <herlesupreeth@gmail.com> | 2020-04-27 12:29:00 +0200 |
commit | d3b13d0c854ed29b74b0bd9da75710cb4c53d200 (patch) | |
tree | c1889b8763111509554799e2fb094c4f09e70ec7 /pySim-read.py | |
parent | 0c4d82d84a74c2de9ef5e08119f5c3bfe8789c08 (diff) |
Use helper method to print available service in EF.SST
Change-Id: I375475e9f7210dae4e8da7258d6824dc2d54cf4c
Diffstat (limited to 'pySim-read.py')
-rwxr-xr-x | pySim-read.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/pySim-read.py b/pySim-read.py index 8f81443..7557201 100755 --- a/pySim-read.py +++ b/pySim-read.py @@ -32,7 +32,7 @@ from pySim.ts_51_011 import EF, DF, EF_SST_map from pySim.commands import SimCardCommands from pySim.cards import card_detect, Card -from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid, dec_msisdn, format_xplmn_w_act, dec_spn +from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid, dec_msisdn, format_xplmn_w_act, dec_spn, dec_st def parse_options(): @@ -234,16 +234,11 @@ if __name__ == '__main__': print("AD: Can't read, response code = %s" % (sw,)) # EF.SST - (res, sw) = card.read_sst() + (res, sw) = card.read_binary('SST') if sw == '9000': - # (st_hex, avail_src_list) = res - # st_hex - Service Table in hex format - # avail_src_list - List of services available - print("SIM Service Table: %s" % res[0]) + print("SIM Service Table: %s" % res) # Print those which are available - for s in res[1]: - if s in EF_SST_map: - print('\tService %d - %s: %s' % (s, EF_SST_map[s], s in res[1])) + print("%s" % dec_st(res)) else: print("SIM Service Table: Can't read, response code = %s" % (sw,)) |