forked from public/pysim
cat: fix Supported Radio Access Technologies state flag
TS 102 223 8.105 codes each supported technology in two bytes:
- the technology from 8.61
- state byte, b1 0 disabled/1 enabled
- b2-b8 RFU
Currently declared as FlagsEnum(Int8ub, enabled=0). kw value is used as
bitmask, so currently:
build {'enabled': True} -> b4 02 08 00 disabled
build {'enabled': False} -> b4 02 08 00 disabled
but parsed 08 00 / 08 01 / 08 ff -> all {'enabled': True}
Use the bit the spec names + tests because well this is so easy that we
don't need tests is apparently not the right approach here..
Change-Id: I4dd16182eb06c99265aabab5d889967b890f6bf2
This commit is contained in:
+5
-1
@@ -729,8 +729,12 @@ class DnsServerAddress(COMPR_TLV_IE, tag=0xC0):
|
||||
|
||||
# TS 102 223 Section 8.105
|
||||
class SupportedRadioAccessTechnologies(COMPR_TLV_IE, tag=0xB4):
|
||||
# 2 bytes/entry:
|
||||
# - technology of 8.61
|
||||
# - state byte b1 is 0 disabled/1 enabled
|
||||
# - b2-b8 RFU.
|
||||
AccessTechTuple = Struct('technology'/AccessTechnology.SingleAccessTech,
|
||||
'state'/FlagsEnum(Int8ub, enabled=0))
|
||||
'state'/FlagsEnum(Int8ub, enabled=1))
|
||||
_construct = GreedyRange(AccessTechTuple)
|
||||
|
||||
# TS 102 223 Section 8.107
|
||||
|
||||
Reference in New Issue
Block a user