Module: Toybox.SensorHistory
Overview
The SensorHistory module contains the interface for SensorHistory.
SensorHistory provides access to historical information recorded by the on-board sensors of device hardware. The amount of information that is available is device dependent. This means that one device may provide more information than another. This class provides an ORDER_* enum which is used to select the data order of the sample iterator.
Classes Under Namespace
Classes: SensorHistoryIterator, SensorSample
Constant Summary
-
Order
Name | Value | Since | Description | See Also |
---|---|---|---|---|
ORDER_NEWEST_FIRST | 0 | API Level 2.1.0 |
Request iterator with newest data first |
|
ORDER_OLDEST_FIRST | 1 | API Level 2.1.0 |
Request iterator with oldest data first |
Instance Method Summary collapse
-
getBodyBatteryHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator
Get the body battery history for the given period.
-
getElevationHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator
Get the elevation history for the given period, up to the last power cycle.
-
getHeartRateHistory(options as { :period as Lang.Number or Time.Duration, :order as SensorHistory.Order or Null } or Null) as SensorHistory.SensorHistoryIterator
Get the heart rate history for the given period, up to the last power cycle.
-
getOxygenSaturationHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator
Get the oxygen saturation history for the given period This function always returns the most recent sensor history samples.
-
getPressureHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator
Get the pressure history for the given period, up to the last power cycle.
-
getStressHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator
Get stress history data for the given period This function always returns the most recent sensor history samples.
-
getTemperatureHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator
Get the temperature history for the given period, up to the last power cycle.
Instance Method Details
getBodyBatteryHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator
Get the body battery history for the given period.
This function always returns the most recent sensor history samples. The time between each `SensorSample` in the iterator may be device dependent.
getElevationHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator
Get the elevation history for the given period, up to the last power cycle.
This function always returns the most recent pressure samples. The time between each SensorSample in the iterator may be device dependent.
getHeartRateHistory(options as { :period as Lang.Number or Time.Duration, :order as SensorHistory.Order or Null } or Null) as SensorHistory.SensorHistoryIterator
Get the heart rate history for the given period, up to the last power cycle.
This function always returns the most recent heart rate samples. The time between each SensorSample in the iterator may be device dependent.
getOxygenSaturationHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator
Get the oxygen saturation history for the given period
This function always returns the most recent sensor history samples. The time between each `SensorSample` in the iterator may be device dependent.
getPressureHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator
Get the pressure history for the given period, up to the last power cycle.
This function always returns the most recent pressure samples. The time between each SensorSample in the iterator may be device dependent.
getStressHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator
Get stress history data for the given period
This function always returns the most recent sensor history samples. The time between each `SensorSample` in the iterator may be device dependent.
getTemperatureHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator
Get the temperature history for the given period, up to the last power cycle.
This function always returns the most recent temperature samples. The time between each SensorSample in the iterator may be device dependent.