laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/38960?usp=email )


Change subject: es2p_client: Print the activation code after confirmOrder 
success
......................................................................

es2p_client: Print the activation code after confirmOrder success

Change-Id: I92608ff0cdc35b184edff0c656221644ba36f257
---
M contrib/es2p_client.py
1 file changed, 6 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/60/38960/1

diff --git a/contrib/es2p_client.py b/contrib/es2p_client.py
index 1353006..8eda6d0 100755
--- a/contrib/es2p_client.py
+++ b/contrib/es2p_client.py
@@ -17,7 +17,7 @@

 import copy
 import argparse
-from pySim.esim import es2p
+from pySim.esim import es2p, ActivationCode

 EID_HELP='EID of the eUICC for which eSIM shall be made available'
 ICCID_HELP='The ICCID of the eSIM that shall be made available'
@@ -73,6 +73,11 @@
         res = peer.call_downloadOrder(data)
     elif opts.command == 'confirm-order':
         res = peer.call_confirmOrder(data)
+        matchingId = res.get('matchingId', None)
+        smdpAddress = res.get('smdpAddress', None)
+        if matchingId:
+            ac = ActivationCode(smdpAddress, matchingId, 
cc_required=bool(opts.confirmationCode))
+            print("Activation Code: '%s'" % ac.to_string())
     elif opts.command == 'cancel-order':
         res = peer.call_cancelOrder(data)
     elif opts.command == 'release-profile':

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/38960?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I92608ff0cdc35b184edff0c656221644ba36f257
Gerrit-Change-Number: 38960
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>

Reply via email to