我正在尝试编译3GPP 38.331 ASN.1规范here -它是从spec document中提取出来的
import asn1tools
rrc = asn1tools.compile_files('./data/asn/38331-f80.docx.asn', 'uper')但是,这会抛出错误asn1tools.errors.CompileError: Type 'SetupRelease' not found in module 'NR-RRC-Definitions'.
我可以在.asn文件中看到SetupRelease定义
SetupRelease { ElementTypeParam } ::= CHOICE {
release NULL,
setup ElementTypeParam
}发布于 2020-01-20 16:55:16
很可能您的编译器不支持参数化类型。
您可以用不同的方式编写规范(保持兼容)
考虑将其从您的规范中删除...
SetupRelease { ElementTypeParam } ::= CHOICE {
release NULL,
setup ElementTypeParam
}每次在规范中引用此类型时,请将ElementTypeParam替换为实际类型。
例如..。
LocationMeasurementIndication-IEs ::= SEQUENCE {
measurementIndication SetupRelease {LocationMeasurementInfo},
lateNonCriticalExtension OCTET STRING OPTIONAL,
nonCriticalExtension SEQUENCE{} OPTIONAL
}应该变成
LocationMeasurementIndication-IEs ::= SEQUENCE {
measurementIndication CHOICE {
release NULL,
setup LocationMeasurementInfo
},
lateNonCriticalExtension OCTET STRING OPTIONAL,
nonCriticalExtension SEQUENCE{} OPTIONAL
}https://stackoverflow.com/questions/59819049
复制相似问题