Interface SensorSampleListener


public interface SensorSampleListener
Receives measurements and state changes from a SensorSession. All callbacks arrive on the EDT.
  • Method Details

    • sensorSample

      void sensorSample(SensorSession session, HealthSample sample)

      A new measurement arrived, already decoded into a health sample in its canonical unit.

      A single notification can produce more than one sample -- a cycling power meter reports power and cadence together -- so this is called once per sample, not once per notification.

    • sensorStateChanged

      void sensorStateChanged(SensorSession session, SensorSessionState state)
      The session changed state.
    • sensorError

      void sensorError(SensorSession session, HealthException error)
      An error occurred. The session may still recover if its state is SensorSessionState.RECONNECTING.