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 the data source

Defining the metering topology data source is a straightforward process. We begin by stating that it implements the IDataSource interface:

public class MeteringTopology : IDataSource 
{ 
   public MeteringTopology() 
   { 
   } 

We define some basic properties of the source, such as its identity, that it does not have any child sources, and that it does not change over time:

public const string ID = "MeteringTopology"; 
public string SourceID => ID; 
public bool HasChildren => false; 
public DateTime LastChanged => DateTime.MinValue; 
public IEnumerable<IDataSource> ChildSources => null; 

We also need to make sure to give the data source a localizable human-readable name. Localizable strings are divided into namespaces. These namespaces ...

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