fix: restore FFF0 fallback and add 'payfrit' name detection in BLE scan
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) <noreply@anthropic.com>
This commit is contained in:
parent
12048e5c88
commit
f0fdb04e0e
1 changed files with 5 additions and 7 deletions
|
|
@ -144,13 +144,10 @@ 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 {
|
||||
// Any FFF0 device is likely CP-28 — don't filter by name
|
||||
return .dxsmart
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 2. DX-Smart factory default iBeacon UUID
|
||||
if let ibeacon = iBeaconData {
|
||||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue