Change in pysim[master]: USIM: Add ENVELOPE and ENVELOPE-SMS shell commands

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Oct 14 15:44:30 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/25786 )

Change subject: USIM: Add ENVELOPE and ENVELOPE-SMS shell commands
......................................................................

USIM: Add ENVELOPE and ENVELOPE-SMS shell commands

Change-Id: I4345459d99c0eeb5753217ad4e7188747c51a2a2
---
M pySim/ts_31_102.py
1 file changed, 14 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index f347f67..faf0f38 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -1089,6 +1089,20 @@
             (data, sw) = self._cmd.card._scc.terminal_profile(arg)
             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
 sw_usim = {

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I4345459d99c0eeb5753217ad4e7188747c51a2a2
Gerrit-Change-Number: 25786
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211014/baeb8cf0/attachment.htm>


More information about the gerrit-log mailing list