MavlinkFiles

public class MavlinkFiles

Utility class that provides methods to generate a MAVLink file from a list of MavlinkCommand, and conversely, parse a MAVLink file.

A MAVLink file contains a list of commands in a plain-text format, which forms a mission script. Note that supported MAVLink commands differ from official MAVLink common message set. For further information about supported MAVLink commands, please refer to Parrot FlightPlan MAVLink documentation.

  • Generates a MAVLink file from the given list of commands.

    Declaration

    Swift

    public static func generate(filepath: String, commands: [MavlinkCommand])

    Parameters

    filepath

    local path of the file to write

    commands

    list of MAVLink commands

  • Parses a MAVLink file into a list of commands.

    Any malformed command is simply ignored. If the given file is not properly formatted, this method returns an empty list.

    Declaration

    Swift

    public static func parse(filepath: String) -> [MavlinkCommand]

    Parameters

    filepath

    local path of the file to read

    Return Value

    the command list extracted from the file