aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSupreeth Herle <herlesupreeth@gmail.com>2020-03-19 12:06:20 +0100
committerSupreeth Herle <herlesupreeth@gmail.com>2020-03-22 10:17:05 +0100
commitc7f2f7413be44212d37feda093537d93f25c0546 (patch)
treecb1e70653ade6e143693d3fc2af9d329a880eac9
parent98a6927b271fefd33f8218542794f8d0c8269cf1 (diff)
Move parsing of GID2 to generic Card class
-rwxr-xr-xpySim-read.py2
-rw-r--r--pySim/cards.py7
2 files changed, 8 insertions, 1 deletions
diff --git a/pySim-read.py b/pySim-read.py
index 083f91b..cd82498 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -124,7 +124,7 @@ if __name__ == '__main__':
# EF.GID2
try:
- (res, sw) = scc.read_binary(EF['GID2'])
+ (res, sw) = card.read_gid2()
if sw == '9000':
print("GID2: %s" % (res,))
else:
diff --git a/pySim/cards.py b/pySim/cards.py
index 61a3707..495d3ee 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -152,6 +152,13 @@ class Card(object):
else:
return (None, sw)
+ def read_gid2(self):
+ (res, sw) = self._scc.read_binary(EF['GID2'])
+ if sw == '9000':
+ return (res, sw)
+ else:
+ return (None, sw)
+
# Read the (full) AID for either ISIM or USIM application
def read_aid(self, isim = False):