Package 

Class SynheartSession


  • 
    public final class SynheartSession
    
                        

    Timer-driven session engine. Collects HR data from a BiosignalProvider, buffers samples in a sliding window, and emits typed SessionEvents with computed metrics on a Flow.

    Mirrors the Flutter sibling SynheartSession and the Swift sibling SynheartSession. The on-the-wire shape (returned by SessionEvent.toMap) is identical across all three SDKs.

    • Method Detail

      • ingestHsiMetrics

         final Unit ingestHsiMetrics(String sessionId, Map<String, Object> hsiMetrics)

        Ingest pre-computed HRV metrics from the runtime, scoped to a session.

        The session SDK does not compute HRV locally; the runtime supplies artifact-filtered, authoritative values. No-op if sessionId does not match the currently active session.

      • startSession

         final SharedFlow<SessionEvent> startSession(SessionConfig config)

        Start a new session and return a hot SharedFlow of SessionEvents.

        Flow lifecycle: SessionStartedSessionFrame*SessionSummary (or SessionErrorEvent on failure). When SessionConfig.includeRawSamples is true, BiosignalFrame events interleave between session frames.

        Eagerly starts the biosignal provider and emission timers; callers that subscribe late will miss earlier events (mirroring Flutter's stream semantics).

      • dispose

         final Unit dispose()

        Release resources held by this instance.