net: lwm2m: response to peer with correct error code when write fail
Update the firmware update_result accordingly by checking return value of the firmware data write callback registered by application. Also, set response code according. Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
This commit is contained in:
parent
d36b3251fa
commit
3ad6719fbf
3 changed files with 51 additions and 39 deletions
|
@ -2674,6 +2674,8 @@ error:
|
|||
msg->code = COAP_RESPONSE_CODE_NOT_ALLOWED;
|
||||
} else if (r == -EEXIST) {
|
||||
msg->code = COAP_RESPONSE_CODE_BAD_REQUEST;
|
||||
} else if (r == -EFAULT) {
|
||||
msg->code = COAP_RESPONSE_CODE_INCOMPLETE;
|
||||
} else if (r == -EFBIG) {
|
||||
msg->code = COAP_RESPONSE_CODE_REQUEST_TOO_LARGE;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue