Change in pysim[master]: SimCardCommands: detect whether UICC or Classic SIM

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

Falkenber9 gerrit-no-reply at lists.osmocom.org
Thu May 6 11:25:37 UTC 2021


Falkenber9 has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/24160 )

Change subject: SimCardCommands: detect whether UICC or Classic SIM
......................................................................


Patch Set 2:

> Patch Set 2: Code-Review-1
> 
> (2 comments)
> 
> I think this needs improvement, also I think this may be partially redundant to the generic SIM/USIM support for pySim-shell.py, which I am currently working on.
> 
> First of all we consciously decide the APDU parameters for each card and I think it should be kept that way. All those classes have autodetect methods which essentially go by the ATR. I plan to have generic classes SimCard, IsimCard and UsimCard. Those will have autodetect methods that will check weather it is a UICC or not. If it is a UICC it will further check if it is an USIM or ISIM by looking at the app-ids in EF.DIR
> 
> I think it makes sense to use detect_card_type() for the first step (distinguishing from UICC), but I think the code is much more readable when the parameter change takes place in the autodetect method.
> 
> Once the detection is inside the base classes things will be simpler the code will only call card_detect() and get either a specific card or a generic SimCard, IsimCard or UsimCard back and the APDU parameters will also be adjusted already.
> 
> Its not very far yet, but here is the change-id: Id6527254a7305516f2d00876815e46a3c71a81b6
> 
> regards.
> Philipp

Thanks for the feedback, didn't want to be too invasive.

I think your suggestion is the way to go and actually will get obsolete if you add your changes.

Actually, I was working on the same issue - here ist my change-id: I862c42f2c3805886f18214d8b4c39da55a735473

But I think, it makes more sense to make those function non-classmethods as you did.

Nevertheless, I suggest to (optionally) support multiple different detection methods, in case ATR is not available in transport layer (e.g. AT commands).


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I224bd6c91cdaf444e2a94117f64030c024a776a7
Gerrit-Change-Number: 24160
Gerrit-PatchSet: 2
Gerrit-Owner: Falkenber9 <robert.falkenberg at tu-dortmund.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Comment-Date: Thu, 06 May 2021 11:25:37 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210506/6817b723/attachment.htm>


More information about the gerrit-log mailing list