gpt4 book ai didi

ASN.1 如何使用 CHOICE 类型

转载 作者:行者123 更新时间:2023-12-05 03:06:58 25 4
gpt4 key购买 nike

我设计的模式如下。

Motorcar ::= SEQUENCE {
carRegNumber VisibleString
}

Bicycle ::= SEQUENCE {
bicycleColor VisibleString,
bicycleModel VisibleString
}

Boat ::= SEQUENCE {
boatRegNumber VisibleString
}

PreferredVehicle ::= CHOICE { car Motorcar, bicycle Bicycle, boat Boat }

Person ::= SEQUENCE {
name VisibleString,
id VisibleString,
preferredVehicle PreferredVehicle
}

当我在“http://asn1-playground.oss.com/”处编译架构时,它编译成功。

但是当我创建一个类型为 Person 的对象时,我遇到了错误。

myBicycle Bicycle ::= {
bicycleColor "Blue",
bicycleModel "Hero 42M"
}

person Person ::= {
name "Rama Krishna",
id "I123456",
preferredVehicle myBicycle
}

谁能告诉我我的架构和数据有什么问题。

最佳答案

您的值符号中缺少 CHOICE 的组成部分。

以下应该有效:

myBicycle Bicycle ::= {
bicycleColor "Blue",
bicycleModel "Hero 42M"
}

person Person ::= {
name "Rama Krishna",
id "I123456",
preferredVehicle bicycle : myBicycle
}

关于ASN.1 如何使用 CHOICE 类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48656264/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com