payfrit-beacon-ios/PayfritBeacon
Schwifty 58facfda47 refactor: v3 BeaconProvisioner — clean refactor from pre-refactor baseline
Starting fresh from the working pre-refactor code (d123d25), this is a clean
rewrite that preserves all the hard-won BLE reliability fixes while simplifying
the architecture. Key changes:

What's preserved (battle-tested, working):
- Exact same 16-step write sequence (DeviceName, Frame1, Frame2 iBeacon, Save)
- Same DX-Smart packet format (4E 4F CMD LEN DATA XOR)
- Response gating between writes (1s timeout, matches Android)
- Adaptive delays (1s for frame select/type, 0.8s for UUID, 0.5s base)
- FFE2 missing → full disconnect/reconnect (CoreBluetooth stale GATT cache)
- SaveConfig write-error = success (beacon reboots immediately)
- Disconnect recovery with write position resume
- Multi-password auth (555555, dx1234, 000000)
- Skip device info read (0x30 causes disconnects, MAC is optional)
- Skip extra frame disables (frames 3-6 untouched, fewer writes = fewer disconnects)

What's cleaned up:
- Removed dead device info provisioning code (was already skipped)
- Removed processDeviceInfoForProvisioning (dead code)
- Removed awaitingDeviceInfoForProvisioning flag
- Removed skipDeviceInfoRead flag
- Removed deviceInfoRetryCount (no longer needed)
- Consolidated charRediscovery into handleFFE2Missing()
- Renamed state vars for clarity (dxSmartWriteIndex → writeIndex, etc.)
- Extracted scheduleGlobalTimeout (was inline closure)
- Added cancelAllTimers() helper
- Reduced mutable state from ~30 vars to ~22

1652 lines → 1441 lines (-211 lines, -13%)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 05:07:58 +00:00
..
Assets.xcassets Add ios-marketing idiom, iPad orientations, launch screen 2026-02-10 19:38:11 -08:00
en.lproj Rewrite app: simplified architecture, CoreLocation beacon scanning, UI fixes 2026-02-04 22:07:39 -08:00
Api.swift feat: multi-password auth, structured error codes, missing API endpoints 2026-03-21 10:31:39 +00:00
BeaconBanList.swift refactor: consolidate UUID formatting into shared String extension 2026-03-21 10:02:58 +00:00
BeaconProvisioner.swift refactor: v3 BeaconProvisioner — clean refactor from pre-refactor baseline 2026-03-22 05:07:58 +00:00
BeaconScanner.swift refactor: consolidate UUID formatting into shared String extension 2026-03-21 10:02:58 +00:00
BeaconShardPool.swift Add ios-marketing idiom, iPad orientations, launch screen 2026-02-10 19:38:11 -08:00
BLEBeaconScanner.swift Migrate API endpoints from CFML to PHP 2026-03-14 17:17:02 -07:00
BusinessListView.swift Add ios-marketing idiom, iPad orientations, launch screen 2026-02-10 19:38:11 -08:00
DebugLog.swift Fix DX-Smart provisioning protocol and add debug logging 2026-03-04 20:01:12 -08:00
DevBanner.swift Rewrite app: simplified architecture, CoreLocation beacon scanning, UI fixes 2026-02-04 22:07:39 -08:00
Info.plist Migrate API endpoints from CFML to PHP 2026-03-14 17:17:02 -07:00
LoginView.swift Rewrite app: simplified architecture, CoreLocation beacon scanning, UI fixes 2026-02-04 22:07:39 -08:00
payfrit-favicon-light-outlines.svg Rewrite app: simplified architecture, CoreLocation beacon scanning, UI fixes 2026-02-04 22:07:39 -08:00
PayfritBeaconApp.swift Fix DX-Smart provisioning protocol and add debug logging 2026-03-04 20:01:12 -08:00
RootView.swift Add ios-marketing idiom, iPad orientations, launch screen 2026-02-10 19:38:11 -08:00
ScanView.swift fix: show live provisioning progress + improve disconnect resilience 2026-03-22 02:38:36 +00:00
ServicePointListView.swift refactor: consolidate UUID formatting into shared String extension 2026-03-21 10:02:58 +00:00
UUIDFormatting.swift refactor: consolidate UUID formatting into shared String extension 2026-03-21 10:02:58 +00:00