Documentation
¶
Overview ¶
Package cli is the reference controller's command line: the module's controller role as a tool that pairs Matter nodes over IP or BLE, reads, writes, invokes and subscribes, creates groups and bindings and serves an OTA image. Its fabric — the CA, the fabric record, the client registry and the DCL trust store — lives in one SQLite database (--db), so every run is the same fabric and every node it paired still trusts it.
Three programs run it: examples/reference-controller (no BLE), ble/bluez/cmd/reference-controller (BLE over BlueZ) and ble/esphome/cmd/reference-controller (BLE through ESPHome Bluetooth proxies), the last two modules of their own, so the main module never imports godbus or a Noise library — ADR 0024 decision 3. They differ only in Options.Central and Options.Proxies.
It is an example, not API (README.md §API stability): copy from it, do not build against it. The README beside the program lists every command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Central opens the BLE central on an adapter (--ble-adapter) for
// pair --ble; nil is a build without BLE.
Central func(adapter string) (ble.Central, error)
// Proxies opens the BLE central over ESPHome Bluetooth proxies
// (--bluetooth-proxy host[:port][,key], repeatable;
// --bluetooth-proxy-discover with --bluetooth-proxy-key name=key,
// repeatable, and --bluetooth-proxy-allow-plaintext) for pair; nil is
// a build without them.
Proxies func(flags ProxyFlags, log *slog.Logger) (ble.Central, error)
}
Options is what the program that runs the command line supplies.
type ProxyFlags ¶
type ProxyFlags struct {
// Proxies are the --bluetooth-proxy specs, host[:port][,key].
Proxies []string
// Discover is --bluetooth-proxy-discover: find the proxies over
// DNS-SD as well.
Discover bool
// Keys are the --bluetooth-proxy-key specs, name=key, the keys of
// discovered proxies by name or MAC.
Keys []string
// AllowPlaintext is --bluetooth-proxy-allow-plaintext: a discovered
// proxy without a key in Keys is dialled over the plaintext API
// (esphome.DiscoverOptions.AllowPlaintext). Off by default: such a
// proxy is skipped, since the plaintext API authenticates neither side
// (decision 196).
AllowPlaintext bool
}
ProxyFlags are pair's ESPHome Bluetooth proxy flags.