Christian Amsüss has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/27825 )
Change subject: ts_102_222: Set number of records when creating linear files ......................................................................
ts_102_222: Set number of records when creating linear files
This information is mandatory for linear files as per TS 102 221 V15 section 11.1.1.4.3. This might not have been spotted earlier because cards of type sysmoISIM-SJA2 accept creation without it as well.
Change-Id: I8aeb869c601ee5d1c8b02da6d72eb3c50e347982 --- M pySim/ts_102_222.py 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/25/27825/1
diff --git a/pySim/ts_102_222.py b/pySim/ts_102_222.py index 2c1d600..c7cff85 100644 --- a/pySim/ts_102_222.py +++ b/pySim/ts_102_222.py @@ -139,6 +139,9 @@ self._cmd.perror("you must specify the --record-length for linear fixed EF") return file_descriptor['record_len'] = opts.record_length + file_descriptor['num_of_rec'] = opts.file_size // opts.record_length + if file_descriptor['num_of_rec'] * file_descriptor['record_len'] != opts.file_size: + raise ValueError("File size not evenly divisible by record length") elif opts.structure == 'ber_tlv': self._cmd.perror("BER-TLV creation not yet fully supported, sorry") return