Attention is currently required from: dexter. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/28185 )
Change subject: ts_102_221: The BTLV IEs FILE SIZE and TOTAL FILE SIZE have a min length ......................................................................
Patch Set 1: Code-Review-1
(1 comment)
File pySim/construct.py:
https://gerrit.osmocom.org/c/pysim/+/28185/comment/9bf39c23_9cd317b8 PS1, Line 244: length = length + (self.minlen - length) This looks weird to me, because 'length' would always be equal to 'self.minlen':
test(len=0, min=10) == 0 + (10 - 0) == 10 test(len=1, min=10) == 1 + (10 - 1) == 10 test(len=5, min=10) == 5 + (10 - 5) == 10 test(len=7, min=10) == 7 + (10 - 7) == 10 test(len=9, min=10) == 9 + (10 - 9) == 10
If you want to ensure a minimum value, just do:
length = min(self.__bytes_required(obj), self.minlen)