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

Give feedback to end user when something wrong occurs on notification reception. #206

Closed
peteryang opened this issue Nov 25, 2016 · 4 comments
Labels
new feature New feature from LWM2M specification server Impact LWM2M server

Comments

@peteryang
Copy link

peteryang commented Nov 25, 2016

Even though the specs requires the client MUST send content format in the response, the server could have better handling strategy if this happens.

Please refer to the discussion in the pull request: #204

One possible solution is to add Not spec compatible related APIs:

public class NotSpecCompatibleAPIs{
static void setResponseContentFormatIfNull(CaliforniumObservationRegistryImpl reg, ContentFormat cf){

}
}
I choose CaliforniumObservationRegistryImpl as the parameter because it will not change the public ObservationRegistry interface.

It is not elegant, but it helps to developers easy because it takes time to ask device manufacturers to fix their code.

@sbernard31
Copy link
Contributor

If you want a short term solution, you can implement your own DefaultLwM2mNodeDecoder.

@hytromo
Copy link

hytromo commented Dec 16, 2016

Just for anyone that wants a Custom decoder that is tested and works with Bosch XDK's observe:

https://gist.github.com/hytromo/b9c5ec7a308e24ca7cec3afcb86642e2 (implements the text decoder if the format is null)

Use it like this:

// Prepare LWM2M server1
LeshanServerBuilder builder = new LeshanServerBuilder();
builder.setLocalAddress(localAddress, localPort);
builder.setLocalSecureAddress(secureLocalAddress, secureLocalPort);
builder.setEncoder(new DefaultLwM2mNodeEncoder());
LwM2mNodeDecoder decoder = new CustomLwM2mNodeDecoder();
builder.setDecoder(decoder);

@sbernard31 sbernard31 added new feature New feature from LWM2M specification server Impact LWM2M server labels Jan 6, 2017
@sbernard31 sbernard31 changed the title Handle the lack of a content format option in client response Give feedback to end user when something wrong occurs on notification reception. Jan 13, 2017
@sbernard31
Copy link
Contributor

I renamed this issue because the conclusion of the #204 discussion was to "handle response of observation like other response (catch+log+return it to application layer)"

@sbernard31
Copy link
Contributor

Fixed as PR #244 and #245 are closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature from LWM2M specification server Impact LWM2M server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants