mavgen.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 '''
00004 parse a MAVLink protocol XML file and generate a python implementation
00005 
00006 Copyright Andrew Tridgell 2011
00007 Released under GNU GPL version 3 or later
00008 
00009 '''
00010 from pymavlink.generator import mavgen
00011 from pymavlink.generator import mavparse
00012 
00013 from argparse import ArgumentParser
00014 
00015 parser = ArgumentParser(description="This tool generate implementations from MAVLink message definitions")
00016 parser.add_argument("-o", "--output", default="mavlink", help="output directory.")
00017 parser.add_argument("--lang", dest="language", choices=mavgen.supportedLanguages, default=mavgen.DEFAULT_LANGUAGE, help="language of generated code [default: %(default)s]")
00018 parser.add_argument("--wire-protocol", choices=[mavparse.PROTOCOL_0_9, mavparse.PROTOCOL_1_0], default=mavgen.DEFAULT_WIRE_PROTOCOL, help="MAVLink protocol version. [default: %(default)s]")
00019 parser.add_argument("--no-validate", action="store_false", dest="validate", default=mavgen.DEFAULT_VALIDATE, help="Do not perform XML validation. Can speed up code generation if XML files are known to be correct.")
00020 parser.add_argument("--error-limit", default=mavgen.DEFAULT_ERROR_LIMIT, help="maximum number of validation errors to display")
00021 parser.add_argument("definitions", metavar="XML", nargs="+", help="MAVLink definitions")
00022 args = parser.parse_args()
00023 
00024 mavgen.mavgen(args, args.definitions)


mavlink
Author(s): Lorenz Meier
autogenerated on Wed Sep 9 2015 18:06:17