mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-28 08:18:36 +03:00
cards.py: Add generic function to read EF binary to card class
This is a generic function applicable for reading EFs which doesnt require further processing such as GID1, GID2 etc while decoding and also to avoid code duplication. Change-Id: If3d8fdddb26f9776c89fd442d1d95b83e0d1476b
This commit is contained in:
@@ -145,6 +145,10 @@ class Card(object):
|
|||||||
data, sw = self._scc.update_binary(EF['SPN'], rpad(content, 32))
|
data, sw = self._scc.update_binary(EF['SPN'], rpad(content, 32))
|
||||||
return sw
|
return sw
|
||||||
|
|
||||||
|
def read_binary(self, ef, length=None, offset=0):
|
||||||
|
ef_path = ef in EF and EF[ef] or ef
|
||||||
|
return self._scc.read_binary(ef_path, length, offset)
|
||||||
|
|
||||||
def read_gid1(self):
|
def read_gid1(self):
|
||||||
(res, sw) = self._scc.read_binary(EF['GID1'])
|
(res, sw) = self._scc.read_binary(EF['GID1'])
|
||||||
if sw == '9000':
|
if sw == '9000':
|
||||||
|
|||||||
Reference in New Issue
Block a user