Treat MCC and MNC as strings, not integers
A MNC of 02 and 002 are *not* equal. The former is a two-digit MNC and the latter is a three-digit MNC. Hence, we shouldn't treat MNCs as integer values as we have no clue how many leading zeroes (if any) the user entered. Change-Id: I9d1d07a64888c76703c3e430bbdd822080c05819 Closes: OS#4523
This commit is contained in:
committed by
Philipp Maier
parent
ff84c23839
commit
7f1d3c496f
@@ -102,7 +102,9 @@ def enc_iccid(iccid):
|
||||
|
||||
def enc_plmn(mcc, mnc):
|
||||
"""Converts integer MCC/MNC into 3 bytes for EF"""
|
||||
return swap_nibbles(lpad('%d' % int(mcc), 3) + lpad('%d' % int(mnc), 3))
|
||||
if len(mnc) == 2:
|
||||
mnc = "F%s" % mnc
|
||||
return swap_nibbles("%s%s" % (mcc, mnc))
|
||||
|
||||
def dec_spn(ef):
|
||||
byte1 = int(ef[0:2])
|
||||
|
||||
Reference in New Issue
Block a user