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>
31 lines
853 B
Swift
31 lines
853 B
Swift
import Foundation
|
|
import CoreBluetooth
|
|
|
|
/// Beacon hardware type — CP-28 (DX-Smart) only for now.
|
|
/// Other types will be added when we start using different beacon hardware.
|
|
enum BeaconType: String, CaseIterable {
|
|
case dxsmart = "DX-Smart"
|
|
}
|
|
|
|
/// A BLE beacon discovered during scanning
|
|
struct DiscoveredBeacon: Identifiable {
|
|
let id: UUID // CBPeripheral identifier
|
|
let peripheral: CBPeripheral
|
|
let name: String
|
|
let type: BeaconType
|
|
var rssi: Int
|
|
var lastSeen: Date
|
|
|
|
var displayName: String {
|
|
name.isEmpty ? "\(id.uuidString.prefix(8))…" : name
|
|
}
|
|
|
|
var signalDescription: String {
|
|
switch rssi {
|
|
case -50...0: return "Excellent"
|
|
case -65 ... -51: return "Good"
|
|
case -80 ... -66: return "Fair"
|
|
default: return "Weak"
|
|
}
|
|
}
|
|
}
|