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

Adding provisioning support

In the AttachFeatures method that we defined in previous chapters, we create the corresponding sensor, actuator, and chat servers. All we need to do to add provisioning support to these is to add a reference to the provisioning client, to each constructor. For a sensor server, we simply write:

this.sensorServer = new SensorServer(this.xmppClient, 
   this.provisioningClient, true); 

The control server in an actuator is instantiated in a similar manner (here, the ellipsis represents the control parameters we give the control server by default):

this.controlServer = new ControlServer(this.xmppClient, 
   this.provisioningClient, ...); 

Similarly, instantiation of the chat server also accepts a provisioning client as an argument: ...

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