Bluetooth through BlueZ: the controller in the board's AIC8800 Wi-Fi chip, its pairings and the devices it knows.
The supervisor starts the system's D-Bus and bluetoothd, then talks to
BlueZ over D-Bus. Pairings are kept on the data partition. Other devices
pair only while pairing is open (open_pairing/1), so the KVM does not
take a keyboard or a host that nobody let in.
children = [NanoKVMGo.Bluetooth]Events go to the processes that subscribe/0, as
{NanoKVMGo.Bluetooth, event}:
{:adapter, info}-info/0changed{:device, device}- a device appeared or changed{:device_removed, address}- a device was forgotten or went away
NanoKVMGo.Bluetooth.HID makes the board a Bluetooth LE keyboard, mouse
or other HID device.
Options
:name- the name other devices see, the host name by default
Summary
Functions
Returns a specification to start this module under a supervisor.
The devices BlueZ knows: paired ones and those seen while scanning.
Forgets a device and its pairing.
The controller: its name, address and state.
Lets other devices pair with the board for seconds, 2 minutes by
default. They find it by an advertisement, such as
NanoKVMGo.Bluetooth.HID's; with discoverable: true by the
controller's own as well.
Pairs with a device the board found, such as a keyboard.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec close_pairing() :: :ok | {:error, term()}
@spec devices() :: [device()]
The devices BlueZ knows: paired ones and those seen while scanning.
Forgets a device and its pairing.
@spec info() :: {:ok, info()} | {:error, :not_ready}
The controller: its name, address and state.
@spec open_pairing(pos_integer(), [{:discoverable, boolean()}]) :: :ok | {:error, term()}
Lets other devices pair with the board for seconds, 2 minutes by
default. They find it by an advertisement, such as
NanoKVMGo.Bluetooth.HID's; with discoverable: true by the
controller's own as well.
Pairs with a device the board found, such as a keyboard.
Starts or stops looking for devices, which show up in devices/0.
@spec start_link(keyword()) :: Supervisor.on_start()
@spec subscribe() :: :ok