O'Reilly logo

Mastering Internet of Things by Peter Waher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Returning writable values

In the general case, some momentary values might correspond to control parameters in an actuator. To highlight this, an overload exists for the field constructors, allowing the application to signal which one of the fields is "writable", or which ones correspond to control parameters with the same name. In our actuator, we report our output value as a writable parameter, by appending a Boolean argument to the value true:

if (this.output.HasValue) 
{ 
Fields.Add(new BooleanField(ThingReference.Empty, Now, 
"Output", this.output.Value, 
FieldType.Momentary, FieldQoS.AutomaticReadout, true)); 
} 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required