refactor: CP-28 only — strip all non-DX-Smart beacon code #41

Merged
schwifty merged 1 commit from schwifty/cp28-only into main 2026-03-23 03:04:15 +00:00
Collaborator

Summary

  • Deleted BlueCharmProvisioner.swift, KBeaconProvisioner.swift, FallbackProvisioner.swift (3 files, ~810 lines)
  • Simplified BeaconType enum to just dxsmart — no more kbeacon, bluecharm, unknown
  • Simplified BLEManager.detectBeaconType() to only detect CP-28 beacons, returns nil for everything else
  • Simplified ScanView.makeProvisioner() to always use DXSmartProvisioner
  • Removed the immediate-write flow for KBeacon/BlueCharm — all provisioning now goes through the CP-28 two-phase connect→confirm→write flow
  • Cleaned GATTConstants to only contain CP-28 service/characteristic UUIDs
  • Removed all stale comments referencing other beacon types
  • Updated CLAUDE.md project docs

Net: -996 lines of dead code

Other beacon types will be re-added when we actually start using them.

Test plan

  • Build in Xcode — verify no compile errors from removed types
  • BLE scan should only show CP-28 beacons
  • Full provisioning flow: scan → select → connect → confirm flash → write config → done

🤖 Generated with Claude Code

## Summary - Deleted `BlueCharmProvisioner.swift`, `KBeaconProvisioner.swift`, `FallbackProvisioner.swift` (3 files, ~810 lines) - Simplified `BeaconType` enum to just `dxsmart` — no more `kbeacon`, `bluecharm`, `unknown` - Simplified `BLEManager.detectBeaconType()` to only detect CP-28 beacons, returns `nil` for everything else - Simplified `ScanView.makeProvisioner()` to always use `DXSmartProvisioner` - Removed the immediate-write flow for KBeacon/BlueCharm — all provisioning now goes through the CP-28 two-phase connect→confirm→write flow - Cleaned `GATTConstants` to only contain CP-28 service/characteristic UUIDs - Removed all stale comments referencing other beacon types - Updated `CLAUDE.md` project docs **Net: -996 lines of dead code** Other beacon types will be re-added when we actually start using them. ## Test plan - [ ] Build in Xcode — verify no compile errors from removed types - [ ] BLE scan should only show CP-28 beacons - [ ] Full provisioning flow: scan → select → connect → confirm flash → write config → done 🤖 Generated with [Claude Code](https://claude.com/claude-code)
schwifty added 2 commits 2026-03-23 02:55:50 +00:00
1. Minor allocation: reject minor=0 from API instead of silently using it.
   API returning null/0 means the service point isn't configured right.

2. DXSmart write reliability:
   - Add per-command retry (1 retry with 500ms backoff)
   - Increase inter-command delay from 200ms to 500ms
   - Increase post-auth settle from 100ms to 500ms
   - Add 2s cooldown in FallbackProvisioner between provisioner attempts
   The beacon's BLE stack gets hammered by KBeacon's 15 failed auth
   attempts before DXSmart even gets a chance. These timings give it
   breathing room.

3. KBeacon passwords: password 5 was a duplicate of password 3
   (both "1234567890123456"). Replaced with "000000" (6-char variant).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove BlueCharmProvisioner, KBeaconProvisioner, and FallbackProvisioner.
Simplify BeaconType enum to DX-Smart only. Simplify BLE detection to only
show CP-28 beacons. Remove multi-type provisioner factory from ScanView.

-989 lines of dead code removed. Other beacon types will be re-added
when we start using different hardware.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
schwifty force-pushed schwifty/cp28-only from 6965fe4ca8 to 5eebf00aa0 2026-03-23 03:04:11 +00:00 Compare
schwifty merged commit 12048e5c88 into main 2026-03-23 03:04:15 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: payfrit/payfrit-beacon-ios#41
No description provided.