Reputation: 5049
I'm trying to compile the 3GPP 38.331 ASN.1 specification here - which was extracted from the spec document
import asn1tools
rrc = asn1tools.compile_files('./data/asn/38331-f80.docx.asn', 'uper')
However this throws the error asn1tools.errors.CompileError: Type 'SetupRelease' not found in module 'NR-RRC-Definitions'.
I could see the SetupRelease
definition in the .asn file
SetupRelease { ElementTypeParam } ::= CHOICE {
release NULL,
setup ElementTypeParam
}
Upvotes: 1
Views: 1460
Reputation: 10008
It is very likely your compiler does not support parameterized types.
You can write the specification a different way (keeping it compatible)
Consider removing this from your spec ...
SetupRelease { ElementTypeParam } ::= CHOICE {
release NULL,
setup ElementTypeParam
}
Every time this type is referenced in the specification, replace ElementTypeParam
with the actual type.
For example ...
LocationMeasurementIndication-IEs ::= SEQUENCE {
measurementIndication SetupRelease {LocationMeasurementInfo},
lateNonCriticalExtension OCTET STRING OPTIONAL,
nonCriticalExtension SEQUENCE{} OPTIONAL
}
Should become
LocationMeasurementIndication-IEs ::= SEQUENCE {
measurementIndication CHOICE {
release NULL,
setup LocationMeasurementInfo
},
lateNonCriticalExtension OCTET STRING OPTIONAL,
nonCriticalExtension SEQUENCE{} OPTIONAL
}
Upvotes: 4