We now have what we need to start interacting with our devices. In the previous chapter, we demonstrated how to create a sensor server and an actuator server. The controller, however, will be a sensor client and actuator client. We prepare the controller with variables for this purpose. The classes are available in the same NuGets and namespaces as the server counterparts:
private SensorClient sensorClient = null; private ControlClient controlClient = null;
When we instantiate them, we provide them with a reference to our XMPP client:
this.sensorClient = new SensorClient(this.xmppClient); this.controlClient = new ControlClient(this.xmppClient);
We will also maintain the current state, from the controller point of ...