pySim/cat: Fix contruct for Address class/IE

Something like "this._.total_len-1" only works during decode. Let's
use GreedyBytes instead, working for encode and decode.

Change-Id: Idf8326298cab7ebc68b09c7e829bfc2061222f51
This commit is contained in:
Harald Welte
2024-05-11 22:49:56 +02:00
parent daeba3c1fb
commit 172c9f7ca6

View File

@@ -32,7 +32,7 @@ from pySim.utils import b2h, dec_xplmn_w_act
# TS 102 223 Section 8.1
class Address(COMPR_TLV_IE, tag=0x06):
_construct = Struct('ton_npi'/Int8ub,
'call_number'/BcdAdapter(Bytes(this._.total_len-1)))
'call_number'/BcdAdapter(GreedyBytes))
# TS 102 223 Section 8.2
class AlphaIdentifier(COMPR_TLV_IE, tag=0x05):