RustlerBtleplug.Native (Rustler btleplug v0.0.3-alpha)

Summary

Types

central()

@type central() :: reference()

gatt_peripheral()

@type gatt_peripheral() :: reference()

mac()

@type mac() :: String.t()

peripheral()

@type peripheral() :: reference()

uuid()

@type uuid() :: String.t()

Functions

add(a, b)

@spec add(Number.t(), Number.t()) :: {:ok, Number.t()} | {:error, term()}

connect(peripheral, timeout \\ 2000)

@spec connect(peripheral(), Number.t()) :: {:ok, peripheral()} | {:error, term()}

create_central(pid \\ self())

@spec create_central(Pid.t()) :: {:ok, central()} | {:error, term()}

find_peripheral(central, uuid, timeout \\ 2000)

@spec find_peripheral(central(), uuid(), Number.t()) ::
  {:ok, peripheral()} | {:error, term()}

find_peripheral_by_name(central, name, timeout \\ 2000)

@spec find_peripheral_by_name(central(), String.t(), Number.t()) ::
  {:ok, peripheral()} | {:error, term()}

get_map()

@spec get_map() :: {:ok, map()} | {:error, term()}

init(opts \\ %{})

@spec init(map()) :: {:ok, central()} | {:error, term()}

start_scan(central, ms \\ 1000)

@spec start_scan(central(), Number.t()) :: {:ok, central()} | {:error, term()}

stop_scan(central)

@spec stop_scan(central()) :: {:ok, central()} | {:error, term()}

subscribe(peripheral, characteristic, timeout \\ 2000)

@spec subscribe(peripheral(), uuid(), Number.t()) ::
  {:ok, peripheral()} | {:error, term()}

test_string(string)

@spec test_string(String.t()) :: {:ok, String.t()} | {:error, term()}