Change in pysim[master]: Use generic function hexstr_to_Nbytearr to convert hex string to 3/5 ...

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
Sun Sep 20 09:49:22 UTC 2020


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

Change subject: Use generic function hexstr_to_Nbytearr to convert hex string to 3/5 Bytes array
......................................................................

Use generic function hexstr_to_Nbytearr to convert hex string to 3/5 Bytes array

Change-Id: I1165e4928d063667f0b4dfc3437c9278e7ec7450
---
M pySim/utils.py
M pySim/utils_test.py
2 files changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/pySim/utils.py b/pySim/utils.py
index e5434a5..43e4c53 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -180,7 +180,7 @@
 
 def format_xplmn_w_act(hexstr):
 	s = ""
-	for rec_data in hexstr_to_fivebytearr(hexstr):
+	for rec_data in hexstr_to_Nbytearr(hexstr, 5):
 		rec_info = dec_xplmn_w_act(rec_data)
 		if rec_info['mcc'] == 0xFFF and rec_info['mnc'] == 0xFFF:
 			rec_str = "unused"
@@ -229,7 +229,7 @@
 
 def format_xplmn(hexstr):
 	s = ""
-	for rec_data in hexstr_to_threebytearr(hexstr):
+	for rec_data in hexstr_to_Nbytearr(hexstr, 3):
 		rec_info = dec_xplmn(rec_data)
 		if rec_info['mcc'] == 0xFFF and rec_info['mnc'] == 0xFFF:
 			rec_str = "unused"
diff --git a/pySim/utils_test.py b/pySim/utils_test.py
index ff028da..8db04bd 100644
--- a/pySim/utils_test.py
+++ b/pySim/utils_test.py
@@ -12,7 +12,7 @@
 			"ffffff0002",
 			"ffffff0001",
 		]
-		self.assertEqual(utils.hexstr_to_fivebytearr(input_str), expected)
+		self.assertEqual(utils.hexstr_to_Nbytearr(input_str, 5), expected)
 
 	def testDecMCCfromPLMN(self):
 		self.assertEqual(utils.dec_mcc_from_plmn("92f501"), 295)

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1165e4928d063667f0b4dfc3437c9278e7ec7450
Gerrit-Change-Number: 20195
Gerrit-PatchSet: 2
Gerrit-Owner: herlesupreeth <herlesupreeth at gmail.com>
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/20200920/cb0d2dca/attachment.htm>


More information about the gerrit-log mailing list