Change in pysim[master]: ts_102_221: fix SFI generation
dexter has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/28184 ) Change subject: ts_102_221: fix SFI generation ...................................................................... ts_102_221: fix SFI generation The generation of the SFI does not work. The result is always a zero length TLV IE. Change-Id: Iaa38d2be4719f12c1d7b30a8befe278f1ed78ac1 --- M pySim/ts_102_221.py 1 file changed, 4 insertions(+), 3 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/pySim/ts_102_221.py b/pySim/ts_102_221.py index bf63f55..e7aff97 100644 --- a/pySim/ts_102_221.py +++ b/pySim/ts_102_221.py @@ -190,10 +190,11 @@ # of the TLV value field. In this case, bits b3 to b1 shall be set to 0 class Shift3RAdapter(Adapter): def _decode(self, obj, context, path): - return obj >> 3 + return int.from_bytes(obj, 'big') >> 3 def _encode(self, obj, context, path): - return obj << 3 - _construct = COptional(Shift3RAdapter(Byte)) + val = int(obj) << 3 + return val.to_bytes(1, 'big') + _construct = COptional(Shift3RAdapter(Bytes(1))) # ETSI TS 102 221 11.1.1.4.9 class LifeCycleStatusInteger(BER_TLV_IE, tag=0x8A): 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit https://gerrit.osmocom.org/c/pysim/+/28184 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Iaa38d2be4719f12c1d7b30a8befe278f1ed78ac1 Gerrit-Change-Number: 28184 Gerrit-PatchSet: 3 Gerrit-Owner: dexter <pmaier@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier@sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-MessageType: merged
participants (1)
-
dexter