feat(wifi): probe wifi-commissioning-service via /api/v1/service-info - #127
Open
JanZachmann wants to merge 2 commits into
Open
feat(wifi): probe wifi-commissioning-service via /api/v1/service-info#127JanZachmann wants to merge 2 commits into
JanZachmann wants to merge 2 commits into
Conversation
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
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.
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 separatestatusandversionrequests 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/versionprobe 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 aOnceLock<VersionReq>, and the sameVersionInfo { required, current, mismatch }triple instead of the previous ad-hocmin_required_versionstring.VersionInfois the existing type, reused. A version that does not parse counts as a mismatch.WifiAvailability::Unavailablenow carriesversion_info: Option<VersionInfo>.Nonemeans the service could not be reached at all, so there is no version to compare — that case shows asunknownin 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_enabledis 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 possibleNoneeven on a healthy service.service-infoanswers all of it at once.The version check existed but was shaped differently from the omnect-device-service one: a bare
semver::Versioncompared with>=, and amin_required_versionstring that only the WiFi code understood. Sharing the requirement-string plusVersionInfoshape 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-infoitself 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.