Tello Lab
Mix.install([
{:tello, "~> 0.3.0"}
])
Cyber Tello
Start the Cyber Tello
Tello.CyberTello.start_link([])
{:ok, tello_server_port} = Tello.CyberTello.port()
Define a module MyReceiver
which implements Tello.Controller.Receiver
to receive messages from Tello.
defmodule MyReceiver do
require Logger
use Tello.Controller.Receiver
def receive_message(data) do
Logger.info("receives message from Tello: #{data}")
end
end
Start Tello client
args = [
controller: [ip: {127, 0, 0, 1}, port: tello_server_port, receiver: MyReceiver],
status_listener: [port: 8890, handler: nil]
]
{:ok, supervisor, client, status_listener} = Tello.start(args)
Enable Tello’s SDK mode
Tello.Controller.enable(client)
Get SDK version
Tello.Controller.get_sdk_version(client)