import Foundation /// Errors during beacon provisioning enum ProvisionError: LocalizedError { case connectionTimeout case serviceDiscoveryTimeout case operationTimeout case serviceNotFound case characteristicNotFound case authFailed case notConnected case writeFailed(String) case saveFailed case verifyFailed var errorDescription: String? { switch self { case .connectionTimeout: return "Connection timed out" case .serviceDiscoveryTimeout: return "Service discovery timed out" case .operationTimeout: return "Operation timed out" case .serviceNotFound: return "GATT service not found" case .characteristicNotFound: return "GATT characteristic not found" case .authFailed: return "Beacon authentication failed" case .notConnected: return "Not connected to beacon" case .writeFailed(let msg): return "Write failed: \(msg)" case .saveFailed: return "Failed to save config to flash" case .verifyFailed: return "Beacon broadcast verification failed" } } }