iotcoapcalifornium

Where I should placed the "coap+tcp" uri?


I'm trying to write CoAP client protocol implementation for embedded device. Now I'm working on tcp-implementation.

I don't understand where I should placed "coap+tcp" uri in the request. I'm testing my code with Californium, so that works fine without that uri.

But in the sources of Californium i saw options:

I dont't understand purpose of that. May anybody explain how to work with that in client-context?


Solution

  • As far as I understand it, URI Scheme is mainly (if consider only technical side) intended for clients to apply the default port if it is not defined:

    RFC7252 Section 6.2

    All of the requirements listed above for the "coap" scheme are also requirements for the "coaps" scheme, except that a default UDP port of 5684 is assumed if the port subcomponent is empty or not given, and the UDP datagrams MUST be secured through the use of DTLS as described in Section 9.1.

    I've found no any direct mentions in the RFC that the PDU should contain the scheme.