asn1tools
asn1tools copied to clipboard
parameter['type'] string not dict
Hi Erik, I've got a very simple bit of code, that I'm not having any luck with, I'm attempting to encode/decode the PER codec ASN.1 definitions from 3GPP used in Cell Broadcast messaging, The code is pretty simple:
import asn1tools
definition_files = ['SBC.asn.txt']
foo = asn1tools.compile_files(definition_files)
I realise the issue is going to be with the definitions file, but it's straight from 3GPP themselves, and I've tried a few different versions with the same result,
The error I'm getting is:
File "/usr/local/lib/python3.8/dist-packages/asn1tools/codecs/compiler.py", line 604, in pre_process_parameterization_step_1_dummy_to_actual_type if parameter['type'] == dummy_parameter: TypeError: string indices must be integers
I added some print statements in compiler.py, to see what's tripping it up,
parameter['type'] is type<class 'str'> parameter value is{ dummy_parameter is type<class 'str'> dummy_parameter value isIEsSetParam
It looks like parameter is not a dict but a string with the value of "{"
Any pointers as to what's tripping this up?
Cheers, NIck
CLASS and parameterization are not supported. If you are lucky someone (not me) will implement this in the future.
Is the situation for this issue not changed?
The situation is the same. Feel free to implement support for it.
unfortunately I'm not able to do it, I hope someone will help in compiling .asn file containing CLASS
There should be a CompilerError
raised when "CLASS" is found.
It takes quite a while to understand the issue when all you get is TypeError: string indices must be integers