forked from public/pysim
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
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user