Skip to content
On this page

Stress Index

The Stress Index value is sent as part of the final results.

The application can receive the Stress Index result by implementing VitalSignsListener:

Swift
func onFinalResults(results: VitalSignsResults) {
    DispatchQueue.main.async {
        if let stressIndex = results.getResult(of: VitalSignTypes.stressIndex) as? VitalSignStressIndex {
            print("Stress Index: \(stressIndex.value)")
        }
    }
}
Objective-C
- (void)onFinalResultsWithResults:(BNHVitalSignsResults *)results {
    dispatch_async(dispatch_get_main_queue(), ^{
        BNHVitalSignStressIndex *stressIndex = (BNHVitalSignStressIndex *)[results getResultOf:BNHVitalSignTypes.stressIndex];
        if (stressIndex != nil) {
            NSLog(@"Stress Index: %ld", (long)stressIndex.value);
        }
    });
}

For general information about vital signs see the Vital Signs and Health Indicators Information Page.

For a list of supported vital signs per platform and measurement mode (face/finger) see the Supported Vital Signs Page.

Important

Note that vital signs are sent on a background thread. The application must switch to the UI thread in order to perform UI updates.