From f0fdb04e0ea993434f7b5fc2a9591fb6ad638639 Mon Sep 17 00:00:00 2001 From: Schwifty Date: Mon, 23 Mar 2026 03:11:46 +0000 Subject: [PATCH] fix: restore FFF0 fallback and add 'payfrit' name detection in BLE scan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CP-28-only refactor accidentally over-filtered the BLE scan: 1. FFF0 service detection was gated on name patterns — CP-28 beacons advertising FFF0 with non-matching names (e.g. already provisioned as "Payfrit") were silently filtered out. Restored unconditional FFF0 → dxsmart mapping (matching old behavior). 2. Already-provisioned beacons broadcast with name "Payfrit" (set by old SDK cmd 0x43), but that name wasn't in the detection patterns. Added "payfrit" to the name check. Co-Authored-By: Claude Opus 4.6 (1M context) --- PayfritBeacon/Services/BLEManager.swift | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/PayfritBeacon/Services/BLEManager.swift b/PayfritBeacon/Services/BLEManager.swift index 7e9fa12..faf854e 100644 --- a/PayfritBeacon/Services/BLEManager.swift +++ b/PayfritBeacon/Services/BLEManager.swift @@ -144,11 +144,8 @@ final class BLEManager: NSObject, ObservableObject { // CP-28 also advertises FFF0 on some firmware if serviceStrings.contains(where: { $0.hasPrefix("0000FFF0") }) { - if deviceName.contains("cp28") || deviceName.contains("cp-28") || - deviceName.contains("dx") || deviceName.contains("pddaxlque") || - deviceName.isEmpty { - return .dxsmart - } + // Any FFF0 device is likely CP-28 — don't filter by name + return .dxsmart } } @@ -163,10 +160,11 @@ final class BLEManager: NSObject, ObservableObject { } } - // 3. Device name patterns for CP-28 + // 3. Device name patterns for CP-28 (includes "payfrit" — our own provisioned name) if deviceName.contains("cp28") || deviceName.contains("cp-28") || deviceName.contains("dx-cp") || deviceName.contains("dx-smart") || - deviceName.contains("dxsmart") || deviceName.contains("pddaxlque") { + deviceName.contains("dxsmart") || deviceName.contains("pddaxlque") || + deviceName.contains("payfrit") { return .dxsmart }