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

Defining basic properties

Our example model is static, as we mentioned before. We will not support editing of nodes:

public DateTime LastChanged => DateTime.MinValue; 

Our sensor will always be readable and never controllable. While the ISensor and IActuator interfaces define the methods for these actions, a class implementing the ISensor interface, for example, might not always be readable. It might depend on settings or timing:

public bool IsReadable => true; 
public bool IsControllable => false;

Our nodes will not define any commands either:

public bool HasCommands => false; 
public Task<IEnumerable<ICommand>> Commands => null; 

We need to define a localizable human-readable name for the node class:

public Task<string> GetTypeNameAsync(Language ...

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