laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/31121 )
Change subject: ts_51_011: EF_SMSP: Use integer division in ValidityPeriodAdapter ......................................................................
ts_51_011: EF_SMSP: Use integer division in ValidityPeriodAdapter
ValidityPeriodAdapter() must return integer values when encoding a value, as only integer values can be expressed in the binary format.
Change-Id: I0b431a591ac1761d875b5697a71b6d59241db87d --- M pySim/ts_51_011.py 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve
diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py index cd17ec8..4d819dd 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -435,11 +435,11 @@ if obj <= 12*60: return obj/5 - 1 elif obj <= 24*60: - return 143 + ((obj - (12 * 60)) / 30) + return 143 + ((obj - (12 * 60)) // 30) elif obj <= 30 * 24 * 60: return 166 + (obj / (24 * 60)) elif obj <= 63 * 7 * 24 * 60: - return 192 + (obj / (7 * 24 * 60)) + return 192 + (obj // (7 * 24 * 60)) else: raise ValueError