aboutsummaryrefslogtreecommitdiffstats
path: root/pySim-read.py
diff options
context:
space:
mode:
authorSupreeth Herle <herlesupreeth@gmail.com>2020-03-22 08:20:11 +0100
committerSupreeth Herle <herlesupreeth@gmail.com>2020-04-27 12:29:00 +0200
commit9641299f9aec97b7a488756281ce9fe6b0702cfa (patch)
tree72ed72e2940b401b89c78a2894e8e7d77f662ad7 /pySim-read.py
parent69e5d27e3c8f595e003344e25cea957e6affb898 (diff)
Enable parsing of USIM Service table (UST)
As per TS.31.102, This EF indicates which USIM services are available. If a service is not indicated as available in the USIM, the ME shall not select this service. Parsing of UST is achieved by first selecting the USIM application using its AID. This is followed by selecting EF.UST with File ID - 6f38 in ADF.USIM Change-Id: I54dbbd40bd3d22cee81f7c32e58cd946f8564257
Diffstat (limited to 'pySim-read.py')
-rwxr-xr-xpySim-read.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pySim-read.py b/pySim-read.py
index 7557201..4551e82 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -29,6 +29,7 @@ import random
import re
import sys
from pySim.ts_51_011 import EF, DF, EF_SST_map
+from pySim.ts_31_102 import EF_UST_map
from pySim.commands import SimCardCommands
from pySim.cards import card_detect, Card
@@ -242,5 +243,17 @@ if __name__ == '__main__':
else:
print("SIM Service Table: Can't read, response code = %s" % (sw,))
+ # Check whether we have th AID of USIM, if so select it by its AID
+ # EF.UST - File Id in ADF USIM : 6f38
+ if '9000' == card.select_adf_by_aid():
+ # EF.UST
+ (res, sw) = card.read_binary('6f38')
+ if sw == '9000':
+ print("USIM Service Table: %s" % res)
+ # Print those which are available
+ print("%s" % dec_st(res, table="usim"))
+ else:
+ print("USIM Service Table: Can't read, response code = %s" % (sw,))
+
# Done for this card and maybe for everything ?
print("Done !\n")