mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-19 11:58:34 +03:00
cards: add update method for EF:PLMNsel to Card class
The Card class offers update methods for various EF, but for PLMNsel there is no update method available yet. Lets add one. Change-Id: I832f7bef70c92dc101b94ad871b6cafaa626e134 Related: SYS#4245
This commit is contained in:
@@ -83,6 +83,12 @@ class Card(object):
|
||||
data, sw = self._scc.update_binary(EF['HPLMNwAcT'], content + 'ffffff0000' * (size/5-1))
|
||||
return sw
|
||||
|
||||
def update_plmnsel(self, mcc, mnc):
|
||||
data = self._scc.read_binary(EF['PLMNsel'], length=None, offset=0)
|
||||
size = len(data[0])/2
|
||||
hplmn = enc_plmn(mcc, mnc)
|
||||
self._scc.update_binary(EF['PLMNsel'], hplmn + 'ff' * (size-3))
|
||||
|
||||
def update_smsp(self, smsp):
|
||||
data, sw = self._scc.update_record(EF['SMSP'], 1, rpad(smsp, 84))
|
||||
return sw
|
||||
|
||||
Reference in New Issue
Block a user