March 2018
Beginner to intermediate
410 pages
10h 40m
English
Let us begin publishing sensor data. This is done in a similar way to the HTTP case, by adding resources to our endpoint. There are two additions we must consider. First, we want to support observable resources. This means we need to store a reference to the resource we create, so that we can tell it when values change. These reference variables will be of CoapResource type. We also specify what messaging service to use when updating values to subscribers. For our ambient light sensor, we will choose the unacknowledged service.
We will also add some metadata about the resources we create, for interoperability. We will discuss this more in the next chapter. For now, it's sufficient to know that we ...
Read now
Unlock full access