Change in pysim[master]: cards: add update method for EF:PLMNsel to Card class

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Fri Jul 13 07:08:50 UTC 2018


dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/9970 )

Change subject: cards: add update method for EF:PLMNsel to Card class
......................................................................

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
---
M pySim/cards.py
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  dexter: Verified



diff --git a/pySim/cards.py b/pySim/cards.py
index 0c9c2b8..3577d8d 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -83,6 +83,12 @@
 		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

-- 
To view, visit https://gerrit.osmocom.org/9970
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I832f7bef70c92dc101b94ad871b6cafaa626e134
Gerrit-Change-Number: 9970
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180713/33c909db/attachment.htm>


More information about the gerrit-log mailing list