From e26331ef72f353f758e0efd7c79afc8d35799c97 Mon Sep 17 00:00:00 2001 From: Supreeth Herle Date: Fri, 20 Mar 2020 18:50:39 +0100 Subject: 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 --- pySim-read.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'pySim-read.py') 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") -- cgit v1.2.3