mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-30 01:40:06 +03:00
USIM: Add ENVELOPE and ENVELOPE-SMS shell commands
Change-Id: I4345459d99c0eeb5753217ad4e7188747c51a2a2
This commit is contained in:
@@ -1089,6 +1089,20 @@ class ADF_USIM(CardADF):
|
|||||||
(data, sw) = self._cmd.card._scc.terminal_profile(arg)
|
(data, sw) = self._cmd.card._scc.terminal_profile(arg)
|
||||||
self._cmd.poutput('SW: %s, data: %s' % (sw, data))
|
self._cmd.poutput('SW: %s, data: %s' % (sw, data))
|
||||||
|
|
||||||
|
def do_envelope(self, arg):
|
||||||
|
"""Send an ENVELOPE command to the card."""
|
||||||
|
(data, sw) = self._cmd.card._scc.envelope(arg)
|
||||||
|
self._cmd.poutput('SW: %s, data: %s' % (sw, data))
|
||||||
|
|
||||||
|
def do_envelope_sms(self, arg):
|
||||||
|
"""Send an ENVELOPE command to the card."""
|
||||||
|
tpdu_ie = SMS_TPDU()
|
||||||
|
tpdu_ie.from_bytes(h2b(arg))
|
||||||
|
dev_ids = DeviceIdentities(decoded={'source_dev_id':'network','dest_dev_id':'uicc'})
|
||||||
|
sms_dl = SMSPPDownload(children=[dev_ids, tpdu_ie])
|
||||||
|
(data, sw) = self._cmd.card._scc.envelope(b2h(sms_dl.to_tlv()))
|
||||||
|
self._cmd.poutput('SW: %s, data: %s' % (sw, data))
|
||||||
|
|
||||||
|
|
||||||
# TS 31.102 Section 7.3
|
# TS 31.102 Section 7.3
|
||||||
sw_usim = {
|
sw_usim = {
|
||||||
|
|||||||
Reference in New Issue
Block a user