Change in pysim[master]: cards: autodetect sysmosim-gr1

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Aug 23 16:08:07 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10570 )

Change subject: cards: autodetect sysmosim-gr1
......................................................................

cards: autodetect sysmosim-gr1

The sysmosim-gr1 lacks the auto detection feature because no autodetect
is yet programmed inside the related class.

- add autodetect for sysmosim-gr1

Change-Id: Iec1f1ab6824ff2328baedd731b08df997df4da01
Related: OS#3405
---
M pySim/cards.py
1 file changed, 9 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/pySim/cards.py b/pySim/cards.py
index a72a52f..4dee0d8 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -387,6 +387,15 @@
 	"""
 	name = 'sysmosim-gr1'
 
+        @classmethod
+	def autodetect(kls, scc):
+		try:
+			# Look for ATR
+			if scc.get_atr() == toBytes("3B 99 18 00 11 88 22 33 44 55 66 77 60"):
+				return kls(scc)
+		except:
+			return None
+		return None
 
 class SysmoUSIMgr1(Card):
 	"""

-- 
To view, visit https://gerrit.osmocom.org/10570
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: Iec1f1ab6824ff2328baedd731b08df997df4da01
Gerrit-Change-Number: 10570
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180823/2188a574/attachment.htm>


More information about the gerrit-log mailing list