Files
haptika/packages/react-native-haptika-ppg/ios/Safety/PPGThermalSafetyPolicy.swift
2026-07-31 16:20:10 +02:00

18 lines
552 B
Swift

import Foundation
/// Pure, testable safety gate used before and during camera acquisition.
/// Serious and critical states stop the measurement; unknown is conservative
/// only in the sense that no torch escalation is attempted elsewhere.
public enum PPGThermalSafetyPolicy {
public static func shouldStopMeasurement(forStateName stateName: String) -> Bool {
switch stateName.lowercased() {
case "serious", "critical":
return true
case "nominal", "fair", "unknown":
return false
default:
return false
}
}
}