mirror of https://gerrit.osmocom.org/pysim
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
This commit is contained in:
parent
6b8eedc501
commit
373b23c372
|
@ -190,10 +190,11 @@ class ShortFileIdentifier(BER_TLV_IE, tag=0x88):
|
||||||
# of the TLV value field. In this case, bits b3 to b1 shall be set to 0
|
# of the TLV value field. In this case, bits b3 to b1 shall be set to 0
|
||||||
class Shift3RAdapter(Adapter):
|
class Shift3RAdapter(Adapter):
|
||||||
def _decode(self, obj, context, path):
|
def _decode(self, obj, context, path):
|
||||||
return obj >> 3
|
return int.from_bytes(obj, 'big') >> 3
|
||||||
def _encode(self, obj, context, path):
|
def _encode(self, obj, context, path):
|
||||||
return obj << 3
|
val = int(obj) << 3
|
||||||
_construct = COptional(Shift3RAdapter(Byte))
|
return val.to_bytes(1, 'big')
|
||||||
|
_construct = COptional(Shift3RAdapter(Bytes(1)))
|
||||||
|
|
||||||
# ETSI TS 102 221 11.1.1.4.9
|
# ETSI TS 102 221 11.1.1.4.9
|
||||||
class LifeCycleStatusInteger(BER_TLV_IE, tag=0x8A):
|
class LifeCycleStatusInteger(BER_TLV_IE, tag=0x8A):
|
||||||
|
|
Loading…
Reference in New Issue