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:
parent
eb5ba43644
commit
1d05ba75d1
2 changed files with 2 additions and 4 deletions
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue