ara_m: use class byte of current lchan

The ara_m commands use APDUs with a fix class byte (0x80). This means
that all ARA-M related features only work in the basic logical channel.
To fix this, let's compute the class byte for the current logical channel
dynamically inside the send_apdu methods of SimCardCommands. This will
fix the problem globally.

Related: OS#6531
Change-Id: Ie3e48678f178a488bfaea6cc2b9a3e18145a8d10
This commit is contained in:
Philipp Maier
2024-08-16 14:33:37 +02:00
parent cc4c021bb1
commit caabee4ccb
3 changed files with 33 additions and 26 deletions

View File

@@ -252,9 +252,9 @@ Online manual available at https://downloads.osmocom.org/docs/pysim/master/html/
# can be executed without the presence of a runtime state (self.rs) object. However, this also means that
# self.lchan is also not present (see method equip).
if opts.raw or self.lchan is None:
data, sw = self.card._scc.send_apdu(opts.APDU)
data, sw = self.card._scc.send_apdu(opts.APDU, apply_lchan = False)
else:
data, sw = self.lchan.scc.send_apdu(opts.APDU)
data, sw = self.lchan.scc.send_apdu(opts.APDU, apply_lchan = False)
if data:
self.poutput("SW: %s, RESP: %s" % (sw, data))
else: