View Source Tello.StatusListener.Handler behaviour (Tello v0.3.0)
The behaviour to define a custom handler for Tello.StatusListener
.
# Define custom handler
defmodule MyHandler do
use Tello.StatusListener.Handler
def handle_status(%Tello.StatusListener.Status{} = status) do
# Do something with the data
end
end
# Set customer receiver while starting the client.
{:ok, client, controller, status_listener} =
Tello.start(
controller: [ip: {127, 0, 0, 1}, port: tello_server_port],
status_listener: [port: 8890, handler: MyHandler]
)
Link to this section Summary
Link to this section Types
@type t() :: module()
Link to this section Callbacks
@callback handle_status(status :: Tello.StatusListener.Status.t()) :: none()
Link to this section Functions
@spec handle_data(t(), Tello.StatusListener.Status.t()) :: any()