如何使用ASN1.IO Playground

根据ASN1C编译生成的协议,以CSAE 53-2020的BSM.asn为例

BSM DEFINITIONS AUTOMATIC TAGS ::= BEGIN

-- imports and exports

EXPORTS BasicSafetyMessage;
IMPORTS AccelerationSet4Way FROM DefAcceleration
		BrakeSystemStatus FROM VehBrake
		VehicleSize FROM VehSize
		Position3D, PositionConfidenceSet, PositionalAccuracy FROM DefPosition
		DSecond, TimeConfidence FROM DefTime
		TransmissionState FROM VehStatus
		Speed, Heading, SteeringWheelAngle, MotionConfidenceSet FROM DefMotion
		MsgCount FROM MsgFrame
		VehicleClassification FROM VehClass
		VehicleSafetyExtensions FROM VehSafetyExt
		VehicleEmergencyExtensions FROM VehEmgExt;

	BasicSafetyMessage ::= SEQUENCE {
		msgCnt MsgCount,
		id OCTET STRING (SIZE(8)),
		-- temperary vehicle ID
		secMark DSecond,
		timeConfidence TimeConfidence OPTIONAL,
		pos Position3D,
		posAccuracy PositionalAccuracy OPTIONAL,
		-- Accuracy for GNSS system
		posConfidence PositionConfidenceSet OPTIONAL,
		-- Realtime position confidence
		transmission TransmissionState,
		speed Speed,
		heading Heading,
		angle SteeringWheelAngle OPTIONAL,
		motionCfd MotionConfidenceSet OPTIONAL,
		accelSet AccelerationSet4Way,
		brakes BrakeSystemStatus,
		size VehicleSize,
		vehicleClass VehicleClassification,
		-- VehicleClassification includes BasicVehicleClass and other extendible type
		safetyExt VehicleSafetyExtensions OPTIONAL,
		emergencyExt VehicleEmergencyExtensions OPTIONAL,
		...
	}

END

(1)截取以下部分:

BasicSafetyMessage ::= SEQUENCE {
		msgCnt MsgCount,
		id OCTET STRING (SIZE(8)),
		-- temperary vehicle ID
		secMark DSecond,
		timeConfidence TimeConfidence OPTIONAL,
		pos Position3D,
		posAccuracy PositionalAccuracy OPTIONAL,
		-- Accuracy for GNSS system
		posConfidence PositionConfidenceSet OPTIONAL,
		-- Realtime position confidence
		transmission TransmissionState,
		speed Speed,
		heading Heading,
		angle SteeringWheelAngle OPTIONAL,
		motionCfd MotionConfidenceSet OPTIONAL,
		accelSet AccelerationSet4Way,
		brakes BrakeSystemStatus,
		size VehicleSize,
		vehicleClass VehicleClassification,
		-- VehicleClassification includes BasicVehicleClass and other extendible type
		safetyExt VehicleSafetyExtensions OPTIONAL,
		emergencyExt VehicleEmergencyExtensions OPTIONAL,
		...
	}

(2)按照该部分的内容,依次粘贴其他ASN文件,将其放在同一个文件下,并取名为***.asn
(3)进入该网站https://asn1.io/asn1playground/
点击如下图所示部分:
在这里插入图片描述
(4)选择你需要刚刚制作的asn文件,并点击右下角的编译
(5)编译成功后你可以看到如下画面:
表示
(6)输入你收到的被编码后的字符串,这里选用的是UPER编码
在这里插入图片描述
(7)单击解码(decode),便会成功打印解码信息
在这里插入图片描述
(8)通过点击download,可以下载txt或者json格式的文件

rec1value MessageFrame ::= bsmFrame : {
  msgCnt 10,
  id '1020300000000000'H,
  secMark 1234,
  pos {
    lat 1000,
    long 230000
  },
  transmission forwardGears,
  speed 1234,
  heading 456,
  accelSet {
    long 12,
    lat 34,
    vert 56,
    yaw 78
  },
  brakes {
  },
  size {
    width 90,
    length 0
  },
  vehicleClass {
    classification 20
  }
}

结束!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Klay_Wiot

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值