Namespace Sensus.Probes
Classes
DataRateCalculator
A memoryless data rate calculator and rate limiter.
DataRateCalculator.SamplingAction
Sampling action.
ListeningProbe
Listening Probes are triggered by a change in state within the underlying device. For example, when an accelerometer reading is emitted, the AccelerometerProbe is provided with information about device movement in each direction. ListeningProbes do not generate data unless such state changes occur (however, in the particular case of the AccelerometerProbe, the hardware accelerometer chip will continuously be registering movement). Whether or not data streams are discontinued when the app is backgrounded depends on the operating system (Android or iOS) as well as the setting of KeepDeviceAwake.
PollingProbe
Polling Probes are triggered at regular intervals. When triggered, the PollingProbe asks the device (and perhaps the user) for some type of information and stores the resulting information in the System.LocalDataStore.
Background Considerations
On Android, each PollingProbe is able to periodically wake up in the background, take a reading, and allow the system to go back to sleep. The Android operating system will occasionally delay the wake-up signal in order to batch wake-ups and thereby conserve energy; however, this delay is usually only 5-10 seconds. So, if you configure a PollingProbe to poll every 60 seconds, you may see actual polling delays of 65-70 seconds and maybe even more. This is by design within Android and cannot be changed.
Polling on iOS is generally less reliable than on Android. By design, iOS apps are restricted from performing processing in the background, with the following exceptions for PollingProbes:
Significant location change processing: If SignificantChangePoll is enabled, the PollingProbe will wake up each time the user's physical location changes significantly. This change is triggered by a change in cellular tower, which is roughly on the order of several kilometers.
Push notification processing: If you configure push notifications, the PollingProbe will be woken up at the desired time to take a reading. Note that the reliability of these timings is subject to push notification throttling imposed by the Apple Push Notification Service. The value of PollingSleepDurationMS should be set conservatively for all probes, for example no lower than 15-20 minutes. The push notification backend server will attempt to deliver push notifications slightly ahead of their scheduled times. If such a push notification arrives at the device before the scheduled time, then the local notification (if AlertUserWhenBackgrounded is enabled) will be cancelled.
Beyond these exceptions, all processing within Sensus for iOS must be halted when the user backgrounds the app. Sensus does its best to support PollingProbes on iOS by scheduling notifications to appear when polling operations (e.g., taking a GPS reading) should execute. This relies on the user to open the notification from the tray and bring Sensus to the foreground so that the polling operation can execute. Of course, the user might not see the notification or might choose not to open it. The polling operation will not be executed in such cases.
Probe
Each Probe collects data of a particular type from the device. Sensus contains Probes for many of the hardware sensors present on many smartphones as well as several software events (e.g., receipt of SMS messages). Sensus also contains Probes that can prompt the user for information, which the user supplies via speech or textual input. Sensus defines a variety of Probes, with platform availability and quality varying by device manufacturer (e.g., Apple, Motorola, Samsung, etc.). Availability and reliability of Probes will depend on the device being used.
Probe.MostRecentDatumChangedDelegateAsync
Delegate for methods that handle MostRecentDatumChanged events from Probes.