laforge has submitted this change. ( 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(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
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':