diff options
author | Supreeth Herle <herlesupreeth@gmail.com> | 2020-03-20 18:50:39 +0100 |
---|---|---|
committer | Supreeth Herle <herlesupreeth@gmail.com> | 2020-04-16 07:38:27 +0200 |
commit | e26331ef72f353f758e0efd7c79afc8d35799c97 (patch) | |
tree | 6e0f0d72c0ba63575eb2c009aee5213ec3ca9776 /pySim-read.py | |
parent | 441c4a768f2bbe7547673e302a7f8e3f95570b0a (diff) |
Add ability to parse SIM Service Table (EF.SST)
As per TS.51.011, This EF indicates which services in the SIM are allocated, and whether, if allocated, the service is activated
.If a service is not indicated as available in the SIM, the ME shall not select this service.
Change-Id: Id28a35727adbaaa9df19b1adc621a0c51ad0e51b
Diffstat (limited to 'pySim-read.py')
-rwxr-xr-x | pySim-read.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/pySim-read.py b/pySim-read.py index 98a2e81..31a3374 100755 --- a/pySim-read.py +++ b/pySim-read.py @@ -28,7 +28,7 @@ import os import random import re import sys -from pySim.ts_51_011 import EF, DF +from pySim.ts_51_011 import EF, DF, EF_SST_map from pySim.commands import SimCardCommands from pySim.cards import card_detect, Card @@ -219,5 +219,19 @@ if __name__ == '__main__': else: print("AD: Can't read, response code = %s" % (sw,)) + # EF.SST + (res, sw) = card.read_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 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])) + else: + print("SIM Service Table: Can't read, response code = %s" % (sw,)) + # Done for this card and maybe for everything ? print("Done !\n") |