net: lwm2m: discover op does not depend on input format type

According to LwM2M specification V1_0_1-20170704-A, table 25,
incoming request is a discover op if it is method GET with
accept format as application/link-format

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
This commit is contained in:
Robert Chou 2017-11-20 15:33:32 +08:00 committed by Anas Nashif
commit dfbe275c64

View file

@ -2570,12 +2570,10 @@ static int handle_request(struct coap_packet *request,
case COAP_METHOD_GET:
/*
* Leshan sends only an accept=LWM2M_FORMAT_APP_LINK_FORMAT to
* indicate a discover OP
* LwM2M V1_0_1-20170704-A, table 25,
* Discover: CoAP GET + accept=LWM2M_FORMAT_APP_LINK_FORMAT
*/
if (well_known ||
format == LWM2M_FORMAT_APP_LINK_FORMAT ||
accept == LWM2M_FORMAT_APP_LINK_FORMAT) {
if (well_known || accept == LWM2M_FORMAT_APP_LINK_FORMAT) {
context.operation = LWM2M_OP_DISCOVER;
accept = LWM2M_FORMAT_APP_LINK_FORMAT;
} else {