feat: implement Haptika PPG and Watch V1

This commit is contained in:
Sacha
2026-07-31 16:19:42 +02:00
parent 6b7d4e0728
commit b9930b7378
249 changed files with 46475 additions and 122 deletions
@@ -0,0 +1,18 @@
import Foundation
struct PPGThermalMonitor {
func currentState() -> ThermalState {
switch ProcessInfo.processInfo.thermalState {
case .nominal:
return .nominal
case .fair:
return .fair
case .serious:
return .serious
case .critical:
return .critical
@unknown default:
return .unknown
}
}
}
@@ -0,0 +1,17 @@
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
}
}
}