Chapter 9. CoAP Client Integration

Request is received.

Send the notification.

Who is listening?

This chapter continues our exploration of CoAP with a discussion of the client implementation—specifically, within the CDA, with some guidance on building a CoAP client within your GDA as well.

What You’ll Learn in This Chapter

Chapter 8 discussed the basics of CoAP and developing a server hosted within the GDA, with an optional set of exercises enabling a CoAP server within the CDA. This chapter focuses on building a CoAP client that will be part of the CDA, with optional exercises enabling the GDA to support a CoAP client. If you implement the exercises in this chapter, you’ll learn how to integrate CoAP client functionality into your CDA (and optionally into your GDA) so it can communicate with the GDA’s CoAP server.

Design Concepts

Let’s quickly review the two client connection examples discussed in Chapter 8, with some minor modifications to each example. We’ll discuss them in more detail in this chapter—that is, the CDA as the CoAP client and the GDA as the CoAP server.

Example A-1: The CDA writes telemetry updates to the GDA’s CoAP server.

  1. The CDA will write new data to a single resource hosted within the GDA’s CoAP server. This resource’s name will be PIOT/ConstrainedDevice/SensorMsg.

  2. The CDA will connect to the ...

Get Programming the Internet of Things now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.