【发布时间】:2018-11-14 00:15:31
【问题描述】:
我正在尝试从套接字反序列化缓冲区。 它被定义为 C 结构。
struct 的一个成员是 uint8[5]。
我坚持如何用 .proto 文件表达这一点。
sender的原始C结构如下。
typedef struct {
uint32_t body_length;
uint8_t body_version;
uint8_t reserved[5];
}
我的 struct.proto 试用版如下。
syntax = "proto3";
message message_t {
uint32 body_version = 1;
uint8 body_version = 2; //uint8_t body_version;
bytes reserved = 3; //uint8 reservered[5];
}
我不知道如何表达 uint8 和 5 字节大小的数组。 proto3 规范中没有 uint8 和固定大小的字节。
【问题讨论】:
标签: protocol-buffers