feat: implement Haptika PPG and Watch V1
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user