Name: RxToBand
Owner: Reactive Extensions
Description: Reactive Extensions (Rx) support for the Microsoft Band
Created: 2015-02-28 00:48:43.0
Updated: 2018-04-20 14:35:36.0
Pushed: 2015-05-18 13:19:36.0
Homepage: null
Size: 504
Language: C#
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Reactive Extensions (Rx) support for the Microsoft Band
Adds a few extension methods for the IBandSensor
A simple example of a reactive query is shown below:
lockedHeartrate = from h in heartRate.OnlyWhenWorn(contact)
where h.Quality == HeartRateQuality.Locked
select h.HeartRate;
Thanks to the compositional nature of Rx, one can write elaborate sensor data analyses in very few lines of code. For example, computing statistics of heart rate using Window and aggregation operators:
heartrateStats = (from w in lockedHeartrate.Window(TimeSpan.FromSeconds(60),
TimeSpan.FromSeconds(10))
let d = w.DefaultIfEmpty()
from s in Observable.CombineLatest(d.Average(), d.Min(), d.Max(),
(avg, min, max) => new
{
Average = avg,
Min = min,
Max = max
})
select s.ToString())
.StartWith("Hold on for a minute...");
Have fun!