asn1tools icon indicating copy to clipboard operation
asn1tools copied to clipboard

parameter['type'] string not dict

Open nickvsnetworking opened this issue 4 years ago • 5 comments

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

SBC.asn.txt

nickvsnetworking avatar Jul 06 '20 21:07 nickvsnetworking

CLASS and parameterization are not supported. If you are lucky someone (not me) will implement this in the future.

eerimoq avatar Jul 07 '20 04:07 eerimoq

Is the situation for this issue not changed?

Gian-Michele avatar Jan 08 '21 12:01 Gian-Michele

The situation is the same. Feel free to implement support for it.

eerimoq avatar Jan 08 '21 14:01 eerimoq

unfortunately I'm not able to do it, I hope someone will help in compiling .asn file containing CLASS

Gian-Michele avatar Jan 08 '21 14:01 Gian-Michele

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

gatopeich avatar Jan 13 '21 13:01 gatopeich