Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send: Return not found if client is NULL #795

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mlasch
Copy link
Contributor

@mlasch mlasch commented Jun 21, 2024

Return 4.04 not found in case the provided client is not valid.

Return 4.04 not found in case the provided client is not valid.
@@ -36,7 +36,7 @@ uint8_t reporting_handleSend(lwm2m_context_t *contextP, void *fromSessionH, coap
break;
}
if (clientP == NULL)
return COAP_400_BAD_REQUEST;
return COAP_404_NOT_FOUND;
Copy link
Contributor

@rettichschnidi rettichschnidi Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning for this change?

Reading up on 404 (CoAP, HTTP: "not find a current representation for the target resource"), I get the feeling that 400 ("indicates that the server cannot or will not process the request") is more appropriate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is about Send Operation ?

For error code in LWM2M, you can also look at : LWM2M-v1.1.1@transportTable: 6.7.-4 Response Codes: Information Reporting Interface

And they say :

Send :
2.04 Changed : "Send" operation completed successfully
4.00 Bad Request : Undetermined error occurred
4.04 Not Found : Reported Object was not registered to the LwM2M Server

In Leshan, I think we send :
BAD_REQUEST this error message "no registration found" when we receive Send request from a device which is currently not registered)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants