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 trigger intervals for observable resources

Object instances and their readable resources are, by default observable, in LWM2M. All we need to do is tell the framework when event notifications should be triggered. As in the previous chapter, we will first define a long interval with which the resources are triggered by default. This will allow subscribers to keep track of what subscriptions are still alive. Defining trigger intervals must be done after the resources have been registered with the CoapEndpoint class. For this reason, it cannot be done in the constructor. We therefore override the AfterRegister() method to define trigger intervals:

public override void AfterRegister(Lwm2mClient Client) { base.AfterRegister(Client); this.TriggerAll(new ...

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