Skip to content

CoAP discovery response does not follow CoRE link format specification #31609

@kasunch

Description

@kasunch

Describe the bug
CoAP RFC (RFC7252) states that end points should support the CoRE Link Format of discoverable resources as described in RFC6690 (refer section 7.2 of the RFC7252).
However, the current CoAP implementation does not place comma “,” and semicolon “;” in appropriate places in the payload according to the RFC6690.

To Reproduce
Follow the usual building and flashing steps for "samples/net/sockets/coap_server" application on any board.
The payload of the discovery response is as shown below.

</test>;</seg1/seg2/seg3>;</wild1/+/wild3>;</wild2/#>;</query>;</separate>;</location-query>;</large>;</large-update>;</large-create>;</obs>;</core1>title="Core 1";rt=core1;</core2>title="Core 1";rt=core1;

Expected behavior
According to the RFC6690, the payload should be formatted as follows.

</test>,</seg1/seg2/seg3>,</wild1/+/wild3>,</wild2/#>,</query>,</separate>,</location-query>,</large>,</large-update>,</large-create>,</obs>,</core1>;title="Core 1";rt=core1,</core2>;title="Core 1";rt=core1

Impact
CoAP client libraries which follow RFC6690 may fail to parse the discovery response.

Metadata

Metadata

Assignees

Labels

bugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions