ASN1C compiling
ASN1C compiling
我有一个小的asn1代码:
---------------------ASN1 文件
------------------------------RectangleModule1 DEFINITIONS ::=
BEGIN
Rectangle ::= SEQUENCE (SIZE(1..10)) OF SEQUENCE {
item CHOICE {
height INTEGER,
width IA5String
} --# UNTAGGED
}
END
当我用asn1c编译它时,它给了我Rectangle.c和Rectangle.h文件。矩形的输出如下所示:
-----------------------矩形.h------------------------------
/* Dependencies */
typedef enum item_PR {
item_PR_NOTHING, /* No components present */
item_PR_height,
item_PR_width
} item_PR;
/* Rectangle */
typedef struct Rectangle {
A_SEQUENCE_OF(struct Member {
struct item {
item_PR present;
union item_u {
long height;
IA5String_t width;
} choice;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} item;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} ) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} Rectangle_t;
但我希望我的输出看起来像这样:
/* Dependencies */
typedef enum item_PR_sl {
item_PR_NOTHING_sl, /* No components present */
item_PR_height_sl,
item_PR_width_sl
} item_PR_sl;
/* Rectangle */
typedef struct Rectangle {
A_SEQUENCE_OF(struct Member {
struct item_sl {
item_PR_sl present;
union item_u_sl {
long height;
IA5String_t width;
} choice;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} item;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} ) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} Rectangle_t;
即,_sl连接到项目字段。我无法通过更改 asn 文件来执行此操作。我不知道constr_CHOICE
和constr_SEQUENCE
是如何工作的。任何帮助将不胜感激。
花了几个小时的时间后,我认为修改 asn 文件无法做到这一点。它只能通过编辑编译asn文件生成的.h和.c文件来完成。
相关文章:
- asn1c 不会从 asn.1 模块中提取八位字节字符串的默认值
- Directx 11 - CompileFromFile() is not compiling
- QtConcurrent::mapped not compiling
- 接收"Error compiling: 0:1(1): error: syntax error, unexpected $end" C++、GLSL、着色器文件
- Compiling OpenCV 3.3 with CUDA 9.0RC
- OpenCV C++ Linux g++ compiling
- 如何使用 asn1c 生成的代码解码 MAP 调用消息
- 在 Arduino Uno 与以太网防护板中使用 Firebase Arduino 库时出现错误"#include <string> while compiling"
- Compiling QTermWidget
- boost multi_index_container not compiling
- Matlab 如何知道有一个 .mex64 文件并避免无穷大"compiling"循环
- 如何正确使用和免费的ASN1C sequence_of
- Ubuntu OpenCV not compiling
- Compiling C++ gRPC for Android
- Compiling c++0x for AVR
- Compiling .dylib for Mac
- Compiling wsdlpull
- compiling sfml c++ (ubuntu)
- Compiling a DLL in C++ mingw 64
- ASN1C compiling