net: lwm2m: fix CREATED response code

Handle LwM2M CREATE op correctly and remove comments.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
This commit is contained in:
Michael Scott 2017-10-11 13:44:35 -07:00 committed by Jukka Rissanen
commit 1d05ba75d1
2 changed files with 2 additions and 4 deletions

View file

@ -2448,10 +2448,11 @@ static int handle_request(struct coap_packet *request,
if (path.level < 2) {
/* write/create a object instance */
context.operation = LWM2M_OP_CREATE;
msg->code = COAP_RESPONSE_CODE_CREATED;
} else {
context.operation = LWM2M_OP_EXECUTE;
}
msg->code = COAP_RESPONSE_CODE_CHANGED;
}
break;
case COAP_METHOD_PUT:

View file

@ -715,9 +715,6 @@ int do_write_op_tlv(struct lwm2m_engine_obj *obj,
pos += len2;
}
/* TODO: Fix me */
/* context->out->out_msg->code = COAP_RESPONSE_CODE_CREATED; */
} else if (tlv.type == OMA_TLV_TYPE_RESOURCE) {
path->res_id = tlv.id;
path->level = 3;