mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-26 15:28:35 +03:00
Remove redundant functions
Change-Id: I2dfb5b662b8a4f351e4a629040b405c182e58e8d
This commit is contained in:
@@ -188,14 +188,6 @@ class Card(object):
|
|||||||
else:
|
else:
|
||||||
return (None, sw)
|
return (None, sw)
|
||||||
|
|
||||||
# Read SIM Service table
|
|
||||||
def read_sst(self):
|
|
||||||
(res, sw) = self._scc.read_binary(EF['SST'])
|
|
||||||
if sw == '9000':
|
|
||||||
return ((res, parse_st(res)), sw)
|
|
||||||
else:
|
|
||||||
return (None, sw)
|
|
||||||
|
|
||||||
# Read the (full) AID for either ISIM or USIM or ISIM application
|
# Read the (full) AID for either ISIM or USIM or ISIM application
|
||||||
def read_aid(self, isim = False):
|
def read_aid(self, isim = False):
|
||||||
|
|
||||||
|
|||||||
@@ -326,28 +326,6 @@ def enc_msisdn(msisdn, npi=0x01, ton=0x03):
|
|||||||
|
|
||||||
return ('%02x' % bcd_len) + ('%02x' % npi_ton) + bcd
|
return ('%02x' % bcd_len) + ('%02x' % npi_ton) + bcd
|
||||||
|
|
||||||
def parse_st(st):
|
|
||||||
"""
|
|
||||||
Parses the EF S/U/IST and returns available/supported services
|
|
||||||
"""
|
|
||||||
st_bytes = [st[i:i+2] for i in range(0, len(st), 2) ]
|
|
||||||
avail_srvc = []
|
|
||||||
# Get each byte and check for available services
|
|
||||||
for i in range(0, len(st_bytes)):
|
|
||||||
# Byte i contains info about Services num (8i+1) to num (8i+8)
|
|
||||||
byte = int(st_bytes[i], 16)
|
|
||||||
# Services in each byte are in order MSB to LSB
|
|
||||||
# MSB - Service (8i+8)
|
|
||||||
# LSB - Service (8i+1)
|
|
||||||
for j in range(1, 9):
|
|
||||||
if byte&0x01 == 0x01:
|
|
||||||
# Byte X contains info about Services num (8X-7) to num (8X)
|
|
||||||
# bit = 1: service available
|
|
||||||
# bit = 0: service not available
|
|
||||||
avail_srvc.append((8*i) + j)
|
|
||||||
byte = byte >> 1
|
|
||||||
return avail_srvc
|
|
||||||
|
|
||||||
def dec_st(st, table="sim"):
|
def dec_st(st, table="sim"):
|
||||||
"""
|
"""
|
||||||
Parses the EF S/U/IST and prints the list of available services in EF S/U/IST
|
Parses the EF S/U/IST and prints the list of available services in EF S/U/IST
|
||||||
|
|||||||
Reference in New Issue
Block a user