mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-17 02:48:34 +03:00
cards: use string representation for MNC/MCC
At the moment MNC and MCC are represented as integer numbers inside the parameter array while all other parameters are represented as strings. Lets use strings for MNC/MCC as well to simplify the parameter handling. We will also not loose the length information in case of leading zeros. Change-Id: Ia2333921a4863f0f26ee923ca796e62ec5e2d59a
This commit is contained in:
@@ -98,7 +98,7 @@ def enc_iccid(iccid):
|
||||
|
||||
def enc_plmn(mcc, mnc):
|
||||
"""Converts integer MCC/MNC into 3 bytes for EF"""
|
||||
return swap_nibbles(lpad('%d' % mcc, 3) + lpad('%d' % mnc, 3))
|
||||
return swap_nibbles(lpad('%d' % int(mcc), 3) + lpad('%d' % int(mnc), 3))
|
||||
|
||||
def dec_spn(ef):
|
||||
byte1 = int(ef[0:2])
|
||||
|
||||
Reference in New Issue
Block a user