View Source Tello.Controller.Receiver behaviour (Tello v0.3.0)

The behaviour to define a custom receiver for Tello.Controller.

# Define custom receiver
defmodule MyReceiver do
  use Tello.Controller.Receiver

  def receive_message(data) 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, receiver: MyReceiver]
    )

Link to this section Summary

Link to this section Types

Link to this section Callbacks

@callback receive_message(data :: binary()) :: any()

Link to this section Functions

Link to this function

receive_message(receiver_module, data)

View Source
@spec receive_message(t(), binary()) :: any()