Hi,
I'm having trouble with repeated bytes type.
I'm encoding the message from a c# app like this:
public Byte[] buildSetTidEpc(Dictionary<byte[], byte[]> tidEpcList)
{
uDoorAPI api = new uDoorAPI();
api.UdoorCmd = new udoorCmd();
api.UdoorCmd.SetTidEpc = new SET_TID_EPC();
foreach (byte[] t in tidEpcList.Keys)
{
api.UdoorCmd.SetTidEpc.TID.Add(ByteString.CopyFrom(t));
api.UdoorCmd.SetTidEpc.EPC.Add(ByteString.CopyFrom(tidEpcList[t]));
}
return api.ToByteArray();
}
Then when sent to a mcu who's using nanopb I get an error. For every other messages type there's no problem decoding.
Here is the error:
[00:03:21.756,000] <dbg> tcpSocketsHandler: sock_thread: Rcv Len 286
[00:00:26.544,000] <dbg> tcpSocketsHandler: sock_thread: rcv cmd :
12 9b 02 62 98 02 0a 0c e2 80 11 70 20 00 12 12 |...b.... ...p ...
e9 75 0a f5 0a 0c e2 80 11 70 20 00 14 56 20 71 |.u...... .p ..V q
0a ef 0a 0c e2 80 11 70 20 00 04 8a 1d 6b 0a ef |.......p ....k..
0a 0c e2 80 11 70 20 00 10 0d 1c 78 0a ef 0a 0c |.....p . ...x....
e2 80 11 70 20 00 03 a3 20 71 0a ef 0a 0c e2 80 |...p ... q......
11 70 20 00 13 70 1e c8 0a fe 0a 0c e2 80 11 70 |.p ..p.. .......p
20 00 05 3f a6 82 0a a3 0a 0c e2 80 11 70 20 00 | ..?.... .....p .
01 94 a7 0e 0a a3 0a 0c e2 80 11 70 20 00 02 de |........ ...p ...
19 45 0a fe 0a 0c e2 80 11 70 20 00 10 fc e4 f7 |.E...... .p .....
0a f5 12 0c e2 80 11 70 20 00 00 00 00 00 00 1c |.......p .......
12 0c e2 80 11 70 20 00 00 00 00 00 00 6d 12 0c |.....p . .....m..
e2 80 11 70 20 00 00 00 00 00 00 11 12 0c e2 80 |...p ... ........
11 70 20 00 00 00 00 00 00 44 12 0c e2 80 11 70 |.p ..... .D.....p
20 00 00 00 00 00 00 8f 12 0c e2 80 11 70 20 00 | ....... .....p .
00 00 00 00 00 95 12 0c e2 80 11 70 20 00 00 00 |........ ...p ...
00 00 00 09 12 0c e2 80 11 70 20 00 00 00 00 00 |........ .p .....
00 4e 12 0c e2 80 11 70 20 00 00 00 00 00 00 27 |.N.....p ......'
12 0c 62 e2 2d ad 7f 5f 3d 7f 0c 8c dc 52 |..b.-.._ =....R
[00:00:26.544,000] <err> cmd_interpretor: Decoding failed: parent stream too short
The packet seems good so I don't understand why it fails decoding it.