Skip to content

feat: a late-discovery hint, the spec GATT service, iOS announcement, macOS keys and menu bar - #17

Merged
Atlanwhite147 merged 6 commits into
mainfrom
hermes-subagent/subagent-work-openzclick-w40-fa5380
Nov 29, 2026
Merged

Atlanwhite147 merged 6 commits into
mainfrom
hermes-subagent/subagent-work-openzclick-w40-fa5380

Conversation

@Atlanwhite147

@Atlanwhite147 Atlanwhite147 commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Four features taken from the November watch, plus an update notice and one correction, each with its unit tests. Nothing here was measured on hardware except where it says so.

What this adds

1. The screen names a game that looked before the bridge existed (31df604)
MyWhoosh browses for _openbikecontrol._tcp once, at startup: a bridge published later leaves its button dead until the game restarts. The bridge now watches the mDNS traffic it already answers (MdnsQueryWatcher, shared port 5353), keeps the two timestamps apart (LateDiscoveryDetector, pure Dart) and, when every browse came before its own announcement, says so on the simple screen in one sentence with the one action that helps: quit MyWhoosh and open it again.

2. The bridge serves the specification's GATT service (9cb3a15)
Service d273f680, buttons on d273f681 (read and notify), haptics on d273f682, application information on d273f683, plus the SIG Device Information service. The project-local 526f7565… UUIDs reached no third-party application. Notifications go through one serialized queue spaced by 500 ms, because Android drops concurrent notifications and a lost release leaves a button stuck down; buttons changed together share one frame, capped at the specification's 20 bytes; a press and its release can never share one. The Android backend is a BluetoothGattServer, reachable from a "Bluetooth controller" switch on the Advanced screen.

3. iOS announces itself without Apple's entitlement (2de833d)
The system Bonjour publisher registers _openbikecontrol._tcp on the port the bridge already holds, and the daemon emits the multicast. NWListener was not used on purpose: a listener must own its TCP port, and that port is opened by Dart without SO_REUSEPORT, so a second listener cannot bind. NetService publishes on a port it does not own, through the same dns_sd path BikeControl measured. docs/ios-multicast.md is untouched, as asked.

4. macOS: keys through CGEvent, and a menu bar item (d57c9ef)
Key and pointer injection over a channel to MacKeyInjection, with the Accessibility permission asked on the first press (macOS drops a posted event without an error). The application survives its window closing and lives in the menu bar: state, start and stop, show the window, quit. The macOS build is no longer sandboxed, because a sandboxed application cannot be granted Accessibility.

5. The bridge screen keeps saying iOS is not supported (4855149)
The capability stays, the sentence was missing: the Network screen now says the platform is not supported yet, and the README, the platforms table and the changelog stop blaming the multicast entitlement, which is no longer what blocks iOS.

6. The interface says when a newer release is published (e4b9e5b)
Once a day, after the first frame, one anonymous GET of downloads/version.txt with a three second timeout. The published version is compared by number, not by text: 0.3.10 is newer than 0.3.9, and a build number breaks a tie, so a rider on a test build is never told to downgrade. A newer release puts one line and one word ("Update") on the simple screen, and a card with Check now at the bottom of Advanced. A failed check is silence: no error, nothing stored, so the next launch retries instead of waiting a day. Nothing is downloaded or installed, and the request carries no identifier or version.

Measured

  • core: dart analyze clean, 354 tests, dart format clean.
  • transports: clean, 149 tests, format clean.
  • app: flutter analyze clean, 221 tests, format clean.
  • flutter build apk --debug succeeds, so the Kotlin backend compiles.
  • https://openzclick.147.ovh/downloads/version.txt answers 200 with version: openzclick 0.3.4, which the parser accepts as it is.
  • The mDNS watcher, the GATT description, the notification queue, the Bonjour wire, the macOS wire and the update check are unit-tested against doubles, not against hardware. The update check runs with an injected clock, an injected source and an in-memory cache.

Not measured, and not claimed

  • No application has connected to the BLE peripheral. No CBPeripheralManager backend exists for macOS or iOS yet.
  • No iPhone has announced to a game on another device. Nothing has been run on an iPhone at all.
  • No Mac was touched: the Swift compiles only in the macOS CI run, and the Accessibility permission, the keyboard injection and the menu bar item are unverified on real hardware.
  • The late-discovery hint is a wire measurement (a browse happened) plus an inference (the game is the browser). On a network with another bridge or a diagnostic tool, the inference can be wrong.
  • The update notice was exercised against the real file with curl, not from a built application: the three second timeout and the silence on failure are unit-tested, not ridden.
  • site/index.html still says the multicast entitlement is what blocks an iPhone. That is now false, and the site is not part of this change.

Defaults

Commit messages are in English and lowercase, one per feature. No code was copied from QZ, BikeControl or ShiftLink: only their failure modes were read.

openzclick added 6 commits November 29, 2026 17:05
MyWhoosh asks for the service once, at startup. The bridge now watches the
mDNS traffic it already answers, and when every browse arrived before its own
announcement it says so on the simple screen, in one sentence, with the one
action that helps.
The peripheral was a skeleton with project-local UUIDs, so no third-party
application could find it. It now exposes d273f680 with buttons on d273f681,
haptics on d273f682 and application information on d273f683, the SIG Device
Information service beside it, and reads answered from the state the bridge
holds. Notifications are serialized and spaced by 500 ms because Android drops
concurrent ones and a lost release leaves a button stuck down; buttons changed
together share one frame, capped at the specification's 20 bytes. The Android
backend is a BluetoothGattServer and compiles; macOS and iOS still need a
CBPeripheralManager one, and nothing was measured against a real application.
A raw multicast socket needs Apple's entitlement, but the system publishes a
Bonjour service on the application's behalf and the daemon emits the multicast:
the bridge therefore registers _openbikecontrol._tcp on the port it already
holds. NetService rather than NWListener, because a listener must own the TCP
port and this one is opened by Dart; NSBonjourServices and the local network
description were already declared. docs/ios-multicast.md is left alone: whether
a game on another device connects to a phone that announces is a measurement
nobody has made yet.
The transport and the engine were already there; what macOS lacked was a way to
type into another application and a way to live without a window in front. Keys
and clicks are now posted as CGEvents, with the Accessibility permission asked on
the first press because a dropped event returns no error. The application stays
alive when its window closes and shows the bridge state in a menu bar item that
starts and stops it. The macOS build is no longer sandboxed: a sandboxed
application cannot be granted Accessibility, and the zip distribution does not
need the sandbox. Unit-tested against a mocked channel; no Mac was touched, so
the hardware run is still owed.
The capability stays: iOS announces itself through the system publisher and the
switch keeps working there. What was missing is the sentence, so a running bridge
is not read as a promise: the Network screen now says the platform is not
supported yet and why. The README, the platforms table and the changelog stop
blaming the multicast entitlement, which is no longer what blocks iOS; what is
missing is a measurement on an iPhone.
Once a day, after the first frame, one anonymous GET of the static
downloads/version.txt with a three second timeout. The published version is
compared by number, so 0.3.10 is newer than 0.3.9 and a build number breaks a
tie. A newer release puts one line and one word on the simple screen, and a card
with Check now in Advanced. A failed check is silence: nothing stored, so the
next launch retries, and nothing downloaded or installed ever.
@Atlanwhite147
Atlanwhite147 merged commit ba1f9d1 into main Nov 29, 2026
6 checks passed
@Atlanwhite147
Atlanwhite147 deleted the hermes-subagent/subagent-work-openzclick-w40-fa5380 branch November 29, 2026 21:57
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