CoAP confirmable response

1.4k views Asked by At

My server exposes a set of measurements but only those that have not been read yet. For this purpose, I have only implemented a single resource /new that discards measurements that it has just sent after a GET request. How can I make the server wait for the requester to acknowledge the reception of the response?

I know this is not fully respectful of CoAP semantics but it would still be useful for me. I mean the server would only discard readings that have actually been received by some client.

2

There are 2 answers

11
Jiloc On BEST ANSWER

You probably solved it (in that case could you tell which approach did you use? i am interested). Anyway i think you should use the Token (https://www.rfc-editor.org/rfc/rfc7252#section-5.3.1). This is what i would do:

  1. Client sends a CON request to server containing the message token.

  2. Server sends an empty ACK with same token.

  3. Server sends a CON response containing the same token and the set of measurements.

  4. Client sends an empty ACK with same token.

  5. Server can now delete read resources.

4
Julien Vermillard On

the server could delete the resource once it was read.

you can also take a look at CoAP-MQ a draf for publish/subscribe on top of CoAP