March 2018
Beginner to intermediate
410 pages
10h 40m
English
We can use the event arguments provided in the handler to learn things about the original request, such as who made the request (the Actor) and which types of data are desired. The interface is loosely coupled, so we just return a set of fields. We don't have to be exact unless it saves processing time. Interfaces will filter the contents not desired or permitted anyway, to avoid information leaks because checks were omitted:
if (e.IsIncluded(FieldType.Identity)) Fields.Add(new StringField(ThingReference.Empty, Now, "Device ID", this.deviceId, FieldType.Identity, FieldQoS.AutomaticReadout)); if (this.lastLight.HasValue) Fields.Add(new QuantityField(ThingReference.Empty, Now, "Light", this.lastLight.Value, 2, "%", ...
Read now
Unlock full access