Skip to content

fix(windows): forward legacy BLE physical status notifications - #66

Open
yomoe wants to merge 3 commits into
AhakeyAI:eternal-devfrom
yomoe:fix/windows-ble-physical-status
Open

yomoe wants to merge 3 commits into
AhakeyAI:eternal-devfrom
yomoe:fix/windows-ble-physical-status

Conversation

@yomoe

@yomoe yomoe commented Sep 19, 2026

Copy link
Copy Markdown

Legacy 13-byte physical status notifications were cached and logged by TcpServer.OnBleNotify, then discarded by an early return. Java therefore received link metadata (0x82) but never the original physical response (0x81), and repeatedly rebuilt its transport after the physical-status timeout.

Keep the cache update and forward the original frame through the existing notification path. Add TCP/payload, physical-status and freshness/recovery diagnostics, a C# loopback regression and two Java regressions. Connection metadata still cannot satisfy physical freshness; recovery, session/timing checks and USB behavior remain unchanged. The protocol trace and packet layouts are documented in docs/windows-ble-physical-status.md.

Validation on an independent checkout of eternal-dev:

  • JDK 17: mvn -f ahakeyconfig-win-java/pom.xml '-Dtest=BleManager*Test,PhysicalStatusFreshnessTest,TaskActivityServiceTest,AhaKeyProtocolTest,UsbHidTransport*Test' package — 47 tests passed; release contents OK.
  • BLE_tcp_bridge/tests/Test-PhysicalStatus.ps1 — production TCP/protocol loopback regression passed.
  • MSBuild BLE_tcp_bridge/BLE_tcp_driver.csproj /restore /p:Configuration=Release — passed.
  • Earlier live-device validation: 20/20 physical query responses; ordinary Java client maintained one BLE connection with five fresh responses and no recovery during a 3m50s observation.

Known limits: legacy 0x98/0x9F empty ACKs are a separate capability/readback incompatibility. An earlier full-suite run also exposed an existing CRLF-sensitive source assertion; the focused regression above is green. This PR contains no firmware, application binaries or raw device logs.

Conflict resolution against eternal-dev a878f63: upstream transport snapshots, receiver/session checks and lastStatusUpdateNanos are preserved together with physical-status diagnostics. Full Maven package passed 344 tests; MSBuild Release and BLE physical-status loopback regression passed. Source-inspection tests normalize CRLF; isolated temp directories prevent parallel GIF extraction collisions. No firmware or installed application changes.

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.

2 participants