dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/26040 )


Change subject: cards: add method to modify APDU parameters (cla, sel_ctrl)
......................................................................

cards: add method to modify APDU parameters (cla, sel_ctrl)

There are situations where it is necessary to modify the class byte and
the selection control bytes of a card at runtime. This should not be
done by accessing the properties of the _scc object directly. The
modification of those properties should be done via a set method
instead.

Change-Id: Ifd8aa2660e44a18d28945d070419612eff443e78
---
M pySim/cards.py
1 file changed, 9 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/40/26040/1

diff --git a/pySim/cards.py b/pySim/cards.py
index 1a86b14..4511271 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -302,6 +302,15 @@
                len = self._scc.record_size(ef)
                self._scc.update_record(ef, rec_no, "ff" * len, 
force_len=False, verify=True)

+       def set_apdu_parameter(self, cla, sel_ctrl):
+               """Set apdu parameters (class byte and selection control 
bytes)"""
+               self._scc.cla_byte = cla
+               self._scc.sel_ctrl = sel_ctrl
+
+       def get_apdu_parameter(self):
+               """Get apdu parameters (class byte and selection control 
bytes)"""
+               return (self._scc.cla_byte, self._scc.sel_ctrl)
+
 class UsimCard(SimCard):

        name = 'USIM'

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ifd8aa2660e44a18d28945d070419612eff443e78
Gerrit-Change-Number: 26040
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>
Gerrit-MessageType: newchange

Reply via email to