Functions | |
def | append_static_code (filename, outf) |
def | camel_case_from_underscores (string) |
def | generate (basename, xml_list) |
def | generate_enums (directory, filelist, xml_list, enums, msgs) |
def | generate_enums_type_info (enums, msgs) |
def | generate_header (outf, filelist, xml_list, filename) |
def | generate_mavlink (directory, filelist, xml_list, msgs) |
def | generate_message_crc_extra_array (outf, msgs) |
def | generate_message_lengths_array (outf, msgs) |
def | generate_message_mappings_array (outf, msgs) |
def | generate_messages (directory, filelist, xml_list, msgs) |
def | generate_messages_type_info (msgs) |
def | get_enum_raw_type (enum, msgs) |
def | lower_camel_case_from_underscores (string) |
Variables | |
list | abbreviations = ["MAV", "PX4", "UDB", "PPZ", "PIXHAWK", "SLUGS", "FP", "ASLUAV", "VTOL", "ROI", "UART", "UDP", "IMU", "IMU2", "3D", "RC", "GPS", "GPS1", "GPS2", "NED", "RTK", "ADSB"] |
list | swift_keywords |
dictionary | swift_types |
t = mavtemplate.MAVTemplate() | |
Parse a MAVLink protocol XML file and generate Swift implementation Copyright Max Odnovolyk 2015 Released under GNU GPL version 3 or later
def pymavlink.generator.mavgen_swift.append_static_code | ( | filename, | |
outf | |||
) |
Open and copy static code from specified file
Definition at line 132 of file mavgen_swift.py.
def pymavlink.generator.mavgen_swift.camel_case_from_underscores | ( | string | ) |
Generate a CamelCase string from an underscore_string
Definition at line 183 of file mavgen_swift.py.
def pymavlink.generator.mavgen_swift.generate | ( | basename, | |
xml_list | |||
) |
Generate complete MAVLink Swift implemenation
Definition at line 301 of file mavgen_swift.py.
def pymavlink.generator.mavgen_swift.generate_enums | ( | directory, | |
filelist, | |||
xml_list, | |||
enums, | |||
msgs | |||
) |
Iterate through all enums and create Swift equivalents
Definition at line 62 of file mavgen_swift.py.
def pymavlink.generator.mavgen_swift.generate_enums_type_info | ( | enums, | |
msgs | |||
) |
Add camel case swift names for enums an entries, descriptions and sort enums alphabetically
Definition at line 207 of file mavgen_swift.py.
def pymavlink.generator.mavgen_swift.generate_header | ( | outf, | |
filelist, | |||
xml_list, | |||
filename | |||
) |
Generate Swift file header with source files list and creation date
Definition at line 46 of file mavgen_swift.py.
def pymavlink.generator.mavgen_swift.generate_mavlink | ( | directory, | |
filelist, | |||
xml_list, | |||
msgs | |||
) |
Definition at line 32 of file mavgen_swift.py.
def pymavlink.generator.mavgen_swift.generate_message_crc_extra_array | ( | outf, | |
msgs | |||
) |
Add array with CRC extra values to detect incompatible XML changes
Definition at line 170 of file mavgen_swift.py.
def pymavlink.generator.mavgen_swift.generate_message_lengths_array | ( | outf, | |
msgs | |||
) |
Create array with message lengths to validate known message lengths
Definition at line 156 of file mavgen_swift.py.
def pymavlink.generator.mavgen_swift.generate_message_mappings_array | ( | outf, | |
msgs | |||
) |
Create array for mapping message Ids to proper structs
Definition at line 144 of file mavgen_swift.py.
def pymavlink.generator.mavgen_swift.generate_messages | ( | directory, | |
filelist, | |||
xml_list, | |||
msgs | |||
) |
Generate Swift structs to represent all MAVLink messages
Definition at line 96 of file mavgen_swift.py.
def pymavlink.generator.mavgen_swift.generate_messages_type_info | ( | msgs | ) |
Add proper formated variable names, initializers and type names to use in templates
Definition at line 252 of file mavgen_swift.py.
def pymavlink.generator.mavgen_swift.get_enum_raw_type | ( | enum, | |
msgs | |||
) |
Search appropirate raw type for enums in messages fields
Definition at line 87 of file mavgen_swift.py.
def pymavlink.generator.mavgen_swift.lower_camel_case_from_underscores | ( | string | ) |
Generate a lower-cased camelCase string from an underscore_string
Definition at line 197 of file mavgen_swift.py.
list pymavlink.generator.mavgen_swift.abbreviations = ["MAV", "PX4", "UDB", "PPZ", "PIXHAWK", "SLUGS", "FP", "ASLUAV", "VTOL", "ROI", "UART", "UDP", "IMU", "IMU2", "3D", "RC", "GPS", "GPS1", "GPS2", "NED", "RTK", "ADSB"] |
Definition at line 13 of file mavgen_swift.py.
list pymavlink.generator.mavgen_swift.swift_keywords |
Definition at line 14 of file mavgen_swift.py.
dictionary pymavlink.generator.mavgen_swift.swift_types |
Definition at line 17 of file mavgen_swift.py.
pymavlink.generator.mavgen_swift.t = mavtemplate.MAVTemplate() |
Definition at line 30 of file mavgen_swift.py.