Skip to content

Speed up continuous Reader scanning on Android - #52

Merged
djwok merged 8 commits into
mainfrom
codex/fix-continuous-reader-scan-cleanup
Jul 29, 2026
Merged

Speed up continuous Reader scanning on Android#52
djwok merged 8 commits into
mainfrom
codex/fix-continuous-reader-scan-cleanup

Conversation

@djwok

@djwok djwok commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • update the example app to stream continuous Reader discoveries and stop scanning on navigation or connection
  • scan all supported ACS Reader types through one filtered, low-latency Android BLE registration
  • prioritize ACR1555U and ACR1255U-J1 Reader matching
  • surface Android scan failures instead of silently leaving an empty scan
  • patch the bundled ACS Android SDK for low-latency scanning and terminal construction
  • bump package and native metadata to 0.2.4

Why

The prior Android implementation rotated five model-specific ACS scans sequentially. With a five-second window per model, an ACR1555U could take roughly 20–25 seconds to appear.

The first parallel implementation registered five Android BLE scans per session. Android throttles frequent scan registrations, so stopping and immediately starting again could fail silently inside the ACS wrapper.

This change instead registers one platform BLE scan with filters for all five ACS service UUIDs. It stops and clears that exact callback on stop, connect, or lifecycle cleanup, reports onScanFailed, and uses the patched ACS terminal factory for discovered devices.

Validation

  • 43 Jest tests
  • root TypeScript
  • example TypeScript
  • ESLint
  • package build
  • ACS Android binary patch check
  • Android example clean module build and :app:assembleDebug (512 tasks)
  • Android native Kotlin compile after the restart fix
  • Android and iOS Expo bundles
  • git diff --check

Real-device latency validation is still required.

@djwok
djwok marked this pull request as ready for review July 29, 2026 10:16
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@djwok
djwok merged commit 0e69e3b into main Jul 29, 2026
1 check passed
@djwok
djwok deleted the codex/fix-continuous-reader-scan-cleanup branch July 29, 2026 10:18
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