From 381519556cee2bf4ae18b73224a634ec19619ef9 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 19 Dec 2025 18:25:54 +0100 Subject: [PATCH] ts_31_102.EF_ECC: Use PaddedBcdAdapter to skip trailing 'f' The emergency numbers from the example are 911 / 913, and not 911f / 311f Change-Id: Ibfe1e23431aa803b936dd8529e0542e93d9df0b9 --- pySim/ts_31_102.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index 4ee6621a..3ae178ce 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -486,17 +486,17 @@ class EF_UST(EF_UServiceTable): # TS 31.103 Section 4.2.7 - *not* the same as DF.GSM/EF.ECC! class EF_ECC(LinFixedEF): _test_de_encode = [ - ( '19f1ff01', { "call_code": "911f", + ( '19f1ff01', { "call_code": "911", "service_category": { "police": True, "ambulance": False, "fire_brigade": False, "marine_guard": False, "mountain_rescue": False, "manual_ecall": False, "automatic_ecall": False } } ), - ( '19f3ff02', { "call_code": "913f", + ( '19f3ff02', { "call_code": "913", "service_category": { "police": False, "ambulance": True, "fire_brigade": False, "marine_guard": False, "mountain_rescue": False, "manual_ecall": False, "automatic_ecall": False } } ), ] _test_no_pad = True - cc_construct = BcdAdapter(Rpad(Bytes(3))) + cc_construct = PaddedBcdAdapter(Rpad(Bytes(3))) category_construct = FlagsEnum(Byte, police=1, ambulance=2, fire_brigade=3, marine_guard=4, mountain_rescue=5, manual_ecall=6, automatic_ecall=7) alpha_construct = GsmOrUcs2Adapter(Rpad(GreedyBytes))