Skip to content

feat(wifi): probe wifi-commissioning-service via /api/v1/service-info - #127

Open
JanZachmann wants to merge 2 commits into
omnect:mainfrom
JanZachmann:feat/wcs-service-info
Open

feat(wifi): probe wifi-commissioning-service via /api/v1/service-info#127
JanZachmann wants to merge 2 commits into
omnect:mainfrom
JanZachmann:feat/wcs-service-info

Conversation

@JanZachmann

@JanZachmann JanZachmann commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Uses GET /api/v1/service-info (wifi-commissioning-service 0.2.0, omnect/wifi-commissioning-service#3) as the single availability probe. It returns version, interface name and the live BLE state in one call, so the separate status and version requests are gone. The interface name also arrives as a plain string instead of an optional field on the status response. With nothing left calling it, the /api/v1/version probe and its response type are removed.

Reports the version requirement the same way as omnect-device-service does: a semver requirement string constant (>=0.2.1) resolved through a OnceLock<VersionReq>, and the same VersionInfo { required, current, mismatch } triple instead of the previous ad-hoc min_required_version string. VersionInfo is the existing type, reused. A version that does not parse counts as a mismatch.

WifiAvailability::Unavailable now carries version_info: Option<VersionInfo>. None means the service could not be reached at all, so there is no version to compare — that case shows as unknown in the device info instead of inventing a version.

A stale wifi-commissioning-service does not block the UI the way a stale omnect-device-service does. WiFi is optional and already gated on the socket being present, so the mismatch appears in the WiFi line of the device info and the rest of the app keeps working.

ble_enabled is parsed and logged only. Nothing consumes it yet, and putting it in the ViewModel would add bincode surface and regenerated bindings for no reader.

Reason

The previous probe needed two round trips and read the interface name from status, where it is optional and had to be handled as a possible None even on a healthy service. service-info answers all of it at once.

The version check existed but was shaped differently from the omnect-device-service one: a bare semver::Version compared with >=, and a min_required_version string that only the WiFi code understood. Sharing the requirement-string plus VersionInfo shape means both services report an unsupported version through the same structure, and the floor is expressed as a semver requirement that can be widened later without touching the comparison.

The floor is >=0.2.1, the current wifi-commissioning-service release. service-info itself landed in 0.2.0; 0.2.1 only adds a BLE adapter retry and no API change, so a device on 0.2.0 would technically serve the probe — the floor tracks the released tag rather than the oldest version that happens to answer, and the constant's comment says so.

Use the service-info endpoint as the single availability probe. It returns
version, interface name and live BLE state in one call, replacing the separate
status and version requests.

Report the version requirement the same way as for omnect-device-service: a
semver requirement string plus a required/current/mismatch triple. Unlike the
device service a stale wifi-commissioning-service does not block the UI, since
WiFi is optional and gated on the socket being present — the mismatch shows in
the WiFi section of the device info.

Signed-off-by: Jan Zachmann 50990105+JanZachmann@users.noreply.github.com
service-info reports the version, so the separate version request has no
caller left. Also correct the version floor comment: 0.2.0 already serves
service-info, the floor tracks the released tag.

Signed-off-by: Jan Zachmann 50990105+JanZachmann@users.noreply.github.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant