Packages

An elixir library for MAVLink, an application that enables communication with other systems using the MAVLink protocol over serial, UDP and TCP connections, and utility modules for performing common MAVLink commands and tasks with one or more remote vehicles.

Current section

Files

Jump to
xmavlink lib mavlink application.ex
Raw

lib/mavlink/application.ex

defmodule XMAVLink.Application do
@moduledoc false
use Application
def start(_, _) do
router_name = Application.get_env(:xmavlink, :router_name, XMAVLink.Router) || XMAVLink.Router
children =
[XMAVLink.Supervisor] ++
utility_child_specs(router_name)
Supervisor.start_link(children, strategy: :one_for_one)
end
defp utility_child_specs(router_name) do
case Application.get_env(:xmavlink, :utilities, false) do
true -> [{XMAVLink.Util.Supervisor, router: router_name}]
_ -> []
end
end
end