aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Amsüss <camsuess@sysmocom.de>2022-04-19 10:29:09 +0200
committerlaforge <laforge@osmocom.org>2022-05-06 11:04:51 +0000
commite17e277a2416221ad899243dd014babca5981b75 (patch)
tree78ea93bbce1251d72067fee1fe5a36ec1dda8e6d
parente6b86872ce1fd91c4eea598a16bb72b2e108300f (diff)
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
-rw-r--r--pySim/ts_102_222.py3
1 files changed, 3 insertions, 0 deletions
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 @@ class Ts102222Commands(CommandSet):
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