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
This commit is contained in:
Supreeth Herle
2020-03-22 08:20:11 +01:00
parent 69e5d27e3c
commit 9641299f9a
5 changed files with 166 additions and 0 deletions

View File

@@ -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")