March 2018
Beginner to intermediate
410 pages
10h 40m
English
Now that we have a live connection, we're ready to publish sampled sensor data. We will first need some member variables. These will store last values, last-published values, and the timestamps of last-published values:
private double? lastLight = null; private bool? lastMotion = null; private double? lastPublishedLight = null; private bool? lastPublishedMotion = null; private DateTimelastLightPublishTime = DateTime.MinValue; private DateTimelastMotionPublishTime = DateTime.MinValue;
From our sampling and event methods where we receive and calculate our most recent sensor data, we call two new methods: PublishLight() and PublishMotion(). To illustrate different ways of publishing data, these two methods will publish ...
Read now
Unlock full access