Open
Conversation
Drops the C-FFI dbus dependency that bluer pulls in transitively. The GATT service, characteristics, and LE advertisement are now zbus `#[interface]` impls registered on the system bus, with BlueZ's GattManager1 / LEAdvertisingManager1 driving the lifecycle. Adapter discovery uses ObjectManager on `org.bluez`. The protocol layer (RPC parser/reassembler, state machine, dispatch, WifiConfigurator trait, NetworkManagerBackend) is unchanged. Public API: `ImprovWifi::install` now takes a `zbus::Connection` and an adapter `OwnedObjectPath`; new `find_adapter` / `power_on_adapter` helpers are exported for callers. Removes `libdbus-1` from the build graph: improv-wifi compiles cleanly for x86_64-unknown-linux-musl with no system libs, and bestool with `--features iti` no longer needs libdbus-1-dev or pkg-config.
All phases implemented. Manual BLE smoke testing on real Linux+BlueZ hardware is still pending (cannot be done from this sandbox).
Per AGENTS.md, prefer the foo.rs / foo/sub.rs module style.
Adds a non-generic, cloneable handle that can signal authorization from another task. Obtain via `ImprovWifi::auth_handle()` before calling `run`. The run loop selects on the underlying mpsc channel alongside its existing arms and calls `set_status(Authorized)` on a trigger.
New flags: - --auth-stdin: any line on stdin authorizes (line content ignored). - --auth-gpio <BCM-pin>: button press on the pin authorizes (active-low, internal pull-up, debounced via --auth-gpio-debounce, default 50ms). Both imply --require-authorization. Either or both can be set; either trigger fires authorize via the new improv-wifi AuthHandle.
ff4a28b to
509baf9
Compare
Pulls `auth_timeout` from `Duration` to `Option<Duration>` in `ImprovWifiConfig`. `None` (the default) keeps the device authorised until provisioned or shut down — useful for benchtop bring-up and for buttons wired to a watchdog rather than a person. Library: the timeout task only spawns when `auth_required` and `auth_timeout` is `Some`. CLI: `--auth-timeout` is now `Option<humantime::Duration>`. Unset means no timeout. Also switches user-facing prose (docstrings, log messages, CLI help) to NZ English.
Runs `bestool iti improv-wifi --auth-gpio 17` on boot, restarts on failure (clean exit after successful provisioning is final). The BCM pin must be edited to match the device's wiring.
Adds `NetworkManagerBackend::is_connected` (queries the Wi-Fi device's NM state). The bestool iti command checks it before installing the BLE service and exits cleanly if the device is in `Activated`. New `--always` flag overrides the check. Makes the boot-time systemd service a no-op once the device is provisioned, instead of advertising forever waiting for a button press.
All phases implemented.
The default mode of `bestool iti improv-wifi` is now a long-running daemon. A fresh device (no Wi-Fi config) advertises immediately for first-boot provisioning; once provisioned, the daemon stays idle and the device is invisible over BLE until a long press (3s+) on `--auth-gpio` re-enters provisioning mode. Short presses during a session authorise the in-progress credential write. Add `--one-shot` for the run-once-and-exit behaviour, with a SECURITY WARNING in its help text. Add `--no-auth` (requires `--one-shot`) to skip authorisation gating, also with a SECURITY WARNING. `--auth-stdin` and `--always` now require `--one-shot`. Library: NetworkManagerBackend::is_configured() — true iff any saved 802-11-wireless connection profile exists. CLI: in daemon mode, the GPIO is configured for both edges with a tokio task classifying each press by hold duration via `--auth-gpio-long-press` (default 3s). Daemon mode requires `--auth-gpio`; one-shot mode requires exactly one of `--auth-gpio` / `--auth-stdin` / `--no-auth`. systemd: ExecStart is `--auth-gpio 17` with Restart=always.
All phases implemented.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.