laforge has uploaded this change for review. (
https://gerrit.osmocom.org/c/pysim/+/28710
)
Change subject: filesystem: Use Tuple for record length
......................................................................
filesystem: Use Tuple for record length
The size should be a *tuple*. In reality we so far passed a set. The
problem with the set is that ordering is not guaranteed, and hence we
cannot assume the first and second item have meaning (minimum vs.
default record length).
Change-Id: I470f4e69c83cb2761861b3350bf8d49e31f4d957
---
M pySim/filesystem.py
M pySim/gsm_r.py
M pySim/sysmocom_sja2.py
M pySim/ts_102_221.py
M pySim/ts_31_102.py
M pySim/ts_51_011.py
6 files changed, 47 insertions(+), 47 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/10/28710/1
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 73da0b6..f293939 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -913,7 +913,7 @@
self._cmd.poutput_json(data)
def __init__(self, fid: str, sfid: str = None, name: str = None, desc: str = None,
- parent: Optional[CardDF] = None, rec_len={1, None}, **kwargs):
+ parent: Optional[CardDF] = None, rec_len: Size = (1, None), **kwargs):
"""
Args:
fid : File Identifier (4 hex digits)
@@ -921,7 +921,7 @@
name : Brief name of the file, lik EF_ICCID
desc : Description of the file
parent : Parent CardFile object within filesystem hierarchy
- rec_len : set of {minimum_length, recommended_length}
+ rec_len : Tuple of (minimum_length, recommended_length)
"""
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, parent=parent,
**kwargs)
self.rec_len = rec_len
@@ -1044,7 +1044,7 @@
# we don't really have any special support for those; just recycling LinFixedEF
here
def __init__(self, fid: str, sfid: str = None, name: str = None, desc: str = None,
parent: CardDF = None,
- rec_len={1, None}, **kwargs):
+ rec_len: Size = (1, None), **kwargs):
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, parent=parent,
rec_len=rec_len, **kwargs)
diff --git a/pySim/gsm_r.py b/pySim/gsm_r.py
index ccab87f..8464197 100644
--- a/pySim/gsm_r.py
+++ b/pySim/gsm_r.py
@@ -61,7 +61,7 @@
def __init__(self):
super().__init__(fid='6ff1', sfid=None, name='EF.EN',
- desc='Functional numbers', rec_len={9, 9})
+ desc='Functional numbers', rec_len=(9, 9))
self._construct =
Struct('functional_number_and_type'/FuncNTypeAdapter(Bytes(8)),
'list_number'/Int8ub)
@@ -166,7 +166,7 @@
"""Section 7.5"""
def __init__(self):
- super().__init__(fid='6ff3', sfid=None, name='EF.CallconfI',
rec_len={21, 21},
+ super().__init__(fid='6ff3', sfid=None, name='EF.CallconfI',
rec_len=(21, 21),
desc='Call Configuration of emergency calls
Information')
self._construct = Struct('t_dur'/Int24ub,
't_relcalc'/Int32ub,
@@ -193,7 +193,7 @@
def __init__(self):
super().__init__(fid='6ff5', sfid=None, name='EF.GsmrPLMN',
- desc='GSM-R network selection', rec_len={9, 9})
+ desc='GSM-R network selection', rec_len=(9, 9))
self._construct = Struct('plmn'/BcdAdapter(Bytes(3)),
'class_of_network'/BitStruct('supported'/FlagsEnum(BitsInteger(5), vbs=1,
vgcs=2, emlpp=4, fn=8, eirene=16),
'preference'/BitsInteger(3)),
@@ -207,7 +207,7 @@
def __init__(self):
super().__init__(fid='6f8d', sfid=None, name='EF.IC',
- desc='International Code', rec_len={7, 7})
+ desc='International Code', rec_len=(7, 7))
self._construct = Struct('next_table_type'/NextTableType,
'id_of_next_table'/HexAdapter(Bytes(2)),
'ic_decision_value'/BcdAdapter(Bytes(2)),
@@ -219,7 +219,7 @@
def __init__(self):
super().__init__(fid='6f80', sfid=None, name='EF.NW',
- desc='Network Name', rec_len={8, 8})
+ desc='Network Name', rec_len=(8, 8))
self._construct = GsmString(8)
@@ -228,7 +228,7 @@
def __init__(self, fid, name, desc):
super().__init__(fid=fid, sfid=None,
- name=name, desc=desc, rec_len={6, 6})
+ name=name, desc=desc, rec_len=(6, 6))
self._construct = Struct('next_table_type'/NextTableType,
'id_of_next_table'/HexAdapter(Bytes(2)),
'decision_value'/BcdAdapter(Bytes(2)),
@@ -240,7 +240,7 @@
def __init__(self, fid, name, desc):
super().__init__(fid=fid, sfid=None,
- name=name, desc=desc, rec_len={3, 3})
+ name=name, desc=desc, rec_len=(3, 3))
# header and other records have different structure. WTF !?!
self._construct = Struct('next_table_type'/NextTableType,
'id_of_next_table'/HexAdapter(Bytes(2)),
diff --git a/pySim/sysmocom_sja2.py b/pySim/sysmocom_sja2.py
index 2edc916..d00a2cb 100644
--- a/pySim/sysmocom_sja2.py
+++ b/pySim/sysmocom_sja2.py
@@ -85,7 +85,7 @@
class EF_0348_KEY(LinFixedEF):
def __init__(self, fid='6f22', name='EF.0348_KEY', desc='TS 03.48
OTA Keys'):
- super().__init__(fid, name=name, desc=desc, rec_len={27, 35})
+ super().__init__(fid, name=name, desc=desc, rec_len=(27, 35))
def _decode_record_bin(self, raw_bin_data):
u = unpack('!BBB', raw_bin_data[0:3])
@@ -103,7 +103,7 @@
class EF_0348_COUNT(LinFixedEF):
def __init__(self, fid='6f23', name='EF.0348_COUNT', desc='TS
03.48 OTA Counters'):
- super().__init__(fid, name=name, desc=desc, rec_len={7, 7})
+ super().__init__(fid, name=name, desc=desc, rec_len=(7, 7))
def _decode_record_bin(self, raw_bin_data):
u = unpack('!BB5s', raw_bin_data)
@@ -118,7 +118,7 @@
class EF_GP_COUNT(LinFixedEF):
def __init__(self, fid='6f26', name='EF.GP_COUNT', desc='GP SCP02
Counters'):
- super().__init__(fid, name=name, desc=desc, rec_len={5, 5})
+ super().__init__(fid, name=name, desc=desc, rec_len=(5, 5))
def _decode_record_bin(self, raw_bin_data):
u = unpack('!BBHB', raw_bin_data)
@@ -127,7 +127,7 @@
class EF_GP_DIV_DATA(LinFixedEF):
def __init__(self, fid='6f27', name='EF.GP_DIV_DATA', desc='GP
SCP02 key diversification data'):
- super().__init__(fid, name=name, desc=desc, rec_len={12, 12})
+ super().__init__(fid, name=name, desc=desc, rec_len=(12, 12))
def _decode_record_bin(self, raw_bin_data):
u = unpack('!BB8s', raw_bin_data)
@@ -241,7 +241,7 @@
class EF_GBA_INT_KEY(LinFixedEF):
def __init__(self, fid='af33', name='EF.GBA_INT_KEY'):
super().__init__(fid, name=name,
- desc='Secret key for GBA key derivation', rec_len={32,
32})
+ desc='Secret key for GBA key derivation', rec_len=(32,
32))
self._construct = GreedyBytes
diff --git a/pySim/ts_102_221.py b/pySim/ts_102_221.py
index 6e04e96..83ddb85 100644
--- a/pySim/ts_102_221.py
+++ b/pySim/ts_102_221.py
@@ -588,7 +588,7 @@
pass
def __init__(self, fid='2f00', sfid=0x1e, name='EF.DIR',
desc='Application Directory'):
- super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len={5, 54})
+ super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=(5, 54))
self._tlv = EF_DIR.ApplicationTemplate
# TS 102 221 Section 13.2
diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index b8a33e7..5df7369 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -333,7 +333,7 @@
IdsOfSelectedEpsAlgos]):
pass
- def __init__(self, fid="4f03", sfid=0x03, name='EF.5GS3GPPNSC',
rec_len={57, None},
+ def __init__(self, fid="4f03", sfid=0x03, name='EF.5GS3GPPNSC',
rec_len=(57, None),
desc='5GS 3GPP Access NAS Security Context', **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._tlv = EF_5GS3GPPNSC.FiveGSNasSecurityContext
@@ -597,7 +597,7 @@
def __init__(self, fid='6fb7', sfid=0x01, name='EF.ECC',
desc='Emergency Call Codes'):
- super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len={4, 20})
+ super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=(4, 20))
def _decode_record_bin(self, in_bin):
# mandatory parts
@@ -661,7 +661,7 @@
# TS 31.102 Section 4.2.33
class EF_ICI(CyclicEF):
- def __init__(self, fid='6f80', sfid=0x14, name='EF.ICI', rec_len={28,
48},
+ def __init__(self, fid='6f80', sfid=0x14, name='EF.ICI', rec_len=(28,
48),
desc='Incoming Call Information', **kwargs):
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._construct =
Struct('alpha_id'/HexAdapter(Bytes(this._.total_len-28)),
@@ -677,7 +677,7 @@
# TS 31.102 Section 4.2.34
class EF_OCI(CyclicEF):
- def __init__(self, fid='6f81', sfid=0x15, name='EF.OCI', rec_len={27,
47},
+ def __init__(self, fid='6f81', sfid=0x15, name='EF.OCI', rec_len=(27,
47),
desc='Outgoing Call Information', **kwargs):
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._construct =
Struct('alpha_id'/HexAdapter(Bytes(this._.total_len-27)),
@@ -692,7 +692,7 @@
# TS 31.102 Section 4.2.35
class EF_ICT(CyclicEF):
- def __init__(self, fid='6f82', sfid=None, name='EF.ICT', rec_len={3,
3},
+ def __init__(self, fid='6f82', sfid=None, name='EF.ICT', rec_len=(3,
3),
desc='Incoming Call Timer', **kwargs):
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._construct = Struct('accumulated_call_timer'/Int24ub)
@@ -700,7 +700,7 @@
# TS 31.102 Section 4.2.38
class EF_CCP2(LinFixedEF):
def __init__(self, fid='6f4f', sfid=0x16, name='EF.CCP2',
desc='Capability Configuration Parameters 2', **kwargs):
- super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len={15, None},
**kwargs)
+ super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len=(15, None),
**kwargs)
# TS 31.102 Section 4.2.47
class EF_EST(EF_UServiceTable):
@@ -769,7 +769,7 @@
# TS 31.102 Section 4.2.80
class EF_MSK(LinFixedEF):
def __init__(self, fid='6fd7', sfid=None, name='EF.MSK',
desc='MBMS Service Key List', **kwargs):
- super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len={20, None},
**kwargs)
+ super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len=(20, None),
**kwargs)
msk_ts_constr = Struct('msk_id'/Int32ub,
'timestamp_counter'/Int32ub)
self._construct = Struct('key_domain_id'/HexAdapter(Bytes(3)),
'num_msk_id'/Int8ub,
@@ -792,7 +792,7 @@
pass
def __init__(self, fid='6fd8', sfid=None, name='EF.MUK',
desc='MBMS User Key', **kwargs):
- super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len={None, None},
**kwargs)
+ super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len=(None, None),
**kwargs)
self._tlv = EF_MUK.EF_MUK_Collection
# TS 31.102 Section 4.2.83
@@ -807,7 +807,7 @@
pass
def __init__(self, fid='6fda', sfid=None, name='EF.GBANL',
desc='GBA NAF List', **kwargs):
- super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len={None, None},
**kwargs)
+ super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len=(None, None),
**kwargs)
self._tlv = EF_GBANL.EF_GBANL_Collection
# TS 31.102 Section 4.2.85
@@ -822,7 +822,7 @@
class EF_NAFKCA(LinFixedEF):
class NAF_KeyCentreAddress(BER_TLV_IE, tag=0x80):
_construct = HexAdapter(GreedyBytes)
- def __init__(self, fid='6fdd', sfid=None, name='EF.NAFKCA',
rec_len={None, None},
+ def __init__(self, fid='6fdd', sfid=None, name='EF.NAFKCA',
rec_len=(None, None),
desc='NAF Key Centre Address', **kwargs):
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._tlv = EF_NAFKCA.NAF_KeyCentreAddress
@@ -853,7 +853,7 @@
class EF_NCP_IP_Collection(TLV_IE_Collection,
nested=[AccessPointName, Login, Password,
BearerDescription]):
pass
- def __init__(self, fid='6fe2', sfid=None, name='EF.NCP-IP',
rec_len={None, None},
+ def __init__(self, fid='6fe2', sfid=None, name='EF.NCP-IP',
rec_len=(None, None),
desc='Network Connectivity Parameters for USIM IP connections',
**kwargs):
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._tlv = EF_NCP_IP.EF_NCP_IP_Collection
@@ -890,7 +890,7 @@
nested=[KSI_ASME, K_ASME, UplinkNASCount,
DownlinkNASCount,
IDofNASAlgorithms]):
pass
- def __init__(self, fid='6fe4', sfid=0x18, name='EF.EPSNSC',
rec_len={54, 128},
+ def __init__(self, fid='6fe4', sfid=0x18, name='EF.EPSNSC',
rec_len=(54, 128),
desc='EPS NAS Security Context', **kwargs):
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._tlv = EF_EPSNSC.EPS_NAS_Security_Context
@@ -905,7 +905,7 @@
# TS 31.102 Section 4.2.101
class EF_IPS(CyclicEF):
- def __init__(self, fid='6ff1', sfid=None, name='EF.IPS', rec_len={4,
4},
+ def __init__(self, fid='6ff1', sfid=None, name='EF.IPS', rec_len=(4,
4),
desc='IMEI(SV) Pairing Status', **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._construct = Struct('status'/PaddedString(2, 'ascii'),
@@ -975,7 +975,7 @@
# TS 31.102 Section 4.4.11.9
class EF_OPL5G(LinFixedEF):
def __init__(self, fid='6f08', sfid=0x08, name='EF.OPL5G',
desc='5GS Operator PLMN List', **kwargs):
- super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len={10, None},
**kwargs)
+ super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len=(10, None),
**kwargs)
Tai = Struct('mcc_mnc'/BcdAdapter(Bytes(3)),
'tac_min'/HexAdapter(Bytes(3)),
'tac_max'/HexAdapter(Bytes(3)))
self._construct = Struct('tai'/Tai, 'pnn_record_id'/Int8ub)
@@ -1131,7 +1131,7 @@
EF_ACMmax(service=13),
EF_UST(),
CyclicEF('6f39', None, 'EF.ACM',
- 'Accumulated call meter', rec_len={3, 3}, service=13),
+ 'Accumulated call meter', rec_len=(3, 3), service=13),
TransparentEF('6f3e', None, 'EF.GID1', 'Group Identifier
Level 1', service=17),
TransparentEF('6f3f', None, 'EF.GID2', 'Group Identifier
Level 2', service=18),
EF_SPN(service=19),
diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py
index 68b32ce..d16ea72 100644
--- a/pySim/ts_51_011.py
+++ b/pySim/ts_51_011.py
@@ -343,7 +343,7 @@
# TS 51.011 Section 10.5.1
class EF_ADN(LinFixedEF):
def __init__(self, fid='6f3a', sfid=None, name='EF.ADN',
desc='Abbreviated Dialing Numbers', **kwargs):
- super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len={14, 30},
**kwargs)
+ super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=(14, 30),
**kwargs)
self._construct =
Struct('alpha_id'/COptional(GsmStringAdapter(Rpad(Bytes(this._.total_len-14)),
codec='ascii')),
'len_of_bcd'/Int8ub,
'ton_npi'/TonNpi,
@@ -354,7 +354,7 @@
# TS 51.011 Section 10.5.5
class EF_SMS(LinFixedEF):
def __init__(self, fid='6f3c', sfid=None, name='EF.SMS',
desc='Short messages', **kwargs):
- super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len={176, 176},
**kwargs)
+ super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=(176, 176),
**kwargs)
def _decode_record_bin(self, raw_bin_data):
def decode_status(status):
@@ -385,7 +385,7 @@
# TS 51.011 Section 10.5.5
class EF_MSISDN(LinFixedEF):
def __init__(self, fid='6f40', sfid=None, name='EF.MSISDN',
desc='MSISDN', **kwargs):
- super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len={15, 34},
**kwargs)
+ super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=(15, 34),
**kwargs)
def _decode_record_hex(self, raw_hex_data):
return {'msisdn': dec_msisdn(raw_hex_data)}
@@ -427,7 +427,7 @@
raise ValueError
def __init__(self, fid='6f42', sfid=None, name='EF.SMSP',
desc='Short message service parameters', **kwargs):
- super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len={28, None},
**kwargs)
+ super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=(28, None),
**kwargs)
ScAddr = Struct('length'/Int8ub, 'ton_npi'/TonNpi,
'call_number'/BcdAdapter(Rpad(Bytes(10))))
self._construct =
Struct('alpha_id'/COptional(GsmStringAdapter(Rpad(Bytes(this._.total_len-28)))),
'parameter_indicators'/InvertAdapter(FlagsEnum(Byte, tp_dest_addr=1,
tp_sc_addr=2,
@@ -455,21 +455,21 @@
# TS 51.011 Section 10.5.8
class EF_SMSR(LinFixedEF):
- def __init__(self, fid='6f47', sfid=None, name='EF.SMSR',
desc='SMS status reports', rec_len={30, 30}, **kwargs):
+ def __init__(self, fid='6f47', sfid=None, name='EF.SMSR',
desc='SMS status reports', rec_len=(30, 30), **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._construct = Struct(
'sms_record_id'/Int8ub,
'sms_status_report'/HexAdapter(Bytes(29)))
class EF_EXT(LinFixedEF):
- def __init__(self, fid, sfid=None, name='EF.EXT', desc='Extension',
rec_len={13, 13}, **kwargs):
+ def __init__(self, fid, sfid=None, name='EF.EXT', desc='Extension',
rec_len=(13, 13), **kwargs):
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._construct = Struct(
'record_type'/Int8ub, 'extension_data'/HexAdapter(Bytes(11)),
'identifier'/Int8ub)
# TS 51.011 Section 10.5.16
class EF_CMI(LinFixedEF):
- def __init__(self, fid='6f58', sfid=None, name='EF.CMI', rec_len={2,
21},
+ def __init__(self, fid='6f58', sfid=None, name='EF.CMI', rec_len=(2,
21),
desc='Comparison Method Information', **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._construct = Struct(
@@ -484,9 +484,9 @@
EF_ADN(fid='6f3b', name='EF.FDN', desc='Fixed dialling
numbers'),
EF_SMS(),
LinFixedEF(fid='6f3d', name='EF.CCP',
- desc='Capability Configuration Parameters', rec_len={14,
14}),
+ desc='Capability Configuration Parameters', rec_len=(14,
14)),
LinFixedEF(fid='6f4f', name='EF.ECCP',
- desc='Extended Capability Configuration Parameters',
rec_len={15, 32}),
+ desc='Extended Capability Configuration Parameters',
rec_len=(15, 32)),
EF_MSISDN(),
EF_SMSP(),
EF_SMSS(),
@@ -790,7 +790,7 @@
# TS 51.011 Section 10.3.31
class EF_NIA(LinFixedEF):
- def __init__(self, fid='6f51', sfid=None, name='EF.NIA', rec_len={1,
32},
+ def __init__(self, fid='6f51', sfid=None, name='EF.NIA', rec_len=(1,
32),
desc='Network\'s Indication of Alerting', **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._construct = Struct(
@@ -895,21 +895,21 @@
# TS 51.011 Section 10.3.42
class EF_OPL(LinFixedEF):
- def __init__(self, fid='6fc6', sfid=None, name='EF.OPL', rec_len={8,
8}, desc='Operator PLMN List', **kwargs):
+ def __init__(self, fid='6fc6', sfid=None, name='EF.OPL', rec_len=(8,
8), desc='Operator PLMN List', **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._construct =
Struct('lai'/Struct('mcc_mnc'/BcdAdapter(Bytes(3)),
'lac_min'/HexAdapter(Bytes(2)),
'lac_max'/HexAdapter(Bytes(2))), 'pnn_record_id'/Int8ub)
# TS 51.011 Section 10.3.44 + TS 31.102 4.2.62
class EF_MBI(LinFixedEF):
- def __init__(self, fid='6fc9', sfid=None, name='EF.MBI', rec_len={4,
5}, desc='Mailbox Identifier', **kwargs):
+ def __init__(self, fid='6fc9', sfid=None, name='EF.MBI', rec_len=(4,
5), desc='Mailbox Identifier', **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._construct = Struct('mbi_voicemail'/Int8ub,
'mbi_fax'/Int8ub, 'mbi_email'/Int8ub,
'mbi_other'/Int8ub,
'mbi_videocall'/COptional(Int8ub))
# TS 51.011 Section 10.3.45 + TS 31.102 4.2.63
class EF_MWIS(LinFixedEF):
- def __init__(self, fid='6fca', sfid=None, name='EF.MWIS', rec_len={5,
6},
+ def __init__(self, fid='6fca', sfid=None, name='EF.MWIS', rec_len=(5,
6),
desc='Message Waiting Indication Status', **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._construct = Struct('mwi_status'/FlagsEnum(Byte, voicemail=1, fax=2,
email=4, other=8, videomail=16),
@@ -932,7 +932,7 @@
# TS 51.011 Section 10.3.51
class EF_MMSN(LinFixedEF):
- def __init__(self, fid='6fce', sfid=None, name='EF.MMSN', rec_len={4,
20}, desc='MMS Notification', **kwargs):
+ def __init__(self, fid='6fce', sfid=None, name='EF.MMSN', rec_len=(4,
20), desc='MMS Notification', **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._construct = Struct('mms_status'/HexAdapter(Bytes(2)),
'mms_implementation'/HexAdapter(Bytes(1)),
'mms_notification'/HexAdapter(Bytes(this._.total_len-4)),
'ext_record_nr'/Byte)
@@ -974,7 +974,7 @@
class MMS_User_Preferences(TLV_IE_Collection,
nested=[MMS_Implementation, MMS_UserPref_ProfileName,
MMS_UserPref_Info]):
pass
- def __init__(self, fid='6fd1', sfid=None, name='EF.MMSUP',
rec_len={1, None},
+ def __init__(self, fid='6fd1', sfid=None, name='EF.MMSUP',
rec_len=(1, None),
desc='MMS User Preferences', **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len,
**kwargs)
self._tlv = EF_MMSUP.MMS_User_Preferences
@@ -1000,7 +1000,7 @@
EF_ServiceTable('6f38', None, 'EF.SST',
'SIM service table', table=EF_SST_map, size=(2,
16)),
CyclicEF('6f39', None, 'EF.ACM',
- 'Accumulated call meter', rec_len={3, 3}),
+ 'Accumulated call meter', rec_len=(3, 3)),
TransparentEF('6f3e', None, 'EF.GID1', 'Group Identifier
Level 1'),
TransparentEF('6f3f', None, 'EF.GID2', 'Group Identifier
Level 2'),
EF_SPN(),
--
To view, visit
https://gerrit.osmocom.org/c/pysim/+/28710
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I470f4e69c83cb2761861b3350bf8d49e31f4d957
Gerrit-Change-Number: 28710
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange