[S] Change in pysim[master]: pySim.esim.es8p: Support non-operational ProfileMetadata
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/41454?usp=email ) Change subject: pySim.esim.es8p: Support non-operational ProfileMetadata ...................................................................... pySim.esim.es8p: Support non-operational ProfileMetadata If no profileClass is given, ProfileMetadata defaults to operational. Let's add the capability to also generate metadata for test or provisioning profiles. Change-Id: Id55537ed03e2690c1fc9545bb3c49cfc76d8e331 --- M pySim/esim/es8p.py 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve diff --git a/pySim/esim/es8p.py b/pySim/esim/es8p.py index 9c76084..6926cae 100644 --- a/pySim/esim/es8p.py +++ b/pySim/esim/es8p.py @@ -76,10 +76,11 @@ class ProfileMetadata: """Representation of Profile metadata. Right now only the mandatory bits are supported, but in general this should follow the StoreMetadataRequest of SGP.22 5.5.3""" - def __init__(self, iccid_bin: bytes, spn: str, profile_name: str): + def __init__(self, iccid_bin: bytes, spn: str, profile_name: str, profile_class = 'operational'): self.iccid_bin = iccid_bin self.spn = spn self.profile_name = profile_name + self.profile_class = profile_class self.icon = None self.icon_type = None self.notifications = [] @@ -105,6 +106,14 @@ 'serviceProviderName': self.spn, 'profileName': self.profile_name, } + if self.profile_class == 'test': + smr['profileClass'] = 0 + elif self.profile_class == 'provisioning': + smr['profileClass'] = 1 + elif self.profile_class == 'operational': + smr['profileClass'] = 2 + else: + raise ValueError('Unsupported Profile Class %s' % self.profile_class) if self.icon: smr['icon'] = self.icon smr['iconType'] = self.icon_type -- To view, visit https://gerrit.osmocom.org/c/pysim/+/41454?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Id55537ed03e2690c1fc9545bb3c49cfc76d8e331 Gerrit-Change-Number: 41454 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge@osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: laforge <laforge@osmocom.org>
participants (1)
-
laforge