diff --git a/pySim/utils.py b/pySim/utils.py index e5434a5a..43e4c535 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -180,7 +180,7 @@ def dec_xplmn_w_act(fivehexbytes): 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 dec_xplmn(threehexbytes): 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 ff028dad..8db04bdd 100644 --- a/pySim/utils_test.py +++ b/pySim/utils_test.py @@ -12,7 +12,7 @@ class DecTestCase(unittest.TestCase): "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)