mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-17 02:48:34 +03:00
Move reading of ePDG Id to generic USIM class
Change-Id: I716acb994430db3d4e56fea072f8dc2cebeaba84
This commit is contained in:
@@ -267,12 +267,12 @@ if __name__ == '__main__':
|
||||
|
||||
#EF.ePDGId - Home ePDG Identifier
|
||||
try:
|
||||
(res, sw) = card.read_binary(EF_USIM_ADF_map['ePDGId'])
|
||||
if sw == '9000':
|
||||
content = dec_epdgid(res)
|
||||
print("ePDGId:\n%s" % (len(content) and content or '\tNot available\n',))
|
||||
else:
|
||||
print("ePDGId: Can't read, response code = %s" % (sw,))
|
||||
if card.file_exists(EF_USIM_ADF_map['ePDGId']):
|
||||
(res, sw) = card.read_epdgid()
|
||||
if sw == '9000':
|
||||
print("ePDGId:\n%s" % (len(res) and res or '\tNot available\n',))
|
||||
else:
|
||||
print("ePDGId: Can't read, response code = %s" % (sw,))
|
||||
except Exception as e:
|
||||
print("ePDGId: Can't read file -- " + str(e))
|
||||
|
||||
|
||||
@@ -264,6 +264,13 @@ class UsimCard(Card):
|
||||
data, sw = self._scc.update_binary(EF_USIM_ADF_map['EHPLMN'], ehplmn)
|
||||
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):
|
||||
epdgid_tlv = enc_epdgid(epdgid)
|
||||
data, sw = self._scc.update_binary(
|
||||
|
||||
@@ -116,6 +116,5 @@ USIM Service Table: 01ea1ffc21360480010000
|
||||
Service 64 - VGCS security
|
||||
Service 65 - VBS security
|
||||
|
||||
ePDGId: Can't read file -- SW match failed! Expected 9000 and got 6a82.
|
||||
Done !
|
||||
|
||||
|
||||
@@ -132,6 +132,5 @@ USIM Service Table: 9eff1b3c37fe5900000000
|
||||
Service 53 - Extension 8
|
||||
Service 55 - MMS User Connectivity Parameters
|
||||
|
||||
ePDGId: Can't read file -- SW match failed! Expected 9000 and got 6a82.
|
||||
Done !
|
||||
|
||||
|
||||
@@ -140,6 +140,5 @@ USIM Service Table: 9e6b1dfc67f6580000
|
||||
Service 53 - Extension 8
|
||||
Service 55 - MMS User Connectivity Parameters
|
||||
|
||||
ePDGId: Can't read file -- SW match failed! Expected 9000 and got 6a82.
|
||||
Done !
|
||||
|
||||
|
||||
Reference in New Issue
Block a user