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:
parent
3062e76858
commit
dfbe275c64
1 changed files with 3 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue