How to use the nanopb.nanopb.generator.nanopb_generator.ExtensionField function in nanopb

To help you get started, we’ve selected a few nanopb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github particle-iot / device-os / nanopb / nanopb / generator / nanopb_generator.py View on Github external
for names, message in iterate_messages(self.fdesc, base_name):
            message_options = get_nanopb_suboptions(message, self.file_options, names)

            if message_options.skip_message:
                continue

            self.messages.append(Message(names, message, message_options))
            for enum in message.enum_type:
                enum_options = get_nanopb_suboptions(enum, message_options, names + enum.name)
                self.enums.append(Enum(names, enum, enum_options))

        for names, extension in iterate_extensions(self.fdesc, base_name):
            field_options = get_nanopb_suboptions(extension, self.file_options, names + extension.name)
            if field_options.type != nanopb_pb2.FT_IGNORE:
                self.extensions.append(ExtensionField(names, extension, field_options))