From: Petteri Aimonen Date: Wed, 23 Oct 2013 18:21:43 +0000 (+0300) Subject: Fix the size of length prefix for messages in other files. X-Git-Tag: 5.0.2~186^2~336 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=51f0e47295d537a113804f250cddef37a57237a8;p=apps%2Fagl-service-can-low-level.git Fix the size of length prefix for messages in other files. --- diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py index ebb020b7..0f14a041 100755 --- a/generator/nanopb_generator.py +++ b/generator/nanopb_generator.py @@ -355,6 +355,11 @@ class Field: # Instead of direct numeric value, reference the size that # has been #defined in the other file. encsize = EncodedSize(self.submsgname + 'size') + + # We will have to make a conservative assumption on the length + # prefix size, though. + encsize += 5 + elif self.enc_size is None: raise RuntimeError("Could not determine encoded size for %s.%s" % (self.struct_name, self.name))