lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41578?usp=email )
Change subject: ts_102_222: correct encode FILE_ID ......................................................................
ts_102_222: correct encode FILE_ID
Fix an exception with FILE_ID. When creating ADF.USIM/DF.5GS:
create_df --ef-arr-record-nr 2 --ef-arr-file-id 2f06 5FC0
EXCEPTION of type 'StringError' occurred with message: Error in path (building) given non-bytes value, perhaps unicode? '5fc0
[..] File "/home/lynxis/projects/osmocom/repos/pysim/pySim/ts_102_222.py", line 207, in do_create_df (_data, _sw) = self._cmd.lchan.scc.create_file(b2h(fcp.to_tlv())) [..] File "/usr/lib/python3.13/site-packages/construct/core.py", line 191, in stream_write raise StringError("given non-bytes value, perhaps unicode? %r" % (data,), path=path) construct.core.StringError: Error in path (building) given non-bytes value, perhaps unicode? '5fc0'
Change-Id: I95c81f6793f1fdbaee5365355bab06a1c1107106 --- M pySim/ts_102_222.py 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/78/41578/1
diff --git a/pySim/ts_102_222.py b/pySim/ts_102_222.py index 74eb2c3..5960359 100644 --- a/pySim/ts_102_222.py +++ b/pySim/ts_102_222.py @@ -145,7 +145,7 @@ elif opts.structure == 'ber_tlv': self._cmd.perror("BER-TLV creation not yet fully supported, sorry") return - ies = [FileDescriptor(decoded=file_descriptor), FileIdentifier(decoded=opts.FILE_ID), + ies = [FileDescriptor(decoded=file_descriptor), FileIdentifier(decoded=opts.FILE_ID.to_bytes()), LifeCycleStatusInteger(decoded='operational_activated'), SecurityAttribReferenced(decoded={'ef_arr_file_id': opts.ef_arr_file_id, 'ef_arr_record_nr': opts.ef_arr_record_nr }),