Hello,
I am trying to transfer message from type loggerMessage from C to python over UART:
status = pb_encode(&stream, loggerMessage_fields, &message);
message_length = stream.bytes_written;
int i=0;
printf("\r\n");
for (i = 0; i <message_length; ++i) {
printf("%x",buffer[i]);
}
In python when reading this and converting to binary, ParseFromString throws google.protobuf.message.DecodeError: Error parsing message:
log = loggerMessage_pb2.loggerMessage()
binary_str = binascii.unhexlify(answer)
log.ParseFromString((binary_str))
What is the problem with the way I am sending/receiving?