Move reading of ePDG Id to generic USIM class

Change-Id: I716acb994430db3d4e56fea072f8dc2cebeaba84
This commit is contained in:
herlesupreeth
2020-09-29 10:03:06 +02:00
committed by laforge
parent 5d0a30c19c
commit f8232db327
5 changed files with 13 additions and 9 deletions

View File

@@ -267,12 +267,12 @@ if __name__ == '__main__':
#EF.ePDGId - Home ePDG Identifier #EF.ePDGId - Home ePDG Identifier
try: try:
(res, sw) = card.read_binary(EF_USIM_ADF_map['ePDGId']) if card.file_exists(EF_USIM_ADF_map['ePDGId']):
if sw == '9000': (res, sw) = card.read_epdgid()
content = dec_epdgid(res) if sw == '9000':
print("ePDGId:\n%s" % (len(content) and content or '\tNot available\n',)) print("ePDGId:\n%s" % (len(res) and res or '\tNot available\n',))
else: else:
print("ePDGId: Can't read, response code = %s" % (sw,)) print("ePDGId: Can't read, response code = %s" % (sw,))
except Exception as e: except Exception as e:
print("ePDGId: Can't read file -- " + str(e)) print("ePDGId: Can't read file -- " + str(e))

View File

@@ -264,6 +264,13 @@ class UsimCard(Card):
data, sw = self._scc.update_binary(EF_USIM_ADF_map['EHPLMN'], ehplmn) data, sw = self._scc.update_binary(EF_USIM_ADF_map['EHPLMN'], ehplmn)
return sw return sw
def read_epdgid(self):
(res, sw) = self._scc.read_binary(EF_USIM_ADF_map['ePDGId'])
if sw == '9000':
return (dec_epdgid(res), sw)
else:
return (None, sw)
def update_epdgid(self, epdgid): def update_epdgid(self, epdgid):
epdgid_tlv = enc_epdgid(epdgid) epdgid_tlv = enc_epdgid(epdgid)
data, sw = self._scc.update_binary( data, sw = self._scc.update_binary(

View File

@@ -116,6 +116,5 @@ USIM Service Table: 01ea1ffc21360480010000
Service 64 - VGCS security Service 64 - VGCS security
Service 65 - VBS security Service 65 - VBS security
ePDGId: Can't read file -- SW match failed! Expected 9000 and got 6a82.
Done ! Done !

View File

@@ -132,6 +132,5 @@ USIM Service Table: 9eff1b3c37fe5900000000
Service 53 - Extension 8 Service 53 - Extension 8
Service 55 - MMS User Connectivity Parameters Service 55 - MMS User Connectivity Parameters
ePDGId: Can't read file -- SW match failed! Expected 9000 and got 6a82.
Done ! Done !

View File

@@ -140,6 +140,5 @@ USIM Service Table: 9e6b1dfc67f6580000
Service 53 - Extension 8 Service 53 - Extension 8
Service 55 - MMS User Connectivity Parameters Service 55 - MMS User Connectivity Parameters
ePDGId: Can't read file -- SW match failed! Expected 9000 and got 6a82.
Done ! Done !