cat: properly decode IMEI/IMEISV IE

Currently BcdAdapter(GreedyBytes), i.e. a plain swapped nibble digit
string, which is wrong, the IMEI IE is not a bcd string.
See TS 124.008 10.5.1.4 figure 10.5.4 + table 10.5.4

It currently
 - decodes framing nibble as digit
 - encodes a 15 digit IMEI as 7 bytes, wrong len, dropped last digit

Fix this, while at it add the 8.74 IMEISV as well + tests for the framing
because the current round trip missed all of this.

Change-Id: Iad7aea77513d413c338edc18ef1bcc37488ae849
This commit is contained in:
Eric Wild
2026-09-23 17:51:04 +02:00
parent df8de1a69a
commit 0de8274e99
3 changed files with 117 additions and 4 deletions
+1
View File
@@ -21,6 +21,7 @@ import logging
from osmocom.utils import b2h, h2b, all_subclasses
from osmocom.tlv import *
import pySim.cat
import pySim.iso7816_4
import pySim.ts_102_221
import pySim.ts_102_222