[英]python asn1tools - failing compilation of asn.1
我試圖編譯3GPP 38.331 ASN.1規范在這里-這是從提取的規范文件
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
}
您的編譯器很可能不支持參數化類型。
您可以以不同的方式編寫規范(保持兼容)
考慮從您的規范中刪除它...
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
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.