feat(#11281): bring up the wifi hotspot and pairing - #443
Draft
paulpascal wants to merge 27 commits into
Draft
paulpascal wants to merge 27 commits into
paulpascal wants to merge 27 commits into
Conversation
3 of 5 tasks
paulpascal
force-pushed
the
11281-wifi-hotspot
branch
from
September 23, 2026 00:09
3f44075 to
17d0b17
Compare
…he scanner a way out
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.
Closes #11281 (android half). The webapp half is medic/cht-core#11450.
Brings up the local-only hotspot and the local server behind it, so a CHW's phone can pair with a supervisor's.
The host starts a
LocalOnlyHotspotand serves over TLS with a certificate generated per session and held in the Android keystore. The QR carries ssid, password, ip, port and the certificate fingerprint. The peer scans it, joins, and verifies the host against that fingerprint before pairing counts as done, so a network that merely has the right name is not enough.A platform limit shapes this, worth knowing before reading the diff.
LocalOnlyHotspotneeds API 26 while our minSdk is 21. So HOSTING is gated at 26 and reported through a bridge availability method, the waymrdt_available()andsms_available()already do it, rather than failing silently later. JOINING works on everything we support:WifiNetworkSpecifierfrom API 29,addNetworkbelow it.The keystore is the other unknown. Not every device can serve TLS from a keystore-backed key, so generation self-tests with a real loopback handshake and fails immediately with a clear reason instead of dying later at an odd moment.
Everything crossing the bridge is a stable code, never a sentence, since prose cannot be translated. All 13 failure codes have a
p2p.error.*key in cht-core.Known gaps, deliberate: there is no mid-session monitoring, so a hotspot that drops after pairing goes unnoticed. That belongs to #11282, where a transfer can actually be interrupted, and it is noted there. No wdio either, since pairing needs two devices.
Draft.
make testwas green at this tip, about 50 flavours with 0 failures, and the lint gate is clean. But it has NOT been exercised on two physical phones yet, which is the only real test for this. Putting it up so the shape can be reviewed while that happens.