我正在使用arduino对按摩进行编码,我已经尝试过编码和解码所需的成功,但是对于重复,在我编码后,缓冲区的大小为0,所以我不能将我的缓冲区发送到其他arduino
这是我的代码
文件.ino
{
for(int i=0;i<7;i++)
message.header[i]=i+1;
//this is my variabel, i declare in .proto = repeated int32 header = 4 [(nanopb).max_count = 10, (nanopb).fixed_length = true];
stream = pb_ostream_from_buffer(buffer, sizeof(buffer));
bool status = pb_encode(&stream, Message_fields, &message);
Serial.println(stream.bytes_written);
//when i print this after encode, the data is loss, but when the field type is required, it will show some data bytes
}