Open abouillot-stl opened 1 week ago
get_obj()
and get_obj_at()
methods are only to work on objects, and not values. This is to keep in mind especially when working with SEQUENCE OF and SET OF. If you want to access values, you need to use get_val()
and get_val_at()
all the way.
I fully understand get_obj_at, and get_obj() are not meant to access values. I was looking at getting the objects corresponding to each of the reportConfigToAddMod present in reportConfigToAddModList and manipulate them as objects.
To access reportConfigToAddMod
, your can use:
report = get_obj_at(meas, ["reportConfigToAddModList", None])
There is no such each of the reportConfigToAddMod. There is only a single object reportConfigToAddMod
, and a list of values that were encoded / decoded through it.
Ok, so this is why, after going through, only the last set of values are stored into the object.
report = get_obj_at(meas, ["reportConfigToAddModList", None])
print(get_val_at(report, ["reportConfigId"]))
print(report())
output
3
{'reportConfigId': 3, 'reportConfig': ('reportConfigNR', {'reportType': ('eventTriggered', {'eventId': ('eventA3', {'a3-Offset': ('rsrp', 6), 'reportOnLeave': False, 'hysteresis': 0, 'timeToTrigger': 'ms100', 'useAllowedCellList': False}), 'rsType': 'ssb', 'reportInterval': 'ms120', 'reportAmount': 'r1', 'reportQuantityCell': {'rsrp': True, 'rsrq': True, 'sinr': True}, 'maxReportCells': 8, 'includeBeamMeasurements': False})})}
I'll have to revise my strategy then.
Thanks for your time.
Hello,
I'm trying get an object iterating an ASN.1 object.
I have a
rrcReconfiguration
message. I can iterate through it and get objects from most of the hierarchy, but when looking into thereportConfigToAddModList
, it always return the last item of the sequence.I can access the values of the different items
reportConfigToAddModList
if I iterate the serialization of the object.I guess I miss something about the usage of the
get_obj_at
function in this particular case ofSEQ OF SQUENCE
Here is the code snippet to show it:
Any hints on
get_obj_at
usage would be welcome.Thanks