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

Creating the digital input object instance class

Similarly, we create a class for the Digital Input Object Instance. In it, we define member fields for each resource our object instances will have:

public class DigitalInputInstance : Lwm2mObjectInstance 
{ 
  private Lwm2mResourceBoolean state; 
  private Lwm2mResourceInteger counter; 
  private Lwm2mResourceCommand counterReset; 
  private Lwm2mResourceString applicationType; 
  private Lwm2mResourceString sensorType; 

In the constructor, we create the corresponding resource objects, using their types, and providing them with the corresponding resource identities, names, and initial values. We also define whether we want the resource to be writable or not, and whether writable, if we want the resource to ...

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