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.
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:
Client sends a CON request to server containing the message token.
Server sends an empty ACK with same token.
Server sends a CON response containing the same token and the set of measurements.
Client sends an empty ACK with same token.
Server can now delete read resources.